gnu: facter: Update to 4.0.33.
[jackhill/guix/guix.git] / gnu / packages / djvu.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
3 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
4 ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages djvu)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix utils)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix git-download)
27 #:use-module (guix build-system gnu)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages glib)
30 #:use-module (gnu packages image)
31 #:use-module (gnu packages pkg-config)
32 #:use-module (gnu packages qt)
33 #:use-module (gnu packages xorg))
34
35 (define-public djvulibre
36 (package
37 (name "djvulibre")
38 (version "3.5.27")
39 (source (origin
40 (method url-fetch)
41 (uri (string-append "mirror://sourceforge/djvu/DjVuLibre/"
42 version "/djvulibre-" version ".tar.gz"))
43 (sha256
44 (base32
45 "0psh3zl9dj4n4r3lx25390nx34xz0bg0ql48zdskhq354ljni5p6"))))
46 (build-system gnu-build-system)
47 (arguments
48 `(#:phases (modify-phases %standard-phases
49 (add-after 'unpack 'reproducible
50 (lambda _
51 ;; Ensure there are no timestamps in .svgz files.
52 (substitute* "desktopfiles/Makefile.in"
53 (("gzip") "gzip -n"))
54 #t)))))
55 (home-page "http://djvu.sourceforge.net/")
56 (synopsis "Implementation of DjVu, the document format")
57 (description "DjVuLibre is an implementation of DjVu,
58 including viewers, browser plugins, decoders, simple encoders, and
59 utilities.")
60 (license license:gpl2+)))
61
62 (define-public djview
63 (package
64 (name "djview")
65 (version "4.11")
66 (source
67 (origin
68 (method git-fetch)
69 (uri (git-reference
70 (url "https://git.code.sf.net/p/djvu/djview-git")
71 (commit (string-append "release." version))))
72 (sha256
73 (base32 "0qlhd0xlxn8i869m0hwdjvwivi2vigqm88wliyr1h7s84zl3qhsy"))
74 (file-name (git-file-name name version))))
75 (build-system gnu-build-system)
76 (native-inputs
77 `(("autoconf" ,autoconf)
78 ("automake" ,automake)
79 ("libtool" ,libtool)
80 ("pkg-config" ,pkg-config)
81 ("qttools" ,qttools)))
82 (inputs
83 `(("djvulibre" ,djvulibre)
84 ("glib" ,glib)
85 ("libxt" ,libxt)
86 ("libtiff" ,libtiff)
87 ("qtbase" ,qtbase)))
88 (arguments
89 `(#:phases
90 (modify-phases %standard-phases
91 (add-after 'unpack 'fix-desktop-file
92 ;; Executable is "djview", not "djview4".
93 (lambda _
94 (substitute* "desktopfiles/djvulibre-djview4.desktop"
95 (("Exec=djview4 %f") "Exec=djview %f"))
96 #t))
97 (add-after 'unpack 'make-files-writable
98 (lambda _
99 (for-each make-file-writable
100 (find-files "."))
101 #t)))))
102 (home-page "http://djvu.sourceforge.net/djview4.html")
103 (synopsis "Viewer for the DjVu image format")
104 (description "DjView is a standalone viewer for DjVu files.
105
106 Its features include navigating documents, zooming and panning page images,
107 producing and displaying thumbnails, displaying document outlines, searching
108 documents for particular words in the hidden text layer, copying hidden text
109 to the clipboard, saving pages and documents as bundled or indirect multi-page
110 files, and printing page and documents.
111
112 The viewer can simultaneously display several pages using a side-by-side or
113 a continuous layout.")
114 (license license:gpl2+)))