gnu: Add itstool.
[jackhill/guix/guix.git] / gnu / packages / glib.scm
CommitLineData
3889a82e 1;;; GNU Guix --- Functional package management for GNU
943f33a3 2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
d6b8cb5c
AE
3;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
4;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
3889a82e
NK
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
943f33a3 21(define-module (gnu packages glib)
d6b8cb5c
AE
22 #:use-module ((guix licenses)
23 #:renamer (symbol-prefix-proc 'license:))
3889a82e
NK
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
943f33a3
LC
27 #:use-module (gnu packages)
28 #:use-module (gnu packages base)
29 #:use-module (gnu packages compression)
30 #:use-module ((gnu packages gettext)
3889a82e 31 #:renamer (symbol-prefix-proc 'guix:))
943f33a3 32 #:use-module (gnu packages libffi)
d6b8cb5c 33 #:use-module (gnu packages perl)
943f33a3
LC
34 #:use-module (gnu packages pkg-config)
35 #:use-module (gnu packages python)
7bc5cc2b 36 #:use-module (gnu packages xml)
5aa601a3
LC
37 #:use-module (gnu packages bash)
38 #:use-module (gnu packages file))
943f33a3
LC
39
40(define-public dbus
41 (package
42 (name "dbus")
43 (version "1.6.4")
44 (source (origin
45 (method url-fetch)
46 (uri
47 (string-append "http://dbus.freedesktop.org/releases/dbus/dbus-"
48 version ".tar.gz"))
49 (sha256
50 (base32
51 "1wacqyfkcpayg7f8rvx9awqg275n5pksxq5q7y21lxjx85x6pfjz"))))
52 (build-system gnu-build-system)
53 (inputs
d6b8cb5c 54 `(("expat" ,expat)
943f33a3
LC
55 ("pkg-config" ,pkg-config)))
56 (home-page "http://dbus.freedesktop.org/")
57 (synopsis "Message bus for inter-process communication (IPC)")
58 (description
59 "D-Bus is a message bus system, a simple way for applications to
60talk to one another. In addition to interprocess communication, D-Bus
61helps coordinate process lifecycle; it makes it simple and reliable to
62code a \"single instance\" application or daemon, and to launch
63applications and daemons on demand when their services are needed.
64
65D-Bus supplies both a system daemon (for events such as \"new hardware
66device added\" or \"printer queue changed\") and a
67per-user-login-session daemon (for general IPC needs among user
68applications). Also, the message bus is built on top of a general
69one-to-one message passing framework, which can be used by any two apps
70to communicate directly (without going through the message bus
71daemon). Currently the communicating applications are on one computer,
72or through unencrypted TCP/IP suitable for use behind a firewall with
73shared NFS home directories.")
d6b8cb5c 74 (license license:gpl2+))) ; or Academic Free License 2.1
3889a82e
NK
75
76(define-public glib
77 (package
78 (name "glib")
7bc5cc2b 79 (version "2.37.1")
3889a82e
NK
80 (source (origin
81 (method url-fetch)
785db4d8 82 (uri (string-append "mirror://gnome/sources/"
f88aeb6a 83 name "/2.37/"
943f33a3 84 name "-" version ".tar.xz"))
3889a82e 85 (sha256
7bc5cc2b 86 (base32 "1lp705q0g9jlfj24x8fpgjh7awmmara5iyj9kz5lhd49sr9s813k"))))
3889a82e 87 (build-system gnu-build-system)
943f33a3
LC
88 (outputs '("out" ; everything
89 "doc")) ; 20 MiB of GTK-Doc reference
3889a82e
NK
90 (inputs
91 `(("coreutils" ,coreutils)
92 ("gettext" ,guix:gettext)
93 ("libffi" ,libffi)
94 ("pkg-config" ,pkg-config)
95 ("python" ,python)
943f33a3
LC
96 ("zlib" ,zlib)
97 ("perl" ,perl) ; needed by GIO tests
98 ("dbus" ,dbus) ; for GDBus tests
7bc5cc2b
LC
99 ("bash" ,bash)
100 ("tzdata" ,tzdata) ; for tests/gdatetime.c
943f33a3 101
943f33a3
LC
102 ("patch/tests-homedir"
103 ,(search-patch "glib-tests-homedir.patch"))
104 ("patch/tests-desktop"
785db4d8
LC
105 ,(search-patch "glib-tests-desktop.patch"))
106 ("patch/tests-prlimit"
107 ,(search-patch "glib-tests-prlimit.patch"))))
943f33a3 108 (arguments
7bc5cc2b 109 '(#:patches (list (assoc-ref %build-inputs "patch/tests-homedir")
785db4d8
LC
110 (assoc-ref %build-inputs "patch/tests-desktop")
111 (assoc-ref %build-inputs "patch/tests-prlimit"))
943f33a3
LC
112 #:phases (alist-cons-before
113 'build 'pre-build
114 (lambda* (#:key inputs outputs #:allow-other-keys)
7bc5cc2b
LC
115 ;; For tests/gdatetime.c.
116 (setenv "TZDIR"
117 (string-append (assoc-ref inputs "tzdata")
118 "/share/zoneinfo"))
119
120 ;; Some tests want write access there.
121 (setenv "XDG_CACHE_HOME" (getcwd))
122
943f33a3
LC
123 (substitute* '("glib/gspawn.c"
124 "glib/tests/utils.c"
125 "tests/spawn-test.c")
7bc5cc2b
LC
126 (("/bin/sh")
127 (string-append (assoc-ref inputs "bash") "/bin/sh")))
128
129 ;; Honor $(TESTS_ENVIRONMENT).
130 (substitute* (find-files "." "^Makefile(\\.in)?$")
131 (("^GTESTER[[:blank:]]*=(.*)$" _ rest)
132 (string-append "GTESTER = $(TESTS_ENVIRONMENT) "
133 rest))))
943f33a3
LC
134 %standard-phases)
135
136 ;; Note: `--docdir' and `--htmldir' are not honored, so work around it.
137 #:configure-flags (list (string-append "--with-html-dir="
138 (assoc-ref %outputs "doc")
139 "/share/gtk-doc"))))
f50d2669 140 (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME")
3889a82e
NK
141 (description
142 "GLib provides data structure handling for C, portability wrappers,
143and interfaces for such runtime functionality as an event loop, threads,
144dynamic loading, and an object system.")
145 (home-page "http://developer.gnome.org/glib/")
d6b8cb5c 146 (license license:lgpl2.0+))) ; some files are under lgpl2.1+
71eb5c10
LC
147
148(define-public intltool
149 (package
150 (name "intltool")
d6b8cb5c 151 (version "0.50.2")
71eb5c10
LC
152 (source (origin
153 (method url-fetch)
d6b8cb5c
AE
154 (uri (string-append "https://launchpad.net/intltool/trunk/"
155 version "/+download/intltool-"
156 version ".tar.gz"))
71eb5c10
LC
157 (sha256
158 (base32
d6b8cb5c 159 "01j4yd7i84n9nk4ccs6yifg84pp68nr9by57jdbhj7dpdxf5rwk7"))))
71eb5c10 160 (build-system gnu-build-system)
71eb5c10 161 (propagated-inputs
107b415e
LC
162 `(;; Propagate gettext because users expect it to be there, and so does
163 ;; the `intltool-update' script.
164 ("gettext" ,guix:gettext)
165
5aa601a3
LC
166 ;; `file' is used by `intltool-update' too.
167 ("file" ,file)
168
e33d9d6f 169 ("perl-xml-parser" ,perl-xml-parser)
107b415e 170 ("perl" ,perl)))
d6b8cb5c
AE
171 (home-page "https://launchpad.net/intltool/+download")
172 (synopsis "Tools to centralise translations of different file formats")
71eb5c10 173 (description
d6b8cb5c 174 "intltool is a set of tools to centralise translations of many different
71eb5c10
LC
175file formats using GNU gettext-compatible PO files.
176
177The intltool collection can be used to do these things:
178
179 Extract translatable strings from various source files (.xml.in,
180 glade, .desktop.in, .server.in, .oaf.in).
181
182 Collect the extracted strings together with messages from traditional
183 source files (.c, .h) in po/$(PACKAGE).pot.
184
185 Merge back the translations from .po files into .xml, .desktop and
186 oaf files. This merge step will happen at build resp. installation time.")
d6b8cb5c 187 (license license:gpl2+)))
24b5c463 188
20a26ff5
CR
189(define-public itstool
190 (package
191 (name "itstool")
192 (version "1.2.0")
193 (source (origin
194 (method url-fetch)
195 (uri (string-append "http://files.itstool.org/itstool/itstool-"
196 version ".tar.bz2"))
197 (sha256
198 (base32
199 "1akq75aflihm3y7js8biy7b5mw2g11vl8yq90gydnwlwp0zxdzj6"))))
200 (build-system gnu-build-system)
201 (home-page "http://www.itstool.org")
202 (synopsis "Tool to translate XML documents with PO files")
203 (description
204 "ITS Tool allows you to translate your XML documents with PO files, using
205rules from the W3C Internationalization Tag Set (ITS) to determine what to
206translate and how to separate it into PO file messages.
207
208PO files are the standard translation format for GNU and other Unix-like
209systems. They present translatable information as discrete messages, allowing
210each message to be translated independently. In contrast to whole-page
211translation, translating with a message-based format like PO means you can
212easily track changes to the source document down to the paragraph. When new
213strings are added or existing strings are modified, you only need to update the
214corresponding messages.
215
216ITS Tool is designed to make XML documents translatable through PO files by
217applying standard ITS rules, as well as extension rules specific to ITS Tool.
218ITS also provides an industry standard way for authors to override translation
219information in their documents, such as whether a particular element should be
220translated.")
221 (license gpl3+)))
222
24b5c463
AE
223(define-public dbus-glib
224 (package
225 (name "dbus-glib")
226 (version "0.100.2")
227 (source (origin
228 (method url-fetch)
229 (uri
230 (string-append "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-"
231 version ".tar.gz"))
232 (sha256
233 (base32
234 "1ibav91yg70f2l3l18cr0hf4mna1h9d4mrg0c60w4l8zjbd45fx5"))))
235 (build-system gnu-build-system)
236 (inputs
237 `(("dbus" ,dbus)
238 ("expat" ,expat)
239 ("glib" ,glib)
240 ("pkg-config" ,pkg-config)))
241 (home-page "http://dbus.freedesktop.org/doc/dbus-glib/")
242 (synopsis "D-Bus GLib bindings")
243 (description
244 "GLib bindings for D-Bus. The package is obsolete and superseded
245by GDBus included in Glib.")
246 (license license:gpl2))) ; or Academic Free License 2.1