summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorGuillaume Le Vaillant <glv@posteo.net>2020-11-29 12:15:45 +0100
committerGuillaume Le Vaillant <glv@posteo.net>2020-11-29 14:36:57 +0100
commite7fb2c6e7b1caa90bd346292b1325ab8f0d8a4d7 (patch)
treee11830b989d3a8387205c93f6f3d0a87e76c1fde /gnu
parent2083ab1280189d7511bfc5ea3a4c8ea6f14db833 (diff)
gnu: Add didjvu.
* gnu/packages/djvu.scm (didjvu): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/djvu.scm67
1 files changed, 67 insertions, 0 deletions
diff --git a/gnu/packages/djvu.scm b/gnu/packages/djvu.scm
index 9ac17cdec87..2a94862c3b8 100644
--- a/gnu/packages/djvu.scm
+++ b/gnu/packages/djvu.scm
@@ -331,3 +331,70 @@ It is able to:
331@end itemize\n") 331@end itemize\n")
332 (home-page "https://jwilk.net/software/djvusmooth") 332 (home-page "https://jwilk.net/software/djvusmooth")
333 (license license:gpl2))) 333 (license license:gpl2)))
334
335(define-public didjvu
336 (package
337 (name "didjvu")
338 (version "0.9")
339 (source
340 (origin
341 (method url-fetch)
342 (uri (string-append
343 "https://github.com/jwilk/didjvu/releases/download/" version
344 "/didjvu-" version ".tar.gz"))
345 (sha256
346 (base32 "0xyrnk8d2khi7q1zr28gjkjq6frz4mkb5jdl8821yzf12k7c8pbv"))))
347 (build-system gnu-build-system)
348 (native-inputs
349 `(("python2-nose" ,python2-nose)))
350 (inputs
351 `(("djvulibre" ,djvulibre)
352 ("minidjvu" ,minidjvu)
353 ("python" ,python-2)
354 ("python2-gamera" ,python2-gamera)
355 ("python2-pillow" ,python2-pillow)))
356 (arguments
357 `(#:modules ((guix build gnu-build-system)
358 ((guix build python-build-system) #:prefix python:)
359 (guix build utils))
360 #:imported-modules (,@%gnu-build-system-modules
361 (guix build python-build-system))
362 #:test-target "test"
363 #:phases
364 (modify-phases %standard-phases
365 (delete 'configure)
366 (add-before 'check 'disable-failing-test
367 (lambda _
368 (substitute* "tests/test_ipc.py"
369 ;; test_wait_signal gets stuck forever
370 (("yield self\\._test_signal, name")
371 "return True")
372 ;; test_path fails to find a file it should have created
373 (("path = os\\.getenv\\('PATH'\\)\\.split\\(':'\\)")
374 "return True"))
375 (substitute* "tests/test_timestamp.py"
376 ;; test_timezones fails with:
377 ;; '2009-12-18T21:25:14Z' != '2009-12-18T22:25:14+01:00'
378 (("@fork_isolation")
379 "return True"))))
380 (replace 'install
381 (lambda* (#:key outputs #:allow-other-keys)
382 (let ((out (assoc-ref outputs "out")))
383 (invoke "make"
384 "DESTDIR="
385 (string-append "PREFIX=" out)
386 "install"))))
387 (add-after 'install 'wrap-python
388 (assoc-ref python:%standard-phases 'wrap))
389 (add-after 'wrap-python 'wrap-path
390 (lambda* (#:key inputs outputs #:allow-other-keys)
391 (let ((out (assoc-ref outputs "out"))
392 (djvulibre (assoc-ref inputs "djvulibre")))
393 (wrap-program (string-append out "/bin/didjvu")
394 `("PATH" ":" prefix (,(string-append djvulibre "/bin"))))))))))
395 (synopsis "DjVu encoder with foreground/background separation")
396 (description
397 "@code{didjvu} uses the @code{Gamera} framework to separate the foreground
398and background layers of images, which can then be encoded into a DjVu file.")
399 (home-page "https://jwilk.net/software/didjvu")
400 (license license:gpl2)))