1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
6 ;;; This file is part of GNU Guix.
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.
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.
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/>.
21 (define-module (gnu packages glib)
22 #:use-module ((guix licenses)
23 #:renamer (symbol-prefix-proc 'license:))
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages base)
29 #:use-module (gnu packages bison)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages flex)
32 #:use-module ((gnu packages gettext)
33 #:renamer (symbol-prefix-proc 'guix:))
34 #:use-module (gnu packages gtk)
35 #:use-module (gnu packages libffi)
36 #:use-module (gnu packages perl)
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages python)
39 #:use-module (gnu packages xml)
40 #:use-module (gnu packages bash)
41 #:use-module (gnu packages file)
42 #:use-module (gnu packages xorg)
43 #:use-module (gnu packages m4)
45 ;; Export variables up-front to allow circular dependency with the 'xorg'
63 (string-append "http://dbus.freedesktop.org/releases/dbus/dbus-"
67 "1wacqyfkcpayg7f8rvx9awqg275n5pksxq5q7y21lxjx85x6pfjz"))))
68 (build-system gnu-build-system)
70 '(#:configure-flags (list ;; Install the system bus socket under /var.
71 "--localstatedir=/var"
73 ;; XXX: Fix the following to allow system-wide
75 ;; "--sysconfdir=/etc"
77 "--with-session-socket-dir=/tmp")
78 #:patches (list (assoc-ref %build-inputs "patch/localstatedir"))))
81 ("pkg-config" ,pkg-config)
82 ("patch/localstatedir"
83 ,(search-patch "dbus-localstatedir.patch"))
85 ;; Add a dependency on libx11 so that 'dbus-launch' has support for
89 (home-page "http://dbus.freedesktop.org/")
90 (synopsis "Message bus for inter-process communication (IPC)")
92 "D-Bus is a message bus system, a simple way for applications to
93 talk to one another. In addition to interprocess communication, D-Bus
94 helps coordinate process lifecycle; it makes it simple and reliable to
95 code a \"single instance\" application or daemon, and to launch
96 applications and daemons on demand when their services are needed.
98 D-Bus supplies both a system daemon (for events such as \"new hardware
99 device added\" or \"printer queue changed\") and a
100 per-user-login-session daemon (for general IPC needs among user
101 applications). Also, the message bus is built on top of a general
102 one-to-one message passing framework, which can be used by any two apps
103 to communicate directly (without going through the message bus
104 daemon). Currently the communicating applications are on one computer,
105 or through unencrypted TCP/IP suitable for use behind a firewall with
106 shared NFS home directories.")
107 (license license:gpl2+))) ; or Academic Free License 2.1
115 (uri (string-append "mirror://gnome/sources/"
116 name "/" (string-take version 4) "/"
117 name "-" version ".tar.xz"))
119 (base32 "0cpzqadqk6z6bmb79p04pykxc8x57rvshh33414cnk41bvgaf4vm"))))
120 (build-system gnu-build-system)
121 (outputs '("out" ; everything
122 "doc")) ; 20 MiB of GTK-Doc reference
124 `(("coreutils" ,coreutils)
125 ("gettext" ,guix:gettext)
127 ("pkg-config" ,pkg-config)
128 ("python" ,python-wrapper)
130 ("perl" ,perl) ; needed by GIO tests
131 ("dbus" ,dbus) ; for GDBus tests
133 ("tzdata" ,tzdata) ; for tests/gdatetime.c
135 ("patch/tests-homedir"
136 ,(search-patch "glib-tests-homedir.patch"))
137 ("patch/tests-desktop"
138 ,(search-patch "glib-tests-desktop.patch"))
139 ("patch/tests-prlimit"
140 ,(search-patch "glib-tests-prlimit.patch"))))
142 '(#:patches (list (assoc-ref %build-inputs "patch/tests-homedir")
143 (assoc-ref %build-inputs "patch/tests-desktop")
144 (assoc-ref %build-inputs "patch/tests-prlimit"))
145 #:phases (alist-cons-before
147 (lambda* (#:key inputs outputs #:allow-other-keys)
148 ;; For tests/gdatetime.c.
150 (string-append (assoc-ref inputs "tzdata")
153 ;; Some tests want write access there.
154 (setenv "XDG_CACHE_HOME" (getcwd))
156 (substitute* '("glib/gspawn.c"
158 "tests/spawn-test.c")
160 (string-append (assoc-ref inputs "bash") "/bin/sh"))))
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")
167 (synopsis "Thread-safe general utility library; basis of GTK+ and GNOME")
169 "GLib provides data structure handling for C, portability wrappers,
170 and interfaces for such runtime functionality as an event loop, threads,
171 dynamic loading, and an object system.")
172 (home-page "http://developer.gnome.org/glib/")
173 (license license:lgpl2.0+))) ; some files are under lgpl2.1+
175 (define gobject-introspection
177 (name "gobject-introspection")
181 (uri (string-append "http://ftp.gnome.org/pub/GNOME/sources/"
182 "gobject-introspection/"
183 (substring version 0 (string-rindex version #\.))
184 "/gobject-introspection-"
187 (base32 "0wvxyvgajmms2bb6k3pf1rdpnd79xdxamykzvxzmcyn1ag9yax9m"))))
188 (build-system gnu-build-system)
195 ("pkg-config" ,pkg-config)
196 ("python-2" ,python-2)))
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.
205 (apply configure args)))
207 (home-page "https://wiki.gnome.org/GObjectIntrospection")
208 (synopsis "Generate interface introspection data for GObject libraries")
210 "GObject introspection is a middleware layer between C libraries (using
211 GObject) and language bindings. The C library can be scanned at compile time
212 and generate a metadata file, in addition to the actual native C library. Then
213 at runtime, language bindings can read this metadata and automatically provide
214 bindings to call into the C library.")
215 ; Some bits are distributed under the LGPL2+, others under the GPL2+
216 (license license:gpl2+)))
224 (uri (string-append "https://launchpad.net/intltool/trunk/"
225 version "/+download/intltool-"
229 "01j4yd7i84n9nk4ccs6yifg84pp68nr9by57jdbhj7dpdxf5rwk7"))))
230 (build-system gnu-build-system)
232 `(;; Propagate gettext because users expect it to be there, and so does
233 ;; the `intltool-update' script.
234 ("gettext" ,guix:gettext)
236 ;; `file' is used by `intltool-update' too.
239 ("perl-xml-parser" ,perl-xml-parser)
241 (home-page "https://launchpad.net/intltool/+download")
242 (synopsis "Tools to centralise translations of different file formats")
244 "intltool is a set of tools to centralise translations of many different
245 file formats using GNU gettext-compatible PO files.
247 The intltool collection can be used to do these things:
249 Extract translatable strings from various source files (.xml.in,
250 glade, .desktop.in, .server.in, .oaf.in).
252 Collect the extracted strings together with messages from traditional
253 source files (.c, .h) in po/$(PACKAGE).pot.
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.")
257 (license license:gpl2+)))
265 (uri (string-append "http://files.itstool.org/itstool/itstool-"
269 "1akq75aflihm3y7js8biy7b5mw2g11vl8yq90gydnwlwp0zxdzj6"))))
270 (build-system gnu-build-system)
272 `(("libxml2" ,libxml2)
273 ("python-2" ,python-2)))
274 (home-page "http://www.itstool.org")
275 (synopsis "Tool to translate XML documents with PO files")
277 "ITS Tool allows you to translate your XML documents with PO files, using
278 rules from the W3C Internationalization Tag Set (ITS) to determine what to
279 translate and how to separate it into PO file messages.
281 PO files are the standard translation format for GNU and other Unix-like
282 systems. They present translatable information as discrete messages, allowing
283 each message to be translated independently. In contrast to whole-page
284 translation, translating with a message-based format like PO means you can
285 easily track changes to the source document down to the paragraph. When new
286 strings are added or existing strings are modified, you only need to update the
287 corresponding messages.
289 ITS Tool is designed to make XML documents translatable through PO files by
290 applying standard ITS rules, as well as extension rules specific to ITS Tool.
291 ITS also provides an industry standard way for authors to override translation
292 information in their documents, such as whether a particular element should be
294 (license license:gpl3+)))
303 (string-append "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-"
307 "1ibav91yg70f2l3l18cr0hf4mna1h9d4mrg0c60w4l8zjbd45fx5"))))
308 (build-system gnu-build-system)
313 ("pkg-config" ,pkg-config)))
314 (home-page "http://dbus.freedesktop.org/doc/dbus-glib/")
315 (synopsis "D-Bus GLib bindings")
317 "GLib bindings for D-Bus. The package is obsolete and superseded
318 by GDBus included in Glib.")
319 (license license:gpl2))) ; or Academic Free License 2.1
327 (uri (string-append "mirror://gnome/sources/libsigc++/2.3/libsigc++-"
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++")
338 "libsigc++ implements a type-safe callback system for standard C++. It
339 allows you to define signals and to connect those signals to any callback
340 function, either global or a member function, regardless of whether it is
343 It also contains adaptor classes for connection of dissimilar callbacks and
344 has an ease of use unmatched by other C++ callback libraries.")
345 (license license:lgpl2.1+)))
353 (uri (string-append "mirror://gnome/sources/glibmm/2.37/glibmm-"
357 "0mms4yl5izsya1135772z4jkb184ss86x0wlg6dm7yvwxvb6bjlw"))))
358 (build-system gnu-build-system)
360 `(#:phases (alist-cons-before
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"
367 (string-append (getcwd)
368 "/tests/giomm_simple/main.cc")))
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"
376 (inputs `(("pkg-config" ,pkg-config)))
378 `(("libsigc++" ,libsigc++)
380 (home-page "http://gtkmm.org/")
381 (synopsis "C++ interface to the GLib library")
383 "glibmm provides a C++ programming interface to the part of GLib that are
385 (license license:lgpl2.1+)))