Merge pull request #128037 from jtojnar/inkscape-app-trans

inkscape-extensions.applytransforms: 0.0.0+unstable=2021-05-11
This commit is contained in:
Jan Tojnar 2021-06-26 14:44:51 +02:00 committed by GitHub
commit 69015ede61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 106 additions and 2 deletions

View file

@ -4,6 +4,7 @@
, cairo
, cmake
, fetchurl
, fetchpatch
, gettext
, ghostscript
, glib
@ -71,6 +72,15 @@ stdenv.mkDerivation rec {
# e.g., those from the "Effects" menu.
python3 = "${python3Env}/bin/python";
})
# 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/";
})
];
postPatch = ''

View file

@ -2,9 +2,12 @@
, fetchFromGitHub
, runCommand
, inkcut
, callPackage
}:
{
applytransforms = callPackage ./extensions/applytransforms { };
hexmap = stdenv.mkDerivation {
name = "hexmap";
version = "2020-06-06";

View file

@ -0,0 +1,42 @@
{ lib
, stdenv
, fetchFromGitHub
, python3
}:
stdenv.mkDerivation {
pname = "inkscape-applytransforms";
version = "0.0.0+unstable=2021-05-11";
src = fetchFromGitHub {
owner = "Klowner";
repo = "inkscape-applytransforms";
rev = "5b3ed4af0fb66e399e686fc2b649b56db84f6042";
sha256 = "XWwkuw+Um/cflRWjIeIgQUxJLrk2DLDmx7K+pMWvIlI=";
};
checkInputs = [
python3.pkgs.inkex
python3.pkgs.pytestCheckHook
];
dontBuild = true;
doCheck = true;
installPhase = ''
runHook preInstall
install -Dt "$out/share/inkscape/extensions" *.inx *.py
runHook postInstall
'';
meta = with lib; {
description = "Inkscape extension which removes all matrix transforms by applying them recursively to shapes";
homepage = "https://github.com/Klowner/inkscape-applytransforms";
license = licenses.gpl2Only;
maintainers = with maintainers; [ jtojnar ];
platforms = platforms.all;
};
}

View file

@ -2,13 +2,19 @@
, inkscape
, symlinkJoin
, makeWrapper
, inkscapeExtensions ? []
, inkscapeExtensions ? [ ]
, inkscape-extensions
}:
let
allExtensions = lib.filter (pkg: lib.isDerivation pkg && !pkg.meta.broken or false) (lib.attrValues inkscape-extensions);
selectedExtensions = if inkscapeExtensions == null then allExtensions else inkscapeExtensions;
in
symlinkJoin {
name = "inkscape-with-extensions-${lib.getVersion inkscape}";
paths = [ inkscape ] ++ inkscapeExtensions;
paths = [ inkscape ] ++ selectedExtensions;
nativeBuildInputs = [ makeWrapper ];

View file

@ -0,0 +1,41 @@
{ buildPythonPackage
, inkscape
, lxml
, python
}:
buildPythonPackage {
pname = "inkex";
inherit (inkscape) version;
format = "other";
propagatedBuildInputs = [
lxml
];
# We just copy the files.
dontUnpack = true;
dontBuild = true;
# No tests installed.
doCheck = false;
installPhase = ''
runHook preInstall
mkdir -p "$out/${python.sitePackages}"
cp -r "${inkscape}/share/inkscape/extensions/inkex" "$out/${python.sitePackages}"
runHook postInstall
'';
meta = inkscape.meta // {
description = "Inkscape Extensions Library";
longDescription = ''
This module provides support for inkscape extensions, it includes support for opening svg files and processing them.
Standalone, it is especially useful for running tests for Inkscape extensions.
'';
};
}

View file

@ -3498,6 +3498,8 @@ in {
injector = callPackage ../development/python-modules/injector { };
inkex = callPackage ../development/python-modules/inkex { };
inotify-simple = callPackage ../development/python-modules/inotify-simple { };
inquirer = callPackage ../development/python-modules/inquirer { };