summary refs log tree commit diff
path: root/pkgs/applications/graphics/ImageMagick
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-01 21:29:47 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-04 14:54:50 +0200
commit5d8fe045b6376851c33a1c772cfe46882411cd21 (patch)
tree6f80e10e2ec11cfed92207ef87082a4ae3e1666e /pkgs/applications/graphics/ImageMagick
parent17b6a597fb36063e4832983d3470ce695f809b31 (diff)
downloadnixlib-5d8fe045b6376851c33a1c772cfe46882411cd21.tar
nixlib-5d8fe045b6376851c33a1c772cfe46882411cd21.tar.gz
nixlib-5d8fe045b6376851c33a1c772cfe46882411cd21.tar.bz2
nixlib-5d8fe045b6376851c33a1c772cfe46882411cd21.tar.lz
nixlib-5d8fe045b6376851c33a1c772cfe46882411cd21.tar.xz
nixlib-5d8fe045b6376851c33a1c772cfe46882411cd21.tar.zst
nixlib-5d8fe045b6376851c33a1c772cfe46882411cd21.zip
Revert "Refactor mkFlag out of old packages"
This reverts commit 3117e0c897522ec8431572de12449f676cc8c8be.

Conflicts:
	pkgs/development/libraries/wayland/default.nix
	pkgs/servers/samba/4.x.nix
Diffstat (limited to 'pkgs/applications/graphics/ImageMagick')
-rw-r--r--pkgs/applications/graphics/ImageMagick/default.nix68
1 files changed, 36 insertions, 32 deletions
diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix
index 011e75fbc1ca..7ae24b38c01c 100644
--- a/pkgs/applications/graphics/ImageMagick/default.nix
+++ b/pkgs/applications/graphics/ImageMagick/default.nix
@@ -17,6 +17,10 @@ let
     else if stdenv.system == "x86_64-linux" || stdenv.system == "x86_64-darwin" then "x86-64"
     else throw "ImageMagick is not supported on this platform.";
 
+  mkFlag = trueStr: falseStr: cond: val: "--${if cond then trueStr else falseStr}-${val}";
+  mkWith = mkFlag "with" "without";
+  mkEnable = mkFlag "enable" "disable";
+
   hasX11 = libX11 != null && libXext != null && libXt != null;
 
 in
@@ -33,38 +37,38 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   configureFlags = [
-    (mkEnable (libcl != null)        "opencl"      null)
-    (mkWith   true                   "modules"     null)
-    (mkWith   true                   "gcc-arch"    arch)
-    #(mkEnable true                   "hdri"        null) This breaks some dependencies
-    (mkWith   (perl != null)         "perl"        null)
-    (mkWith   (jemalloc != null)     "jemalloc"    null)
-    (mkWith   true                   "frozenpaths" null)
-    (mkWith   (bzip2 != null)        "bzlib"       null)
-    (mkWith   hasX11                 "x"           null)
-    (mkWith   (zlib != null)         "zlib"        null)
-    (mkWith   false                  "dps"         null)
-    (mkWith   (fftw != null)         "fftw"        null)
-    (mkWith   (libfpx != null)       "fpx"         null)
-    (mkWith   (djvulibre != null)    "djvu"        null)
-    (mkWith   (fontconfig != null)   "fontconfig"  null)
-    (mkWith   (freetype != null)     "freetype"    null)
-    (mkWith   (ghostscript != null)  "gslib"       null)
-    (mkWith   (graphviz != null)     "gvc"         null)
-    (mkWith   (jbigkit != null)      "jbig"        null)
-    (mkWith   (libjpeg != null)      "jpeg"        null)
-    (mkWith   (lcms2 != null)        "lcms2"       null)
-    (mkWith   false                  "lcms"        null)
-    (mkWith   (openjpeg != null)     "openjp2"     null)
-    (mkWith   (liblqr1 != null)      "lqr"         null)
-    (mkWith   (xz != null)           "lzma"        null)
-    (mkWith   (openexr != null)      "openexr"     null)
-    (mkWith   (pango != null)        "pango"       null)
-    (mkWith   (libpng != null)       "png"         null)
-    (mkWith   (librsvg != null)      "rsvg"        null)
-    (mkWith   (libtiff != null)      "tiff"        null)
-    (mkWith   (libwebp != null)      "webp"        null)
-    (mkWith   (libxml2 != null)      "xml"         null)
+    (mkEnable (libcl != null)        "opencl")
+    (mkWith   true                   "modules")
+    (mkWith   true                   "gcc-arch=${arch}")
+    #(mkEnable true                   "hdri") This breaks some dependencies
+    (mkWith   (perl != null)         "perl")
+    (mkWith   (jemalloc != null)     "jemalloc")
+    (mkWith   true                   "frozenpaths")
+    (mkWith   (bzip2 != null)        "bzlib")
+    (mkWith   hasX11                 "x")
+    (mkWith   (zlib != null)         "zlib")
+    (mkWith   false                  "dps")
+    (mkWith   (fftw != null)         "fftw")
+    (mkWith   (libfpx != null)       "fpx")
+    (mkWith   (djvulibre != null)    "djvu")
+    (mkWith   (fontconfig != null)   "fontconfig")
+    (mkWith   (freetype != null)     "freetype")
+    (mkWith   (ghostscript != null)  "gslib")
+    (mkWith   (graphviz != null)     "gvc")
+    (mkWith   (jbigkit != null)      "jbig")
+    (mkWith   (libjpeg != null)      "jpeg")
+    (mkWith   (lcms2 != null)        "lcms2")
+    (mkWith   false                  "lcms")
+    (mkWith   (openjpeg != null)     "openjp2")
+    (mkWith   (liblqr1 != null)      "lqr")
+    (mkWith   (xz != null)           "lzma")
+    (mkWith   (openexr != null)      "openexr")
+    (mkWith   (pango != null)        "pango")
+    (mkWith   (libpng != null)       "png")
+    (mkWith   (librsvg != null)      "rsvg")
+    (mkWith   (libtiff != null)      "tiff")
+    (mkWith   (libwebp != null)      "webp")
+    (mkWith   (libxml2 != null)      "xml")
   ] ++ optional (dejavu_fonts != null) "--with-dejavu-font-dir=${dejavu_fonts}/share/fonts/truetype/"
     ++ optional (ghostscript != null) "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts/";