Commit | Line | Data |
---|---|---|
233e7676 LC |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org> | |
c57a6e4c | 3 | ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> |
97f70018 | 4 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> |
d99861d3 | 5 | ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> |
f190f92f | 6 | ;;; |
233e7676 | 7 | ;;; This file is part of GNU Guix. |
f190f92f | 8 | ;;; |
233e7676 | 9 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
f190f92f NK |
10 | ;;; under the terms of the GNU General Public License as published by |
11 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
12 | ;;; your option) any later version. | |
13 | ;;; | |
233e7676 | 14 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
f190f92f NK |
15 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | ;;; GNU General Public License for more details. | |
18 | ;;; | |
19 | ;;; You should have received a copy of the GNU General Public License | |
233e7676 | 20 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
f190f92f | 21 | |
1ffa7090 | 22 | (define-module (gnu packages gettext) |
97f70018 | 23 | #:use-module ((guix licenses) #:select (gpl2+ gpl3+)) |
59a43334 | 24 | #:use-module (gnu packages) |
f190f92f NK |
25 | #:use-module (guix packages) |
26 | #:use-module (guix download) | |
c42a4b76 | 27 | #:use-module (guix build-system gnu) |
97f70018 RW |
28 | #:use-module (guix build-system perl) |
29 | #:use-module (gnu packages docbook) | |
30 | #:use-module (gnu packages perl) | |
8f9ac901 | 31 | #:use-module (gnu packages tex) |
c42a4b76 | 32 | #:use-module (gnu packages xml)) |
f190f92f | 33 | |
1dba6407 LC |
34 | ;; Use that name to avoid clashes with Guile's 'gettext' procedure. |
35 | ;; | |
36 | ;; We used to resort to #:renamer on the user side, but that prevented | |
37 | ;; circular dependencies involving (gnu packages gettext). This is because | |
38 | ;; 'resolve-interface' (as of Guile 2.0.9) iterates eagerly over the used | |
39 | ;; module when there's a #:renamer, and that module may be empty at that point | |
40 | ;; in case or circular dependencies. | |
41 | (define-public gnu-gettext | |
f190f92f NK |
42 | (package |
43 | (name "gettext") | |
d99861d3 | 44 | (version "0.19.7") |
2c9143a1 LC |
45 | (source (origin |
46 | (method url-fetch) | |
47 | (uri (string-append "mirror://gnu/gettext/gettext-" | |
48 | version ".tar.gz")) | |
49 | (sha256 | |
50 | (base32 | |
d99861d3 | 51 | "0gy2b2aydj8r0sapadnjw8cmb8j2rynj28d5qs1mfa800njd51jk")))) |
f190f92f | 52 | (build-system gnu-build-system) |
d7170f44 LC |
53 | (outputs '("out" |
54 | "doc")) ;8 MiB of HTML | |
c42a4b76 AE |
55 | (inputs |
56 | `(("expat" ,expat))) | |
f190f92f | 57 | (arguments |
e5f03762 EF |
58 | `(#:phases |
59 | (modify-phases %standard-phases | |
60 | (add-before 'check 'patch-tests | |
61 | (lambda* (#:key inputs #:allow-other-keys) | |
62 | (let* ((bash (which "sh"))) | |
63 | ;; Some of the files we're patching are | |
64 | ;; ISO-8859-1-encoded, so choose it as the default | |
65 | ;; encoding so the byte encoding is preserved. | |
66 | (with-fluids ((%default-port-encoding #f)) | |
67 | (substitute* | |
68 | (find-files "gettext-tools/tests" | |
69 | "^(lang-sh|msg(exec|filter)-[0-9])") | |
70 | (("#![[:blank:]]/bin/sh") | |
71 | (format #f "#!~a" bash))) | |
0e4e4b13 | 72 | |
e5f03762 EF |
73 | (substitute* (cons "gettext-tools/src/msginit.c" |
74 | (find-files "gettext-tools/gnulib-tests" | |
75 | "posix_spawn")) | |
76 | (("/bin/sh") | |
77 | bash)) | |
0e4e4b13 | 78 | |
e5f03762 EF |
79 | (substitute* "gettext-tools/src/project-id" |
80 | (("/bin/pwd") | |
81 | "pwd")))))) | |
82 | (add-before 'configure 'link-expat | |
83 | (lambda _ | |
84 | ;; Gettext defaults to opening expat via dlopen on | |
85 | ;; "Linux". Change to link directly. | |
86 | (substitute* "gettext-tools/configure" | |
87 | (("LIBEXPAT=\"-ldl\"") "LIBEXPAT=\"-ldl -lexpat\"") | |
88 | (("LTLIBEXPAT=\"-ldl\"") "LTLIBEXPAT=\"-ldl -lexpat\""))))) | |
0e4e4b13 LC |
89 | |
90 | ;; When tests fail, we want to know the details. | |
91 | #:make-flags '("VERBOSE=yes"))) | |
2c9143a1 | 92 | (home-page "http://www.gnu.org/software/gettext/") |
f50d2669 | 93 | (synopsis "Tools and documentation for translation") |
f190f92f | 94 | (description |
79c311b8 LC |
95 | "GNU Gettext is a package providing a framework for translating the |
96 | textual output of programs into multiple languages. It provides translators | |
97 | with the means to create message catalogs, as well as an Emacs mode to work | |
98 | with them, and a runtime library to load translated messages from the | |
99 | catalogs. Nearly all GNU packages use Gettext.") | |
1c301e48 | 100 | (license gpl3+))) ;some files are under GPLv2+ |
97f70018 RW |
101 | |
102 | (define-public po4a | |
103 | (package | |
104 | (name "po4a") | |
105 | (version "0.47") | |
106 | (source (origin | |
107 | (method url-fetch) | |
108 | (uri (string-append "https://alioth.debian.org/frs/download.php" | |
109 | "/file/4142/po4a-" version ".tar.gz")) | |
110 | (sha256 | |
111 | (base32 | |
112 | "01vm0750aq0h2lphrflv3wq9gz7y0py8frglfpacn58ivyvy242h")))) | |
113 | (build-system perl-build-system) | |
114 | (arguments | |
115 | `(#:phases | |
116 | (modify-phases %standard-phases | |
117 | ;; FIXME: One test fails as we don't have SGMLS.pm | |
118 | (add-before 'check 'disable-sgml-test | |
119 | (lambda _ | |
120 | (delete-file "t/20-sgml.t") | |
121 | #t)) | |
122 | (add-after 'unpack 'fix-builder | |
123 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
124 | (substitute* "Po4aBuilder.pm" | |
125 | ;; By default it tries to install into perl's manpath. | |
126 | (("my \\$mandir = .*$") | |
127 | (string-append "my $mandir = \"" (assoc-ref outputs "out") | |
128 | "/share/man\";\n"))) | |
129 | #t)) | |
130 | (add-after 'install 'wrap-programs | |
131 | (lambda* (#:key outputs #:allow-other-keys) | |
132 | ;; Make sure all executables in "bin" find the Perl modules | |
133 | ;; provided by this package at runtime. | |
134 | (let* ((out (assoc-ref outputs "out")) | |
135 | (bin (string-append out "/bin/")) | |
136 | (path (string-append out "/lib/perl5/site_perl"))) | |
137 | (for-each (lambda (file) | |
138 | (wrap-program file | |
139 | `("PERL5LIB" ":" prefix (,path)))) | |
140 | (find-files bin "\\.*$")) | |
141 | #t)))))) | |
142 | (native-inputs | |
143 | `(("gettext" ,gnu-gettext) | |
144 | ("perl-module-build" ,perl-module-build) | |
145 | ("docbook-xsl" ,docbook-xsl) | |
146 | ("docbook-xml" ,docbook-xml) ;for tests | |
fde60603 | 147 | ("texlive" ,texlive-minimal) ;for tests |
97f70018 RW |
148 | ("libxml2" ,libxml2) |
149 | ("xsltproc" ,libxslt))) | |
150 | (home-page "http://po4a.alioth.debian.org/") | |
151 | (synopsis "Scripts to ease maintenance of translations") | |
152 | (description | |
153 | "The po4a (PO for anything) project goal is to ease translations (and | |
154 | more interestingly, the maintenance of translations) using gettext tools on | |
155 | areas where they were not expected like documentation.") | |
156 | (license gpl2+))) |