1{ stdenv, fetchurl, pkg-config, darwin, lib
2, zlib, ghostscript, imagemagick, plotutils, gd
3, libjpeg, libwebp, libiconv
4}:
5
6stdenv.mkDerivation rec {
7 pname = "pstoedit";
8 version = "3.78";
9
10 src = fetchurl {
11 url = "mirror://sourceforge/pstoedit/pstoedit-${version}.tar.gz";
12 sha256 = "sha256-jMKONLx/iNkTeA+AdOgT3VqqCsIFams21L8ASg6Q2AE=";
13 };
14
15 #
16 # Turn on "-rdb" option (REALLYDELAYBIND) by default to ensure compatibility with gs-9.22
17 #
18 patches = [ ./pstoedit-gs-9.22-compat.patch ];
19
20 outputs = [ "out" "dev" ];
21 nativeBuildInputs = [ pkg-config ];
22 buildInputs = [ zlib ghostscript imagemagick plotutils gd libjpeg libwebp ]
23 ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
24 libiconv ApplicationServices
25 ]);
26
27 # '@LIBPNG_LDFLAGS@' is no longer substituted by autoconf (the code is commented out)
28 # so we need to remove it from the pkg-config file as well
29 preConfigure = ''
30 substituteInPlace config/pstoedit.pc.in --replace '@LIBPNG_LDFLAGS@' ""
31 '';
32
33 meta = with lib; {
34 description = "Translates PostScript and PDF graphics into other vector formats";
35 homepage = "https://sourceforge.net/projects/pstoedit/";
36 license = licenses.gpl2;
37 maintainers = [ maintainers.marcweber ];
38 platforms = platforms.unix;
39 };
40}