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