diff options
author | William A. Kennington III <william@wkennington.com> | 2015-05-22 13:33:08 -0700 |
---|---|---|
committer | William A. Kennington III <william@wkennington.com> | 2015-05-22 13:54:52 -0700 |
commit | 3117e0c897522ec8431572de12449f676cc8c8be (patch) | |
tree | c3b55ca870549d87bb52e9b0e173ff1bd3b902df /pkgs/applications | |
parent | 25a148fa196b944b3f134527da87e43d88c066f9 (diff) | |
download | nixlib-3117e0c897522ec8431572de12449f676cc8c8be.tar nixlib-3117e0c897522ec8431572de12449f676cc8c8be.tar.gz nixlib-3117e0c897522ec8431572de12449f676cc8c8be.tar.bz2 nixlib-3117e0c897522ec8431572de12449f676cc8c8be.tar.lz nixlib-3117e0c897522ec8431572de12449f676cc8c8be.tar.xz nixlib-3117e0c897522ec8431572de12449f676cc8c8be.tar.zst nixlib-3117e0c897522ec8431572de12449f676cc8c8be.zip |
Refactor mkFlag out of old packages
Diffstat (limited to 'pkgs/applications')
-rw-r--r-- | pkgs/applications/graphics/ImageMagick/default.nix | 68 |
1 files changed, 32 insertions, 36 deletions
diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix index 7ae24b38c01c..011e75fbc1ca 100644 --- a/pkgs/applications/graphics/ImageMagick/default.nix +++ b/pkgs/applications/graphics/ImageMagick/default.nix @@ -17,10 +17,6 @@ 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 @@ -37,38 +33,38 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; configureFlags = [ - (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") + (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) ] ++ optional (dejavu_fonts != null) "--with-dejavu-font-dir=${dejavu_fonts}/share/fonts/truetype/" ++ optional (ghostscript != null) "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts/"; |