From 580dfc332966d9a5b4d432bac82d3dec276efbaf Mon Sep 17 00:00:00 2001 From: 宋文武 Date: Sun, 21 Aug 2016 00:29:19 +0800 Subject: gnu: gimp: Fix python plugin. * 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 7e0b54aef8..6540990b36 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) -- cgit v1.2.3