summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-07-12 16:20:29 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-07-12 23:23:26 -0400
commitb1523ffac597d56ab9657ab1c1b1a7fc49344d67 (patch)
treeae0b82907d9d2b269b91fdf58112567e68b5c558
parent7dcba233a3745cfdcc291adf46261548eb2f3d76 (diff)
downloadguix-b1523ffac597d56ab9657ab1c1b1a7fc49344d67.tar.gz
gnu: inkscape: Wrap GDK_PIXBUF_MODULE_FILE.
Fixes <https://issues.guix.gnu.org/55634>.

* gnu/packages/inkscape.scm (inkscape)
[phases]{wrap-program}: Override phase.

Reported-by: Maxime Devos <maximedevos@telenet.be>
-rw-r--r--gnu/packages/inkscape.scm15
1 files changed, 14 insertions, 1 deletions
diff --git a/gnu/packages/inkscape.scm b/gnu/packages/inkscape.scm
index 0a2118576b..5f033ee89a 100644
--- a/gnu/packages/inkscape.scm
+++ b/gnu/packages/inkscape.scm
@@ -267,5 +267,18 @@ as the native format.")
              (lambda _
                (substitute* "testfiles/src/path-boolop-test.cpp"
                  (("PathBoolopTest, UnionOutside(Swap)?.*" all)
-                  (string-append all "    GTEST_SKIP();\n")))))))))
+                  (string-append all "    GTEST_SKIP();\n")))))
+           (replace 'wrap-program
+             ;; Ensure Python is available at runtime.
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+                 (wrap-program (string-append out "/bin/inkscape")
+                   `("GUIX_PYTHONPATH" prefix
+                     (,(getenv "GUIX_PYTHONPATH")))
+                   ;; Wrapping GDK_PIXBUF_MODULE_FILE allows Inkscape to load
+                   ;; its own icons in pure environments.
+                   `("GDK_PIXBUF_MODULE_FILE" =
+                     (,(getenv "GDK_PIXBUF_MODULE_FILE")))))))))))
+    (inputs (modify-inputs (package-inputs inkscape/stable)
+              (append librsvg)))        ;for the pixbuf loader
     (properties (alist-delete 'hidden? (package-properties inkscape/stable)))))