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