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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

190 lines
3.9 KiB
Nix
Raw Normal View History

{ stdenv
, lib
, boehmgc
, boost
, cairo
, cmake
2023-08-02 18:54:27 +00:00
, desktopToDarwinBundle
, fetchurl
2023-12-11 00:33:30 +00:00
, fetchpatch
, gettext
, ghostscript
, glib
, glibmm
, gobject-introspection
, gsl
, gspell
2020-04-14 08:55:08 +00:00
, gtk-mac-integration
, gtkmm3
, gdk-pixbuf
, imagemagick
, lcms
, lib2geom
, libcdr
, libexif
, libpng
, librevenge
, librsvg
, libsigcxx
2020-04-14 08:55:08 +00:00
, libsoup
, libvisio
, libwpg
, libXft
, libxml2
, libxslt
2020-04-14 08:55:08 +00:00
, ninja
, perlPackages
, pkg-config
, poppler
, popt
, potrace
, python3
2020-04-14 08:55:08 +00:00
, substituteAll
, wrapGAppsHook
, libepoxy
, zlib
}:
2017-03-09 00:26:26 +00:00
let
python3Env = python3.withPackages
(ps: with ps; [
appdirs
beautifulsoup4
cachecontrol
]
# CacheControl requires extra runtime dependencies for FileCache
# https://gitlab.com/inkscape/extras/extension-manager/-/commit/9a4acde6c1c028725187ff5972e29e0dbfa99b06
++ cachecontrol.optional-dependencies.filecache
++ [
numpy
lxml
packaging
pillow
scour
pyparsing
2022-04-20 02:39:59 +00:00
pyserial
requests
pygobject3
] ++ inkex.propagatedBuildInputs);
2015-05-21 13:43:02 +00:00
in
stdenv.mkDerivation rec {
pname = "inkscape";
version = "1.3.2";
src = fetchurl {
url = "https://inkscape.org/release/inkscape-${version}/source/archive/xz/dl/inkscape-${version}.tar.xz";
sha256 = "sha256-29GETcRD/l4Q0+mohxROX7ciOFL/8ZHPte963qsOCGs=";
};
# Inkscape hits the ARGMAX when linking on macOS. It appears to be
# CMakes ARGMAX check doesnt offer enough padding for NIX_LDFLAGS.
# Setting strictDeps it avoids duplicating some dependencies so it
# will leave us under ARGMAX.
strictDeps = true;
2020-04-14 08:55:08 +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-02 18:54:27 +00:00
(substituteAll {
# Fix path to ps2pdf binary
src = ./fix-ps2pdf-path.patch;
inherit ghostscript;
})
2023-12-11 00:33:30 +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=";
})
2020-04-14 08:55:08 +00:00
];
postPatch = ''
patchShebangs share/extensions
2020-04-14 08:55:08 +00:00
patchShebangs share/templates
patchShebangs man/fix-roff-punct
# double-conversion is a dependency of 2geom
substituteInPlace CMakeScripts/DefineDependsandFlags.cmake \
--replace 'find_package(DoubleConversion REQUIRED)' ""
'';
nativeBuildInputs = [
pkg-config
cmake
2020-04-14 08:55:08 +00:00
ninja
python3Env
2020-04-14 08:55:08 +00:00
glib # for setup hook
gdk-pixbuf # for setup hook
wrapGAppsHook
gobject-introspection
] ++ (with perlPackages; [
perl
XMLParser
2023-08-02 18:54:27 +00:00
]) ++ lib.optionals stdenv.isDarwin [
desktopToDarwinBundle
];
buildInputs = [
boehmgc
boost
gettext
glib
glibmm
gsl
2020-04-14 08:55:08 +00:00
gtkmm3
imagemagick
lcms
lib2geom
libcdr
libexif
libpng
librevenge
librsvg # for loading icons
libsigcxx
2020-04-14 08:55:08 +00:00
libsoup
libvisio
libwpg
libXft
libxml2
libxslt
perlPackages.perl
poppler
popt
potrace
python3Env
zlib
libepoxy
2021-01-15 13:21:58 +00:00
] ++ lib.optionals (!stdenv.isDarwin) [
gspell
2021-01-15 13:21:58 +00:00
] ++ lib.optionals stdenv.isDarwin [
cairo
2020-04-14 08:55:08 +00:00
gtk-mac-integration
];
# Make sure PyXML modules can be found at run-time.
2021-01-15 13:21:58 +00:00
postInstall = lib.optionalString stdenv.isDarwin ''
2023-11-06 11:56:50 +00:00
for f in $out/lib/inkscape/*.dylib; do
ln -s $f $out/lib/$(basename $f)
done
'';
meta = with lib; {
description = "Vector graphics editor";
2020-04-13 23:11:51 +00:00
homepage = "https://www.inkscape.org";
license = licenses.gpl3Plus;
maintainers = [ maintainers.jtojnar ];
platforms = platforms.all;
mainProgram = "inkscape";
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.
'';
};
}