fix-qmake-libtool.sh

This commit is contained in:
Thomas Tuegel 2019-09-18 15:19:31 -05:00
parent dd599e20cf
commit 756b46a449
No known key found for this signature in database
GPG Key ID: 22CBF5249D4B4D59
5 changed files with 19 additions and 6 deletions

View File

@ -160,9 +160,7 @@ let
qmake = makeSetupHook {
deps = [ self.qtbase.dev ];
substitutions = {
inherit (stdenv) isDarwin;
qtbase_dev = self.qtbase.dev;
fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.sh;
fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
};
} ../hooks/qmake-hook.sh;

View File

@ -154,9 +154,7 @@ let
qmake = makeSetupHook {
deps = [ self.qtbase.dev ];
substitutions = {
inherit (stdenv) isDarwin;
qtbase_dev = self.qtbase.dev;
fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.sh;
fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
};
} ../hooks/qmake-hook.sh;

View File

@ -0,0 +1,14 @@
# Fix libtool libraries generated by qmake.
# qmake started inserting filenames of shared objects instead of the appropriate
# linker flags. fixQmakeLibtool searches for broken libtool libraries and
# replaces the filenames with the linker flags that should have been there.
fixQmakeLibtool() {
if [ -d "$1" ]; then
find "$1" -name '*.la' | while read la; do
sed -i "$la" \
-e '/^dependency_libs/ s,\(/[^ ]\+\)/lib\([^/ ]\+\)\.so,-L\1 -l\2,g'
done
fi
}
fixupOutputHooks+=('fixQmakeLibtool $prefix')

View File

@ -1,3 +1,5 @@
. @fix_qmake_libtool@
qmakeFlags=( $qmakeFlags )
qmakePrePhase() {

View File

@ -100,6 +100,7 @@ stdenv.mkDerivation {
. "$fix_qt_builtin_paths"
. "$fix_qt_module_paths"
. ${../hooks/move-qt-dev-tools.sh}
. ${../hooks/fix-qmake-libtool.sh}
'';
postPatch =