depot/pkgs/tools/graphics/pstoedit/default.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

41 lines
1.3 KiB
Nix

{ stdenv, fetchurl, pkg-config, darwin, lib
, zlib, ghostscript, imagemagick, plotutils, gd
, libjpeg, libwebp, libiconv, makeWrapper
}:
stdenv.mkDerivation rec {
pname = "pstoedit";
version = "4.01";
src = fetchurl {
url = "mirror://sourceforge/pstoedit/pstoedit-${version}.tar.gz";
hash = "sha256-RZdlq3NssQ+VVKesAsXqfzVcbC6fz9IXYRx9UQKxB2s=";
};
outputs = [ "out" "dev" ];
nativeBuildInputs = [ makeWrapper pkg-config ];
buildInputs = [ zlib ghostscript imagemagick plotutils gd libjpeg libwebp ]
++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
libiconv ApplicationServices
]);
# '@LIBPNG_LDFLAGS@' is no longer substituted by autoconf (the code is commented out)
# so we need to remove it from the pkg-config file as well
preConfigure = ''
substituteInPlace config/pstoedit.pc.in --replace '@LIBPNG_LDFLAGS@' ""
'';
postInstall = ''
wrapProgram $out/bin/pstoedit \
--prefix PATH : ${lib.makeBinPath [ ghostscript ]}
'';
meta = with lib; {
description = "Translates PostScript and PDF graphics into other vector formats";
homepage = "https://sourceforge.net/projects/pstoedit/";
license = licenses.gpl2Plus;
maintainers = [ maintainers.marcweber ];
platforms = platforms.unix;
mainProgram = "pstoedit";
};
}