2014-10-30 05:34:26 -07:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2010-04-30 03:49:33 -07:00
|
|
|
, fetchurl
|
2013-11-12 12:53:37 -08:00
|
|
|
, pkgconfig
|
2010-04-30 03:49:33 -07:00
|
|
|
, bzip2
|
2013-11-12 12:53:37 -08:00
|
|
|
, fontconfig
|
2010-04-30 03:49:33 -07:00
|
|
|
, freetype
|
2013-01-11 09:32:45 -08:00
|
|
|
, ghostscript ? null
|
2010-04-30 03:49:33 -07:00
|
|
|
, libjpeg
|
|
|
|
, libpng
|
|
|
|
, libtiff
|
|
|
|
, libxml2
|
|
|
|
, zlib
|
|
|
|
, libtool
|
|
|
|
, jasper
|
|
|
|
, libX11
|
|
|
|
, tetex ? null
|
|
|
|
, librsvg ? null
|
|
|
|
}:
|
2008-05-16 04:05:37 -07:00
|
|
|
|
2010-04-30 03:49:33 -07:00
|
|
|
let
|
2014-10-30 05:34:26 -07:00
|
|
|
|
2015-03-27 11:42:06 -07:00
|
|
|
version = "6.9.1-0";
|
2014-10-30 05:34:26 -07: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.";
|
|
|
|
|
2010-04-30 03:49:33 -07:00
|
|
|
in
|
2014-10-30 05:34:26 -07:00
|
|
|
|
2010-04-30 03:49:33 -07:00
|
|
|
stdenv.mkDerivation rec {
|
2015-01-29 04:55:23 -08:00
|
|
|
name = "imagemagick-${version}";
|
2008-02-28 10:53:39 -08:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-01-29 14:16:44 -08:00
|
|
|
url = "mirror://imagemagick/releases/ImageMagick-${version}.tar.xz";
|
2015-03-27 11:42:06 -07:00
|
|
|
sha256 = "03lvj6rxv16xk0dpsbzvm2gq5bggkwff9wqbpkq0znihzijpax1j";
|
2008-02-28 10:53:39 -08:00
|
|
|
};
|
|
|
|
|
2013-09-26 10:27:13 -07:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2013-09-15 09:13:26 -07:00
|
|
|
preConfigure = if tetex != null then
|
|
|
|
''
|
|
|
|
export DVIDecodeDelegate=${tetex}/bin/dvips
|
|
|
|
'' else "";
|
|
|
|
|
2014-10-30 05:34:26 -07:00
|
|
|
configureFlags =
|
|
|
|
[ "--with-frozenpaths" ]
|
|
|
|
++ [ "--with-gcc-arch=${arch}" ]
|
|
|
|
++ lib.optional (librsvg != null) "--with-rsvg"
|
|
|
|
++ lib.optionals (stdenv.system != "x86_64-darwin")
|
|
|
|
[ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
|
|
|
|
"--with-gslib"
|
|
|
|
];
|
2008-05-16 04:05:37 -07:00
|
|
|
|
2011-06-07 14:49:04 -07:00
|
|
|
propagatedBuildInputs =
|
2013-11-12 12:53:37 -08:00
|
|
|
[ bzip2 fontconfig freetype libjpeg libpng libtiff libxml2 zlib librsvg
|
2013-09-26 10:27:13 -07:00
|
|
|
libtool jasper libX11
|
2014-10-30 05:34:26 -07:00
|
|
|
] ++ lib.optional (stdenv.system != "x86_64-darwin") ghostscript;
|
2011-06-07 14:49:04 -07:00
|
|
|
|
2013-11-12 12:53:37 -08:00
|
|
|
buildInputs = [ tetex pkgconfig ];
|
2011-06-07 14:49:04 -07:00
|
|
|
|
2013-09-15 09:13:26 -07:00
|
|
|
postInstall = ''(cd "$out/include" && ln -s ImageMagick* ImageMagick)'';
|
2008-02-28 10:53:39 -08:00
|
|
|
|
2013-11-12 12:53:37 -08:00
|
|
|
meta = with stdenv.lib; {
|
2013-01-06 13:30:23 -08:00
|
|
|
homepage = http://www.imagemagick.org/;
|
|
|
|
description = "A software suite to create, edit, compose, or convert bitmap images";
|
2013-11-14 07:42:58 -08:00
|
|
|
platforms = platforms.linux ++ [ "x86_64-darwin" ];
|
2013-11-12 12:53:37 -08:00
|
|
|
maintainers = with maintainers; [ the-kenny ];
|
2008-02-28 10:53:39 -08:00
|
|
|
};
|
2010-04-30 03:49:33 -07:00
|
|
|
}
|