@@ -165,7 +165,10 @@
("qtwebengine" ,qtwebengine)
("sqlite" ,sqlite)))
(arguments
- `(#:python ,python-2
+ `(#:modules ((guix build python-build-system)
+ (guix build utils)
+ (ice-9 match))
+ #:python ,python-2
;; Calibre is using setuptools by itself, but the setup.py is not
;; compatible with the shim wrapper (taken from pip) we are using.
#:use-setuptools? #f
@@ -252,6 +255,35 @@
"man-pages"
(string-append (assoc-ref outputs "out") "/share/man"))
#t))
+ ;; wrap phase copied from anki package.
+ (add-after 'install 'wrap
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
+ ;; List of paths to the site-packages directories of Python
+ ;; library inputs.
+ (site-packages
+ (map (lambda (pyinput)
+ (string-append
+ (cdr pyinput)
+ "/lib/python2.7/site-packages"))
+ (filter (match-lambda
+ ((label . _)
+ (string-prefix? "python2-" label)))
+ inputs)))
+ (qtwebengineprocess
+ (string-append (assoc-ref inputs "qtwebengine")
+ "/lib/qt5/libexec/QtWebEngineProcess")))
+ ;; The program fails to find the QtWebEngineProcess program, so
+ ;; we set QTWEBENGINEPROCESS_PATH to help it. PYTHONPATH is
+ ;; wrapped to avoid declaring Python libraries as propagated
+ ;; inputs.
+ (for-each (lambda (program)
+ (wrap-program program
+ `("QTWEBENGINEPROCESS_PATH" =
+ (,qtwebengineprocess))
+ `("PYTHONPATH" = ,site-packages)))
+ (find-files bin ".")))
+ #t))
;; The font TTF files are used in some miscellaneous tests, so we
;; unbundle them here to avoid patching the tests.
(add-after 'install 'unbundle-font-liberation