summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-07-24 16:25:18 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-08-02 15:17:46 -0400
commiteeb9837beba38e0f5c5e26357e478f74a7f6bc7c (patch)
tree2e5c6aa368244afeb768f5e6a5151c512a46eca5 /pkgs
parent25348b27c5b78877800eb0ec77b8e26219002b75 (diff)
downloadnixlib-eeb9837beba38e0f5c5e26357e478f74a7f6bc7c.tar
nixlib-eeb9837beba38e0f5c5e26357e478f74a7f6bc7c.tar.gz
nixlib-eeb9837beba38e0f5c5e26357e478f74a7f6bc7c.tar.bz2
nixlib-eeb9837beba38e0f5c5e26357e478f74a7f6bc7c.tar.lz
nixlib-eeb9837beba38e0f5c5e26357e478f74a7f6bc7c.tar.xz
nixlib-eeb9837beba38e0f5c5e26357e478f74a7f6bc7c.tar.zst
nixlib-eeb9837beba38e0f5c5e26357e478f74a7f6bc7c.zip
qt-{3,4.8}: Clean up generally
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/libraries/qt-3/default.nix51
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/default.nix59
2 files changed, 60 insertions, 50 deletions
diff --git a/pkgs/development/libraries/qt-3/default.nix b/pkgs/development/libraries/qt-3/default.nix
index 32841c9b9331..a3c91f9f307c 100644
--- a/pkgs/development/libraries/qt-3/default.nix
+++ b/pkgs/development/libraries/qt-3/default.nix
@@ -30,31 +30,38 @@ stdenv.mkDerivation {
   };
 
   nativeBuildInputs = [ which ];
-  propagatedBuildInputs = [libpng xlibsWrapper libXft libXrender zlib libjpeg];
+  buildInputs = [
+    xextproto
+  ] ++ stdenv.lib.optionals openglSupport [
+    libGLU_combined libXmu
+  ] ++ stdenv.lib.optionals xftSupport [
+    libXft libXft.freetype libXft.fontconfig
+  ] ++ stdenv.lib.optional xrenderSupport libXrender
+    ++ stdenv.lib.optional xineramaSupport libXinerama
+    ++ stdenv.lib.optional xrandrSupport libXrandr
+    ++ stdenv.lib.optional xineramaSupport libXinerama;
+
+  propagatedBuildInputs = [ libpng xlibsWrapper libXft libXrender zlib libjpeg ];
 
   hardeningDisable = [ "format" ];
 
