1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

gnu: Remove ocrodjvu.

* gnu/packages/djvu.scm (ocrodjvu): Delete variable.

Fixes: guix/guix#6307
Change-Id: Ib7e7e3cf7925347f7ef5bcaa4cf093572a30d911
This commit is contained in:
Andreas Enge
2026-03-11 11:55:18 +01:00
parent ec77e0e743
commit 6da5c6775b

View File

@@ -357,97 +357,3 @@ and white.")
and background layers of images, which can then be encoded into a DjVu file.")
(home-page "https://jwilk.net/software/didjvu")
(license license:gpl2)))
(define-public ocrodjvu
(let ((revision "0")
(commit "0dd3364462fc77d5674b4457fcc8230835323c30"))
(package
(name "ocrodjvu")
(version (git-version "0.12" revision commit))
(source (origin
(method git-fetch)
(uri (git-reference
;; Use the following fork repository, as upstream
;; doesn't seem too concerned with Python 3
;; compatibility.
(url "https://github.com/rmast/ocrodjvu")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32
"0x64hg9ysrk8sismxb4jgk0sq7r9j90v2i9765xhmxpiy6f0lpni"))))
(build-system gnu-build-system)
(arguments
(list
#:modules '((guix build gnu-build-system)
((guix build pyproject-build-system) #:prefix python:)
(guix build utils))
#:imported-modules `(,@%default-gnu-imported-modules
,@%pyproject-build-system-modules)
#:test-target "test"
#:phases
#~(modify-phases %standard-phases
(delete 'configure)
(add-after 'unpack 'fix-for-python-3.11
(lambda _
(substitute* "lib/cli/ocrodjvu.py"
;; The getargspec function has been removed in python 3.11.
(("init_args, _, _, _ = inspect.getargspec\\(cls.__init__\\)")
"init_args = inspect.getfullargspec(cls.__init__).args"))))
(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"))
;; Disable tests with tesseract. They can't work without
;; the language files that must downloaded by the final user
;; as they are not packaged in Guix.
(substitute* "tests/ocrodjvu/test.py"
(("engines = stdout\\.getvalue\\(\\)\\.splitlines\\(\\)")
"engines = ['ocrad']"))
(substitute* "tests/ocrodjvu/test_integration.py"
(("engines = 'tesseract', 'cuneiform', 'gocr', 'ocrad'")
"engines = 'ocrad'"))))
(replace 'install
(lambda _
(invoke "make" "install"
"DESTDIR=" (string-append "PREFIX=" #$output))))
(add-after 'install 'wrap-python
(assoc-ref python:%standard-phases 'wrap))
(add-after 'wrap-python 'wrap-path
(lambda* (#:key outputs #:allow-other-keys)
(for-each (lambda (file)
(wrap-program (search-input-file outputs file)
`("PATH" ":" prefix
(,(string-append
#$(this-package-input "djvulibre") "/bin:"
#$(this-package-input "ocrad") "/bin:"
#$(this-package-input "tesseract-ocr")
"/bin")))))
'("bin/djvu2hocr"
"bin/hocr2djvused"
"bin/ocrodjvu")))))))
(native-inputs
(list (libc-utf8-locales-for-target) libxml2 python-pynose python-pillow))
(inputs
(list bash-minimal
djvulibre
ocrad
python-djvulibre
python-future
python-html5lib
python-lxml
python-pyicu
python-regex
python-wrapper
tesseract-ocr))
(synopsis "Program to perform OCR on DjVu files")
(description
"@code{ocrodjvu} is a wrapper for OCR systems, that allows you to perform
OCR on DjVu files.")
(home-page "https://jwilk.net/software/ocrodjvu")
(license license:gpl2))))