Skip to content

Commit

Permalink
Merge inkscape: 1.3.2 -> 1.4 (NixOS#348253)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtojnar authored Dec 11, 2024
2 parents 26baece + 368ac90 commit 1c58a08
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 85 deletions.
85 changes: 45 additions & 40 deletions pkgs/applications/graphics/inkscape/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
, cmake
, desktopToDarwinBundle
, fetchurl
, fetchpatch
, fd
, gettext
, ghostscript
, glib
Expand All @@ -27,7 +27,6 @@
, librevenge
, librsvg
, libsigcxx
, libsoup_2_4
, libvisio
, libwpg
, libXft
Expand All @@ -40,40 +39,43 @@
, popt
, potrace
, python3
, runCommand
, substituteAll
, wrapGAppsHook3
, libepoxy
, zlib
, yq
}:
let
python3Env = python3.withPackages
(ps: with ps; [
# List taken almost verbatim from the output of nix-build -A inkscape.passthru.pythonDependencies
appdirs
beautifulsoup4
cachecontrol
]
# CacheControl requires extra runtime dependencies for FileCache
# https://gitlab.com/inkscape/extras/extension-manager/-/commit/9a4acde6c1c028725187ff5972e29e0dbfa99b06
++ cachecontrol.optional-dependencies.filecache
++ [
numpy
cssselect
filelock
inkex
lxml
numpy
packaging
pillow
scour
pygobject3
pyparsing
pyserial
requests
pygobject3
] ++ inkex.propagatedBuildInputs);
scour
tinycss2
zstandard
]);
in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "inkscape";
version = "1.3.2";
version = "1.4";

src = fetchurl {
url = "https://inkscape.org/release/inkscape-${version}/source/archive/xz/dl/inkscape-${version}.tar.xz";
sha256 = "sha256-29GETcRD/l4Q0+mohxROX7ciOFL/8ZHPte963qsOCGs=";
url = "https://inkscape.org/release/inkscape-${finalAttrs.version}/source/archive/xz/dl/inkscape-${finalAttrs.version}.tar.xz";
sha256 = "sha256-xZqFRTtpmt3rzVHB3AdoTdlqEMiuxxaxlVHbUFYuE/U=";
};

# Inkscape hits the ARGMAX when linking on macOS. It appears to be
Expand All @@ -87,29 +89,13 @@ stdenv.mkDerivation rec {
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";
python3 = lib.getExe python3Env;
})
(substituteAll {
# Fix path to ps2pdf binary
src = ./fix-ps2pdf-path.patch;
inherit ghostscript;
})

# 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=";
})

# 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=";
})
];

