inkscape-extensions.inkstitch: fix editor opening
Co-authored-by: tropf <29873239+tropf@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
From af541a4f8ddda287f74687327e4ed89b79557777 Mon Sep 17 00:00:00 2001
|
||||
From: tropf <tropf@noreply.codeberg.org>
|
||||
Date: Mon, 5 Aug 2024 21:25:33 +0200
|
||||
Subject: [PATCH 1/3] force frozen=true
|
||||
|
||||
Enforce installation in frozen mode, i.e. as a packaged version where
|
||||
source can not be modified.
|
||||
---
|
||||
inkstitch.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/inkstitch.py b/inkstitch.py
|
||||
index 50f33d19..398465ca 100644
|
||||
--- a/inkstitch.py
|
||||
+++ b/inkstitch.py
|
||||
@@ -40,7 +40,7 @@ else:
|
||||
ini = {}
|
||||
# --------------------------------------------------------------------------------------------
|
||||
|
||||
-running_as_frozen = getattr(sys, 'frozen', None) is not None # check if running from pyinstaller bundle
|
||||
+running_as_frozen = True
|
||||
|
||||
if not running_as_frozen: # override running_as_frozen from DEBUG.toml - for testing
|
||||
if safe_get(ini, "DEBUG", "force_frozen", default=False):
|
||||
--
|
||||
2.36.0
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
From a86412c57833c24743214c9d3abb76093365769f Mon Sep 17 00:00:00 2001
|
||||
From: tropf <tropf@noreply.codeberg.org>
|
||||
Date: Mon, 5 Aug 2024 21:26:13 +0200
|
||||
Subject: [PATCH 2/3] plugin invocation: use python script as entrypoint
|
||||
|
||||
Ink/Stitch is invoked by calling a script with command line parameters.
|
||||
Depending on the distribution format, this is bundled into a standalone
|
||||
binary -- at least for vanilla Ink/Stitch. For the nix version, we
|
||||
follow manual install, which does *not* bundle the file. Hence, the
|
||||
generation is patched to treat this packaged install as manual install,
|
||||
and to still refer to the python file.
|
||||
|
||||
To keep the patchset small, only an if statement is changed, with the
|
||||
intent of only using the else path.
|
||||
---
|
||||
lib/inx/utils.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/inx/utils.py b/lib/inx/utils.py
|
||||
index 9168f2a2..00313639 100755
|
||||
--- a/lib/inx/utils.py
|
||||
+++ b/lib/inx/utils.py
|
||||
@@ -21,7 +21,7 @@ def build_environment():
|
||||
extensions=['jinja2.ext.i18n']
|
||||
)
|
||||
|
||||
- if "BUILD" in os.environ:
|
||||
+ if False:
|
||||
# building a ZIP release, with inkstitch packaged as a binary
|
||||
# Command tag and icons path
|
||||
if sys.platform == "win32":
|
||||
--
|
||||
2.36.0
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
let
|
||||
version = "3.1.0";
|
||||
in
|
||||
python3.pkgs.buildPythonApplication {
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "inkstitch";
|
||||
inherit version;
|
||||
pyproject = false; # Uses a Makefile (yikes)
|
||||
@@ -54,11 +54,27 @@ python3.pkgs.buildPythonApplication {
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/share/inkscape/extensions
|
||||
cp -a inx $out/share/inkscape/extensions/inkstitch
|
||||
cp -a . $out/share/inkscape/extensions/inkstitch
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
patches = [
|
||||
./0001-force-frozen-true.patch
|
||||
./0002-plugin-invocation-use-python-script-as-entrypoint.patch
|
||||
];
|
||||
|
||||
postPatch =
|
||||
let
|
||||
pyEnv = python3.withPackages (_: dependencies);
|
||||
in
|
||||
''
|
||||
# Add shebang with python dependencies
|
||||
substituteInPlace lib/inx/utils.py --replace-fail ' interpreter="python"' ""
|
||||
sed -i -e '1i#!${pyEnv.interpreter}' inkstitch.py
|
||||
chmod a+x inkstitch.py
|
||||
'';
|
||||
|
||||
nativeCheckInputs = with python3.pkgs; [
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user