nixpkgs-suyu/pkgs/applications/graphics/inkscape/default.nix

67 lines
2.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, fetchpatch, pkgconfig, perl, perlXMLParser, libXft
, libpng, zlib, popt, boehmgc, libxml2, libxslt, glib, gtkmm2
, glibmm, libsigcxx, lcms, boost, gettext, makeWrapper
, gsl, python2, poppler, imagemagick, libwpg, librevenge
, libvisio, libcdr, libexif, potrace, cmake
}:
2017-03-09 01:26:26 +01:00
let
python2Env = python2.withPackages(ps: with ps; [ numpy lxml ]);
2015-05-21 15:43:02 +02:00
in
stdenv.mkDerivation rec {
2017-08-25 15:59:15 +02:00
name = "inkscape-0.92.2";
src = fetchurl {
2017-08-25 15:59:15 +02:00
url = "https://media.inkscape.org/dl/resources/file/${name}.tar.bz2";
sha256 = "1lyghk6yarcv9nwkh6k366p6hb7rfilqcvbyji09hki59khd0a56";
};
2017-03-09 01:26:26 +01:00
unpackPhase = ''
cp $src ${name}.tar.bz2
tar xvjf ${name}.tar.bz2 > /dev/null
cd ${name}
'';
postPatch = ''
patchShebangs share/extensions
2017-01-09 10:02:10 +01:00
patchShebangs fix-roff-punct
# Python is used at run-time to execute scripts, e.g., those from
# the "Effects" menu.
substituteInPlace src/extension/implementation/script.cpp \
--replace '"python-interpreter", "python"' '"python-interpreter", "${python2Env}/bin/python"'
'';
nativeBuildInputs = [ pkgconfig ];
buildInputs = [
perl perlXMLParser libXft libpng zlib popt boehmgc
libxml2 libxslt glib gtkmm2 glibmm libsigcxx lcms boost gettext
makeWrapper gsl poppler imagemagick libwpg librevenge
libvisio libcdr libexif potrace cmake python2Env
2017-01-09 10:02:10 +01:00
];
enableParallelBuilding = true;
postInstall = ''
# Make sure PyXML modules can be found at run-time.
rm "$out/share/icons/hicolor/icon-theme.cache"
2017-04-08 22:43:25 +02:00
'' + stdenv.lib.optionalString stdenv.isDarwin ''
install_name_tool -change $out/lib/libinkscape_base.dylib $out/lib/inkscape/libinkscape_base.dylib $out/bin/inkscape
install_name_tool -change $out/lib/libinkscape_base.dylib $out/lib/inkscape/libinkscape_base.dylib $out/bin/inkview
'';
meta = with stdenv.lib; {
license = "GPL";
2017-08-25 15:59:15 +02:00
homepage = https://www.inkscape.org;
description = "Vector graphics editor";
platforms = platforms.all;
longDescription = ''
Inkscape is a feature-rich vector graphics editor that edits
files in the W3C SVG (Scalable Vector Graphics) file format.
If you want to import .eps files install ps2edit.
'';
};
}