Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / gtk.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014, 2015, 2017, 2018 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
6 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
8 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
9 ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com>
10 ;;; Copyright © 2015 David Hashe <david.hashe@dhashe.com>
11 ;;; Coypright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
12 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
13 ;;; Copyright © 2016 Fabian Harfert <fhmgufs@web.de>
14 ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2016 Patrick Hetu <patrick.hetu@auf.org>
16 ;;; Copyright © 2016 Nils Gillmann <ng0@n0.is>
17 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
18 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
19 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
20 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
21 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
22 ;;;
23 ;;; This file is part of GNU Guix.
24 ;;;
25 ;;; GNU Guix is free software; you can redistribute it and/or modify it
26 ;;; under the terms of the GNU General Public License as published by
27 ;;; the Free Software Foundation; either version 3 of the License, or (at
28 ;;; your option) any later version.
29 ;;;
30 ;;; GNU Guix is distributed in the hope that it will be useful, but
31 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 ;;; GNU General Public License for more details.
34 ;;;
35 ;;; You should have received a copy of the GNU General Public License
36 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
37
38 (define-module (gnu packages gtk)
39 #:use-module ((guix licenses) #:prefix license:)
40 #:use-module (guix utils)
41 #:use-module (guix packages)
42 #:use-module (guix download)
43 #:use-module (guix git-download)
44 #:use-module (guix build-system gnu)
45 #:use-module (guix build-system meson)
46 #:use-module (guix build-system perl)
47 #:use-module (guix build-system python)
48 #:use-module (guix build-system waf)
49 #:use-module (gnu packages)
50 #:use-module (gnu packages algebra)
51 #:use-module (gnu packages autotools)
52 #:use-module (gnu packages base)
53 #:use-module (gnu packages texinfo)
54 #:use-module (gnu packages check)
55 #:use-module (gnu packages compression)
56 #:use-module (gnu packages docbook)
57 #:use-module (gnu packages enchant)
58 #:use-module (gnu packages fontutils)
59 #:use-module (gnu packages freedesktop)
60 #:use-module (gnu packages fribidi)
61 #:use-module (gnu packages gettext)
62 #:use-module (gnu packages ghostscript)
63 #:use-module (gnu packages gl)
64 #:use-module (gnu packages glib)
65 #:use-module (gnu packages gnome)
66 #:use-module (gnu packages icu4c)
67 #:use-module (gnu packages image)
68 #:use-module (gnu packages libffi)
69 #:use-module (gnu packages pdf)
70 #:use-module (gnu packages perl)
71 #:use-module (gnu packages pkg-config)
72 #:use-module (gnu packages pretty-print)
73 #:use-module (gnu packages python)
74 #:use-module (gnu packages guile)
75 #:use-module (gnu packages cups)
76 #:use-module (gnu packages xml)
77 #:use-module (gnu packages xorg)
78 #:use-module (gnu packages xdisorg))
79
80 (define-public atk
81 (package
82 (name "atk")
83 (version "2.28.1")
84 (source (origin
85 (method url-fetch)
86 (uri (string-append "mirror://gnome/sources/" name "/"
87 (version-major+minor version) "/"
88 name "-" version ".tar.xz"))
89 (sha256
90 (base32
91 "1z7laf6qwv5zsqcnj222dm5f43c6f3liil0cgx4s4s62xjk1wfnd"))))
92 (build-system gnu-build-system)
93 (outputs '("out" "doc"))
94 (arguments
95 `(#:configure-flags
96 (list (string-append "--with-html-dir="
97 (assoc-ref %outputs "doc")
98 "/share/gtk-doc/html"))))
99 (propagated-inputs `(("glib" ,glib))) ; required by atk.pc
100 (native-inputs
101 `(("pkg-config" ,pkg-config)
102 ("glib" ,glib "bin") ; glib-mkenums, etc.
103 ("gobject-introspection" ,gobject-introspection))) ; g-ir-compiler, etc.
104 (synopsis "GNOME accessibility toolkit")
105 (description
106 "ATK provides the set of accessibility interfaces that are implemented
107 by other toolkits and applications. Using the ATK interfaces, accessibility
108 tools have full access to view and control running applications.")
109 (license license:lgpl2.0+)
110 (home-page "https://developer.gnome.org/atk/")))
111
112 (define-public cairo
113 (package
114 (name "cairo")
115 (version "1.14.12")
116 (source (origin
117 (method url-fetch)
118 (uri (string-append "https://cairographics.org/releases/cairo-"
119 version ".tar.xz"))
120 (sha256
121 (base32
122 "05mzyxkvsfc1annjw2dja8vka01ampp9pp93lg09j8hba06g144c"))
123 (patches (search-patches "cairo-CVE-2016-9082.patch"
124 "cairo-setjmp-wrapper.patch"))))
125 (build-system gnu-build-system)
126 (propagated-inputs
127 `(("fontconfig" ,fontconfig)
128 ("freetype" ,freetype)
129 ("glib" ,glib)
130 ("libpng" ,libpng)
131 ("libx11" ,libx11)
132 ("libxext" ,libxext)
133 ("libxrender" ,libxrender)
134 ("pixman" ,pixman)))
135 (inputs
136 `(("ghostscript" ,ghostscript)
137 ("libspectre" ,libspectre)
138 ("poppler" ,poppler)
139 ("xorgproto" ,xorgproto)
140 ("zlib" ,zlib)))
141 (native-inputs
142 `(("pkg-config" ,pkg-config)
143 ("python" ,python-wrapper)))
144 (arguments
145 `(#:tests? #f ; see http://lists.gnu.org/archive/html/bug-guix/2013-06/msg00085.html
146 #:configure-flags '("--enable-tee"))) ; needed for GNU Icecat
147 (synopsis "2D graphics library")
148 (description
149 "Cairo is a 2D graphics library with support for multiple output devices.
150 Currently supported output targets include the X Window System (via both
151 Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file
152 output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB.
153
154 Cairo is designed to produce consistent output on all output media while
155 taking advantage of display hardware acceleration when available
156 eg. through the X Render Extension).
157
158 The cairo API provides operations similar to the drawing operators of
159 PostScript and PDF. Operations in cairo including stroking and filling cubic
160 Bézier splines, transforming and compositing translucent images, and
161 antialiased text rendering. All drawing operations can be transformed by any
162 affine transformation (scale, rotation, shear, etc.).")
163 (license license:lgpl2.1) ; or Mozilla Public License 1.1
164 (home-page "https://cairographics.org/")))
165
166 (define-public cairo-xcb
167 (package
168 (inherit cairo)
169 (name "cairo-xcb")
170 (inputs
171 `(("mesa" ,mesa)
172 ,@(package-inputs cairo)))
173 (arguments
174 `(#:tests? #f
175 #:configure-flags
176 '("--enable-xlib-xcb" "--enable-gl" "--enable-egl")))
177 (synopsis "2D graphics library (with X11 support)")))
178
179 (define-public harfbuzz
180 (package
181 (name "harfbuzz")
182 (version "1.8.8")
183 (source (origin
184 (method url-fetch)
185 (uri (string-append "https://www.freedesktop.org/software/"
186 "harfbuzz/release/harfbuzz-"
187 version ".tar.bz2"))
188 (sha256
189 (base32
190 "1ag3scnm1fcviqgx2p4858y433mr0ndqw6zccnccrqcr9mpcird8"))))
191 (build-system gnu-build-system)
192 (outputs '("out"
193 "bin")) ; 160K, only hb-view depend on cairo
194 (inputs
195 `(("cairo" ,cairo)))
196 (propagated-inputs
197 ;; There are all in the Requires or Requires.private field of '.pc'.
198 `(("glib" ,glib)
199 ("graphite2" ,graphite2)
200 ("icu4c" ,icu4c)))
201 (native-inputs
202 `(("gobject-introspection" ,gobject-introspection)
203 ("pkg-config" ,pkg-config)
204 ("python" ,python-wrapper)
205 ("which" ,which)))
206 (arguments
207 `(#:configure-flags `("--with-graphite2"
208 "--with-gobject"
209 ,(string-append
210 "--bindir=" (assoc-ref %outputs "bin") "/bin"))))
211 (synopsis "OpenType text shaping engine")
212 (description
213 "HarfBuzz is an OpenType text shaping engine.")
214 (license (license:x11-style "file://COPYING"
215 "See 'COPYING' in the distribution."))
216 (home-page "https://www.freedesktop.org/wiki/Software/HarfBuzz/")))
217
218 (define-public pango
219 (package
220 (name "pango")
221 (version "1.42.4")
222 (source (origin
223 (method url-fetch)
224 (uri (string-append "mirror://gnome/sources/pango/"
225 (version-major+minor version) "/"
226 name "-" version ".tar.xz"))
227 (sha256
228 (base32
229 "17bwb7dgbncrfsmchlib03k9n3xaalirb39g3yb43gg8cg6p8aqx"))))
230 (build-system gnu-build-system)
231 (propagated-inputs
232 ;; These are all in Requires or Requires.private of the '.pc' files.
233 `(("cairo" ,cairo)
234 ("fribidi" ,fribidi)
235 ("fontconfig" ,fontconfig)
236 ("freetype" ,freetype)
237 ("glib" ,glib)
238 ("harfbuzz" ,harfbuzz)))
239 (inputs
240 `(("zlib" ,zlib)
241
242 ;; Some packages, such as Openbox, expect Pango to be built with the
243 ;; optional libxft support.
244 ("libxft" ,libxft)))
245 (native-inputs
246 `(("pkg-config" ,pkg-config)
247 ("glib" ,glib "bin") ; glib-mkenums, etc.
248 ("gobject-introspection" ,gobject-introspection))) ; g-ir-compiler, etc.
249 (synopsis "GNOME text and font handling library")
250 (description
251 "Pango is the core text and font handling library used in GNOME
252 applications. It has extensive support for the different writing systems
253 used throughout the world.")
254 (license license:lgpl2.0+)
255 (home-page "https://developer.gnome.org/pango/")))
256
257 (define-public pangox-compat
258 (package
259 (name "pangox-compat")
260 (version "0.0.2")
261 (source (origin
262 (method url-fetch)
263 (uri (string-append "mirror://gnome/sources/" name "/"
264 (version-major+minor version) "/"
265 name "-" version ".tar.xz"))
266 (sha256
267 (base32
268 "0ip0ziys6mrqqmz4n71ays0kf5cs1xflj1gfpvs4fgy2nsrr482m"))))
269 (build-system gnu-build-system)
270 (inputs
271 `(("glib" ,glib)
272 ("pango" ,pango)))
273 (native-inputs
274 `(("intltool" ,intltool)
275 ("pkg-config" ,pkg-config)))
276 (home-page "https://developer.gnome.org/pango")
277 (synopsis "Obsolete pango functions")
278 (description "Pangox was a X backend to pango. It is now obsolete and no
279 longer provided by recent pango releases. pangox-compat provides the
280 functions which were removed.")
281 (license license:lgpl2.0+)))
282
283 (define-public ganv
284 (package
285 (name "ganv")
286 (version "1.4.2")
287 (source (origin
288 (method url-fetch)
289 (uri (string-append "https://download.drobilla.net/ganv-"
290 version ".tar.bz2"))
291 (sha256
292 (base32
293 "0g7s5mp14qgbfjdql0k1s8464r21g47ssn5dws6jazsnw6njhl0l"))))
294 (build-system waf-build-system)
295 (arguments
296 `(#:phases
297 (modify-phases %standard-phases
298 (add-before 'configure 'set-flags
299 (lambda* (#:key outputs #:allow-other-keys)
300 ;; Compile with C++11, required by gtkmm.
301 (setenv "CXXFLAGS" "-std=c++11")
302 ;; Allow 'bin/ganv_bench' to find libganv-1.so.
303 (setenv "LDFLAGS"
304 (string-append "-Wl,-rpath="
305 (assoc-ref outputs "out") "/lib"))
306 #t)))
307 #:tests? #f)) ; no check target
308 (inputs
309 `(("gtk" ,gtk+-2)
310 ("gtkmm" ,gtkmm-2)))
311 (native-inputs
312 `(("glib" ,glib "bin") ; for glib-genmarshal, etc.
313 ("pkg-config" ,pkg-config)))
314 (home-page "https://drobilla.net/software/ganv/")
315 (synopsis "GTK+ widget for interactive graph-like environments")
316 (description
317 "Ganv is an interactive GTK+ widget for interactive “boxes and lines” or
318 graph-like environments, e.g. modular synths or finite state machine
319 diagrams.")
320 (license license:gpl3+)))
321
322 (define-public ganv-devel
323 (let ((commit "12f7d6b0438c94dd87f773a92eee3453d971846e")
324 (revision "1"))
325 (package
326 (inherit ganv)
327 (name "ganv")
328 (version (string-append "1.5.4-" revision "."
329 (string-take commit 9)))
330 (source (origin
331 (method git-fetch)
332 (uri (git-reference
333 (url "https://git.drobilla.net/ganv.git")
334 (commit commit)))
335 (file-name (git-file-name name version))
336 (sha256
337 (base32
338 "1cr8w02lr6bk9mkxa12j3imq721b2an2yn4bj5wnwmpm91ddn2gi")))))))
339
340 (define-public gtksourceview-2
341 (package
342 (name "gtksourceview")
343 (version "2.10.5") ; This is the last version which builds against gtk+2
344 (source (origin
345 (method url-fetch)
346 (uri (string-append "mirror://gnome/sources/" name "/"
347 (version-major+minor version) "/"
348 name "-" version ".tar.bz2"))
349 (sha256
350 (base32
351 "07hrabhpl6n8ajz10s0d960jdwndxs87szxyn428mpxi8cvpg1f5"))))
352 (build-system gnu-build-system)
353 (native-inputs
354 `(("intltool" ,intltool)
355 ("glib" ,glib "bin") ; for glib-genmarshal, etc.
356 ("pkg-config" ,pkg-config)
357 ;; For testing.
358 ("xorg-server" ,xorg-server)
359 ("shared-mime-info" ,shared-mime-info)))
360 (propagated-inputs
361 ;; As per the pkg-config file.
362 `(("gtk" ,gtk+-2)
363 ("libxml2" ,libxml2)))
364 (arguments
365 `(#:phases
366 ;; Unfortunately, some of the tests in "make check" are highly dependent
367 ;; on the environment therefore, some black magic is required.
368 (modify-phases %standard-phases
369 (add-before 'check 'start-xserver
370 (lambda* (#:key inputs #:allow-other-keys)
371 (let ((xorg-server (assoc-ref inputs "xorg-server"))
372 (mime (assoc-ref inputs "shared-mime-info")))
373
374 ;; There must be a running X server and make check doesn't start one.
375 ;; Therefore we must do it.
376 (system (format #f "~a/bin/Xvfb :1 &" xorg-server))
377 (setenv "DISPLAY" ":1")
378
379 ;; The .lang files must be found in $XDG_DATA_HOME/gtksourceview-2.0
380 (system "ln -s gtksourceview gtksourceview-2.0")
381 (setenv "XDG_DATA_HOME" (getcwd))
382
383 ;; Finally, the mimetypes must be available.
384 (setenv "XDG_DATA_DIRS" (string-append mime "/share/")))
385 #t)))))
386 (synopsis "Widget that extends the standard GTK+ 2.x 'GtkTextView' widget")
387 (description
388 "GtkSourceView is a portable C library that extends the standard GTK+
389 framework for multiline text editing with support for configurable syntax
390 highlighting, unlimited undo/redo, search and replace, a completion framework,
391 printing and other features typical of a source code editor.")
392 (license license:lgpl2.0+)
393 (home-page "https://developer.gnome.org/gtksourceview/")))
394
395 (define-public gtksourceview
396 (package
397 (name "gtksourceview")
398 (version "3.24.8")
399 (source (origin
400 (method url-fetch)
401 (uri (string-append "mirror://gnome/sources/" name "/"
402 (version-major+minor version) "/"
403 name "-" version ".tar.xz"))
404 (sha256
405 (base32
406 "1zinqid62zjcsq7vy1y4mq1qh3hzd3zj7p8np7g0bdqd37zvi6qy"))))
407 (build-system gnu-build-system)
408 (arguments
409 '(#:phases
410 (modify-phases %standard-phases
411 (add-before
412 'check 'pre-check
413 (lambda* (#:key inputs #:allow-other-keys)
414 (let ((xorg-server (assoc-ref inputs "xorg-server")))
415 ;; Tests require a running X server.
416 (system (format #f "~a/bin/Xvfb :1 &" xorg-server))
417 (setenv "DISPLAY" ":1")
418 ;; For the missing /etc/machine-id.
419 (setenv "DBUS_FATAL_WARNINGS" "0")
420 #t))))))
421 (native-inputs
422 `(("glib:bin" ,glib "bin") ; for glib-genmarshal, etc.
423 ("intltool" ,intltool)
424 ("itstool" ,itstool)
425 ("gobject-introspection" ,gobject-introspection)
426 ("pkg-config" ,pkg-config)
427 ("vala" ,vala)
428 ;; For testing.
429 ("xorg-server" ,xorg-server)
430 ("shared-mime-info" ,shared-mime-info)))
431 (propagated-inputs
432 ;; gtksourceview-3.0.pc refers to all these.
433 `(("glib" ,glib)
434 ("gtk+" ,gtk+)
435 ("libxml2" ,libxml2)))
436 (home-page "https://wiki.gnome.org/Projects/GtkSourceView")
437 (synopsis "GNOME source code widget")
438 (description "GtkSourceView is a text widget that extends the standard
439 GTK+ text widget GtkTextView. It improves GtkTextView by implementing syntax
440 highlighting and other features typical of a source code editor.")
441 (license license:lgpl2.1+)))
442
443 (define-public gdk-pixbuf
444 (package
445 (name "gdk-pixbuf")
446 (version "2.38.0")
447 (source (origin
448 (method url-fetch)
449 (uri (string-append "mirror://gnome/sources/" name "/"
450 (version-major+minor version) "/"
451 name "-" version ".tar.xz"))
452 (sha256
453 (base32
454 "0ixfmnxjylx06mjaw116apymwi1a8rnkmkbbvqaxxg2pfwy9fl6x"))))
455 (build-system meson-build-system)
456 (arguments
457 '(#:configure-flags '("-Dinstalled-tests=false")
458 #:phases
459 (modify-phases %standard-phases
460 (add-after
461 'unpack 'disable-failing-tests
462 (lambda _
463 (substitute* "tests/meson.build"
464 ;; XXX FIXME: This test fails on armhf machines with:
465 ;; SKIP Not enough memory to load bitmap image
466 ;; ERROR: cve-2015-4491 - too few tests run (expected 4, got 2)
467 ((".*'cve-2015-4491'.*") "")
468 ;; XXX FIXME: This test fails with:
469 ;; ERROR:pixbuf-jpeg.c:74:test_type9_rotation_exif_tag:
470 ;; assertion failed (error == NULL): Data differ
471 ;; (gdk-pixbuf-error-quark, 0)
472 ((".*'pixbuf-jpeg'.*") ""))
473 #t))
474 (add-before 'configure 'aid-install-script
475 (lambda* (#:key outputs #:allow-other-keys)
476 ;; "build-aux/post-install.sh" invokes `gdk-pixbuf-query-loaders`
477 ;; for updating loader.cache, but it's not on PATH. Make it use
478 ;; the one we're installing. XXX: Won't work when cross-compiling.
479 (substitute* "build-aux/post-install.sh"
480 (("gdk-pixbuf-query-loaders" match)
481 (string-append (assoc-ref outputs "out") "/bin/" match)))
482 #t)))))
483 (propagated-inputs
484 `(;; Required by gdk-pixbuf-2.0.pc
485 ("glib" ,glib)
486 ("libpng" ,libpng)
487 ;; Used for testing and required at runtime.
488 ("shared-mime-info" ,shared-mime-info)))
489 (inputs
490 `(("libjpeg" ,libjpeg)
491 ("libtiff" ,libtiff)
492 ("libx11" ,libx11)))
493 (native-inputs
494 `(("pkg-config" ,pkg-config)
495 ("gettext" ,gettext-minimal)
496 ("glib" ,glib "bin") ; glib-mkenums, etc.
497 ("gobject-introspection" ,gobject-introspection))) ; g-ir-compiler, etc.
498 (synopsis "GNOME image loading and manipulation library")
499 (description
500 "GdkPixbuf is a library for image loading and manipulation developed
501 in the GNOME project.")
502 (license license:lgpl2.0+)
503 (home-page "https://developer.gnome.org/gdk-pixbuf/")))
504
505 ;; To build gdk-pixbuf with SVG support, we need librsvg, and librsvg depends
506 ;; on gdk-pixbuf, so this new varibale. Also, librsvg adds 90MiB to the
507 ;; closure size.
508 (define-public gdk-pixbuf+svg
509 (package (inherit gdk-pixbuf)
510 (name "gdk-pixbuf+svg")
511 (inputs
512 `(("librsvg" ,librsvg)
513 ,@(package-inputs gdk-pixbuf)))
514 (arguments
515 '(#:configure-flags '("-Dinstalled-tests=false")
516 #:tests? #f ; tested by the gdk-pixbuf package already
517 #:phases
518 (modify-phases %standard-phases
519 (add-after 'install 'register-svg-loader
520 (lambda* (#:key inputs outputs #:allow-other-keys)
521 (let* ((out (assoc-ref outputs "out"))
522 (librsvg (assoc-ref inputs "librsvg"))
523 (loaders
524 (append
525 (find-files out "^libpixbufloader-.*\\.so$")
526 (find-files librsvg "^libpixbufloader-.*\\.so$")))
527 (gdk-pixbuf-query-loaders
528 (string-append out "/bin/gdk-pixbuf-query-loaders")))
529 (apply invoke
530 gdk-pixbuf-query-loaders
531 "--update-cache"
532 loaders)))))))
533 (synopsis
534 "GNOME image loading and manipulation library, with SVG support")))
535
536 (define-public at-spi2-core
537 (package
538 (name "at-spi2-core")
539 (version "2.26.2")
540 (source (origin
541 (method url-fetch)
542 (uri (string-append "mirror://gnome/sources/" name "/"
543 (version-major+minor version) "/"
544 name "-" version ".tar.xz"))
545 (sha256
546 (base32
547 "0596ghkamkxgv08r4a1pdhm06qd5zzgcfqsv64038w9xbvghq3n8"))))
548 (build-system gnu-build-system)
549 (outputs '("out" "doc"))
550 (arguments
551 '(#:configure-flags
552 (list (string-append "--with-html-dir="
553 (assoc-ref %outputs "doc")
554 "/share/gtk-doc/html"))
555 #:phases
556 (modify-phases %standard-phases
557 (replace 'check
558 ;; Run test-suite under a dbus session.
559 (lambda _
560 ;; Don't fail on missing '/etc/machine-id'.
561 (setenv "DBUS_FATAL_WARNINGS" "0")
562 (invoke "dbus-launch" "make" "check"))))))
563 (propagated-inputs
564 ;; atspi-2.pc refers to all these.
565 `(("dbus" ,dbus)
566 ("glib" ,glib)))
567 (inputs
568 `(("libxi" ,libxi)
569 ("libxtst" ,libxtst)))
570 (native-inputs
571 `(("gobject-introspection" ,gobject-introspection)
572 ("intltool" ,intltool)
573 ("pkg-config" ,pkg-config)))
574 (synopsis "Assistive Technology Service Provider Interface, core components")
575 (description
576 "The Assistive Technology Service Provider Interface, core components,
577 is part of the GNOME accessibility project.")
578 (license license:lgpl2.0+)
579 (home-page "https://projects.gnome.org/accessibility/")))
580
581 (define-public at-spi2-atk
582 (package
583 (name "at-spi2-atk")
584 (version "2.26.2")
585 (source (origin
586 (method url-fetch)
587 (uri (string-append "mirror://gnome/sources/" name "/"
588 (version-major+minor version) "/"
589 name "-" version ".tar.xz"))
590 (sha256
591 (base32
592 "0vkan52ab9vrkknnv8y4f1cspk8x7xd10qx92xk9ys71p851z2b1"))))
593 (build-system gnu-build-system)
594 (arguments
595 '(#:phases
596 (modify-phases %standard-phases
597 (replace 'check
598 ;; Run test-suite under a dbus session.
599 (lambda _
600 (setenv "DBUS_FATAL_WARNINGS" "0")
601 (invoke "dbus-launch" "make" "check"))))))
602 (propagated-inputs
603 `(("at-spi2-core" ,at-spi2-core))) ; required by atk-bridge-2.0.pc
604 (inputs
605 `(("atk" ,atk)))
606 (native-inputs
607 `(("dbus" ,dbus) ; for testing
608 ("pkg-config" ,pkg-config)))
609 (synopsis "Assistive Technology Service Provider Interface, ATK bindings")
610 (description
611 "The Assistive Technology Service Provider Interface
612 is part of the GNOME accessibility project.")
613 (license license:lgpl2.0+)
614 (home-page "https://projects.gnome.org/accessibility/")))
615
616 (define-public gtk+-2
617 (package
618 (name "gtk+")
619 (version "2.24.32")
620 (source (origin
621 (method url-fetch)
622 (uri (string-append "mirror://gnome/sources/" name "/"
623 (version-major+minor version) "/"
624 name "-" version ".tar.xz"))
625 (sha256
626 (base32
627 "0bjq7ja9gwcv6n5q4qkvdjjx40wsdiikksz1zqxvxsm5vlyskj5n"))
628 (patches (search-patches "gtk2-respect-GUIX_GTK2_PATH.patch"
629 "gtk2-respect-GUIX_GTK2_IM_MODULE_FILE.patch"
630 "gtk2-theme-paths.patch"))))
631 (build-system gnu-build-system)
632 (outputs '("out" "doc"))
633 (propagated-inputs
634 `(("atk" ,atk)
635 ("gdk-pixbuf" ,gdk-pixbuf+svg)
636 ("pango" ,pango)))
637 (inputs
638 `(("cups" ,cups)
639 ("libxcomposite" ,libxcomposite)
640 ("libxcursor" ,libxcursor)
641 ("libxdamage" ,libxdamage)
642 ("libxi" ,libxi)
643 ("libxinerama" ,libxinerama)
644 ("libxrandr" ,libxrandr)))
645 (native-inputs
646 `(("perl" ,perl)
647 ("gettext" ,gettext-minimal)
648 ("glib" ,glib "bin")
649 ("gobject-introspection" ,gobject-introspection)
650 ("pkg-config" ,pkg-config)
651 ("python-wrapper" ,python-wrapper)))
652 (arguments
653 `(#:configure-flags
654 (list "--with-xinput=yes"
655 (string-append "--with-html-dir="
656 (assoc-ref %outputs "doc")
657 "/share/gtk-doc/html"))
658 #:phases
659 (alist-cons-before
660 'configure 'disable-tests
661 (lambda _
662 ;; FIXME: re-enable tests requiring an X server
663 (substitute* "gtk/Makefile.in"
664 (("SUBDIRS = theme-bits . tests") "SUBDIRS = theme-bits ."))
665 #t)
666 %standard-phases)))
667 (native-search-paths
668 (list (search-path-specification
669 (variable "GUIX_GTK2_PATH")
670 (files '("lib/gtk-2.0")))))
671 (synopsis "Cross-platform toolkit for creating graphical user interfaces")
672 (description
673 "GTK+, or the GIMP Toolkit, is a multi-platform toolkit for creating
674 graphical user interfaces. Offering a complete set of widgets, GTK+ is
675 suitable for projects ranging from small one-off tools to complete
676 application suites.")
677 (license license:lgpl2.0+)
678 (home-page "https://www.gtk.org/")))
679
680 (define-public gtk+
681 (package (inherit gtk+-2)
682 (name "gtk+")
683 ;; NOTE: When updating the version of 'gtk+', the hash of 'mate-themes' in
684 ;; mate.scm will also need to be updated.
685 (version "3.24.0")
686 (source (origin
687 (method url-fetch)
688 (uri (string-append "mirror://gnome/sources/" name "/"
689 (version-major+minor version) "/"
690 name "-" version ".tar.xz"))
691 (sha256
692 (base32
693 "1a1jbsh9fg5ykmwrcl3svy7xfvx0b87d314qsx9n483pj8w93s82"))
694 (patches (search-patches "gtk3-respect-GUIX_GTK3_PATH.patch"
695 "gtk3-respect-GUIX_GTK3_IM_MODULE_FILE.patch"))))
696 (outputs '("out" "bin" "doc"))
697 (propagated-inputs
698 `(("at-spi2-atk" ,at-spi2-atk)
699 ("atk" ,atk)
700 ("gdk-pixbuf" ,gdk-pixbuf+svg)
701 ("libepoxy" ,libepoxy)
702 ("libxcursor" ,libxcursor)
703 ("libxi" ,libxi)
704 ("libxinerama" ,libxinerama)
705 ("libxkbcommon" ,libxkbcommon)
706 ("libxdamage" ,libxdamage)
707 ("mesa" ,mesa)
708 ("pango" ,pango)
709 ("wayland" ,wayland)
710 ("wayland-protocols" ,wayland-protocols)))
711 (inputs
712 `(("libxml2" ,libxml2)
713 ;; XXX: colord depends on mozjs (through polkit), which fails on
714 ;; on non-intel systems now.
715 ;;("colord" ,colord)
716 ("cups" ,cups) ;for printing support
717 ;; XXX: rest depends on p11-kit, which fails on mips64el now.
718 ;;("rest" ,rest)
719 ("json-glib" ,json-glib)))
720 (native-inputs
721 `(("perl" ,perl)
722 ("glib" ,glib "bin")
723 ("gettext" ,gettext-minimal)
724 ("pkg-config" ,pkg-config)
725 ("gobject-introspection" ,gobject-introspection)
726 ("python-wrapper" ,python-wrapper)
727 ;; By using a special xorg-server for GTK+'s tests, we reduce the impact
728 ;; of updating xorg-server directly on the master branch.
729 ("xorg-server" ,xorg-server-for-tests)))
730 (arguments
731 `(#:disallowed-references (,xorg-server-for-tests)
732 ;; 47 MiB goes to "out" (24 of which is locale data!), and 26 MiB goes
733 ;; to "doc".
734 #:configure-flags (list (string-append "--with-html-dir="
735 (assoc-ref %outputs "doc")
736 "/share/gtk-doc/html")
737 ;; The header file <gdk/gdkwayland.h> is required
738 ;; by gnome-control-center
739 "--enable-wayland-backend"
740 ;; This is necessary to build both backends.
741 "--enable-x11-backend"
742 ;; This enables the HTML5 websocket backend.
743 "--enable-broadway-backend")
744 #:phases (modify-phases %standard-phases
745 (add-before 'configure 'pre-configure
746 (lambda _
747 ;; Disable most tests, failing in the chroot with the message:
748 ;; D-Bus library appears to be incorrectly set up; failed to read
749 ;; machine uuid: Failed to open "/etc/machine-id": No such file or
750 ;; directory.
751 ;; See the manual page for dbus-uuidgen to correct this issue.
752 (substitute* "testsuite/Makefile.in"
753 (("SUBDIRS = gdk gtk a11y css reftests")
754 "SUBDIRS = gdk"))
755 #t))
756 (add-after 'install 'move-desktop-files
757 ;; Move desktop files into 'bin' to avoid cycle references.
758 (lambda* (#:key outputs #:allow-other-keys)
759 (let ((out (assoc-ref outputs "out"))
760 (bin (assoc-ref outputs "bin")))
761 (mkdir-p (string-append bin "/share"))
762 (rename-file (string-append out "/share/applications")
763 (string-append bin "/share/applications"))
764 #t))))))
765 (native-search-paths
766 (list (search-path-specification
767 (variable "GUIX_GTK3_PATH")
768 (files '("lib/gtk-3.0")))))))
769
770 ;;;
771 ;;; Guile bindings.
772 ;;;
773
774 (define-public guile-cairo
775 (package
776 (name "guile-cairo")
777 (version "1.10.0")
778 (source (origin
779 (method url-fetch)
780 (uri (string-append "mirror://savannah/guile-cairo/guile-cairo-"
781 version ".tar.gz"))
782 (sha256
783 (base32
784 "0p6xrhf2k6n5dybn88050za7h90gnd7534n62l53vsca187pwgdf"))
785 (modules '((guix build utils)))
786 (snippet
787 (begin
788 '(begin
789 ;; Install Scheme files in …/guile/site/X.Y.
790 (substitute* (find-files "." "^Makefile\\.in$")
791 (("^(.*)dir = (.*)/guile/site(.*)" _ name prefix suffix)
792 (string-append name "dir = " prefix
793 "/guile/site/@GUILE_EFFECTIVE_VERSION@"
794 suffix)))
795 #t)))))
796 (build-system gnu-build-system)
797 (inputs
798 `(("guile-lib" ,guile-lib)
799 ("expat" ,expat)
800 ("guile" ,guile-2.2)))
801 (propagated-inputs
802 ;; The .pc file refers to 'cairo'.
803 `(("cairo" ,cairo)))
804 (native-inputs
805 `(("pkg-config" ,pkg-config)))
806 (home-page "https://www.nongnu.org/guile-cairo/")
807 (synopsis "Cairo bindings for GNU Guile")
808 (description
809 "Guile-Cairo wraps the Cairo graphics library for Guile Scheme.
810 Guile-Cairo is complete, wrapping almost all of the Cairo API. It is API
811 stable, providing a firm base on which to do graphics work. Finally, and
812 importantly, it is pleasant to use. You get a powerful and well-maintained
813 graphics library with all of the benefits of Scheme: memory management,
814 exceptions, macros, and a dynamic programming environment.")
815 (license license:lgpl3+)))
816
817 (define-public guile-rsvg
818 ;; Use a recent snapshot that supports Guile 2.2 and beyond.
819 (let ((commit "05c6a2fd67e4fea1a7c3ff776729dc931bae6678")
820 (revision "0"))
821 (package
822 (name "guile-rsvg")
823 (version (string-append "2.18.1-" revision "."
824 (string-take commit 7)))
825 (source (origin
826 (method url-fetch)
827 (uri (string-append "https://gitlab.com/wingo/guile-rsvg/"
828 "repository/archive.tar.gz?ref="
829 commit))
830 (sha256
831 (base32
832 "0vdzjx8l5nc4y2xjqs0g1rqn1zrwfsm30brh5gz00r1x41a2pvv2"))
833 (patches (search-patches "guile-rsvg-pkgconfig.patch"))
834 (modules '((guix build utils)))
835 (snippet
836 '(begin
837 (substitute* (find-files "." "Makefile\\.am")
838 (("/share/guile/site")
839 "/share/guile/site/@GUILE_EFFECTIVE_VERSION@"))
840 #t))
841 (file-name (string-append name "-" version ".tar.gz"))))
842 (build-system gnu-build-system)
843 (arguments
844 `(#:phases (modify-phases %standard-phases
845 (replace 'bootstrap
846 (lambda _
847 (invoke "autoreconf" "-vfi"))))))
848 (native-inputs `(("pkg-config" ,pkg-config)
849 ("autoconf" ,autoconf)
850 ("automake" ,automake)
851 ("libtool" ,libtool)
852 ("texinfo" ,texinfo)))
853 (inputs `(("guile" ,guile-2.2)
854 ("librsvg" ,librsvg)
855 ("guile-lib" ,guile-lib))) ;for (unit-test)
856 (propagated-inputs `(("guile-cairo" ,guile-cairo)))
857 (synopsis "Render SVG images using Cairo from Guile")
858 (description
859 "Guile-RSVG wraps the RSVG library for Guile, allowing you to render SVG
860 images onto Cairo surfaces.")
861 (home-page "http://wingolog.org/projects/guile-rsvg/")
862 (license license:lgpl2.1+))))
863
864 (define-public guile-present
865 (package
866 (name "guile-present")
867 (version "0.3.0")
868 (source (origin
869 (method url-fetch)
870 (uri (string-append "http://wingolog.org/pub/guile-present/"
871 "guile-present-" version ".tar.gz"))
872 (sha256
873 (base32
874 "1qam447m05sxxv6x8dlzg7qnyfc4dh8apjw1idpfhpns671gfr6m"))
875 (patches (search-patches "guile-present-coding.patch"))))
876 (build-system gnu-build-system)
877 (arguments
878 '(#:phases
879 (modify-phases %standard-phases
880 (add-after 'install 'post-install
881 (lambda* (#:key inputs outputs #:allow-other-keys)
882 (let* ((out (assoc-ref outputs "out"))
883 (bin (string-append out "/bin"))
884 (guile (assoc-ref inputs "guile")))
885 (substitute* (find-files bin ".*")
886 (("guile")
887 (string-append guile "/bin/guile -L "
888 out "/share/guile/site/2.0 -C "
889 out "/share/guile/site/2.0 "))))
890 #t)))))
891 (native-inputs `(("pkg-config" ,pkg-config)))
892 (inputs `(("guile" ,guile-2.2)))
893 (propagated-inputs
894 ;; These are used by the (present …) modules.
895 `(("guile-lib" ,guile-lib)
896 ("guile-cairo" ,guile-cairo)
897 ("guile-rsvg" ,guile-rsvg)))
898 (home-page "http://wingolog.org/software/guile-present/")
899 (synopsis "Create SVG or PDF presentations in Guile")
900 (description
901 "Guile-Present defines a declarative vocabulary for presentations,
902 together with tools to render presentation documents as SVG or PDF.
903 Guile-Present can be used to make presentations programmatically, but also
904 includes a tools to generate PDF presentations out of Org mode and Texinfo
905 documents.")
906 (license license:lgpl3+)))
907
908 (define-public guile-gnome
909 (package
910 (name "guile-gnome")
911 (version "2.16.5")
912 (source (origin
913 (method url-fetch)
914 (uri
915 (string-append "mirror://gnu/" name
916 "/guile-gnome-platform/guile-gnome-platform-"
917 version ".tar.gz"))
918 (sha256
919 (base32
920 "1gnf3j96nip5kl99a268i0dy1hj7s1cfs66sps3zwysnkd7qr399"))))
921 (build-system gnu-build-system)
922 (native-inputs
923 `(("pkg-config" ,pkg-config)
924 ("atk" ,atk)
925 ;;("corba" ,corba) ; not packaged yet
926 ("gconf" ,gconf)
927 ("gobject-introspection" ,gobject-introspection)
928 ;;("gthread" ,gthread) ; not packaged yet
929 ("gnome-vfs" ,gnome-vfs)
930 ("gdk-pixbuf" ,gdk-pixbuf)
931 ("gtk+" ,gtk+-2)
932 ("libglade" ,libglade)
933 ("libgnome" ,libgnome)
934 ("libgnomecanvas" ,libgnomecanvas)
935 ("libgnomeui" ,libgnomeui)
936 ("pango" ,pango)
937 ("libffi" ,libffi)
938 ("glib" ,glib)))
939 (inputs `(("guile" ,guile-2.2)))
940 (propagated-inputs
941 `(("guile-cairo" ,guile-cairo)
942 ("g-wrap" ,g-wrap)
943 ("guile-lib" ,guile-lib)))
944 (arguments
945 `(#:tests? #f ;FIXME
946 #:phases (modify-phases %standard-phases
947 (add-before 'configure 'pre-configure
948 (lambda* (#:key outputs #:allow-other-keys)
949 (let ((out (assoc-ref outputs "out")))
950 (substitute* (find-files "." "^Makefile.in$")
951 (("guilesite :=.*guile/site" all)
952 (string-append all "/@GUILE_EFFECTIVE_VERSION@")))
953 #t))))))
954 (outputs '("out" "debug"))
955 (synopsis "Guile interface for GTK+ programming for GNOME")
956 (description
957 "Includes guile-clutter, guile-gnome-gstreamer,
958 guile-gnome-platform (GNOME developer libraries), and guile-gtksourceview.")
959 (home-page "https://www.gnu.org/software/guile-gnome/")
960 (license license:gpl2+)
961 (properties '((upstream-name . "guile-gnome-platform")
962 (ftp-directory . "/gnu/guile-gnome/guile-gnome-platform")))))
963
964 ;;;
965 ;;; C++ bindings.
966 ;;;
967
968 (define-public cairomm
969 (package
970 (name "cairomm")
971 (version "1.12.2")
972 (source (origin
973 (method url-fetch)
974 (uri (string-append "https://www.cairographics.org/releases/"
975 name "-" version ".tar.gz"))
976 (sha256
977 (base32
978 "16fmigxsaz85c3lgcls7biwyz8zy8c8h3jndfm54cxxas3a7zi25"))))
979 (build-system gnu-build-system)
980 (arguments
981 ;; The examples lack -lcairo.
982 '(#:make-flags '("LDFLAGS=-lcairo")))
983 (native-inputs `(("pkg-config" ,pkg-config)))
984 (propagated-inputs
985 `(("libsigc++" ,libsigc++)
986 ("freetype" ,freetype)
987 ("fontconfig" ,fontconfig)
988 ("cairo" ,cairo)))
989 (home-page "https://cairographics.org/")
990 (synopsis "C++ bindings to the Cairo 2D graphics library")
991 (description
992 "Cairomm provides a C++ programming interface to the Cairo 2D graphics
993 library.")
994 (license license:lgpl2.0+)))
995
996 (define-public pangomm
997 (package
998 (name "pangomm")
999 (version "2.40.1")
1000 (source (origin
1001 (method url-fetch)
1002 (uri (string-append "mirror://gnome/sources/" name "/"
1003 (version-major+minor version) "/"
1004 name "-" version ".tar.xz"))
1005 (sha256
1006 (base32
1007 "1bz3gciff23bpw9bqc4v2l3lkq9w7394v3a4jxkvx0ap5lmfwqlp"))))
1008 (build-system gnu-build-system)
1009 (native-inputs `(("pkg-config" ,pkg-config)))
1010 (propagated-inputs
1011 `(("cairo" ,cairo)
1012 ("cairomm" ,cairomm)
1013 ("glibmm" ,glibmm)
1014 ("pango" ,pango)))
1015 (home-page "http://www.pango.org/")
1016 (synopsis "C++ interface to the Pango text rendering library")
1017 (description
1018 "Pangomm provides a C++ programming interface to the Pango text rendering
1019 library.")
1020 (license license:lgpl2.1+)))
1021
1022 (define-public atkmm
1023 (package
1024 (name "atkmm")
1025 (version "2.24.2")
1026 (source (origin
1027 (method url-fetch)
1028 (uri (string-append "mirror://gnome/sources/" name "/"
1029 (version-major+minor version) "/"
1030 name "-" version ".tar.xz"))
1031 (sha256
1032 (base32
1033 "1gaqwhviadsmy0fsr47686yglv1p4mpkamj0in127bz2b5bki5gz"))))
1034 (build-system gnu-build-system)
1035 (native-inputs `(("pkg-config" ,pkg-config)))
1036 (propagated-inputs
1037 `(("glibmm" ,glibmm) ("atk" ,atk)))
1038 (home-page "https://www.gtkmm.org")
1039 (synopsis "C++ interface to the ATK accessibility library")
1040 (description
1041 "ATKmm provides a C++ programming interface to the ATK accessibility
1042 toolkit.")
1043 (license license:lgpl2.1+)))
1044
1045 (define-public gtkmm
1046 (package
1047 (name "gtkmm")
1048 (version "3.22.2")
1049 (source (origin
1050 (method url-fetch)
1051 (uri (string-append "mirror://gnome/sources/" name "/"
1052 (version-major+minor version) "/"
1053 name "-" version ".tar.xz"))
1054 (sha256
1055 (base32
1056 "1400535lhyya462pfx8bp11k3mg3jsbdghlpygskd5ai665dkbwi"))))
1057 (build-system gnu-build-system)
1058 (native-inputs `(("pkg-config" ,pkg-config)
1059 ("glib" ,glib "bin") ;for 'glib-compile-resources'
1060 ("xorg-server" ,xorg-server-for-tests)))
1061 (propagated-inputs
1062 `(("pangomm" ,pangomm)
1063 ("cairomm" ,cairomm)
1064 ("atkmm" ,atkmm)
1065 ("gtk+" ,gtk+)
1066 ("glibmm" ,glibmm)))
1067 (arguments
1068 `(;; XXX: Tests require C++14 or later. Remove this when the default
1069 ;; compiler is >= GCC6.
1070 #:configure-flags '("CXXFLAGS=-std=gnu++14")
1071 #:disallowed-references (,xorg-server-for-tests)
1072 #:phases (modify-phases %standard-phases
1073 (add-before 'check 'run-xvfb
1074 (lambda* (#:key inputs #:allow-other-keys)
1075 (let ((xorg-server (assoc-ref inputs "xorg-server")))
1076 ;; Tests such as 'object_move/test' require a running
1077 ;; X server.
1078 (system (string-append xorg-server "/bin/Xvfb :1 &"))
1079 (setenv "DISPLAY" ":1")
1080 ;; Don't fail because of the missing /etc/machine-id.
1081 (setenv "DBUS_FATAL_WARNINGS" "0")
1082 #t))))))
1083 (home-page "https://gtkmm.org/")
1084 (synopsis
1085 "C++ interface to the GTK+ graphical user interface library")
1086 (description
1087 "gtkmm is the official C++ interface for the popular GUI library GTK+.
1088 Highlights include typesafe callbacks, and a comprehensive set of widgets that
1089 are easily extensible via inheritance. You can create user interfaces either
1090 in code or with the Glade User Interface designer, using libglademm. There's
1091 extensive documentation, including API reference and a tutorial.")
1092 (license license:lgpl2.1+)))
1093
1094
1095 (define-public gtkmm-2
1096 (package (inherit gtkmm)
1097 (name "gtkmm")
1098 (version "2.24.5")
1099 (source (origin
1100 (method url-fetch)
1101 (uri (string-append "mirror://gnome/sources/" name "/"
1102 (version-major+minor version) "/"
1103 name "-" version ".tar.xz"))
1104 (sha256
1105 (base32
1106 "0wkbzvsx4kgw16f6xjdc1dz7f77ldngdila4yi5lw2zrgcxsb006"))))
1107 (arguments
1108 '(#:configure-flags '("CPPFLAGS=-std=c++11"))) ; required by libsigc++
1109 (native-inputs `(("pkg-config" ,pkg-config)))
1110 (propagated-inputs
1111 `(("pangomm" ,pangomm)
1112 ("cairomm" ,cairomm)
1113 ("atkmm" ,atkmm)
1114 ("gtk+" ,gtk+-2)
1115 ("glibmm" ,glibmm)))))
1116
1117 (define-public gtksourceviewmm
1118 (package
1119 (name "gtksourceviewmm")
1120 (version "3.18.0")
1121 (source (origin
1122 (method url-fetch)
1123 (uri (string-append "mirror://gnome/sources/" name "/"
1124 (version-major+minor version) "/"
1125 name "-" version ".tar.xz"))
1126 (sha256
1127 (base32 "0fgvmhm4h4qmxig87qvangs6ijw53mi40siz7pixlxbrsgiil22i"))))
1128 (build-system gnu-build-system)
1129 (native-inputs
1130 `(("pkg-config" ,pkg-config)))
1131 (propagated-inputs
1132 ;; In 'Requires' of gtksourceviewmm-3.0.pc.
1133 `(("glibmm" ,glibmm)
1134 ("gtkmm" ,gtkmm)
1135 ("gtksourceview" ,gtksourceview)))
1136 (synopsis "C++ interface to the GTK+ 'GtkTextView' widget")
1137 (description
1138 "gtksourceviewmm is a portable C++ library that extends the standard GTK+
1139 framework for multiline text editing with support for configurable syntax
1140 highlighting, unlimited undo/redo, search and replace, a completion framework,
1141 printing and other features typical of a source code editor.")
1142 (license license:lgpl2.1+)
1143 (home-page "https://developer.gnome.org/gtksourceview/")))
1144
1145 ;;;
1146 ;;; Python bindings.
1147 ;;;
1148
1149 (define-public python-pycairo
1150 (package
1151 (name "python-pycairo")
1152 (version "1.17.1")
1153 (source
1154 (origin
1155 (method url-fetch)
1156 (uri (string-append "https://github.com/pygobject/pycairo/releases/download/v"
1157 version "/pycairo-" version ".tar.gz"))
1158 (sha256
1159 (base32
1160 "165n0g7gp2a0qi8558snvfans17x83jv2lv7bx4vr1rxjbn3a2hg"))))
1161 (build-system python-build-system)
1162 (native-inputs
1163 `(("pkg-config" ,pkg-config)
1164 ("python-pytest" ,python-pytest)))
1165 (propagated-inputs ;pycairo.pc references cairo
1166 `(("cairo" ,cairo)))
1167 (home-page "https://cairographics.org/pycairo/")
1168 (synopsis "Python bindings for cairo")
1169 (description
1170 "Pycairo is a set of Python bindings for the Cairo graphics library.")
1171 (license license:lgpl3+)
1172 (properties `((python2-variant . ,(delay python2-pycairo))))))
1173
1174 (define-public python2-pycairo
1175 (let ((pycairo (package-with-python2
1176 (strip-python2-variant python-pycairo))))
1177 (package
1178 (inherit pycairo)
1179 (propagated-inputs
1180 `(("python2-funcsigs" ,python2-funcsigs)
1181 ,@(package-propagated-inputs pycairo)))
1182 ;; Dual-licensed under LGPL 2.1 or Mozilla Public License 1.1
1183 (license (list license:lgpl2.1 license:mpl1.1)))))
1184
1185 (define-public python2-pygtk
1186 (package
1187 (name "python2-pygtk")
1188 (version "2.24.0")
1189 (source
1190 (origin
1191 (method url-fetch)
1192 (uri (string-append "mirror://gnome/sources"
1193 "/pygtk/" (version-major+minor version)
1194 "/pygtk-" version ".tar.bz2"))
1195 (sha256
1196 (base32
1197 "04k942gn8vl95kwf0qskkv6npclfm31d78ljkrkgyqxxcni1w76d"))))
1198 (build-system gnu-build-system)
1199 (outputs '("out"
1200 "doc")) ;13 MiB of gtk-doc HTML
1201 (native-inputs
1202 `(("pkg-config" ,pkg-config)))
1203 (inputs
1204 `(("python" ,python-2)
1205 ("libglade" ,libglade)
1206 ("glib" ,glib)))
1207 (propagated-inputs
1208 `(("python-pycairo" ,python2-pycairo) ;loaded at runtime
1209 ("python-pygobject" ,python2-pygobject-2) ;referenced in pc file
1210 ("gtk+" ,gtk+-2)))
1211 (arguments
1212 `(#:tests? #f
1213 #:phases (modify-phases %standard-phases
1214 (add-before 'configure 'set-gtk-doc-directory
1215 (lambda* (#:key outputs #:allow-other-keys)
1216 ;; Install documentation to "doc".
1217 (let ((doc (assoc-ref outputs "doc")))
1218 (substitute* "docs/Makefile.in"
1219 (("TARGET_DIR = \\$\\(datadir\\)")
1220 (string-append "TARGET_DIR = " doc))))))
1221 (add-after 'configure 'fix-codegen
1222 (lambda* (#:key inputs #:allow-other-keys)
1223 (substitute* "pygtk-codegen-2.0"
1224 (("^prefix=.*$")
1225 (string-append
1226 "prefix="
1227 (assoc-ref inputs "python-pygobject") "\n")))))
1228 (add-after 'install 'install-pth
1229 (lambda* (#:key inputs outputs #:allow-other-keys)
1230 ;; pygtk's modules are stored in a subdirectory of
1231 ;; python's site-packages directory. Add a .pth file so
1232 ;; that python will add that subdirectory to its module
1233 ;; search path.
1234 (let* ((out (assoc-ref outputs "out"))
1235 (site (string-append out "/lib/python"
1236 ,(version-major+minor
1237 (package-version python-2))
1238 "/site-packages")))
1239 (call-with-output-file (string-append site "/pygtk.pth")
1240 (lambda (port)
1241 (format port "gtk-2.0~%")))))))))
1242 (home-page "http://www.pygtk.org/")
1243 (synopsis "Python bindings for GTK+")
1244 (description
1245 "PyGTK allows you to write full featured GTK programs in Python. It is
1246 targeted at GTK 2.x, and can be used in conjunction with gnome-python to
1247 write GNOME applications.")
1248 (license license:lgpl2.1+)))
1249
1250 (define-public perl-cairo
1251 (package
1252 (name "perl-cairo")
1253 (version "1.106")
1254 (source (origin
1255 (method url-fetch)
1256 (uri (string-append
1257 "mirror://cpan/authors/id/X/XA/XAOC/Cairo-"
1258 version ".tar.gz"))
1259 (sha256
1260 (base32
1261 "1i25kks408c54k2zxskvg54l5k3qadzm8n72ffga9jy7ic0h6j76"))))
1262 (build-system perl-build-system)
1263 (native-inputs
1264 `(("perl-extutils-depends" ,perl-extutils-depends)
1265 ("perl-extutils-pkgconfig" ,perl-extutils-pkgconfig)))
1266 (inputs
1267 `(("cairo" ,cairo)))
1268 (home-page "https://metacpan.org/release/Cairo")
1269 (synopsis "Perl interface to the cairo 2d vector graphics library")
1270 (description "Cairo provides Perl bindings for the vector graphics library
1271 cairo. It supports multiple output targets, including PNG, PDF and SVG. Cairo
1272 produces identical output on all those targets.")
1273 (license license:lgpl2.1+)))
1274
1275 (define-public perl-gtk2
1276 (package
1277 (name "perl-gtk2")
1278 (version "1.24992")
1279 (source (origin
1280 (method url-fetch)
1281 (uri (string-append "mirror://cpan/authors/id/X/XA/XAOC/Gtk2-"
1282 version ".tar.gz"))
1283 (sha256
1284 (base32
1285 "1044rj3wbfmgaif2jb0k28m2aczli6ai2n5yvn6pr7zjyw16kvd2"))))
1286 (build-system perl-build-system)
1287 (native-inputs
1288 `(("perl-extutils-depends" ,perl-extutils-depends)
1289 ("perl-extutils-pkgconfig" ,perl-extutils-pkgconfig)))
1290 (inputs
1291 `(("gtk+" ,gtk+-2)))
1292 (propagated-inputs
1293 `(("perl-pango" ,perl-pango)))
1294 (home-page "https://metacpan.org/release/Gtk2")
1295 (synopsis "Perl interface to the 2.x series of the Gimp Toolkit library")
1296 (description "Perl bindings to the 2.x series of the Gtk+ widget set.
1297 This module allows you to write graphical user interfaces in a Perlish and
1298 object-oriented way, freeing you from the casting and memory management in C,
1299 yet remaining very close in spirit to original API.")
1300 (license license:lgpl2.1+)))
1301
1302 (define-public perl-pango
1303 (package
1304 (name "perl-pango")
1305 (version "1.227")
1306 (source (origin
1307 (method url-fetch)
1308 (uri (string-append "mirror://cpan/authors/id/X/XA/XAOC/Pango-"
1309 version ".tar.gz"))
1310 (sha256
1311 (base32
1312 "0wdcidnfnb6nm79fzfs39ivawj3x8m98a147fmcxgv1zvwia9c1l"))))
1313 (build-system perl-build-system)
1314 (native-inputs
1315 `(("perl-extutils-depends" ,perl-extutils-depends)
1316 ("perl-extutils-pkgconfig" ,perl-extutils-pkgconfig)))
1317 (inputs
1318 `(("pango" ,pango)))
1319 (propagated-inputs
1320 `(("perl-cairo" ,perl-cairo)
1321 ("perl-glib" ,perl-glib)))
1322 (home-page "https://metacpan.org/release/Pango")
1323 (synopsis "Layout and render international text")
1324 (description "Pango is a library for laying out and rendering text, with an
1325 emphasis on internationalization. Pango can be used anywhere that text layout
1326 is needed, but using Pango in conjunction with Cairo and/or Gtk2 provides a
1327 complete solution with high quality text handling and graphics rendering.
1328
1329 Dynamically loaded modules handle text layout for particular combinations of
1330 script and font backend. Pango provides a wide selection of modules, including
1331 modules for Hebrew, Arabic, Hangul, Thai, and a number of Indic scripts.
1332 Virtually all of the world's major scripts are supported.
1333
1334 In addition to the low level layout rendering routines, Pango includes
1335 @code{Pango::Layout}, a high level driver for laying out entire blocks of text,
1336 and routines to assist in editing internationalized text.")
1337 (license license:lgpl2.1+)))
1338
1339 (define-public girara
1340 (package
1341 (name "girara")
1342 (version "0.2.9")
1343 (source (origin
1344 (method url-fetch)
1345 (uri
1346 (string-append "https://pwmt.org/projects/girara/download/girara-"
1347 version ".tar.xz"))
1348 (sha256
1349 (base32
1350 "0lkxrfna818wkkr2f6mdzf15y5z8xl1b9592ylmzjbqsqya3w7x8"))))
1351 (native-inputs `(("pkg-config" ,pkg-config)
1352 ("check" ,check)
1353 ("gettext" ,gettext-minimal)
1354 ("glib:bin" ,glib "bin")
1355 ("xorg-server" ,xorg-server-for-tests)))
1356 ;; Listed in 'Requires.private' of 'girara.pc'.
1357 (propagated-inputs `(("gtk+" ,gtk+)))
1358 (arguments
1359 `(#:phases (modify-phases %standard-phases
1360 (add-before 'check 'start-xserver
1361 ;; Tests require a running X server.
1362 (lambda* (#:key inputs #:allow-other-keys)
1363 (let ((xorg-server (assoc-ref inputs "xorg-server"))
1364 (display ":1"))
1365 (setenv "DISPLAY" display)
1366
1367 ;; On busy machines, tests may take longer than
1368 ;; the default of four seconds.
1369 (setenv "CK_DEFAULT_TIMEOUT" "20")
1370
1371 ;; Don't fail due to missing '/etc/machine-id'.
1372 (setenv "DBUS_FATAL_WARNINGS" "0")
1373 (zero? (system (string-append xorg-server "/bin/Xvfb "
1374 display " &")))))))))
1375 (build-system meson-build-system)
1376 (home-page "https://pwmt.org/projects/girara/")
1377 (synopsis "Library for minimalistic gtk+3 user interfaces")
1378 (description "Girara is a library that implements a user interface that
1379 focuses on simplicity and minimalism. Currently based on GTK+, a
1380 cross-platform widget toolkit, it provides an interface that focuses on three
1381 main components: a so-called view widget that represents the actual
1382 application, an input bar that is used to execute commands of the
1383 application and the status bar which provides the user with current
1384 information.")
1385 (license license:zlib)))
1386
1387 (define-public gtk-doc
1388 (package
1389 (name "gtk-doc")
1390 (version "1.27")
1391 (source (origin
1392 (method url-fetch)
1393 (uri (string-append "mirror://gnome/sources/" name "/"
1394 (version-major+minor version) "/"
1395 name "-" version ".tar.xz"))
1396 (sha256
1397 (base32
1398 "0vwsdl61nvnmqswlz5j9m4hg7qirhazwcikcnqf9nx0c13vx6sz2"))))
1399 (build-system gnu-build-system)
1400 (arguments
1401 `(#:parallel-tests? #f
1402 #:phases
1403 (modify-phases %standard-phases
1404 (add-after 'unpack 'patch-gtk-doc-scan
1405 (lambda* (#:key inputs #:allow-other-keys)
1406 (substitute* "gtk-doc.xsl"
1407 (("http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl")
1408 (string-append (assoc-ref inputs "docbook-xsl")
1409 "/xml/xsl/docbook-xsl-"
1410 ,(package-version docbook-xsl)
1411 "/html/chunk.xsl")))
1412 #t))
1413 (add-after 'patch-gtk-doc-scan 'patch-test-out
1414 (lambda _
1415 ;; sanity.sh counts the number of status lines. Since our
1416 ;; texlive regenerates the fonts every time and the font
1417 ;; generator metafont outputs a lot of extra lines, this
1418 ;; test would always fail. Disable it for now.
1419 (substitute* "tests/Makefile.in"
1420 (("empty.sh sanity.sh") "empty.sh"))
1421 #t))
1422 (add-before 'build 'set-HOME
1423 (lambda _
1424 ;; FIXME: dblatex with texlive-union does not find the built
1425 ;; metafonts, so it tries to generate them in HOME.
1426 (setenv "HOME" "/tmp")
1427 #t))
1428 (add-before 'configure 'fix-docbook
1429 (lambda* (#:key inputs #:allow-other-keys)
1430 (substitute* "configure"
1431 ;; The configure check is overzealous about making sure that
1432 ;; things are in place -- it uses the xmlcatalog tool to make
1433 ;; sure that docbook-xsl is available, but this tool can only
1434 ;; look in one catalog file, unlike the $XML_CATALOG_FILES
1435 ;; variable that Guix defines. Fool the test by using the
1436 ;; docbook-xsl catalog explicitly and get on with life.
1437 (("\"\\$XML_CATALOG_FILE\" \
1438 \"http://docbook.sourceforge.net/release/xsl/")
1439 (string-append (car (find-files (assoc-ref inputs "docbook-xsl")
1440 "^catalog.xml$"))
1441 " \"http://docbook.sourceforge.net/release/xsl/")))
1442 #t))
1443 (add-after 'install 'wrap-executables
1444 (lambda* (#:key outputs #:allow-other-keys)
1445 (let ((out (assoc-ref outputs "out")))
1446 (for-each (lambda (prog)
1447 (wrap-program prog
1448 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))))
1449 (find-files (string-append out "/bin")))
1450 #t))))
1451 #:configure-flags
1452 (list (string-append "--with-xml-catalog="
1453 (assoc-ref %build-inputs "docbook-xml")
1454 "/xml/dtd/docbook/catalog.xml"))))
1455 (native-inputs
1456 `(("pkg-config" ,pkg-config)
1457 ("itstool" ,itstool)
1458 ("libxml" ,libxml2)
1459 ("gettext" ,gettext-minimal)
1460 ("bc" ,bc)))
1461 (inputs
1462 `(("perl" ,perl)
1463 ("python" ,python)
1464 ("xsltproc" ,libxslt)
1465 ("dblatex" ,dblatex)
1466 ("docbook-xml" ,docbook-xml-4.3)
1467 ("docbook-xsl" ,docbook-xsl)
1468 ("source-highlight" ,source-highlight)
1469 ("glib" ,glib)
1470 ("python-six" ,python-six)))
1471 (home-page "https://www.gtk.org/gtk-doc/")
1472 (synopsis "Documentation generator from C source code")
1473 (description
1474 "GTK-Doc generates API documentation from comments added to C code. It is
1475 typically used to document the public API of GTK+ and GNOME libraries, but it
1476 can also be used to document application code.")
1477 (license license:gpl2+)))
1478
1479 (define-public gtk-engines
1480 (package
1481 (name "gtk-engines")
1482 (version "2.20.2")
1483 (source (origin
1484 (method url-fetch)
1485 (uri (string-append "mirror://gnome/sources/" name "/"
1486 (version-major+minor version) "/"
1487 name "-" version ".tar.bz2"))
1488 (sha256
1489 (base32
1490 "1db65pb0j0mijmswrvpgkdabilqd23x22d95hp5kwxvcramq1dhm"))))
1491 (build-system gnu-build-system)
1492 (arguments
1493 `(#:configure-flags
1494 `("--enable-animation")))
1495 (native-inputs
1496 `(("pkg-config" ,pkg-config)
1497 ("intltool" ,intltool)))
1498 (inputs
1499 ;; Don't propagate GTK+ to reduce "profile pollution".
1500 `(("gtk+" ,gtk+-2))) ; required by gtk-engines-2.pc
1501 (home-page "https://live.gnome.org/GnomeArt")
1502 (synopsis "Theming engines for GTK+ 2.x")
1503 (description
1504 "This package contains the standard GTK+ 2.x theming engines including
1505 Clearlooks, Crux, High Contrast, Industrial, LighthouseBlue, Metal, Mist,
1506 Redmond95 and ThinIce.")
1507 (license (list license:gpl2+ license:lgpl2.1+))))
1508
1509 (define-public murrine
1510 (package
1511 (name "murrine")
1512 (version "0.98.2")
1513 (source (origin
1514 (method url-fetch)
1515 (uri (string-append "mirror://gnome/sources/" name "/"
1516 (version-major+minor version) "/"
1517 name "-" version ".tar.xz"))
1518 (sha256
1519 (base32
1520 "129cs5bqw23i76h3nmc29c9mqkm9460iwc8vkl7hs4xr07h8mip9"))))
1521 (build-system gnu-build-system)
1522 (arguments
1523 `(#:configure-flags
1524 `("--enable-animation"
1525 "--enable-animationrtl")))
1526 (native-inputs
1527 `(("pkg-config" ,pkg-config)
1528 ("intltool" ,intltool)))
1529 (propagated-inputs
1530 `(("gtk+" ,gtk+-2)))
1531 (home-page "https://live.gnome.org/GnomeArt")
1532 (synopsis "Cairo-based theming engine for GTK+ 2.x")
1533 (description
1534 "Murrine is a cairo-based GTK+ theming engine. It is named after the
1535 glass artworks done by Venicians glass blowers.")
1536 (license license:gpl2+)))
1537
1538 (define-public gtkspell3
1539 (package
1540 (name "gtkspell3")
1541 (version "3.0.9")
1542 (source (origin
1543 (method url-fetch)
1544 (uri (string-append "mirror://sourceforge/gtkspell/"
1545 version "/" name "-" version ".tar.xz"))
1546 (sha256
1547 (base32
1548 "09jdicmpipmj4v84gnkqwbmj4lh8v0i6pn967rb9jx4zg2ia9x54"))))
1549 (build-system gnu-build-system)
1550 (native-inputs
1551 `(("intltool" ,intltool)
1552 ("pkg-config" ,pkg-config)))
1553 (inputs
1554 `(("gobject-introspection" ,gobject-introspection)
1555 ("gtk+" ,gtk+)
1556 ("pango" ,pango)))
1557 (propagated-inputs
1558 `(("enchant" ,enchant-1.6))) ;gtkspell3-3.0.pc refers to it
1559 (home-page "http://gtkspell.sourceforge.net")
1560 (synopsis "Spell-checking addon for GTK's TextView widget")
1561 (description
1562 "GtkSpell provides word-processor-style highlighting and replacement of
1563 misspelled words in a GtkTextView widget.")
1564 (license license:gpl2+)))
1565
1566 (define-public clipit
1567 (package
1568 (name "clipit")
1569 (version "1.4.2")
1570 (source (origin
1571 (method url-fetch)
1572 (uri (string-append
1573 "https://github.com/downloads/ClipIt/clipit-"
1574 version ".tar.gz"))
1575 (sha256
1576 (base32
1577 "0jrwn8qfgb15rwspdp1p8hb1nc0ngmpvgr87d4k3lhlvqg2cfqva"))))
1578 (build-system gnu-build-system)
1579 (native-inputs
1580 `(("intltool" ,intltool)
1581 ("pkg-config" ,pkg-config)))
1582 (inputs
1583 `(("gtk+" ,gtk+-2)))
1584 (home-page "https://github.com/CristianHenzel/ClipIt")
1585 (synopsis "Lightweight GTK+ clipboard manager")
1586 (description
1587 "ClipIt is a clipboard manager with features such as a history, search
1588 thereof, global hotkeys and clipboard item actions. It was forked from
1589 Parcellite and adds bugfixes and features.")
1590 (license license:gpl2+)))
1591
1592 (define-public graphene
1593 (package
1594 (name "graphene")
1595 (version "1.6.0")
1596 (source (origin
1597 (method url-fetch)
1598 (uri (string-append
1599 "https://github.com/ebassi/graphene/archive/"
1600 version ".tar.gz"))
1601 (file-name (string-append name "-" version ".tar.gz"))
1602 (sha256
1603 (base32 "1zd2daj7y590wnzn4jw0niyc4fnzgxrcl9i7nwhy8b25ks2hz5wq"))))
1604 (build-system gnu-build-system)
1605 (arguments
1606 `(#:configure-flags '("--enable-introspection=yes")
1607 #:phases
1608 (modify-phases %standard-phases
1609 (add-before 'configure 'autogen
1610 (lambda _
1611 (zero? (system* "./autogen.sh")))))))
1612 (native-inputs
1613 `(("autoconf" ,autoconf)
1614 ("which" ,which)
1615 ("pkg-config" ,pkg-config)
1616 ("automake" ,automake)
1617 ("libtool" ,libtool)))
1618 (inputs
1619 `(("python" ,python)
1620 ("python-2" ,python-2)
1621 ("glib" ,glib)
1622 ("gobject-introspection" ,gobject-introspection)))
1623 (home-page "http://ebassi.github.io/graphene")
1624 (synopsis "Thin layer of graphic data types")
1625 (description "This library provides graphic types and their relative API;
1626 it does not deal with windowing system surfaces, drawing, scene graphs, or
1627 input.")
1628 (license license:expat)))
1629
1630 (define-public yad
1631 (package
1632 (name "yad")
1633 (version "0.40.3")
1634 (source
1635 (origin
1636 (method git-fetch)
1637 (uri (git-reference
1638 (url "https://github.com/v1cont/yad.git")
1639 (commit (string-append "v" version))))
1640 (file-name (git-file-name name version))
1641 (sha256
1642 (base32 "1vpgbjbkkbk5plicyklzpf65j1vlig4n4bi3qpvrz5bb09ic5alw"))))
1643 (build-system gnu-build-system)
1644 (arguments
1645 `(#:configure-flags
1646 '("--with-gtk=gtk3"
1647 "--enable-html"
1648 "--enable-gio"
1649 "--enable-spell"
1650 "--enable-icon-browser")
1651 #:phases
1652 (modify-phases %standard-phases
1653 (replace 'bootstrap
1654 (lambda _
1655 (invoke "autoreconf" "-vif")
1656 (invoke "intltoolize" "--force" "--automake")
1657 #t)))))
1658 (inputs
1659 `(("gtk+" ,gtk+)))
1660 (native-inputs
1661 `(("autoconf" ,autoconf)
1662 ("automake" ,automake)
1663 ("intltool" ,intltool)
1664 ("pkg-config" ,pkg-config)))
1665 (home-page "https://sourceforge.net/projects/yad-dialog/")
1666 (synopsis "GTK+ dialog boxes for shell scripts")
1667 (description
1668 "This program allows you to display GTK+ dialog boxes from command line or
1669 shell scripts. Example of how to use @code{yad} can be consulted at
1670 @url{https://sourceforge.net/p/yad-dialog/wiki/browse_pages/}.")
1671 (license license:gpl3+)))