postPatch = ''
Expand All @@ -119,7 +105,7 @@ stdenv.mkDerivation rec {
# double-conversion is a dependency of 2geom
substituteInPlace CMakeScripts/DefineDependsandFlags.cmake \
--replace 'find_package(DoubleConversion REQUIRED)' ""
--replace-fail 'find_package(DoubleConversion REQUIRED)' ""
'';

nativeBuildInputs = [
Expand Down Expand Up @@ -155,7 +141,6 @@ stdenv.mkDerivation rec {
librevenge
librsvg # for loading icons
libsigcxx
libsoup_2_4
libvisio
libwpg
libXft
Expand All @@ -182,14 +167,34 @@ stdenv.mkDerivation rec {
done
'';

passthru.tests.ps2pdf-plugin = callPackage ./test-ps2pdf-plugin.nix { };
passthru = {
tests = {
ps2pdf-plugin = callPackage ./test-ps2pdf-plugin.nix { };
inherit (python3.pkgs) inkex;
};

pythonDependencies = runCommand "python-dependency-list" {
nativeBuildInputs = [
fd
yq
];
inherit (finalAttrs) src;
} ''
unpackPhase
tomlq --slurp 'map(.tool.poetry.dependencies | to_entries | map(.key)) | flatten | map(ascii_downcase) | unique' $(fd pyproject.toml) > "$out"
'';
};

meta = with lib; {
meta = {
description = "Vector graphics editor";
homepage = "https://www.inkscape.org";
license = licenses.gpl3Plus;
maintainers = [ maintainers.jtojnar ];
platforms = platforms.all;
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [
jtojnar
x123
Luflosi
];
platforms = lib.platforms.all;
mainProgram = "inkscape";
longDescription = ''
Inkscape is a feature-rich vector graphics editor that edits
Expand All @@ -198,4 +203,4 @@ stdenv.mkDerivation rec {
If you want to import .eps files install ps2edit.
'';
};
}
})
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
stdenv,
fetchpatch,
fetchFromGitLab,
cmake,
ninja,
Expand All @@ -16,7 +15,7 @@

stdenv.mkDerivation rec {
pname = "lib2geom";
version = "1.3";
version = "1.4";

outputs = [
"out"
Expand All @@ -27,33 +26,9 @@ stdenv.mkDerivation rec {
owner = "inkscape";
repo = "lib2geom";
rev = "refs/tags/${version}";
hash = "sha256-llUpW8VRBD8RKaGfyedzsMbLRb8DIo0ePt6m2T2w7Po=";
hash = "sha256-kbcnefzNhUj/ZKZaB9r19bpI68vxUKOLVAwUXSr/zz0=";
};

patches = [
# Fix compilation with Clang.
# https://gitlab.com/inkscape/lib2geom/-/merge_requests/102
(fetchpatch {
url = "https://gitlab.com/inkscape/lib2geom/-/commit/a5b5ac7d992023f8a80535ede60421e73ecd8e20.patch";
hash = "sha256-WJYkk3WRYVyPSvyTbKDUrYvUwFgKA9mmTiEWtYQqM4Q=";
})
(fetchpatch {
url = "https://gitlab.com/inkscape/lib2geom/-/commit/23d9393af4bee17aeb66a3c13bdad5dbed982d08.patch";
hash = "sha256-LAaGMIXpDI/Wzv5E2LasW1Y2/G4ukhuEzDmFu3AzZOA=";
})

# Fix ellipses rendering near page corners.
# https://gitlab.com/inkscape/lib2geom/-/issues/66
(fetchpatch {
url = "https://gitlab.com/inkscape/lib2geom/-/commit/039ce8d4af23a0a2a9d48eb970b321d9795dcc08.patch";
hash = "sha256-JfgGrqBcYSYKcdl4Bt7vGZ4aTBPSHM6JjZ95IlzxPwI=";
})
(fetchpatch {
url = "https://gitlab.com/inkscape/lib2geom/-/commit/cf523857e48c87f9f6a09217bdf935fff457823d.patch";
hash = "sha256-BRg8ANHMSgoi6vt9PNbhwG1fRkzEPXb4gPTPO3sY0XE=";
})
];

nativeBuildInputs = [
cmake
ninja
Expand Down Expand Up @@ -91,6 +66,17 @@ stdenv.mkDerivation rec {
# Fails due to rounding differences
# https://gitlab.com/inkscape/lib2geom/-/issues/70
"circle-test"
]
++ lib.optionals (stdenv.hostPlatform.system != "x86_64-linux") [
# https://gitlab.com/inkscape/lib2geom/-/issues/69
"polynomial-test"

# https://gitlab.com/inkscape/lib2geom/-/issues/75
"line-test"

# Failure observed on aarch64-darwin
"bezier-test"
"ellipse-test"
];
in
''
Expand Down
17 changes: 3 additions & 14 deletions pkgs/development/python-modules/inkex/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
stdenv,
buildPythonPackage,
inkscape,
fetchpatch,
poetry-core,
cssselect,
lxml,
Expand All @@ -14,6 +13,7 @@
pyparsing,
pyserial,
scour,
tinycss2,
gobject-introspection,
pytestCheckHook,
gtk3,
Expand All @@ -27,17 +27,6 @@ buildPythonPackage {

inherit (inkscape) src;

patches = [
# Fix “distribute along path” test with Python 3.12.
# 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=";
})
];

nativeBuildInputs = [ poetry-core ];

propagatedBuildInputs = [
Expand All @@ -46,6 +35,7 @@ buildPythonPackage {
numpy
pygobject3
pyserial
tinycss2
];

pythonImportsCheck = [ "inkex" ];
Expand Down Expand Up @@ -87,8 +77,7 @@ buildPythonPackage {
cd share/extensions
substituteInPlace pyproject.toml \
--replace-fail 'scour = "^0.37"' 'scour = ">=0.37"' \
--replace-fail 'lxml = "^4.5.0"' 'lxml = "^4.5.0 || ^5.0.0"'
--replace-fail 'scour = "^0.37"' 'scour = ">=0.37"'
'';

meta = {
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/python-modules/svg2tikz/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ buildPythonPackage rec {
dotlambda
gal_bolle
];
broken = true;
};
}
4 changes: 0 additions & 4 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9628,10 +9628,6 @@ with pkgs;

lcms = lcms2;

lib2geom = callPackage ../development/libraries/lib2geom {
stdenv = if stdenv.cc.isClang then llvmPackages_13.stdenv else stdenv;
};

libacr38u = callPackage ../tools/security/libacr38u {
inherit (darwin.apple_sdk.frameworks) IOKit;
};
Expand Down

0 comments on commit 1c58a08

Please # to comment.