diff options
author | Bjørn Forsman <bjorn.forsman@gmail.com> | 2017-03-01 18:30:27 +0100 |
---|---|---|
committer | Thomas Tuegel <ttuegel@mailbox.org> | 2017-03-04 15:08:47 -0600 |
commit | f5d460a7a0795f0caf85625adda970dd94491b5f (patch) | |
tree | 648a9113f00515f1046ac46c84f6e62c7b0cc9e4 | |
parent | 46ba7cf94a21f7e78ddfd72bdca61f567219ccec (diff) |
qt5.qtbase: fix host_bins= path in pkg-config file
So that pkg-config can be used to find 'moc' etc. (Currently it points to a non-existing path.) Fixes #22945 ('Linux kbuild incompatible with "nix-shell -p qt5.full"').
4 files changed, 55 insertions, 1 deletions
diff --git a/pkgs/development/libraries/qt-5/5.5/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.5/qtbase/default.nix index a8598f654dda6..87fb3f08e2b99 100644 --- a/pkgs/development/libraries/qt-5/5.5/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.5/qtbase/default.nix @@ -269,6 +269,9 @@ stdenv.mkDerivation { done popd fi + + # fixup .pc file (where to find 'moc' etc.) + sed "s|^host_bins=.*|host_bins=$dev/bin|" -i "$dev/lib/pkgconfig/Qt5Core.pc" ''; inherit lndir; diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.6/qtbase/default.nix index 341ebe1198b7e..b0e12ae99e485 100644 --- a/pkgs/development/libraries/qt-5/5.6/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.6/qtbase/default.nix @@ -267,6 +267,9 @@ stdenv.mkDerivation { done popd fi + + # fixup .pc file (where to find 'moc' etc.) + sed "s|^host_bins=.*|host_bins=$dev/bin|" -i "$dev/lib/pkgconfig/Qt5Core.pc" '' + lib.optionalString stdenv.isDarwin '' fixDarwinDylibNames_rpath() { local flags=() diff --git a/pkgs/development/libraries/qt-5/5.7/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.7/qtbase/default.nix index 934203950b093..7f0c71f64b258 100644 --- a/pkgs/development/libraries/qt-5/5.7/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.7/qtbase/default.nix @@ -228,6 +228,29 @@ stdenv.mkDerivation { done popd fi + + # fixup .pc file (where to find 'moc' etc.) + sed "s|^host_bins=.*|host_bins=$dev/bin|" -i "$dev/lib/pkgconfig/Qt5Core.pc" + '' + # Don't move .prl files on darwin because they end up in + # "dev/lib/Foo.framework/Foo.prl" which interferes with subsequent + # use of lndir in the qtbase setup-hook. On Linux, the .prl files + # are in lib, and so do not cause a subsequent recreation of deep + # framework directory trees. + + lib.optionalString stdenv.isDarwin '' + fixDarwinDylibNames_rpath() { + local flags=() + + for fn in "$@"; do + flags+=(-change "@rpath/$fn.framework/Versions/5/$fn" "$out/lib/$fn.framework/Versions/5/$fn") + done + + for fn in "$@"; do + echo "$fn: fixing dylib" + install_name_tool -id "$out/lib/$fn.framework/Versions/5/$fn" "''${flags[@]}" "$out/lib/$fn.framework/Versions/5/$fn" + done + } + fixDarwinDylibNames_rpath "QtConcurrent" "QtPrintSupport" "QtCore" "QtSql" "QtDBus" "QtTest" "QtGui" "QtWidgets" "QtNetwork" "QtXml" "QtOpenGL" ''; inherit lndir; diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix index e4783ef9838a9..cafaaecaa507d 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix @@ -225,10 +225,35 @@ stdenv.mkDerivation { done popd fi + + # fixup .pc file (where to find 'moc' etc.) + sed "s|^host_bins=.*|host_bins=$dev/bin|" -i "$dev/lib/pkgconfig/Qt5Core.pc" + '' + # Don't move .prl files on darwin because they end up in + # "dev/lib/Foo.framework/Foo.prl" which interferes with subsequent + # use of lndir in the qtbase setup-hook. On Linux, the .prl files + # are in lib, and so do not cause a subsequent recreation of deep + # framework directory trees. + + lib.optionalString stdenv.isDarwin '' + fixDarwinDylibNames_rpath() { + local flags=() + + for fn in "$@"; do + flags+=(-change "@rpath/$fn.framework/Versions/5/$fn" "$out/lib/$fn.framework/Versions/5/$fn") + done + + for fn in "$@"; do + echo "$fn: fixing dylib" + install_name_tool -id "$out/lib/$fn.framework/Versions/5/$fn" "''${flags[@]}" "$out/lib/$fn.framework/Versions/5/$fn" + done + } + fixDarwinDylibNames_rpath "QtConcurrent" "QtPrintSupport" "QtCore" "QtSql" "QtDBus" "QtTest" "QtGui" "QtWidgets" "QtNetwork" "QtXml" "QtOpenGL" ''; inherit lndir; - setupHook = ../../qtbase-setup-hook.sh; + setupHook = if stdenv.isDarwin + then ../../qtbase-setup-hook-darwin.sh + else ../../qtbase-setup-hook.sh; enableParallelBuilding = true; |