2021-12-06 16:07:01 +00:00
|
|
|
|
{ stdenv
|
|
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, boehmgc
|
|
|
|
|
, boost
|
|
|
|
|
, cairo
|
|
|
|
|
, cmake
|
|
|
|
|
, fetchurl
|
2021-06-28 23:13:55 +00:00
|
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, gettext
|
2021-02-19 19:06:45 +00:00
|
|
|
|
, ghostscript
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, glib
|
2020-08-20 17:08:02 +00:00
|
|
|
|
, glib-networking
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, glibmm
|
|
|
|
|
, gsl
|
2021-05-28 09:39:13 +00:00
|
|
|
|
, gspell
|
2020-08-20 17:08:02 +00:00
|
|
|
|
, gtk-mac-integration
|
|
|
|
|
, gtkmm3
|
|
|
|
|
, gdk-pixbuf
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, imagemagick
|
|
|
|
|
, lcms
|
2021-05-28 09:39:13 +00:00
|
|
|
|
, lib2geom
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, libcdr
|
|
|
|
|
, libexif
|
|
|
|
|
, libpng
|
|
|
|
|
, librevenge
|
|
|
|
|
, librsvg
|
|
|
|
|
, libsigcxx
|
2020-08-20 17:08:02 +00:00
|
|
|
|
, libsoup
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, libvisio
|
|
|
|
|
, libwpg
|
|
|
|
|
, libXft
|
|
|
|
|
, libxml2
|
|
|
|
|
, libxslt
|
2020-08-20 17:08:02 +00:00
|
|
|
|
, ninja
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, perlPackages
|
|
|
|
|
, pkg-config
|
|
|
|
|
, poppler
|
|
|
|
|
, popt
|
|
|
|
|
, potrace
|
|
|
|
|
, python3
|
2020-08-20 17:08:02 +00:00
|
|
|
|
, substituteAll
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, wrapGAppsHook
|
|
|
|
|
, zlib
|
|
|
|
|
}:
|
|
|
|
|
let
|
|
|
|
|
python3Env = python3.withPackages
|
|
|
|
|
(ps: with ps; [
|
|
|
|
|
numpy
|
|
|
|
|
lxml
|
2021-05-28 09:39:13 +00:00
|
|
|
|
pillow
|
2020-04-24 23:36:52 +00:00
|
|
|
|
scour
|
|
|
|
|
]);
|
|
|
|
|
in
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "inkscape";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
version = "1.1.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
2020-08-20 17:08:02 +00:00
|
|
|
|
url = "https://media.inkscape.org/dl/resources/file/${pname}-${version}.tar.xz";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
sha256 = "sha256-rsoLnTO1sc+pqnBDO97mqMPQIP+vwubwyaYO7Xp5eK8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Inkscape hits the ARGMAX when linking on macOS. It appears to be
|
|
|
|
|
# CMake’s ARGMAX check doesn’t offer enough padding for NIX_LDFLAGS.
|
|
|
|
|
# Setting strictDeps it avoids duplicating some dependencies so it
|
|
|
|
|
# will leave us under ARGMAX.
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
|
patches = [
|
|
|
|
|
(substituteAll {
|
|
|
|
|
src = ./fix-python-paths.patch;
|
|
|
|
|
# Python is used at run-time to execute scripts,
|
|
|
|
|
# e.g., those from the "Effects" menu.
|
|
|
|
|
python3 = "${python3Env}/bin/python";
|
|
|
|
|
})
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
|
|
# Fix parsing paths by Python extensions.
|
|
|
|
|
# https://gitlab.com/inkscape/extensions/-/merge_requests/342
|
|
|
|
|
(fetchpatch {
|
|
|
|
|
url = "https://gitlab.com/inkscape/extensions/-/commit/a82c382c610d37837c8f3f5b13224bab8fd3667e.patch";
|
|
|
|
|
sha256 = "YWrgjCnQ9q6BUsxSLQojIXnDzPxM/SgrIfj1gxQ/JKM=";
|
|
|
|
|
stripLen = 1;
|
|
|
|
|
extraPrefix = "share/extensions/";
|
|
|
|
|
})
|
2020-08-20 17:08:02 +00:00
|
|
|
|
];
|
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
postPatch = ''
|
|
|
|
|
patchShebangs share/extensions
|
2021-02-19 19:06:45 +00:00
|
|
|
|
substituteInPlace share/extensions/eps_input.inx \
|
|
|
|
|
--replace "location=\"path\">ps2pdf" "location=\"absolute\">${ghostscript}/bin/ps2pdf"
|
|
|
|
|
substituteInPlace share/extensions/ps_input.inx \
|
|
|
|
|
--replace "location=\"path\">ps2pdf" "location=\"absolute\">${ghostscript}/bin/ps2pdf"
|
|
|
|
|
substituteInPlace share/extensions/ps_input.py \
|
|
|
|
|
--replace "call('ps2pdf'" "call('${ghostscript}/bin/ps2pdf'"
|
2020-08-20 17:08:02 +00:00
|
|
|
|
patchShebangs share/templates
|
|
|
|
|
patchShebangs man/fix-roff-punct
|
2021-05-28 09:39:13 +00:00
|
|
|
|
|
|
|
|
|
# double-conversion is a dependency of 2geom
|
|
|
|
|
substituteInPlace CMakeScripts/DefineDependsandFlags.cmake \
|
|
|
|
|
--replace 'find_package(DoubleConversion REQUIRED)' ""
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
pkg-config
|
|
|
|
|
cmake
|
2020-08-20 17:08:02 +00:00
|
|
|
|
ninja
|
2020-04-24 23:36:52 +00:00
|
|
|
|
python3Env
|
2020-08-20 17:08:02 +00:00
|
|
|
|
glib # for setup hook
|
|
|
|
|
gdk-pixbuf # for setup hook
|
2020-04-24 23:36:52 +00:00
|
|
|
|
wrapGAppsHook
|
|
|
|
|
] ++ (with perlPackages; [
|
|
|
|
|
perl
|
|
|
|
|
XMLParser
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
|
boehmgc
|
|
|
|
|
boost
|
|
|
|
|
gettext
|
|
|
|
|
glib
|
2020-08-20 17:08:02 +00:00
|
|
|
|
glib-networking
|
2020-04-24 23:36:52 +00:00
|
|
|
|
glibmm
|
|
|
|
|
gsl
|
2020-08-20 17:08:02 +00:00
|
|
|
|
gtkmm3
|
2020-04-24 23:36:52 +00:00
|
|
|
|
imagemagick
|
|
|
|
|
lcms
|
2021-05-28 09:39:13 +00:00
|
|
|
|
lib2geom
|
2020-04-24 23:36:52 +00:00
|
|
|
|
libcdr
|
|
|
|
|
libexif
|
|
|
|
|
libpng
|
|
|
|
|
librevenge
|
|
|
|
|
librsvg # for loading icons
|
|
|
|
|
libsigcxx
|
2020-08-20 17:08:02 +00:00
|
|
|
|
libsoup
|
2020-04-24 23:36:52 +00:00
|
|
|
|
libvisio
|
|
|
|
|
libwpg
|
|
|
|
|
libXft
|
|
|
|
|
libxml2
|
|
|
|
|
libxslt
|
|
|
|
|
perlPackages.perl
|
|
|
|
|
poppler
|
|
|
|
|
popt
|
|
|
|
|
potrace
|
|
|
|
|
python3Env
|
|
|
|
|
zlib
|
2021-01-17 00:15:33 +00:00
|
|
|
|
] ++ lib.optionals (!stdenv.isDarwin) [
|
2021-05-28 09:39:13 +00:00
|
|
|
|
gspell
|
2021-01-17 00:15:33 +00:00
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2020-04-24 23:36:52 +00:00
|
|
|
|
cairo
|
2020-08-20 17:08:02 +00:00
|
|
|
|
gtk-mac-integration
|
2020-04-24 23:36:52 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Make sure PyXML modules can be found at run-time.
|
2021-01-17 00:15:33 +00:00
|
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
|
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
|
|
|
|
|
'';
|
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "Vector graphics editor";
|
|
|
|
|
homepage = "https://www.inkscape.org";
|
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
|
maintainers = [ maintainers.jtojnar ];
|
|
|
|
|
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.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
}
|