mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-24 22:53:42 +00:00
a1ab165b81
Before this commit we had libxml and freetype development files as part of the runtime closure of graphicsmagick. Both of these combined added up to 2MiB. With this commit those references are now gone :-)
50 lines
1.3 KiB
Nix
50 lines
1.3 KiB
Nix
{ lib, stdenv, fetchurl, bzip2, freetype, graphviz, ghostscript
|
|
, libjpeg, libpng, libtiff, libxml2, zlib, libtool, xz, libX11
|
|
, libwebp, quantumdepth ? 8, fixDarwinDylibNames, nukeReferences }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "graphicsmagick";
|
|
version = "1.3.36";
|
|
|
|
src = fetchurl {
|
|
url = "mirror://sourceforge/graphicsmagick/GraphicsMagick-${version}.tar.xz";
|
|
sha256 = "0ilg6fkppb4avzais1dvi3qf6ln7v3mzj7gjm83w7pwwfpg3ynsx";
|
|
};
|
|
|
|
patches = [
|
|
./disable-popen.patch
|
|
];
|
|
|
|
configureFlags = [
|
|
"--enable-shared"
|
|
"--with-frozenpaths"
|
|
"--with-quantum-depth=${toString quantumdepth}"
|
|
"--with-gslib=yes"
|
|
];
|
|
|
|
buildInputs =
|
|
[ bzip2 freetype ghostscript graphviz libjpeg libpng libtiff libX11 libxml2
|
|
zlib libtool libwebp
|
|
];
|
|
|
|
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
|
|
'';
|
|
|
|
postInstall = ''
|
|
sed -i 's/-ltiff.*'\'/\'/ $out/bin/*
|
|
'';
|
|
|
|
meta = {
|
|
homepage = "http://www.graphicsmagick.org";
|
|
description = "Swiss army knife of image processing";
|
|
license = lib.licenses.mit;
|
|
platforms = lib.platforms.all;
|
|
};
|
|
}
|