2021-01-15 13:21:58 +00:00
|
|
|
{ lib, stdenv, fetchurl, bzip2, freetype, graphviz, ghostscript
|
2016-10-13 22:53:43 +01:00
|
|
|
, libjpeg, libpng, libtiff, libxml2, zlib, libtool, xz, libX11
|
2022-02-03 21:46:28 +00:00
|
|
|
, libwebp, quantumdepth ? 8, fixDarwinDylibNames, nukeReferences
|
|
|
|
, runCommand
|
|
|
|
, graphicsmagick # for passthru.tests
|
|
|
|
}:
|
2010-03-04 14:44:47 +00:00
|
|
|
|
2018-04-18 23:53:42 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "graphicsmagick";
|
2022-03-29 20:15:31 +01:00
|
|
|
version = "1.3.38";
|
2010-03-04 14:44:47 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2012-02-23 21:14:19 +00:00
|
|
|
url = "mirror://sourceforge/graphicsmagick/GraphicsMagick-${version}.tar.xz";
|
2022-03-29 20:15:31 +01:00
|
|
|
sha256 = "sha256-1gzZ21k1HSucsZvrRDFwrKoo8HPRPSWPZ7NidjXjJnU=";
|
2010-03-04 14:44:47 +00:00
|
|
|
};
|
|
|
|
|
2016-10-13 22:53:43 +01:00
|
|
|
patches = [
|
|
|
|
./disable-popen.patch
|
|
|
|
];
|
2016-05-30 09:26:31 +01:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-shared"
|
2021-02-24 20:02:35 +00:00
|
|
|
"--with-frozenpaths"
|
2016-05-30 09:26:31 +01:00
|
|
|
"--with-quantum-depth=${toString quantumdepth}"
|
|
|
|
"--with-gslib=yes"
|
|
|
|
];
|
2010-03-04 14:44:51 +00:00
|
|
|
|
2010-03-04 14:44:47 +00:00
|
|
|
buildInputs =
|
|
|
|
[ bzip2 freetype ghostscript graphviz libjpeg libpng libtiff libX11 libxml2
|
2016-05-30 09:26:31 +01:00
|
|
|
zlib libtool libwebp
|
2020-10-26 07:17:14 +00:00
|
|
|
];
|
2010-03-04 14:44:47 +00:00
|
|
|
|
2021-06-02 11:51:28 +01:00
|
|
|
nativeBuildInputs = [ xz nukeReferences ]
|
|
|
|
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
|
|
|
|
|
|
|
|
# Remove CFLAGS from the binaries to avoid closure bloat.
|
|
|
|
# In the past we have had -dev packages in the closure of the binaries soley due to the string references.
|
|
|
|
postConfigure = ''
|
2022-02-03 21:44:44 +00:00
|
|
|
nuke-refs -e $out ./magick/magick_config.h
|
2021-06-02 11:51:28 +01:00
|
|
|
'';
|
2012-02-23 21:14:19 +00:00
|
|
|
|
2010-03-04 16:41:10 +00:00
|
|
|
postInstall = ''
|
|
|
|
sed -i 's/-ltiff.*'\'/\'/ $out/bin/*
|
|
|
|
'';
|
|
|
|
|
2022-02-03 21:46:28 +00:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
issue-157920 = runCommand "issue-157920-regression-test" {
|
|
|
|
buildInputs = [ graphicsmagick ];
|
|
|
|
} ''
|
|
|
|
gm convert ${graphviz}/share/graphviz/doc/pdf/neatoguide.pdf jpg:$out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2010-03-04 14:44:47 +00:00
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.graphicsmagick.org";
|
2010-03-04 14:44:47 +00:00
|
|
|
description = "Swiss army knife of image processing";
|
2021-01-15 13:21:58 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
platforms = lib.platforms.all;
|
2021-11-03 10:05:49 +00:00
|
|
|
mainProgram = "gm";
|
2010-03-04 14:44:47 +00:00
|
|
|
};
|
|
|
|
}
|