2015-03-27 22:36:11 +00:00
|
|
|
{ stdenv, fetchurl, pkgconfig, libtool
|
|
|
|
, libcl ? null, perl ? null, jemalloc ? null, bzip2 ? null, zlib ? null
|
|
|
|
, libX11 ? null, libXext ? null, libXt ? null, dejavu_fonts ? null, fftw ? null
|
|
|
|
, libfpx ? null, djvulibre ? null, fontconfig ? null, freetype ? null
|
|
|
|
, ghostscript ? null, graphviz ? null, jbigkit ? null, libjpeg ? null
|
|
|
|
, lcms2 ? null, openjpeg ? null, liblqr1 ? null, xz ? null, openexr ? null
|
|
|
|
, pango ? null, libpng ? null, librsvg ? null, libtiff ? null, libwebp ? null
|
|
|
|
, libxml2 ? null
|
2010-04-30 10:49:33 +00:00
|
|
|
}:
|
2008-05-16 11:05:37 +00:00
|
|
|
|
2010-04-30 10:49:33 +00:00
|
|
|
let
|
2014-10-30 12:34:26 +00:00
|
|
|
|
2015-03-27 18:42:06 +00:00
|
|
|
version = "6.9.1-0";
|
2014-10-30 12:34:26 +00:00
|
|
|
|
|
|
|
arch =
|
|
|
|
if stdenv.system == "i686-linux" then "i686"
|
|
|
|
else if stdenv.system == "x86_64-linux" || stdenv.system == "x86_64-darwin" then "x86-64"
|
|
|
|
else throw "ImageMagick is not supported on this platform.";
|
|
|
|
|
2015-06-01 19:29:47 +00:00
|
|
|
mkFlag = trueStr: falseStr: cond: val: "--${if cond then trueStr else falseStr}-${val}";
|
|
|
|
mkWith = mkFlag "with" "without";
|
|
|
|
mkEnable = mkFlag "enable" "disable";
|
|
|
|
|
2015-03-27 22:36:11 +00:00
|
|
|
hasX11 = libX11 != null && libXext != null && libXt != null;
|
|
|
|
|
2010-04-30 10:49:33 +00:00
|
|
|
in
|
2014-10-30 12:34:26 +00:00
|
|
|
|
2015-03-27 22:36:11 +00:00
|
|
|
with stdenv.lib;
|
2010-04-30 10:49:33 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2015-01-29 12:55:23 +00:00
|
|
|
name = "imagemagick-${version}";
|
2008-02-28 18:53:39 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-01-29 22:16:44 +00:00
|
|
|
url = "mirror://imagemagick/releases/ImageMagick-${version}.tar.xz";
|
2015-03-27 18:42:06 +00:00
|
|
|
sha256 = "03lvj6rxv16xk0dpsbzvm2gq5bggkwff9wqbpkq0znihzijpax1j";
|
2008-02-28 18:53:39 +00:00
|
|
|
};
|
|
|
|
|
2013-09-26 17:27:13 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-03-27 22:36:11 +00:00
|
|
|
configureFlags = [
|
2015-06-01 19:29:47 +00:00
|
|
|
(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")
|
2015-03-27 22:36:11 +00:00
|
|
|
] ++ optional (dejavu_fonts != null) "--with-dejavu-font-dir=${dejavu_fonts}/share/fonts/truetype/"
|
|
|
|
++ optional (ghostscript != null) "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts/";
|
2008-05-16 11:05:37 +00:00
|
|
|
|
2015-03-27 22:36:11 +00:00
|
|
|
buildInputs = [
|
|
|
|
pkgconfig libtool libcl perl jemalloc bzip2 zlib libX11 libXext libXt fftw
|
|
|
|
libfpx djvulibre fontconfig freetype ghostscript graphviz jbigkit libjpeg
|
|
|
|
lcms2 openjpeg liblqr1 xz openexr pango libpng librsvg libtiff libwebp
|
|
|
|
libxml2
|
|
|
|
];
|
2011-06-07 21:49:04 +00:00
|
|
|
|
2015-03-30 05:46:16 +00:00
|
|
|
propagatedBuildInputs = []
|
|
|
|
++ (stdenv.lib.optional (lcms2 != null) lcms2)
|
|
|
|
++ (stdenv.lib.optional (liblqr1 != null) liblqr1)
|
|
|
|
++ (stdenv.lib.optional (fftw != null) fftw)
|
|
|
|
++ (stdenv.lib.optional (libtool != null) libtool)
|
|
|
|
++ (stdenv.lib.optional (jemalloc != null) jemalloc)
|
|
|
|
++ (stdenv.lib.optional (libXext != null) libXext)
|
|
|
|
++ (stdenv.lib.optional (libX11 != null) libX11)
|
|
|
|
++ (stdenv.lib.optional (libXt != null) libXt)
|
|
|
|
++ (stdenv.lib.optional (bzip2 != null) bzip2)
|
|
|
|
;
|
|
|
|
|
2013-09-15 16:13:26 +00:00
|
|
|
postInstall = ''(cd "$out/include" && ln -s ImageMagick* ImageMagick)'';
|
2008-02-28 18:53:39 +00:00
|
|
|
|
2013-11-12 20:53:37 +00:00
|
|
|
meta = with stdenv.lib; {
|
2013-01-06 21:30:23 +00:00
|
|
|
homepage = http://www.imagemagick.org/;
|
|
|
|
description = "A software suite to create, edit, compose, or convert bitmap images";
|
2013-11-14 15:42:58 +00:00
|
|
|
platforms = platforms.linux ++ [ "x86_64-darwin" ];
|
2015-03-27 22:36:11 +00:00
|
|
|
maintainers = with maintainers; [ the-kenny wkennington ];
|
2008-02-28 18:53:39 +00:00
|
|
|
};
|
2010-04-30 10:49:33 +00:00
|
|
|
}
|