qmake: unify Darwin and Linux setup hooks

+14 -51
+4 -4
pkgs/development/libraries/qt-5/5.6/default.nix
··· 151 151 { deps = [ makeWrapper ]; } 152 152 (if stdenv.isDarwin then ../make-qt-wrapper-darwin.sh else ../make-qt-wrapper.sh); 153 153 154 - qmake = 155 - makeSetupHook 156 - { deps = [ self.qtbase.dev ]; } 157 - (if stdenv.isDarwin then ../qmake-hook-darwin.sh else ../qmake-hook.sh); 154 + qmake = makeSetupHook { 155 + deps = [ self.qtbase.dev ]; 156 + substitutions = { inherit (stdenv) isDarwin; }; 157 + } ../qmake-hook.sh; 158 158 }; 159 159 160 160 self = makeScope newScope addPackages;
+4 -4
pkgs/development/libraries/qt-5/5.8/default.nix
··· 138 138 { deps = [ makeWrapper ] ++ optionals (!stdenv.isDarwin) [ dconf.lib gtk3 ]; } 139 139 (if stdenv.isDarwin then ../make-qt-wrapper-darwin.sh else ../make-qt-wrapper.sh); 140 140 141 - qmake = 142 - makeSetupHook 143 - { deps = [ self.qtbase.dev ]; } 144 - (if stdenv.isDarwin then ../qmake-hook-darwin.sh else ../qmake-hook.sh); 145 141 142 + qmake = makeSetupHook { 143 + deps = [ self.qtbase.dev ]; 144 + substitutions = { inherit (stdenv) isDarwin; }; 145 + } ../qmake-hook.sh; 146 146 }; 147 147 148 148 self = makeScope newScope addPackages;
-42
pkgs/development/libraries/qt-5/qmake-hook-darwin.sh
··· 1 - qmakeConfigurePhase() { 2 - runHook preConfigure 3 - 4 - qmake PREFIX=$out $qmakeFlags 5 - 6 - runHook postConfigure 7 - } 8 - 9 - if [ -z "$dontUseQmakeConfigure" -a -z "$configurePhase" ]; then 10 - configurePhase=qmakeConfigurePhase 11 - fi 12 - 13 - _qtModuleMultioutDevsPre() { 14 - # We cannot simply set these paths in configureFlags because libQtCore retains 15 - # references to the paths it was built with. 16 - moveToOutput "bin" "${!outputDev}" 17 - moveToOutput "include" "${!outputDev}" 18 - 19 - # The destination directory must exist or moveToOutput will do nothing 20 - mkdir -p "${!outputDev}/share" 21 - moveToOutput "share/doc" "${!outputDev}" 22 - } 23 - 24 - _qtModuleMultioutDevsPost() { 25 - # Move libtool archives and qmake project files to $dev/lib 26 - if [ "z${!outputLib}" != "z${!outputDev}" ]; then 27 - pushd "${!outputLib}" 28 - if [ -d "lib" ]; then 29 - find lib \( -name '*.a' -o -name '*.la' \) -print0 | \ 30 - while read -r -d $'\0' file; do 31 - mkdir -p "${!outputDev}/$(dirname "$file")" 32 - mv "${!outputLib}/$file" "${!outputDev}/$file" 33 - done 34 - fi 35 - popd 36 - fi 37 - } 38 - 39 - if [ -n "$NIX_QT_SUBMODULE" ]; then 40 - preFixupHooks+=(_qtModuleMultioutDevsPre) 41 - postFixupHooks+=(_qtModuleMultioutDevsPost) 42 - fi
+6 -1
pkgs/development/libraries/qt-5/qmake-hook.sh
··· 22 22 } 23 23 24 24 _qtModuleMultioutDevsPost() { 25 + local -a findopts=(-name '*.a' -o -name '*.la') 26 + if [ -z "@isDarwin@" ]; then 27 + findopts+=(-o -name '*.prl') 28 + fi 29 + 25 30 # Move libtool archives and qmake project files to $dev/lib 26 31 if [ "z${!outputLib}" != "z${!outputDev}" ]; then 27 32 pushd "${!outputLib}" 28 33 if [ -d "lib" ]; then 29 - find lib \( -name '*.a' -o -name '*.la' -o -name '*.prl' \) -print0 | \ 34 + find lib \( "${findopts[@]}" \) -print0 | \ 30 35 while read -r -d $'\0' file; do 31 36 mkdir -p "${!outputDev}/$(dirname "$file")" 32 37 mv "${!outputLib}/$file" "${!outputDev}/$file"