diff options
author | Thomas Tuegel <ttuegel@mailbox.org> | 2017-05-17 14:25:42 -0500 |
---|---|---|
committer | Thomas Tuegel <ttuegel@mailbox.org> | 2017-06-18 08:43:39 -0500 |
commit | 1607f51613fc63a6fbfc1884c55a9efea06161b3 (patch) | |
tree | bfdf967138444e078cf1febb81847961e3a97635 /pkgs/development/libraries | |
parent | 870c07cc2b020b507238ef6f71003add14ec5cfc (diff) |
qmake: unify Darwin and Linux setup hooks
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r-- | pkgs/development/libraries/qt-5/5.6/default.nix | 8 | ||||
-rw-r--r-- | pkgs/development/libraries/qt-5/5.8/default.nix | 8 | ||||
-rw-r--r-- | pkgs/development/libraries/qt-5/qmake-hook-darwin.sh | 42 | ||||
-rw-r--r-- | pkgs/development/libraries/qt-5/qmake-hook.sh | 7 |
4 files changed, 14 insertions, 51 deletions
diff --git a/pkgs/development/libraries/qt-5/5.6/default.nix b/pkgs/development/libraries/qt-5/5.6/default.nix index 586a8d584da1a..37065edc440d9 100644 --- a/pkgs/development/libraries/qt-5/5.6/default.nix +++ b/pkgs/development/libraries/qt-5/5.6/default.nix @@ -151,10 +151,10 @@ let { deps = [ makeWrapper ]; } (if stdenv.isDarwin then ../make-qt-wrapper-darwin.sh else ../make-qt-wrapper.sh); - qmake = - makeSetupHook - { deps = [ self.qtbase.dev ]; } - (if stdenv.isDarwin then ../qmake-hook-darwin.sh else ../qmake-hook.sh); + qmake = makeSetupHook { + deps = [ self.qtbase.dev ]; + substitutions = { inherit (stdenv) isDarwin; }; + } ../qmake-hook.sh; }; self = makeScope newScope addPackages; diff --git a/pkgs/development/libraries/qt-5/5.8/default.nix b/pkgs/development/libraries/qt-5/5.8/default.nix index 399c0415b11be..1000bf09b17fa 100644 --- a/pkgs/development/libraries/qt-5/5.8/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/default.nix @@ -138,11 +138,11 @@ let { deps = [ makeWrapper ] ++ optionals (!stdenv.isDarwin) [ dconf.lib gtk3 ]; } (if stdenv.isDarwin then ../make-qt-wrapper-darwin.sh else ../make-qt-wrapper.sh); - qmake = - makeSetupHook - { deps = [ self.qtbase.dev ]; } - (if stdenv.isDarwin then ../qmake-hook-darwin.sh else ../qmake-hook.sh); + qmake = makeSetupHook { + deps = [ self.qtbase.dev ]; + substitutions = { inherit (stdenv) isDarwin; }; + } ../qmake-hook.sh; }; self = makeScope newScope addPackages; diff --git a/pkgs/development/libraries/qt-5/qmake-hook-darwin.sh b/pkgs/development/libraries/qt-5/qmake-hook-darwin.sh deleted file mode 100644 index c359cb4ee6a77..0000000000000 --- a/pkgs/development/libraries/qt-5/qmake-hook-darwin.sh +++ /dev/null @@ -1,42 +0,0 @@ -qmakeConfigurePhase() { - runHook preConfigure - - qmake PREFIX=$out $qmakeFlags - - runHook postConfigure -} - -if [ -z "$dontUseQmakeConfigure" -a -z "$configurePhase" ]; then - configurePhase=qmakeConfigurePhase -fi - -_qtModuleMultioutDevsPre() { - # We cannot simply set these paths in configureFlags because libQtCore retains - # references to the paths it was built with. - moveToOutput "bin" "${!outputDev}" - moveToOutput "include" "${!outputDev}" - - # The destination directory must exist or moveToOutput will do nothing - mkdir -p "${!outputDev}/share" - moveToOutput "share/doc" "${!outputDev}" -} - -_qtModuleMultioutDevsPost() { - # Move libtool archives and qmake project files to $dev/lib - if [ "z${!outputLib}" != "z${!outputDev}" ]; then - pushd "${!outputLib}" - if [ -d "lib" ]; then - find lib \( -name '*.a' -o -name '*.la' \) -print0 | \ - while read -r -d $'\0' file; do - mkdir -p "${!outputDev}/$(dirname "$file")" - mv "${!outputLib}/$file" "${!outputDev}/$file" - done - fi - popd - fi -} - -if [ -n "$NIX_QT_SUBMODULE" ]; then - preFixupHooks+=(_qtModuleMultioutDevsPre) - postFixupHooks+=(_qtModuleMultioutDevsPost) -fi diff --git a/pkgs/development/libraries/qt-5/qmake-hook.sh b/pkgs/development/libraries/qt-5/qmake-hook.sh index 696b4ea8dad38..c70410975ecdd 100644 --- a/pkgs/development/libraries/qt-5/qmake-hook.sh +++ b/pkgs/development/libraries/qt-5/qmake-hook.sh @@ -22,11 +22,16 @@ _qtModuleMultioutDevsPre() { } _qtModuleMultioutDevsPost() { + local -a findopts=(-name '*.a' -o -name '*.la') + if [ -z "@isDarwin@" ]; then + findopts+=(-o -name '*.prl') + fi + # Move libtool archives and qmake project files to $dev/lib if [ "z${!outputLib}" != "z${!outputDev}" ]; then pushd "${!outputLib}" if [ -d "lib" ]; then - find lib \( -name '*.a' -o -name '*.la' -o -name '*.prl' \) -print0 | \ + find lib \( "${findopts[@]}" \) -print0 | \ while read -r -d $'\0' file; do mkdir -p "${!outputDev}/$(dirname "$file")" mv "${!outputLib}/$file" "${!outputDev}/$file" |