-  configureFlags = "
-    -v
-    -system-zlib -system-libpng -system-libjpeg
-    -qt-gif
-    -I${xextproto}/include
-    ${if openglSupport then "-dlopen-opengl
-      -L${libGLU_combined}/lib -I${libGLU_combined}/include
-      -L${libXmu.out}/lib -I${libXmu.dev}/include" else ""}
-    ${if threadSupport then "-thread" else "-no-thread"}
-    ${if xrenderSupport then "-xrender -L${libXrender.out}/lib -I${libXrender.dev}/include" else "-no-xrender"}
-    ${if xrandrSupport then "-xrandr
-      -L${libXrandr.out}/lib -I${libXrandr.dev}/include
-      -I${randrproto}/include" else "-no-xrandr"}
-    ${if xineramaSupport then "-xinerama -L${libXinerama.out}/lib -I${libXinerama.dev}/include" else "-no-xinerama"}
-    ${if cursorSupport then "-L${libXcursor.out}/lib -I${libXcursor.dev}/include" else ""}
-    ${if mysqlSupport then "-qt-sql-mysql -L${mysql.connector-c}/lib/mysql -I${mysql.connector-c}/include/mysql" else ""}
-    ${if xftSupport then "-xft
-      -L${libXft.out}/lib -I${libXft.dev}/include
-      -L${libXft.freetype.out}/lib -I${libXft.freetype.dev}/include
-      -L${libXft.fontconfig.lib}/lib -I${libXft.fontconfig.dev}/include" else "-no-xft"}
-  ";
+  configurePlatforms = [];
+  configureFlags = let
+    mk = cond: name: "-${stdenv.lib.optionalString cond "no-"}${name}";
+  in [
+    "-v"
+    "-system-zlib" "-system-libpng" "-system-libjpeg"
+    "-qt-gif"
+    (mk xftSupport "xft")
+    (mk xrenderSupport "xrender")
+    (mk xrandrSupport "xrandr")
+    (mk xineramaSupport "xinerama")
+    (mk threadSupport "thread")
+  ] ++ stdenv.lib.optionals mysqlSupport [
+    "-qt-sql-mysql"
+    "-L${mysql.connector-c}/lib/mysql"
+    "-I${mysql.connector-c}/include/mysql"
+  ] ++ stdenv.lib.optional openglSupport "-dlopen-opengl";
 
   patches = [
     # Don't strip everything so we can get useful backtraces.
diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix
index 471f11ad107b..463cb2938ede 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/default.nix
+++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -6,7 +6,7 @@
 , buildMultimedia ? stdenv.isLinux, alsaLib, gstreamer, gst-plugins-base
 , buildWebkit ? (stdenv.isLinux || stdenv.isDarwin)
 , flashplayerFix ? false, gdk_pixbuf
-, gtkStyle ? true, gtk2
+, gtkStyle ? stdenv.hostPlatform == stdenv.buildPlatform, gtk2
 , gnomeStyle ? false, libgnomeui, GConf, gnome_vfs
 , developerBuild ? false
 , docs ? false
@@ -139,37 +139,40 @@ stdenv.mkDerivation rec {
 
   prefixKey = "-prefix ";
 
-  ${if stdenv.hostPlatform == stdenv.buildPlatform then null else "configurePlatforms"} = [];
+  configurePlatforms = [];
   configureFlags = let
+    mk = cond: name: "-${lib.optionalString cond "no-"}${name}";
     platformFlag =
       if stdenv.hostPlatform != stdenv.buildPlatform
       then "-xplatform"
       else "-platform";
-    in (if stdenv.hostPlatform == stdenv.buildPlatform then ''
-      -v -no-separate-debug-info -release -fast -confirm-license -opensource
-
-      -${if stdenv.isFreeBSD then "no-" else ""}opengl -xrender -xrandr -xinerama -xcursor -xinput -xfixes -fontconfig
-      -qdbus -${if cups == null then "no-" else ""}cups -glib -dbus-linked -openssl-linked
-
-      ${if mysql != null then "-plugin" else "-no"}-sql-mysql -system-sqlite
-
-      -exceptions -xmlpatterns
-
-      -make libs -make tools -make translations
-      -${if demos then "" else "no"}make demos
-      -${if examples then "" else "no"}make examples
-      -${if docs then "" else "no"}make docs
-
-      -no-phonon ${if buildWebkit then "" else "-no"}-webkit ${if buildMultimedia then "" else "-no"}-multimedia -audio-backend
-      ${if developerBuild then "-developer-build" else ""}
-    '' else ''
-      -static -release -confirm-license -opensource
-      -no-opengl -no-phonon
-      -no-svg
-      -make qmake -make libs -nomake tools
-      -nomake demos -nomake examples -nomake docs
-    '') + lib.optionalString stdenv.hostPlatform.isDarwin "${platformFlag} unsupported/macx-clang-libc++"
-        + lib.optionalString stdenv.hostPlatform.isMinGW  "${platformFlag} win32-g++-4.6";
+  in (if stdenv.hostPlatform != stdenv.buildPlatform then [
+    # I've not tried any case other than i686-pc-mingw32.
+    # -nomake tools: it fails linking some asian language symbols
+    # -no-svg: it fails to build on mingw64
+    "-static" "-release" "-confirm-license" "-opensource"
+    "-no-opengl" "-no-phonon"
+    "-no-svg"
+    "-make" "qmake" "-make" "libs" "-nomake" "tools"
+  ] else [
+    "-v" "-no-separate-debug-info" "-release" "-fast" "-confirm-license" "-opensource"
+
+    (mk (!stdenv.isFreeBSD) "opengl") "-xrender" "-xrandr" "-xinerama" "-xcursor" "-xinput" "-xfixes" "-fontconfig"
+    "-qdbus" (mk (cups != null) "cups") "-glib" "-dbus-linked" "-openssl-linked"
+
+    "-${if mysql != null then "plugin" else "no"}-sql-mysql" "-system-sqlite"
+
+    "-exceptions" "-xmlpatterns"
+
+    "-make" "libs" "-make" "tools" "-make" "translations"
+    "-no-phonon" (mk buildWebkit "webkit") (mk buildMultimedia "multimedia") "-audio-backend"
+  ]) ++ [
+    (mk demos "make") "demos"
+    (mk examples "make") "examples"
+    (mk docs "make") "docs"
+  ] ++ lib.optional developerBuild "-developer-build"
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [ platformFlag "unsupported/macx-clang-libc++" ]
+    ++ lib.optionals stdenv.hostPlatform.isWindows [ platformFlag "win32-g++-4.6" ];
 
   propagatedBuildInputs =
     [ libXrender libXrandr libXinerama libXcursor libXext libXfixes libXv libXi
@@ -219,7 +222,7 @@ stdenv.mkDerivation rec {
     cp bin/qmake* $out/bin
   '';
 
-  dontStrip = if stdenv.hostPlatform == stdenv.buildPlatform then null else true;
+  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
 
   meta = {
     homepage    = http://qt-project.org/;