From cde95b8a3e47b2780a180aa64aae503a0d432bbe Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Fri, 29 Jul 2022 15:55:35 +0200 Subject: [PATCH] inkcut: fixes for use with newer inkscape and python * avoid inkex.py error with Inkscape 1.2 * avoid distutils deprecation error with recent python * workaround for problem loading documents from stdin --- pkgs/applications/misc/inkcut/default.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pkgs/applications/misc/inkcut/default.nix b/pkgs/applications/misc/inkcut/default.nix index f863f56fcfd7..b5b9b12e15cd 100644 --- a/pkgs/applications/misc/inkcut/default.nix +++ b/pkgs/applications/misc/inkcut/default.nix @@ -1,4 +1,5 @@ { lib +, fetchpatch , python3Packages , fetchFromGitHub , wrapQtAppsHook @@ -18,6 +19,28 @@ buildPythonApplication rec { sha256 = "sha256-S5IrNWVoUp1w+P7DrKlOUOyY3Q16CHSct9ndZOB3UpU="; }; + patches = [ + # fix opening the extension on inkscape 1.2 + # https://github.com/inkcut/inkcut/pull/340 + (fetchpatch { + url = "https://github.com/inkcut/inkcut/commit/d5d5d0ab3c588c576b668f4c7b07a10609ba2fd0.patch"; + hash = "sha256-szfiOujuV7OOwYK/OU51m9FK6dzkbWds+h0cr5dGIg4="; + }) + # fix loading a document from stdin (as used from the extension) + # https://github.com/inkcut/inkcut/issues/341 + (fetchpatch { + url = "https://github.com/inkcut/inkcut/commit/748ab4157f87afec37dadd715094e87d02c9c739.patch"; + hash = "sha256-ZGiwZru2bUYu749YSz5vxmGwLTAoYIAsafcX6PmdbYo="; + revert = true; + }) + # fix distutils deprecation error + # https://github.com/inkcut/inkcut/pull/343 + (fetchpatch { + url = "https://github.com/inkcut/inkcut/commit/9fb95204981bcc51401a1bc10caa02d1fae0d6cb.patch"; + hash = "sha256-nriys7IWPGykZjVz+DIDsE9Tm40DewkHQlIUaxFwtzM="; + }) + ]; + postPatch = '' substituteInPlace inkcut/device/transports/printer/plugin.py \ --replace ", 'lpr', " ", '${cups}/bin/lpr', "