Commit | Line | Data |
---|---|---|
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 | 100 | talk to one another. In addition to interprocess communication, D-Bus |
943f33a3 LC |
101 | helps coordinate process lifecycle; it makes it simple and reliable to |
102 | code a \"single instance\" application or daemon, and to launch | |
103 | applications and daemons on demand when their services are needed. | |
104 | ||
105 | D-Bus supplies both a system daemon (for events such as \"new hardware | |
106 | device added\" or \"printer queue changed\") and a | |
107 | per-user-login-session daemon (for general IPC needs among user | |
35b9e423 | 108 | applications). Also, the message bus is built on top of a general |
943f33a3 LC |
109 | one-to-one message passing framework, which can be used by any two apps |
110 | to communicate directly (without going through the message bus | |
35b9e423 | 111 | daemon). Currently the communicating applications are on one computer, |
943f33a3 LC |
112 | or through unencrypted TCP/IP suitable for use behind a firewall with |
113 | shared 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, | |
188 | and interfaces for such runtime functionality as an event loop, threads, | |
189 | dynamic 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 | |
233 | GObject) and language bindings. The C library can be scanned at compile time | |
234 | and generate a metadata file, in addition to the actual native C library. Then | |
235 | at runtime, language bindings can read this metadata and automatically provide | |
236 | bindings 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) |
71eb5c10 | 253 | (propagated-inputs |
107b415e LC |
254 | `(;; Propagate gettext because users expect it to be there, and so does |
255 | ;; the `intltool-update' script. | |
1dba6407 | 256 | ("gettext" ,gnu-gettext) |
107b415e | 257 | |
5aa601a3 LC |
258 | ;; `file' is used by `intltool-update' too. |
259 | ("file" ,file) | |
260 | ||
e33d9d6f | 261 | ("perl-xml-parser" ,perl-xml-parser) |
107b415e | 262 | ("perl" ,perl))) |
d6b8cb5c AE |
263 | (home-page "https://launchpad.net/intltool/+download") |
264 | (synopsis "Tools to centralise translations of different file formats") | |
71eb5c10 | 265 | (description |
35b9e423 | 266 | "Intltool is a set of tools to centralise translations of many different |
71eb5c10 LC |
267 | file formats using GNU gettext-compatible PO files. |
268 | ||
269 | The intltool collection can be used to do these things: | |
270 | ||
271 | Extract translatable strings from various source files (.xml.in, | |
272 | glade, .desktop.in, .server.in, .oaf.in). | |
273 | ||
274 | Collect the extracted strings together with messages from traditional | |
275 | source files (.c, .h) in po/$(PACKAGE).pot. | |
276 | ||
277 | Merge back the translations from .po files into .xml, .desktop and | |
35b9e423 | 278 | oaf files. This merge step will happen at build resp. installation time.") |
d6b8cb5c | 279 | (license license:gpl2+))) |
24b5c463 | 280 | |
80370441 | 281 | (define itstool |
20a26ff5 CR |
282 | (package |
283 | (name "itstool") | |
284 | (version "1.2.0") | |
285 | (source (origin | |
286 | (method url-fetch) | |
287 | (uri (string-append "http://files.itstool.org/itstool/itstool-" | |
288 | version ".tar.bz2")) | |
289 | (sha256 | |
290 | (base32 | |
291 | "1akq75aflihm3y7js8biy7b5mw2g11vl8yq90gydnwlwp0zxdzj6")))) | |
292 | (build-system gnu-build-system) | |
f922fc42 AE |
293 | (propagated-inputs |
294 | `(("libxml2" ,libxml2) | |
295 | ("python-2" ,python-2))) | |
20a26ff5 CR |
296 | (home-page "http://www.itstool.org") |
297 | (synopsis "Tool to translate XML documents with PO files") | |
298 | (description | |
299 | "ITS Tool allows you to translate your XML documents with PO files, using | |
300 | rules from the W3C Internationalization Tag Set (ITS) to determine what to | |
301 | translate and how to separate it into PO file messages. | |
302 | ||
303 | PO files are the standard translation format for GNU and other Unix-like | |
304 | systems. They present translatable information as discrete messages, allowing | |
305 | each message to be translated independently. In contrast to whole-page | |
306 | translation, translating with a message-based format like PO means you can | |
307 | easily track changes to the source document down to the paragraph. When new | |
308 | strings are added or existing strings are modified, you only need to update the | |
309 | corresponding messages. | |
310 | ||
311 | ITS Tool is designed to make XML documents translatable through PO files by | |
312 | applying standard ITS rules, as well as extension rules specific to ITS Tool. | |
313 | ITS also provides an industry standard way for authors to override translation | |
314 | information in their documents, such as whether a particular element should be | |
315 | translated.") | |
a129e0d8 | 316 | (license license:gpl3+))) |
20a26ff5 | 317 | |
80370441 | 318 | (define dbus-glib |
24b5c463 AE |
319 | (package |
320 | (name "dbus-glib") | |
321 | (version "0.100.2") | |
322 | (source (origin | |
323 | (method url-fetch) | |
324 | (uri | |
325 | (string-append "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-" | |
326 | version ".tar.gz")) | |
327 | (sha256 | |
328 | (base32 | |
329 | "1ibav91yg70f2l3l18cr0hf4mna1h9d4mrg0c60w4l8zjbd45fx5")))) | |
330 | (build-system gnu-build-system) | |
331 | (inputs | |
332 | `(("dbus" ,dbus) | |
333 | ("expat" ,expat) | |
44add1ce LC |
334 | ("glib" ,glib))) |
335 | (native-inputs | |
336 | `(("glib" ,glib "bin") | |
24b5c463 AE |
337 | ("pkg-config" ,pkg-config))) |
338 | (home-page "http://dbus.freedesktop.org/doc/dbus-glib/") | |
339 | (synopsis "D-Bus GLib bindings") | |
340 | (description | |
341 | "GLib bindings for D-Bus. The package is obsolete and superseded | |
342 | by GDBus included in Glib.") | |
343 | (license license:gpl2))) ; or Academic Free License 2.1 | |
a5a7d374 LC |
344 | |
345 | (define libsigc++ | |
346 | (package | |
347 | (name "libsigc++") | |
348 | (version "2.3.1") | |
349 | (source (origin | |
350 | (method url-fetch) | |
351 | (uri (string-append "mirror://gnome/sources/libsigc++/2.3/libsigc++-" | |
352 | version ".tar.xz")) | |
353 | (sha256 | |
354 | (base32 | |
355 | "14q3sq6d43f6wfcmwhw4v1aal4ba0h5x9v6wkxy2dnqznd95il37")))) | |
356 | (build-system gnu-build-system) | |
41eb1198 LC |
357 | (native-inputs `(("pkg-config" ,pkg-config) |
358 | ("m4" ,m4))) | |
a5a7d374 LC |
359 | (home-page "http://libsigc.sourceforge.net/") |
360 | (synopsis "Type-safe callback system for standard C++") | |
361 | (description | |
35b9e423 | 362 | "Libsigc++ implements a type-safe callback system for standard C++. It |
a5a7d374 LC |
363 | allows you to define signals and to connect those signals to any callback |
364 | function, either global or a member function, regardless of whether it is | |
365 | static or virtual. | |
366 | ||
367 | It also contains adaptor classes for connection of dissimilar callbacks and | |
368 | has an ease of use unmatched by other C++ callback libraries.") | |
369 | (license license:lgpl2.1+))) | |
370 | ||
371 | (define glibmm | |
372 | (package | |
373 | (name "glibmm") | |
374 | (version "2.37.7") | |
375 | (source (origin | |
376 | (method url-fetch) | |
377 | (uri (string-append "mirror://gnome/sources/glibmm/2.37/glibmm-" | |
378 | version ".tar.xz")) | |
379 | (sha256 | |
380 | (base32 | |
381 | "0mms4yl5izsya1135772z4jkb184ss86x0wlg6dm7yvwxvb6bjlw")))) | |
382 | (build-system gnu-build-system) | |
383 | (arguments | |
384 | `(#:phases (alist-cons-before | |
385 | 'build 'pre-build | |
386 | (lambda _ | |
387 | ;; This test uses /etc/fstab as an example file to read | |
388 | ;; from; choose a better example. | |
389 | (substitute* "tests/giomm_simple/main.cc" | |
390 | (("/etc/fstab") | |
391 | (string-append (getcwd) | |
392 | "/tests/giomm_simple/main.cc"))) | |
393 | ||
394 | ;; This test does a DNS lookup, and then expects to be able | |
395 | ;; to open a TLS session; just skip it. | |
396 | (substitute* "tests/giomm_tls_client/main.cc" | |
397 | (("Gio::init.*$") | |
398 | "return 77;\n"))) | |
399 | %standard-phases))) | |
41eb1198 LC |
400 | (native-inputs `(("pkg-config" ,pkg-config) |
401 | ("glib" ,glib "bin"))) | |
a5a7d374 LC |
402 | (propagated-inputs |
403 | `(("libsigc++" ,libsigc++) | |
404 | ("glib" ,glib))) | |
405 | (home-page "http://gtkmm.org/") | |
406 | (synopsis "C++ interface to the GLib library") | |
407 | (description | |
35b9e423 | 408 | "Glibmm provides a C++ programming interface to the part of GLib that are |
a5a7d374 LC |
409 | useful for C++.") |
410 | (license license:lgpl2.1+))) |