2021-01-17 00:15:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, bzip2, freetype, graphviz, ghostscript
|
2020-04-24 23:36:52 +00:00
|
|
|
, libjpeg, libpng, libtiff, libxml2, zlib, libtool, xz, libX11
|
2021-06-28 23:13:55 +00:00
|
|
|
, libwebp, quantumdepth ? 8, fixDarwinDylibNames, nukeReferences }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "graphicsmagick";
|
2022-01-26 04:04:25 +00:00
|
|
|
version = "1.3.37";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/graphicsmagick/GraphicsMagick-${version}.tar.xz";
|
2022-01-26 04:04:25 +00:00
|
|
|
sha256 = "sha256-kNwi8ae9JA5MkGWpQJYr8T2kPJm8w2yxEcw8Gg10d9Q=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./disable-popen.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-shared"
|
2021-03-09 03:18:52 +00:00
|
|
|
"--with-frozenpaths"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-quantum-depth=${toString quantumdepth}"
|
|
|
|
"--with-gslib=yes"
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
[ bzip2 freetype ghostscript graphviz libjpeg libpng libtiff libX11 libxml2
|
|
|
|
zlib libtool libwebp
|
2020-11-12 09:05:59 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00: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 = ''
|
|
|
|
nuke-refs ./magick/magick_config.h
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
sed -i 's/-ltiff.*'\'/\'/ $out/bin/*
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://www.graphicsmagick.org";
|
|
|
|
description = "Swiss army knife of image processing";
|
2021-01-17 00:15:33 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
platforms = lib.platforms.all;
|
2021-12-06 16:07:01 +00:00
|
|
|
mainProgram = "gm";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|