qt4: enable parallel building in the configure phase

This commit is contained in:
Orivej Desh 2017-11-29 09:02:01 +00:00
parent 5f020d5627
commit 8b0ef2a564
2 changed files with 25 additions and 1 deletions

View File

@ -67,6 +67,7 @@ stdenv.mkDerivation rec {
patches =
[ ./glib-2.32.patch
./libressl.patch
./parallel-configure.patch
(substituteAll {
src = ./dlopen-absolute-paths.diff;
cups = if cups != null then stdenv.lib.getLib cups else null;
@ -117,6 +118,7 @@ stdenv.mkDerivation rec {
-demosdir $TMPDIR/share/doc/${name}/demos
-datadir $out/share/${name}
-translationdir $out/share/${name}/translations
--jobs=$NIX_BUILD_CORES
"
unset LD # Makefile uses gcc for linking; setting LD interferes
'' + optionalString stdenv.cc.isClang ''
@ -251,7 +253,7 @@ stdenv.mkDerivation rec {
homepage = http://qt-project.org/;
description = "A cross-platform application framework for C++";
license = licenses.lgpl21Plus; # or gpl3
maintainers = with maintainers; [ lovek323 phreedom sander ];
maintainers = with maintainers; [ orivej lovek323 phreedom sander ];
platforms = platforms.unix;
};
}

View File

@ -0,0 +1,22 @@
--- a/configure
+++ b/configure
@@ -1087,2 +1087,3 @@ fi
#-------------------------------------------------------------------------------
+JOBS=
@@ -2528,2 +2529,5 @@ while [ "$#" -gt 0 ]; do
;;
+ jobs)
+ JOBS=-j$VAL
+ ;;
*)
@@ -5072,3 +5076,3 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
if "$WHICH" makedepend >/dev/null 2>&1 && grep 'depend:' "$mkfile" >/dev/null 2>&1; then
- (cd "$outpath/qmake" && "$MAKE" -f "$mkfile" depend) >/dev/null 2>&1
+ (cd "$outpath/qmake" && "$MAKE" $JOBS -f "$mkfile" depend) >/dev/null 2>&1
sed "s,^.*/\([^/]*.o\):,\1:,g" "$mkfile" >"$mkfile.tmp"
@@ -5080,3 +5084,3 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
QMAKE_BUILD_ERROR=no
- (cd "$outpath/qmake"; "$MAKE") || QMAKE_BUILD_ERROR=yes
+ (cd "$outpath/qmake"; "$MAKE" $JOBS) || QMAKE_BUILD_ERROR=yes
[ '!' -z "$QCONFIG_H" ] && mv -f "$QCONFIG_H" "$QMAKE_QCONFIG_H" #move qmake's qconfig.h to qconfig.h.qmake