[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Inkscape export errors
From: |
Ekaitz Zarraga |
Subject: |
Re: Inkscape export errors |
Date: |
Wed, 21 Oct 2020 17:17:55 +0000 |
Hi,
I think I managed to solve the issues.
All the issues I had were coming from the extensions' dependencies
not being added to Inkscape's.
With the following changes it's supposed to work (it worked in my
machine lol).
I had to package scour too, because it wasn't packaged.
I have a question here btw. In general, python deps are propagated,
and that makes sense. But in programs like inkscape and kicad they
are not propagated. Is this because they create a separate python
interpreter for themselves that has those dependencies separated?
That's why we need to wrap it?
Sorry for the amount of questions but I thought I could understand
it but now everything is blurred in my mind and I'm afraid of myself.
:)
Patch candidate below, please tell me if it makes sense or if it's
anything wrong and I'll update and send to guix-patches.
Thanks!
>From 21a439f6f1978116584a6dc9ac80c0759c3fa771 Mon Sep 17 00:00:00 2001
From: Ekaitz Zarraga <ekaitz@elenq.tech>
Date: Wed, 21 Oct 2020 19:08:20 +0200
Subject: [PATCH] gnu: Correct Inkscape extension dependencies
* gnu/packages/inkscape.scm (inkscape@1.0.1): Add dependencies.
* gnu/packages/python-xyz.scm (python-scour): New variable.
---
gnu/packages/inkscape.scm | 27 +++++++++++++++++++++++++--
gnu/packages/python-xyz.scm | 27 +++++++++++++++++++++++++++
2 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/inkscape.scm b/gnu/packages/inkscape.scm
index 4ac3cf3966..b02a8ba8ef 100644
--- a/gnu/packages/inkscape.scm
+++ b/gnu/packages/inkscape.scm
@@ -44,6 +44,7 @@
#:use-module (gnu packages pdf)
#:use-module (gnu packages popt)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-xyz)
#:use-module (gnu packages xml)
#:use-module (gnu packages ghostscript)
#:use-module (gnu packages fontutils)
@@ -250,7 +251,25 @@ endif()~%~%"
(add-after 'install 'glib-or-gtk-compile-schemas
(assoc-ref glib-or-gtk:%standard-phases
'glib-or-gtk-compile-schemas))
(add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
- (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
+ (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
+ (add-after 'install 'wrap-program
+ ;; Ensure correct Python at runtime.
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (python (assoc-ref inputs "python"))
+ (file (string-append out "/bin/inkscape"))
+ (path (string-append
+ out
+ "/lib/python"
+ ,(version-major+minor
+ (package-version python))
+ "/site-packages:"
+ (getenv "PYTHONPATH"))))
+ (wrap-program file
+ `("PYTHONPATH" ":" prefix (,path))
+ `("PATH" ":" prefix
+ (,(string-append python "/bin:")))))
+ #t)))))
(inputs
`(("aspell" ,aspell)
("autotrace" ,autotrace)
@@ -283,7 +302,11 @@ endif()~%~%"
("googletest" ,googletest)
("perl" ,perl)
("pkg-config" ,pkg-config)
- ("python" ,python-wrapper)))
+ ("python" ,python-wrapper)
+ ("python-scour" ,python-scour)
+ ("python-pyserial" ,python-pyserial)
+ ("python-numpy" ,python-numpy)
+ ("python-lxml" ,python-lxml)))
(home-page "https://inkscape.org/")
(synopsis "Vector graphics editor")
(description "Inkscape is a vector graphics editor. What sets Inkscape
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 575ce40ac8..5e8aedc63b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -22524,3 +22524,30 @@ applications with variable CPU loads).")
(define-public python2-parallel
(package-with-python2 python-parallel))
+
+(define-public python-scour
+ (package
+ (name "python-scour")
+ (version "038.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://github.com/scour-project/scour.git")
+ (commit
+ (string-append "v" version))))
+ (sha256
+ (base32 "0rgiypb9ig8x4rl3hfzpy7kwnx1q3064nvlrv4fk0dnp84girn0v"))))
+ (propagated-inputs
+ `(("python-six" ,python-six)))
+ (build-system python-build-system)
+ (home-page "https://github.com/scour-project/scour")
+ (synopsis "Scour is an SVG optimizer/cleaner that reduces the size of
+scalable vector graphics by optimizing structure and removing unnecessary data
+written in Python.")
+ (description "The goal of Scour is to output a file that renderes
+identically at a fraction of the size by removing a lot of redundant
+information created by most SVG editors. Optimization options are typically
+lossless but can be tweaked for more agressive cleaning.")
+ (license license:asl2.0)))
--
2.28.0