2021-12-06 16:07:01 +00:00
|
|
|
|
{ stdenv
|
|
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, boehmgc
|
|
|
|
|
, boost
|
|
|
|
|
, cairo
|
2024-06-05 15:53:02 +00:00
|
|
|
|
, callPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, cmake
|
2023-08-04 22:07:22 +00:00
|
|
|
|
, desktopToDarwinBundle
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, fetchurl
|
2024-01-13 08:15:51 +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
|
|
|
|
|
, glibmm
|
2023-10-09 19:29:22 +00:00
|
|
|
|
, gobject-introspection
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, 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
|
2024-05-15 15:35:15 +00:00
|
|
|
|
, wrapGAppsHook3
|
2023-11-16 04:20:00 +00:00
|
|
|
|
, libepoxy
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, zlib
|
|
|
|
|
}:
|
|
|
|
|
let
|
|
|
|
|
python3Env = python3.withPackages
|
|
|
|
|
(ps: with ps; [
|
2022-06-16 17:23:12 +00:00
|
|
|
|
appdirs
|
|
|
|
|
beautifulsoup4
|
|
|
|
|
cachecontrol
|
2023-11-16 04:20:00 +00:00
|
|
|
|
]
|
|
|
|
|
# CacheControl requires extra runtime dependencies for FileCache
|
|
|
|
|
# https://gitlab.com/inkscape/extras/extension-manager/-/commit/9a4acde6c1c028725187ff5972e29e0dbfa99b06
|
|
|
|
|
++ cachecontrol.optional-dependencies.filecache
|
|
|
|
|
++ [
|
2020-04-24 23:36:52 +00:00
|
|
|
|
numpy
|
|
|
|
|
lxml
|
2022-08-12 12:06:08 +00:00
|
|
|
|
packaging
|
2021-05-28 09:39:13 +00:00
|
|
|
|
pillow
|
2020-04-24 23:36:52 +00:00
|
|
|
|
scour
|
2023-11-16 04:20:00 +00:00
|
|
|
|
pyparsing
|
2022-04-27 09:35:20 +00:00
|
|
|
|
pyserial
|
2022-06-16 17:23:12 +00:00
|
|
|
|
requests
|
|
|
|
|
pygobject3
|
|
|
|
|
] ++ inkex.propagatedBuildInputs);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
in
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "inkscape";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
version = "1.3.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
2023-11-16 04:20:00 +00:00
|
|
|
|
url = "https://inkscape.org/release/inkscape-${version}/source/archive/xz/dl/inkscape-${version}.tar.xz";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
sha256 = "sha256-29GETcRD/l4Q0+mohxROX7ciOFL/8ZHPte963qsOCGs=";
|
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";
|
|
|
|
|
})
|
2023-08-04 22:07:22 +00:00
|
|
|
|
(substituteAll {
|
|
|
|
|
# Fix path to ps2pdf binary
|
|
|
|
|
src = ./fix-ps2pdf-path.patch;
|
|
|
|
|
inherit ghostscript;
|
|
|
|
|
})
|
2024-01-13 08:15:51 +00:00
|
|
|
|
|
|
|
|
|
# Fix build with libxml2 2.12
|
|
|
|
|
# https://gitlab.com/inkscape/inkscape/-/merge_requests/6089
|
|
|
|
|
(fetchpatch {
|
|
|
|
|
url = "https://gitlab.com/inkscape/inkscape/-/commit/694d8ae43d06efff21adebf377ce614d660b24cd.patch";
|
|
|
|
|
hash = "sha256-9IXJzpZbNU5fnt7XKgqCzUDrwr08qxGwo8TqnL+xc6E=";
|
|
|
|
|
})
|
2024-07-27 06:49:29 +00:00
|
|
|
|
|
|
|
|
|
# Improve distribute along path precision
|
|
|
|
|
# https://gitlab.com/inkscape/extensions/-/issues/580
|
|
|
|
|
(fetchpatch {
|
|
|
|
|
url = "https://gitlab.com/inkscape/extensions/-/commit/c576043c195cd044bdfc975e6367afb9b655eb14.patch";
|
|
|
|
|
extraPrefix = "share/extensions/";
|
|
|
|
|
stripLen = 1;
|
|
|
|
|
hash = "sha256-D9HxBx8RNkD7hHuExJqdu3oqlrXX6IOUw9m9Gx6+Dr8=";
|
|
|
|
|
})
|
2020-08-20 17:08:02 +00:00
|
|
|
|
];
|
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
postPatch = ''
|
|
|
|
|
patchShebangs share/extensions
|
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
|
2024-05-15 15:35:15 +00:00
|
|
|
|
wrapGAppsHook3
|
2023-10-09 19:29:22 +00:00
|
|
|
|
gobject-introspection
|
2020-04-24 23:36:52 +00:00
|
|
|
|
] ++ (with perlPackages; [
|
|
|
|
|
perl
|
|
|
|
|
XMLParser
|
2024-09-26 11:04:55 +00:00
|
|
|
|
]) ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2023-08-04 22:07:22 +00:00
|
|
|
|
desktopToDarwinBundle
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
|
boehmgc
|
|
|
|
|
boost
|
|
|
|
|
gettext
|
|
|
|
|
glib
|
|
|
|
|
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
|
2023-11-16 04:20:00 +00:00
|
|
|
|
libepoxy
|
2024-09-26 11:04:55 +00:00
|
|
|
|
] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
|
2021-05-28 09:39:13 +00:00
|
|
|
|
gspell
|
2024-09-26 11:04:55 +00:00
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.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.
|
2024-09-26 11:04:55 +00:00
|
|
|
|
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
2023-11-16 04:20:00 +00:00
|
|
|
|
for f in $out/lib/inkscape/*.dylib; do
|
|
|
|
|
ln -s $f $out/lib/$(basename $f)
|
|
|
|
|
done
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
|
passthru.tests.ps2pdf-plugin = callPackage ./test-ps2pdf-plugin.nix { };
|
|
|
|
|
|
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;
|
2023-08-04 22:07:22 +00:00
|
|
|
|
mainProgram = "inkscape";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
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.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
}
|