From 89f9678126e7dbcd3b1f96694fdf96778d9b5979 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sun, 15 May 2022 22:52:12 -0400 Subject: gnu: didjvu: Switch to a Python 3 compatible fork. * gnu/packages/djvu.scm (didjvu)[source]: Switch to a Python 3 compatible fork. [native-inputs, inputs]: Move below arguments field. Use new style. Replace the Python 2 inputs by their Python 3 equivalents. --- gnu/packages/djvu.scm | 131 ++++++++++++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 64 deletions(-) (limited to 'gnu/packages/djvu.scm') diff --git a/gnu/packages/djvu.scm b/gnu/packages/djvu.scm index 9c834bcfba..f27dc70b70 100644 --- a/gnu/packages/djvu.scm +++ b/gnu/packages/djvu.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2020 Nicolas Goaziou ;;; Copyright © 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020, 2021 Guillaume Le Vaillant +;;; Copyright © 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -292,71 +293,73 @@ and white.") (license license:gpl2))) (define-public didjvu - (package - (name "didjvu") - (version "0.9") - (source - (origin - (method url-fetch) - (uri (string-append - "https://github.com/jwilk/didjvu/releases/download/" version - "/didjvu-" version ".tar.gz")) - (sha256 - (base32 "0xyrnk8d2khi7q1zr28gjkjq6frz4mkb5jdl8821yzf12k7c8pbv")))) - (build-system gnu-build-system) - (native-inputs - (list python2-nose)) - (inputs - `(("djvulibre" ,djvulibre) - ("minidjvu" ,minidjvu) - ("python" ,python-2) - ("python2-gamera" ,python2-gamera) - ("python2-pillow" ,python2-pillow))) - (arguments - `(#:modules ((guix build gnu-build-system) - ((guix build python-build-system) #:prefix python:) - (guix build utils)) - #:imported-modules (,@%gnu-build-system-modules - (guix build python-build-system)) - #:test-target "test" - #:phases - (modify-phases %standard-phases - (delete 'configure) - (add-before 'check 'disable-failing-test - (lambda _ - (substitute* "tests/test_ipc.py" - ;; test_wait_signal gets stuck forever - (("yield self\\._test_signal, name") - "return True") - ;; test_path fails to find a file it should have created - (("path = os\\.getenv\\('PATH'\\)\\.split\\(':'\\)") - "return True")) - (substitute* "tests/test_timestamp.py" - ;; test_timezones fails with: - ;; '2009-12-18T21:25:14Z' != '2009-12-18T22:25:14+01:00' - (("@fork_isolation") - "return True")))) - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (invoke "make" - "DESTDIR=" - (string-append "PREFIX=" out) - "install")))) - (add-after 'install 'wrap-python - (assoc-ref python:%standard-phases 'wrap)) - (add-after 'wrap-python 'wrap-path - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (djvulibre (assoc-ref inputs "djvulibre"))) - (wrap-program (string-append out "/bin/didjvu") - `("PATH" ":" prefix (,(string-append djvulibre "/bin")))))))))) - (synopsis "DjVu encoder with foreground/background separation") - (description - "@code{didjvu} uses the @code{Gamera} framework to separate the foreground + (let ((revision "0") + (commit "c792d61e85fbe5b6e678bc7d686b0208717c587b")) + (package + (name "didjvu") + (version (git-version "0.9" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/FriedrichFroebel/didjvu") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "09lwfwirmfl93062i2rvdcrgwp9fj95ny07059bxq7dl6z0z35qj")))) + (build-system gnu-build-system) + (arguments + `(#:modules ((guix build gnu-build-system) + ((guix build python-build-system) #:prefix python:) + (guix build utils)) + #:imported-modules (,@%gnu-build-system-modules + (guix build python-build-system)) + #:test-target "test" + #:phases + (modify-phases %standard-phases + (delete 'configure) + (add-before 'check 'disable-failing-test + (lambda _ + (substitute* "tests/test_ipc.py" + ;; test_wait_signal gets stuck forever + (("yield self\\._test_signal, name") + "return True") + ;; test_path fails to find a file it should have created + (("path = os\\.getenv\\('PATH'\\)\\.split\\(':'\\)") + "return True")) + (substitute* "tests/test_timestamp.py" + ;; test_timezones fails with: + ;; '2009-12-18T21:25:14Z' != '2009-12-18T22:25:14+01:00' + (("@fork_isolation") + "return True")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (invoke "make" + "DESTDIR=" + (string-append "PREFIX=" out) + "install")))) + (add-after 'install 'wrap-python + (assoc-ref python:%standard-phases 'wrap)) + (add-after 'wrap-python 'wrap-path + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (djvulibre (assoc-ref inputs "djvulibre"))) + (wrap-program (string-append out "/bin/didjvu") + `("PATH" ":" prefix (,(string-append djvulibre "/bin")))))))))) + (native-inputs (list python-nose)) + (inputs + (list djvulibre + minidjvu + python-gamera + python-pillow + python-wrapper)) + (synopsis "DjVu encoder with foreground/background separation") + (description + "@code{didjvu} uses the @code{Gamera} framework to separate the foreground and background layers of images, which can then be encoded into a DjVu file.") - (home-page "https://jwilk.net/software/didjvu") - (license license:gpl2))) + (home-page "https://jwilk.net/software/didjvu") + (license license:gpl2)))) (define-public ocrodjvu (let ((revision "0") -- cgit v1.2.3