summary refs log tree commit diff
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@mailbox.org>2017-05-17 14:25:42 -0500
committerThomas Tuegel <ttuegel@mailbox.org>2017-06-18 08:43:39 -0500
commit1607f51613fc63a6fbfc1884c55a9efea06161b3 (patch)
treebfdf967138444e078cf1febb81847961e3a97635
parent870c07cc2b020b507238ef6f71003add14ec5cfc (diff)
downloadnixpkgs-1607f51613fc63a6fbfc1884c55a9efea06161b3.tar
nixpkgs-1607f51613fc63a6fbfc1884c55a9efea06161b3.tar.gz
nixpkgs-1607f51613fc63a6fbfc1884c55a9efea06161b3.tar.bz2
nixpkgs-1607f51613fc63a6fbfc1884c55a9efea06161b3.tar.lz
nixpkgs-1607f51613fc63a6fbfc1884c55a9efea06161b3.tar.xz
nixpkgs-1607f51613fc63a6fbfc1884c55a9efea06161b3.tar.zst
nixpkgs-1607f51613fc63a6fbfc1884c55a9efea06161b3.zip
qmake: unify Darwin and Linux setup hooks
-rw-r--r--pkgs/development/libraries/qt-5/5.6/default.nix8
-rw-r--r--pkgs/development/libraries/qt-5/5.8/default.nix8
-rw-r--r--pkgs/development/libraries/qt-5/qmake-hook-darwin.sh42
-rw-r--r--pkgs/development/libraries/qt-5/qmake-hook.sh7
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 586a8d584da..37065edc440 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 399c0415b11..1000bf09b17 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 c359cb4ee6a..00000000000
--- 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 696b4ea8dad..c70410975ec 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"