install-qt-action icon indicating copy to clipboard operation
install-qt-action copied to clipboard

Wrong prefix in pkgconfig files

Open drfiemost opened this issue 4 years ago • 5 comments

As a follow up of the previous pkg-confing issue, I've noticed that in the installed pc files the prefix is hardcoded to "/home/qt/work/install" rendering them unusable.

As a workaround I run this sed on Linux and everything builds fine now: for file in $(ls $Qt5_DIR/lib/pkgconfig/*); do sed -i "s|^prefix=.*|prefix=$Qt5_DIR|" $file; done;

I'm running the job on ubuntu-latest.

drfiemost avatar Feb 08 '21 15:02 drfiemost

I see, thank you

jurplel avatar Feb 08 '21 16:02 jurplel

If this is still an ongoing problem, I would really like to handle it at aqtinstall, because it would affect aqtinstall users as well.

Unless I misunderstand the problem though, this is already fixed. Since https://github.com/miurahr/aqtinstall/pull/210, aqtinstall started patching all $Qt5_DIR/lib/pkgconfig/*.pc files, and that code was released in aqtinstall v1.1.0 on Feb 11, 2021.

The current version of the relevant code is here: https://github.com/miurahr/aqtinstall/blob/179bea9a66204d850284db474ad8f88dcfa47214/aqt/updater.py#L100-L103

ddalcino avatar Aug 24 '22 03:08 ddalcino

Can't say, I've switched to cmake since and it doesn't use the pkg-config files so it's not an issue anymore for me. You might grep the *.pc files for "/home/qt/work/install" to check if they're still broken though.

drfiemost avatar Aug 24 '22 08:08 drfiemost

On a Mac host:

$ python -m aqt version
INFO    : aqtinstall(aqt) v2.2.2 on Python 3.9.13 [CPython Clang 13.1.6 (clang-1316.0.21.2)]
$ python -m aqt install-qt mac android 5.15.2 android
... output ...
$ grep prefix="/home/qt/work/install" 5.15.2/android/lib/pkgconfig/* | wc -l
0
$ rm -rf 5.15.2
$ python -m aqt install-qt linux android 5.15.2 android
... output ...
$ grep prefix="/home/qt/work/install" 5.15.2/android/lib/pkgconfig/* | wc -l
210

~~The pkgconfig/*.pc files are all patched properly for same-platform installations, but not cross-platform installations.~~

Edit: Same-platform vs. cross-platform apparently has nothing to do with it: On Mac, the default prefix string is /Users/qt/work/install, and for some reason it is not being patched.

$ python -m aqt install-qt mac android 5.15.2 android
... output ...
$ grep prefix="/Users/qt/work/install" 5.15.2/android/lib/pkgconfig/* | wc -l
210

I'm going to open a separate issue for this at aqtinstall.

ddalcino avatar Aug 24 '22 13:08 ddalcino

I have closed miurahr/aqtinstall#560 because of this: https://github.com/miurahr/aqtinstall/pull/561#issuecomment-1229087569

Note that if you run the above grep commands on Qt installations installed by aqtinstall and by the official GUI installer, you get the same output. In this regard, the lib/pkgconfig/*.pc files installed by aqtinstall are identical to those installed by the official GUI installer.

I'm certain that this was a problem with aqtinstall at the time this issue was created, but as far as I can tell, it is now fixed. Please feel free to prove me wrong.

ddalcino avatar Aug 27 '22 02:08 ddalcino