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