gnu: intltool: Make file a regular input.
[jackhill/guix/guix.git] / gnu / packages / glib.scm
CommitLineData
3889a82e 1;;; GNU Guix --- Functional package management for GNU
00585a55 2;;; Copyright © 2013, 2014 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)
b5b73a82 22 #:use-module ((guix licenses) #:prefix license:)
3889a82e
NK
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
943f33a3
LC
26 #:use-module (gnu packages)
27 #:use-module (gnu packages base)
9ceb630c 28 #:use-module (gnu packages bison)
943f33a3 29 #:use-module (gnu packages compression)
9ceb630c 30 #:use-module (gnu packages flex)
1dba6407 31 #:use-module (gnu packages gettext)
9ceb630c 32 #:use-module (gnu packages gtk)
943f33a3 33 #:use-module (gnu packages libffi)
d6b8cb5c 34 #:use-module (gnu packages perl)
943f33a3
LC
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages python)
7bc5cc2b 37 #:use-module (gnu packages xml)
5aa601a3 38 #:use-module (gnu packages bash)
80370441
LC
39 #:use-module (gnu packages file)
40 #:use-module (gnu packages xorg)
a5a7d374 41 #:use-module (gnu packages m4)
943f33a3 42
80370441
LC
43 ;; Export variables up-front to allow circular dependency with the 'xorg'
44 ;; module.
45 #:export (dbus
46 glib
6ac6a6b9 47 gobject-introspection
80370441
LC
48 dbus-glib
49 intltool
a5a7d374
LC
50 itstool
51 libsigc++
52 glibmm))
80370441
LC
53
54(define dbus
943f33a3
LC
55 (package
56 (name "dbus")
22e47b64 57 (version "1.8.8")
943f33a3
LC
58 (source (origin
59 (method url-fetch)
60 (uri
61 (string-append "http://dbus.freedesktop.org/releases/dbus/dbus-"
62 version ".tar.gz"))
63 (sha256
64 (base32
22e47b64 65 "1zfi5grrlryppgrl23im82cqw6l9fk1wlc2ayvzx0yd994v2dayz"))
01eafd38 66 (patches (list (search-patch "dbus-localstatedir.patch")))))
943f33a3 67 (build-system gnu-build-system)
8eaa8a3b
LC
68 (arguments
69 '(#:configure-flags (list ;; Install the system bus socket under /var.
70 "--localstatedir=/var"
71
72 ;; XXX: Fix the following to allow system-wide
73 ;; config.
74 ;; "--sysconfdir=/etc"
75
8fa9ff20
LC
76 "--with-session-socket-dir=/tmp")
77 #:phases (alist-cons-after
78 'install 'post-install
79 (lambda* (#:key outputs #:allow-other-keys)
80 ;; 'dbus-launch' bails out if the 'session.d' directory
81 ;; below is missing, so create it along with its companion.
82 (let ((out (assoc-ref outputs "out")))
83 (mkdir (string-append out "/etc/dbus-1/session.d"))
84 (mkdir (string-append out "/etc/dbus-1/system.d"))
85 #t))
86 %standard-phases)))
708be46b
LC
87 (native-inputs
88 `(("pkg-config" ,pkg-config)))
943f33a3 89 (inputs
d6b8cb5c 90 `(("expat" ,expat)
80370441
LC
91
92 ;; Add a dependency on libx11 so that 'dbus-launch' has support for
93 ;; '--autolaunch'.
94 ("libx11" ,libx11)))
95
943f33a3
LC
96 (home-page "http://dbus.freedesktop.org/")
97 (synopsis "Message bus for inter-process communication (IPC)")
98 (description
99 "D-Bus is a message bus system, a simple way for applications to
35b9e423 100talk to one another. In addition to interprocess communication, D-Bus
943f33a3
LC
101helps coordinate process lifecycle; it makes it simple and reliable to
102code a \"single instance\" application or daemon, and to launch
103applications and daemons on demand when their services are needed.
104
105D-Bus supplies both a system daemon (for events such as \"new hardware
106device added\" or \"printer queue changed\") and a
107per-user-login-session daemon (for general IPC needs among user
35b9e423 108applications). Also, the message bus is built on top of a general
943f33a3
LC
109one-to-one message passing framework, which can be used by any two apps
110to communicate directly (without going through the message bus
35b9e423 111daemon). Currently the communicating applications are on one computer,
943f33a3
LC
112or through unencrypted TCP/IP suitable for use behind a firewall with
113shared NFS home directories.")
d6b8cb5c 114 (license license:gpl2+))) ; or Academic Free License 2.1
3889a82e 115
80370441 116(define glib
3889a82e
NK
117 (package
118 (name "glib")
59bad04f 119 (version "2.40.0")
3889a82e
NK
120 (source (origin
121 (method url-fetch)
785db4d8 122 (uri (string-append "mirror://gnome/sources/"
d274f499 123 name "/" (string-take version 4) "/"
943f33a3 124 name "-" version ".tar.xz"))
3889a82e 125 (sha256
59bad04f 126 (base32 "1d98mbqjmc34s8095lkw1j1bwvnnkw9581yfvjaikjvfjsaz29qd"))
01eafd38
LC
127 (patches (list (search-patch "glib-tests-homedir.patch")
128 (search-patch "glib-tests-desktop.patch")
ca9ea1a8
EB
129 (search-patch "glib-tests-prlimit.patch")
130 (search-patch "glib-tests-timer.patch")))))
3889a82e 131 (build-system gnu-build-system)
426adbe8
LC
132 (outputs '("out" ; everything
133 "bin" ; glib-mkenums, gtester, etc.; depends on Python
134 "doc")) ; 20 MiB of GTK-Doc reference
3889a82e
NK
135 (inputs
136 `(("coreutils" ,coreutils)
3889a82e 137 ("libffi" ,libffi)
c4c4cc05
JD
138 ("zlib" ,zlib)
139 ("tzdata" ,tzdata))) ; for tests/gdatetime.c
140 (native-inputs
59bad04f 141 `(("gettext" ,gnu-gettext)
c4c4cc05 142 ("dbus" ,dbus) ; for GDBus tests
3889a82e 143 ("pkg-config" ,pkg-config)
ee3e314b 144 ("python" ,python-wrapper)
943f33a3 145 ("perl" ,perl) ; needed by GIO tests
c4c4cc05 146 ("bash" ,bash)))
943f33a3 147 (arguments
01eafd38 148 '(#:phases (alist-cons-before
943f33a3
LC
149 'build 'pre-build
150 (lambda* (#:key inputs outputs #:allow-other-keys)
7bc5cc2b
LC
151 ;; For tests/gdatetime.c.
152 (setenv "TZDIR"
153 (string-append (assoc-ref inputs "tzdata")
154 "/share/zoneinfo"))
155
156 ;; Some tests want write access there.
157 (setenv "XDG_CACHE_HOME" (getcwd))
158
943f33a3
LC
159 (substitute* '("glib/gspawn.c"
160 "glib/tests/utils.c"
161 "tests/spawn-test.c")
7bc5cc2b 162 (("/bin/sh")
d274f499 163 (string-append (assoc-ref inputs "bash") "/bin/sh"))))
943f33a3
LC
164 %standard-phases)
165
166 ;; Note: `--docdir' and `--htmldir' are not honored, so work around it.
167 #:configure-flags (list (string-append "--with-html-dir="
168 (assoc-ref %outputs "doc")
00585a55
LC
169 "/share/gtk-doc"))
170
171 ;; In 'gio/tests', 'gdbus-test-codegen-generated.h' is #included in a
172 ;; file that gets compiled possibly before it has been fully generated.
173 #:parallel-tests? #f))
ce2df078
LC
174
175 (native-search-paths
176 ;; This variable is not really "owned" by GLib, but several related
177 ;; packages refer to it: gobject-introspection's tools use it as a search
178 ;; path for .gir files, and it's also a search path for schemas produced
179 ;; by 'glib-compile-schemas'.
180 (list (search-path-specification
181 (variable "XDG_DATA_DIRS")
182 (directories '("share")))))
183 (search-paths native-search-paths)
184
f50d2669 185 (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME")
3889a82e
NK
186 (description
187 "GLib provides data structure handling for C, portability wrappers,
188and interfaces for such runtime functionality as an event loop, threads,
189dynamic loading, and an object system.")
190 (home-page "http://developer.gnome.org/glib/")
d6b8cb5c 191 (license license:lgpl2.0+))) ; some files are under lgpl2.1+
71eb5c10 192
6ac6a6b9 193(define gobject-introspection
9ceb630c
CR
194 (package
195 (name "gobject-introspection")
196 (version "1.38.0")
197 (source (origin
198 (method url-fetch)
199 (uri (string-append "http://ftp.gnome.org/pub/GNOME/sources/"
200 "gobject-introspection/"
201 (substring version 0 (string-rindex version #\.))
202 "/gobject-introspection-"
203 version ".tar.xz"))
204 (sha256
503c5f6d
CR
205 (base32 "0wvxyvgajmms2bb6k3pf1rdpnd79xdxamykzvxzmcyn1ag9yax9m"))
206 (patches (list (search-patch "gobject-introspection-cc.patch")))))
9ceb630c
CR
207 (build-system gnu-build-system)
208 (inputs
209 `(("bison" ,bison)
210 ("cairo" ,cairo)
211 ("flex" ,flex)
212 ("glib" ,glib)
9ceb630c
CR
213 ("pkg-config" ,pkg-config)
214 ("python-2" ,python-2)))
426adbe8
LC
215 (native-inputs
216 `(("glib" ,glib "bin")))
af949e8e
CR
217 (propagated-inputs
218 `(;; In practice, GIR users will need libffi when using
219 ;; gobject-introspection.
220 ("libffi" ,libffi)))
9ceb630c
CR
221 (arguments
222 `(#:phases
d4bf49b1
EB
223 (alist-cons-before
224 'configure 'patch-paths
225 (lambda _
503c5f6d 226 (substitute* "giscanner/sourcescanner.py"
d4bf49b1 227 (("GUIX_GCC_PATH") (which "gcc"))))
9ceb630c
CR
228 %standard-phases)))
229 (home-page "https://wiki.gnome.org/GObjectIntrospection")
230 (synopsis "Generate interface introspection data for GObject libraries")
231 (description
232 "GObject introspection is a middleware layer between C libraries (using
233GObject) and language bindings. The C library can be scanned at compile time
234and generate a metadata file, in addition to the actual native C library. Then
235at runtime, language bindings can read this metadata and automatically provide
236bindings to call into the C library.")
237 ; Some bits are distributed under the LGPL2+, others under the GPL2+
238 (license license:gpl2+)))
239
80370441 240(define intltool
71eb5c10
LC
241 (package
242 (name "intltool")
d6b8cb5c 243 (version "0.50.2")
71eb5c10
LC
244 (source (origin
245 (method url-fetch)
d6b8cb5c
AE
246 (uri (string-append "https://launchpad.net/intltool/trunk/"
247 version "/+download/intltool-"
248 version ".tar.gz"))
71eb5c10
LC
249 (sha256
250 (base32
d6b8cb5c 251 "01j4yd7i84n9nk4ccs6yifg84pp68nr9by57jdbhj7dpdxf5rwk7"))))
71eb5c10 252 (build-system gnu-build-system)
93882f0e
EB
253 (inputs
254 `(("file" ,file)))
71eb5c10 255 (propagated-inputs
107b415e
LC
256 `(;; Propagate gettext because users expect it to be there, and so does
257 ;; the `intltool-update' script.
1dba6407 258 ("gettext" ,gnu-gettext)
107b415e 259
e33d9d6f 260 ("perl-xml-parser" ,perl-xml-parser)
107b415e 261 ("perl" ,perl)))
93882f0e
EB
262 (arguments
263 `(#:phases (alist-cons-after
264 'unpack 'patch-file-references
265 (lambda* (#:key inputs #:allow-other-keys)
266 (let ((file (assoc-ref inputs "file")))
267 (substitute* "intltool-update.in"
268 (("`file") (string-append "`" file "/bin/file")))))
269 %standard-phases)))
d6b8cb5c
AE
270 (home-page "https://launchpad.net/intltool/+download")
271 (synopsis "Tools to centralise translations of different file formats")
71eb5c10 272 (description
35b9e423 273 "Intltool is a set of tools to centralise translations of many different
71eb5c10
LC
274file formats using GNU gettext-compatible PO files.
275
276The intltool collection can be used to do these things:
277
278 Extract translatable strings from various source files (.xml.in,
279 glade, .desktop.in, .server.in, .oaf.in).
280
281 Collect the extracted strings together with messages from traditional
282 source files (.c, .h) in po/$(PACKAGE).pot.
283
284 Merge back the translations from .po files into .xml, .desktop and
35b9e423 285 oaf files. This merge step will happen at build resp. installation time.")
d6b8cb5c 286 (license license:gpl2+)))
24b5c463 287
80370441 288(define itstool
20a26ff5
CR
289 (package
290 (name "itstool")
291 (version "1.2.0")
292 (source (origin
293 (method url-fetch)
294 (uri (string-append "http://files.itstool.org/itstool/itstool-"
295 version ".tar.bz2"))
296 (sha256
297 (base32
298 "1akq75aflihm3y7js8biy7b5mw2g11vl8yq90gydnwlwp0zxdzj6"))))
299 (build-system gnu-build-system)
f922fc42
AE
300 (propagated-inputs
301 `(("libxml2" ,libxml2)
302 ("python-2" ,python-2)))
20a26ff5
CR
303 (home-page "http://www.itstool.org")
304 (synopsis "Tool to translate XML documents with PO files")
305 (description
306 "ITS Tool allows you to translate your XML documents with PO files, using
307rules from the W3C Internationalization Tag Set (ITS) to determine what to
308translate and how to separate it into PO file messages.
309
310PO files are the standard translation format for GNU and other Unix-like
311systems. They present translatable information as discrete messages, allowing
312each message to be translated independently. In contrast to whole-page
313translation, translating with a message-based format like PO means you can
314easily track changes to the source document down to the paragraph. When new
315strings are added or existing strings are modified, you only need to update the
316corresponding messages.
317
318ITS Tool is designed to make XML documents translatable through PO files by
319applying standard ITS rules, as well as extension rules specific to ITS Tool.
320ITS also provides an industry standard way for authors to override translation
321information in their documents, such as whether a particular element should be
322translated.")
a129e0d8 323 (license license:gpl3+)))
20a26ff5 324
80370441 325(define dbus-glib
24b5c463
AE
326 (package
327 (name "dbus-glib")
328 (version "0.100.2")
329 (source (origin
330 (method url-fetch)
331 (uri
332 (string-append "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-"
333 version ".tar.gz"))
334 (sha256
335 (base32
336 "1ibav91yg70f2l3l18cr0hf4mna1h9d4mrg0c60w4l8zjbd45fx5"))))
337 (build-system gnu-build-system)
338 (inputs
339 `(("dbus" ,dbus)
340 ("expat" ,expat)
44add1ce
LC
341 ("glib" ,glib)))
342 (native-inputs
343 `(("glib" ,glib "bin")
24b5c463
AE
344 ("pkg-config" ,pkg-config)))
345 (home-page "http://dbus.freedesktop.org/doc/dbus-glib/")
346 (synopsis "D-Bus GLib bindings")
347 (description
348 "GLib bindings for D-Bus. The package is obsolete and superseded
349by GDBus included in Glib.")
350 (license license:gpl2))) ; or Academic Free License 2.1
a5a7d374
LC
351
352(define libsigc++
353 (package
354 (name "libsigc++")
355 (version "2.3.1")
356 (source (origin
357 (method url-fetch)
358 (uri (string-append "mirror://gnome/sources/libsigc++/2.3/libsigc++-"
359 version ".tar.xz"))
360 (sha256
361 (base32
362 "14q3sq6d43f6wfcmwhw4v1aal4ba0h5x9v6wkxy2dnqznd95il37"))))
363 (build-system gnu-build-system)
41eb1198
LC
364 (native-inputs `(("pkg-config" ,pkg-config)
365 ("m4" ,m4)))
a5a7d374
LC
366 (home-page "http://libsigc.sourceforge.net/")
367 (synopsis "Type-safe callback system for standard C++")
368 (description
35b9e423 369 "Libsigc++ implements a type-safe callback system for standard C++. It
a5a7d374
LC
370allows you to define signals and to connect those signals to any callback
371function, either global or a member function, regardless of whether it is
372static or virtual.
373
374It also contains adaptor classes for connection of dissimilar callbacks and
375has an ease of use unmatched by other C++ callback libraries.")
376 (license license:lgpl2.1+)))
377
378(define glibmm
379 (package
380 (name "glibmm")
381 (version "2.37.7")
382 (source (origin
383 (method url-fetch)
384 (uri (string-append "mirror://gnome/sources/glibmm/2.37/glibmm-"
385 version ".tar.xz"))
386 (sha256
387 (base32
388 "0mms4yl5izsya1135772z4jkb184ss86x0wlg6dm7yvwxvb6bjlw"))))
389 (build-system gnu-build-system)
390 (arguments
391 `(#:phases (alist-cons-before
392 'build 'pre-build
393 (lambda _
394 ;; This test uses /etc/fstab as an example file to read
395 ;; from; choose a better example.
396 (substitute* "tests/giomm_simple/main.cc"
397 (("/etc/fstab")
398 (string-append (getcwd)
399 "/tests/giomm_simple/main.cc")))
400
401 ;; This test does a DNS lookup, and then expects to be able
402 ;; to open a TLS session; just skip it.
403 (substitute* "tests/giomm_tls_client/main.cc"
404 (("Gio::init.*$")
405 "return 77;\n")))
406 %standard-phases)))
41eb1198
LC
407 (native-inputs `(("pkg-config" ,pkg-config)
408 ("glib" ,glib "bin")))
a5a7d374
LC
409 (propagated-inputs
410 `(("libsigc++" ,libsigc++)
411 ("glib" ,glib)))
412 (home-page "http://gtkmm.org/")
413 (synopsis "C++ interface to the GLib library")
414 (description
35b9e423 415 "Glibmm provides a C++ programming interface to the part of GLib that are
a5a7d374
LC
416useful for C++.")
417 (license license:lgpl2.1+)))