Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to specify a custom Qt directory? #221

Open
yuriymacdev opened this issue Sep 15, 2022 · 7 comments
Open

Is there a way to specify a custom Qt directory? #221

yuriymacdev opened this issue Sep 15, 2022 · 7 comments

Comments

@yuriymacdev
Copy link

yuriymacdev commented Sep 15, 2022

On Ubuntu 20 the appimage tool picks up qt libs from the system library directory (/usr/lib/x86_64-linux-gnu/qt5) instead of the one used for development ($HOME/Qt/5.15.2/gcc_64/lib).
Is there a way to specify the one located in $HOME, similar to what can be done with a -qmake CLI option (or setting PATH variable to Qt's bin dir) for linuxdeployqt?

@probonopd
Copy link
Owner

What happens if you export LD_LIBRARY_PATH=$HOME/Qt/5.15.2/gcc_64/lib?

@yuriymacdev
Copy link
Author

Thanks for the reply @probonopd, no, that didn't work, the script still uses the system directory.

@probonopd
Copy link
Owner

I don't quite remember how we determine this. To be investigated.

@yuriymacdev
Copy link
Author

I don't quite remember how we determine this. To be investigated.

From what I can see here https://github.com/probonopd/go-appimage/blob/master/src/appimagetool/appdirtool.go, first the script searches standard library directories, then dirs specified in /etc/ld.so.conf, and only then LD_LIBRARY_PATH. Perhaps it makes sense to change the order to look at LD_LIBRARY_PATH first?

I wasn't able to build the project myself (build instructions in Readme.md seem to be outdated?).

@probonopd
Copy link
Owner

probonopd commented Sep 17, 2022

That might be worth a try indeed.

I wasn't able to build the project myself

Do what https://github.com/probonopd/go-appimage/blob/master/.github/workflows/build.yaml does: Essentially, run ./scripts/build.sh -a amd64

@yuriymacdev
Copy link
Author

yuriymacdev commented Sep 17, 2022

Thanks, it built.

So, two things made the script pick up my Qt installation directory:

  1. I moved LD_LIBRARY_PATH up the list of directories scanned.
  2. qtPrfxpath, that the script tries to extract from a libQt5Core.so.5, is incorrect (it contains a hardcoded path of the user who created the build), so I temporarily hardcoded the string with my own Qt directory.

Perhaps it makes sense to introduce an optional env variable for the Qt installation directory that considers these things.

@probonopd
Copy link
Owner

probonopd commented Sep 18, 2022

When you run your application before using go-appimage, then it picks up the correct Qt, right? We need to find out how that works. Then we can use that information instead of relying on qtPrfxpath, which indeed can be wrong (and often is).
I really want these things to "just work" without the need for configuration. Every configuration option is cumbersome to support and an opportunity to screw up for users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants