summary refs log tree commit diff
path: root/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2023-02-21 19:50:48 +0000
committerSergei Trofimovich <slyich@gmail.com>2023-02-26 22:02:09 +0000
commit69cf5181c31c691e9fb225ada9a33f54208d914b (patch)
treed9fcfa94ee535efc424a566105d1d4993f6af108 /pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
parent203e1cb49986de7452cb907417fedc80a43a6e70 (diff)
downloadnixpkgs-69cf5181c31c691e9fb225ada9a33f54208d914b.tar
nixpkgs-69cf5181c31c691e9fb225ada9a33f54208d914b.tar.gz
nixpkgs-69cf5181c31c691e9fb225ada9a33f54208d914b.tar.bz2
nixpkgs-69cf5181c31c691e9fb225ada9a33f54208d914b.tar.lz
nixpkgs-69cf5181c31c691e9fb225ada9a33f54208d914b.tar.xz
nixpkgs-69cf5181c31c691e9fb225ada9a33f54208d914b.tar.zst
nixpkgs-69cf5181c31c691e9fb225ada9a33f54208d914b.zip
stdenv/generic/setup.sh: enable parallel installs by default
The primary motivating example is openssl:

Before the change full package build took 1m54s minutes.
After the change full package build takes 59s.

About a 2x speedup.

The difference is visible because openssl builds hundreds of manpages
spawning a perl process per manual in `install` phase. Such a workload
is very easy to parallelize.

Another example would be `autotools`+`libtool` based build system where
install step requires relinking. The more binaries there are to relink
the more gain it will be to do it in parallel.

The change enables parallel installs by default only for buiilds that
already have parallel builds enabled. There is a high chance those build
systems already handle parallelism well but some packages will fail.

Consistently propagated the enableParallelBuilding to:
- cmake (enabled by default, similar to builds)
- ninja (set parallelism explicitly, don't rely on default)
- bmake (enable when requested)
- scons (enable when requested)
- meson (set parallelism explicitly, don't rely on default)
- waf (set parallelism explicitly, don't rely on default)
- qmake-4/5/6 (enable by default, similar to builds)
- xorg (always enable, similar to builds)
Diffstat (limited to 'pkgs/development/libraries/qt-5/hooks/qmake-hook.sh')
-rw-r--r--pkgs/development/libraries/qt-5/hooks/qmake-hook.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh b/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
index 741225a5aa8..0d30f0e2665 100644
--- a/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
+++ b/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
@@ -38,6 +38,11 @@ qmakeConfigurePhase() {
         echo "qmake: enabled parallel building"
     fi
 
+    if ! [[ -v enableParallelInstalling ]]; then
+        enableParallelInstalling=1
+        echo "qmake: enabled parallel installing"
+    fi
+
     runHook postConfigure
 }