guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] gnu: gimp: Fix python plugin.


From: 宋文武
Subject: [PATCH] gnu: gimp: Fix python plugin.
Date: Sun, 21 Aug 2016 00:32:17 +0800

* gnu/packages/gimp.scm (gimp)[arguments]: Add phase to
install 'sitecustomize.py'.
---
 gnu/packages/gimp.scm | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gimp.scm b/gnu/packages/gimp.scm
index 7e0b54a..6540990 100644
--- a/gnu/packages/gimp.scm
+++ b/gnu/packages/gimp.scm
@@ -141,7 +141,23 @@ buffers.")
     (arguments
      '(#:configure-flags (list (string-append "--with-html-dir="
                                               (assoc-ref %outputs "doc")
-                                              "/share/gtk-doc/html"))))
+                                              "/share/gtk-doc/html"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-sitecustomize.py
+           ;; Install 'sitecustomize.py' into gimp's python directory to
+           ;; add pygobject and pygtk to pygimp's search path.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((pythonpath (getenv "PYTHONPATH"))
+                    (out        (assoc-ref outputs "out"))
+                    (sitecustomize.py
+                     (string-append
+                      out "/lib/gimp/2.0/python/sitecustomize.py")))
+               (call-with-output-file sitecustomize.py
+                 (lambda (port)
+                   (format port "import site~%")
+                   (format port "for dir in '~a'.split(':'):~%" pythonpath)
+                   (format port "    site.addsitedir(dir)~%")))))))))
     (inputs
      `(("babl" ,babl)
        ("glib" ,glib)
-- 
2.8.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]