1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
6 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages gtk)
24 #:use-module ((guix licenses) #:prefix license:)
25 #:use-module (guix utils)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix build-system python)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages fontutils)
32 #:use-module (gnu packages ghostscript)
33 #:use-module (gnu packages glib)
34 #:use-module (gnu packages gnome)
35 #:use-module (gnu packages icu4c)
36 #:use-module (gnu packages image)
37 #:use-module (gnu packages pdf)
38 #:use-module (gnu packages perl)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages python)
41 #:use-module (gnu packages guile)
42 #:use-module (gnu packages cups)
43 #:use-module (gnu packages xml)
44 #:use-module (gnu packages xorg)
45 #:use-module (gnu packages xdisorg))
53 (uri (string-append "mirror://gnome/sources/" name "/"
54 (version-major+minor version) "/"
55 name "-" version ".tar.xz"))
58 "177a9x6lz2im0mfgxv2crv0l740wy7rg5vlnb8wyyf4fmnh0q19f")))) ; 2.15.3
59 (build-system gnu-build-system)
60 (inputs `(("glib" ,glib)))
62 `(("pkg-config" ,pkg-config)
63 ("glib" ,glib "bin") ; glib-mkenums, etc.
64 ("gobject-introspection" ,gobject-introspection))) ; g-ir-compiler, etc.
65 (synopsis "GNOME accessibility toolkit")
67 "ATK provides the set of accessibility interfaces that are implemented
68 by other toolkits and applications. Using the ATK interfaces, accessibility
69 tools have full access to view and control running applications.")
70 (license license:lgpl2.0+)
71 (home-page "https://developer.gnome.org/atk/")))
79 (uri (string-append "http://cairographics.org/releases/cairo-"
83 "1dpmlxmmigpiyv0jchjsn2l1a29655x24g5073hy8p4lmjvz0nfw"))))
84 (build-system gnu-build-system)
86 `(("fontconfig" ,fontconfig)
87 ("freetype" ,freetype)
92 ("libxrender" ,libxrender)
95 `(("ghostscript" ,ghostscript)
96 ("libspectre" ,libspectre)
98 ("xextproto" ,xextproto)
101 `(("pkg-config" ,pkg-config)
102 ("python" ,python-wrapper)))
104 `(#:tests? #f)) ; see http://lists.gnu.org/archive/html/bug-guix/2013-06/msg00085.html
105 (synopsis "2D graphics library")
107 "Cairo is a 2D graphics library with support for multiple output devices.
108 Currently supported output targets include the X Window System (via both
109 Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file
110 output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB.
112 Cairo is designed to produce consistent output on all output media while
113 taking advantage of display hardware acceleration when available
114 eg. through the X Render Extension).
116 The cairo API provides operations similar to the drawing operators of
117 PostScript and PDF. Operations in cairo including stroking and filling cubic
118 Bézier splines, transforming and compositing translucent images, and
119 antialiased text rendering. All drawing operations can be transformed by any
120 affine transformation (scale, rotation, shear, etc.)")
121 (license license:lgpl2.1) ; or Mozilla Public License 1.1
122 (home-page "http://cairographics.org/")))
124 (define-public harfbuzz
130 (uri (string-append "http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-"
134 "1nkimwadri6v2kzrmz8y0crmy59gw0kg4i4f6cc786bngs0815lq"))))
135 (build-system gnu-build-system)
138 ("graphite2" ,graphite2)
141 `(("pkg-config" ,pkg-config)
142 ("python" ,python-wrapper)))
144 `(#:configure-flags `("--with-graphite2=yes")))
145 (synopsis "OpenType text shaping engine")
147 "HarfBuzz is an OpenType text shaping engine.")
148 (license (license:x11-style "file://COPYING"
149 "See 'COPYING' in the distribution."))
150 (home-page "http://www.freedesktop.org/wiki/Software/HarfBuzz/")))
158 (uri (string-append "mirror://gnome/sources/pango/"
159 (version-major+minor version) "/"
160 name "-" version ".tar.xz"))
163 "01rdzjh68w8l5zn0648yibyarj8p6g7yfn59nw5awaz1i8dvbnqq"))))
164 (build-system gnu-build-system)
167 ("harfbuzz" ,harfbuzz)))
171 ;; Some packages, such as Openbox, expect Pango to be built with the
172 ;; optional libxft support.
175 `(("pkg-config" ,pkg-config)
176 ("glib" ,glib "bin") ; glib-mkenums, etc.
177 ("gobject-introspection" ,gobject-introspection))) ; g-ir-compiler, etc.
178 (synopsis "GNOME text and font handling library")
180 "Pango is the core text and font handling library used in GNOME
181 applications. It has extensive support for the different writing systems
182 used throughout the world.")
183 (license license:lgpl2.0+)
184 (home-page "https://developer.gnome.org/pango/")))
186 (define-public pangox-compat
188 (name "pangox-compat")
192 (uri (string-append "mirror://gnome/sources/" name "/"
193 (version-major+minor version) "/"
194 name "-" version ".tar.xz"))
197 "0ip0ziys6mrqqmz4n71ays0kf5cs1xflj1gfpvs4fgy2nsrr482m"))))
198 (build-system gnu-build-system)
203 `(("intltool" ,intltool)
204 ("pkg-config" ,pkg-config)))
205 (home-page "https://developer.gnome.org/pango")
206 (synopsis "Obsolete pango functions")
207 (description "Pangox was a X backend to pango. It is now obsolete and no
208 longer provided by recent pango releases. pangox-compat provides the
209 functions which were removed.")
210 (license license:lgpl2.0+)))
213 (define-public gtksourceview
215 (name "gtksourceview")
216 (version "2.10.5") ; This is the last version which builds against gtk+2
219 (uri (string-append "mirror://gnome/sources/" name "/"
220 (version-major+minor version) "/"
221 name "-" version ".tar.bz2"))
224 "07hrabhpl6n8ajz10s0d960jdwndxs87szxyn428mpxi8cvpg1f5"))))
225 (build-system gnu-build-system)
229 ;; These two are needed only to allow the tests to run successfully.
230 ("xorg-server" ,xorg-server)
231 ("shared-mime-info" ,shared-mime-info)))
233 `(("intltool" ,intltool)
234 ("glib" ,glib "bin") ; for glib-genmarshal, etc.
235 ("pkg-config" ,pkg-config)))
238 ;; Unfortunately, some of the tests in "make check" are highly dependent
239 ;; on the environment therefore, some black magic is required.
241 'check 'start-xserver
242 (lambda* (#:key inputs #:allow-other-keys)
243 (let ((xorg-server (assoc-ref inputs "xorg-server"))
244 (mime (assoc-ref inputs "shared-mime-info")))
246 ;; There must be a running X server and make check doesn't start one.
247 ;; Therefore we must do it.
248 (system (format #f "~a/bin/Xvfb :1 &" xorg-server))
249 (setenv "DISPLAY" ":1")
251 ;; The .lang files must be found in $XDG_DATA_HOME/gtksourceview-2.0
252 (system "ln -s gtksourceview gtksourceview-2.0")
253 (setenv "XDG_DATA_HOME" (getcwd))
255 ;; Finally, the mimetypes must be available.
256 (setenv "XDG_DATA_DIRS" (string-append mime "/share/")) ))
258 (synopsis "Widget that extends the standard GTK+ 2.x 'GtkTextView' widget")
260 "GtkSourceView is a portable C library that extends the standard GTK+
261 framework for multiline text editing with support for configurable syntax
262 highlighting, unlimited undo/redo, search and replace, a completion framework,
263 printing and other features typical of a source code editor.")
264 (license license:lgpl2.0+)
265 (home-page "https://developer.gnome.org/gtksourceview/")))
267 (define-public gdk-pixbuf
273 (uri (string-append "mirror://gnome/sources/" name "/"
274 (version-major+minor version) "/"
275 name "-" version ".tar.xz"))
278 "1kajvfckn88bzcdnl73b933gmjhwjm3dhsj1yrpixhfsc4y5x9r5"))))
279 (build-system gnu-build-system)
280 (propagated-inputs ; required by gdk-pixbuf-2.0.pc
284 `(("libjpeg" ,libjpeg)
285 ("libtiff" ,libtiff)))
287 `(("pkg-config" ,pkg-config)
288 ("glib" ,glib "bin") ; glib-mkenums, etc.
289 ("gobject-introspection", gobject-introspection))) ; g-ir-compiler, etc.
290 (synopsis "GNOME image loading and manipulation library")
292 "GdkPixbuf is a library for image loading and manipulation developed
293 in the GNOME project.")
294 (license license:lgpl2.0+)
295 (home-page "https://developer.gnome.org/gdk-pixbuf/")))
297 (define-public at-spi2-core
299 (name "at-spi2-core")
303 (uri (string-append "mirror://gnome/sources/" name "/"
304 (version-major+minor version) "/"
305 name "-" version ".tar.xz"))
308 "1ns44yibdgcwzwri7sr075hfs5rh5lgxkh71247a0822az3mahcn"))))
309 (build-system gnu-build-system)
310 (inputs `(("dbus" ,dbus)
313 ("libxtst" ,libxtst)))
315 `(("intltool" ,intltool)
316 ("pkg-config" ,pkg-config)))
318 `(#:tests? #f)) ; FIXME: dbind/dbtest fails; one should disable tests in
319 ; a more fine-grained way.
320 (synopsis "Assistive Technology Service Provider Interface, core components")
322 "The Assistive Technology Service Provider Interface, core components,
323 is part of the GNOME accessibility project.")
324 (license license:lgpl2.0+)
325 (home-page "https://projects.gnome.org/accessibility/")))
327 (define-public at-spi2-atk
333 (uri (string-append "mirror://gnome/sources/" name "/"
334 (version-major+minor version) "/"
335 name "-" version ".tar.xz"))
338 "150sqc21difazqd53llwfdaqnwfy73bic9hia41xpfy9kcpzz9yy"))))
339 (build-system gnu-build-system)
340 (inputs `(("atk" ,atk)
341 ("at-spi2-core" ,at-spi2-core)
345 `(("pkg-config" ,pkg-config)))
347 `(#:tests? #f)) ; FIXME: droute/droute-test fails; one should disable
348 ; tests in a more fine-grained way.
349 (synopsis "Assistive Technology Service Provider Interface, ATK bindings")
351 "The Assistive Technology Service Provider Interface
352 is part of the GNOME accessibility project.")
353 (license license:lgpl2.0+)
354 (home-page "https://projects.gnome.org/accessibility/")))
356 (define-public gtk+-2
362 (uri (string-append "mirror://gnome/sources/" name "/"
363 (version-major+minor version) "/"
364 name "-" version ".tar.xz"))
367 "1qyw73pr9ryqhir2h1kbx3vm70km4dg2fxrgkrdlpv0rvlb94bih"))))
368 (build-system gnu-build-system)
371 ("gdk-pixbuf" ,gdk-pixbuf)
376 ("pkg-config" ,pkg-config)
377 ("python-wrapper" ,python-wrapper)))
381 'configure 'disable-tests
383 ;; FIXME: re-enable tests requiring an X server
384 (substitute* "gtk/Makefile.in"
385 (("SUBDIRS = theme-bits . tests") "SUBDIRS = theme-bits .")))
387 (synopsis "Cross-platform toolkit for creating graphical user interfaces")
389 "GTK+, or the GIMP Toolkit, is a multi-platform toolkit for creating
390 graphical user interfaces. Offering a complete set of widgets, GTK+ is
391 suitable for projects ranging from small one-off tools to complete
392 application suites.")
393 (license license:lgpl2.0+)
394 (home-page "http://www.gtk.org/")))
397 (package (inherit gtk+-2)
402 (uri (string-append "mirror://gnome/sources/" name "/"
403 (version-major+minor version) "/"
404 name "-" version ".tar.xz"))
407 "0vm40n6nf0w3vv54wqy67jcxddka7hplksi093xim3119yq196gv"))))
409 `(("at-spi2-atk" ,at-spi2-atk)
411 ("gdk-pixbuf" ,gdk-pixbuf)
413 ("libxinerama" ,libxinerama)
414 ("libxdamage" ,libxdamage)
417 `(("libxml2" ,libxml2)
418 ("cups" ,cups))) ;for printing support
422 ("pkg-config" ,pkg-config)
423 ("gobject-introspection" ,gobject-introspection)
424 ("python-wrapper" ,python-wrapper)
425 ("xorg-server" ,xorg-server)))
430 (lambda* (#:key inputs #:allow-other-keys #:rest args)
431 (let ((configure (assoc-ref %standard-phases 'configure)))
432 ;; Disable most tests, failing in the chroot with the message:
433 ;; D-Bus library appears to be incorrectly set up; failed to read
434 ;; machine uuid: Failed to open "/etc/machine-id": No such file or
436 ;; See the manual page for dbus-uuidgen to correct this issue.
437 (substitute* "testsuite/Makefile.in"
438 (("SUBDIRS = gdk gtk a11y css reftests")
440 (apply configure args)))
441 %standard-phases)))))
447 (define-public guile-cairo
454 "http://download.gna.org/guile-cairo/guile-cairo-"
459 "1f5nd9n46n6cwfl1byjml02q3y2hgn7nkx98km1czgwarxl7ws3x"))))
460 (build-system gnu-build-system)
462 '(#:phases (alist-cons-before
463 'configure 'set-module-directory
464 (lambda* (#:key outputs #:allow-other-keys)
465 ;; Install modules under $out/share/guile/site/2.0.
466 (let ((out (assoc-ref outputs "out")))
467 (substitute* "Makefile.in"
468 (("scmdir = ([[:graph:]]+).*" _ value)
469 (string-append "scmdir = " value "/2.0\n")))
470 (substitute* "cairo/Makefile.in"
471 (("moduledir = ([[:graph:]]+).*" _ value)
472 (string-append "moduledir = "
473 "$(prefix)/share/guile/site/2.0/cairo\n'")))))
475 'install 'install-missing-file
476 (lambda* (#:key outputs #:allow-other-keys)
477 ;; By default 'vector-types.scm' is not installed, so do
479 (let ((out (assoc-ref outputs "out")))
480 (copy-file "cairo/vector-types.scm"
481 (string-append out "/share/guile/site/2.0"
482 "/cairo/vector-types.scm"))))
485 `(("guile-lib" ,guile-lib)
487 ("guile" ,guile-2.0)))
489 ;; The .pc file refers to 'cairo'.
492 `(("pkg-config" ,pkg-config)))
493 (home-page "http://www.nongnu.org/guile-cairo/")
494 (synopsis "Cairo bindings for GNU Guile")
496 "Guile-Cairo wraps the Cairo graphics library for Guile Scheme.
497 Guile-Cairo is complete, wrapping almost all of the Cairo API. It is API
498 stable, providing a firm base on which to do graphics work. Finally, and
499 importantly, it is pleasant to use. You get a powerful and well-maintained
500 graphics library with all of the benefits of Scheme: memory management,
501 exceptions, macros, and a dynamic programming environment.")
502 (license license:lgpl3+)))
509 (define-public cairomm
515 (uri (string-append "http://cairographics.org/releases/cairomm-"
519 "138052ybc58q5yl92m2p0br0k0a9g1pi9gfhmn4y220yih4pgxnc"))))
520 (build-system gnu-build-system)
522 ;; The examples lack -lcairo.
523 '(#:make-flags '("LDFLAGS=-lcairo")))
524 (native-inputs `(("pkg-config" ,pkg-config)))
526 `(("libsigc++" ,libsigc++)
527 ("freetype" ,freetype)
528 ("fontconfig" ,fontconfig)
530 (home-page "http://cairographics.org/")
531 (synopsis "C++ bindings to the Cairo 2D graphics library")
533 "Cairomm provides a C++ programming interface to the Cairo 2D graphics
535 (license license:lgpl2.0+)))
537 (define-public pangomm
543 (uri (string-append "mirror://gnome/sources/" name "/"
544 (version-major+minor version) "/"
545 name "-" version ".tar.xz"))
548 "0hcyvv7c5zmivprdam6cp111i6hn2y5jsxzk00m6j9pncbzvp0hf"))))
549 (build-system gnu-build-system)
550 (native-inputs `(("pkg-config" ,pkg-config)))
556 (home-page "http://www.pango.org/")
557 (synopsis "C++ interface to the Pango text rendering library")
559 "Pangomm provides a C++ programming interface to the Pango text rendering
561 (license license:lgpl2.1+)))
569 (uri (string-append "mirror://gnome/sources/" name "/"
570 (version-major+minor version) "/"
571 name "-" version ".tar.xz"))
574 "06zrf2ymml2dzp53sss0d4ch4dk9v09jm8rglnrmwk4v81mq9gxz"))))
575 (build-system gnu-build-system)
576 (native-inputs `(("pkg-config" ,pkg-config)))
578 `(("glibmm" ,glibmm) ("atk" ,atk)))
579 (home-page "http://www.gtkmm.org")
580 (synopsis "C++ interface to the ATK accessibility library")
582 "ATKmm provides a C++ programming interface to the ATK accessibility
584 (license license:lgpl2.1+)))
592 (uri (string-append "mirror://gnome/sources/" name "/"
593 (version-major+minor version) "/"
594 name "-" version ".tar.xz"))
597 "12z4g2in82nk92nfjs2hmrdcwbav8v3laz1813x2dhkf5jk2ixfr"))))
598 (build-system gnu-build-system)
599 (native-inputs `(("pkg-config" ,pkg-config)))
601 `(("pangomm" ,pangomm)
606 (home-page "http://gtkmm.org/")
608 "C++ interface to the GTK+ graphical user interface library")
610 "gtkmm is the official C++ interface for the popular GUI library GTK+.
611 Highlights include typesafe callbacks, and a comprehensive set of widgets that
612 are easily extensible via inheritance. You can create user interfaces either
613 in code or with the Glade User Interface designer, using libglademm. There's
614 extensive documentation, including API reference and a tutorial.")
615 (license license:lgpl2.1+)))
618 (define-public gtkmm-2
619 (package (inherit gtkmm)
624 (uri (string-append "mirror://gnome/sources/" name "/"
625 (version-major+minor version) "/"
626 name "-" version ".tar.xz"))
629 "0gcm91sc1a05c56kzh74l370ggj0zz8nmmjvjaaxgmhdq8lpl369"))))
631 `(("pangomm" ,pangomm)
635 ("glibmm" ,glibmm)))))
637 (define-public python-pycairo
639 (name "python-pycairo")
644 (uri (string-append "http://cairographics.org/releases/pycairo-"
648 "1gjkf8x6hyx1skq3hhwcbvwifxvrf9qxis5vx8x5igmmgs70g94s"))))
649 (build-system python-build-system)
651 `(("pkg-config" ,pkg-config)))
652 (propagated-inputs ;pycairo.pc references cairo
656 #:phases (alist-cons-before
658 (lambda* (#:key outputs #:allow-other-keys)
659 (zero? (system* "./waf" "configure"
660 (string-append "--prefix="
661 (assoc-ref outputs "out")))))
665 (zero? (system* "./waf" "build")))
669 (zero? (system* "./waf" "install")))
670 %standard-phases)))))
671 (home-page "http://cairographics.org/pycairo/")
672 (synopsis "Python bindings for cairo")
674 "Pycairo is a set of Python bindings for the Cairo graphics library.")
675 (license license:lgpl3+)))
677 (define-public python2-py2cairo
678 (package (inherit python-pycairo)
679 (name "python2-py2cairo")
684 (uri (string-append "http://cairographics.org/releases/py2cairo-"
688 "0cblk919wh6w0pgb45zf48xwxykfif16qk264yga7h9fdkq3j16k"))))
691 ,@(package-arguments python-pycairo)))
692 ;; Dual-licensed under LGPL 2.1 or Mozilla Public License 1.1
693 (license (list license:lgpl2.1 license:mpl1.1))))
695 (define-public python2-pygtk
697 (name "python2-pygtk")
702 (uri (string-append "http://ftp.gnome.org/pub/GNOME/sources"
703 "/pygtk/" (version-major+minor version)
704 "/pygtk-" version ".tar.bz2"))
707 "04k942gn8vl95kwf0qskkv6npclfm31d78ljkrkgyqxxcni1w76d"))))
708 (build-system gnu-build-system)
710 `(("pkg-config" ,pkg-config)))
712 `(("python" ,python-2)
715 `(("python-pycairo" ,python2-py2cairo) ;loaded at runtime
716 ("python-pygobject" ,python2-pygobject-2) ;referenced in pc file
720 #:phases (alist-cons-after
721 'install 'install-pth
722 (lambda* (#:key inputs outputs #:allow-other-keys)
723 ;; pygtk's modules are stored in a subdirectory of python's
724 ;; site-packages directory. Add a .pth file so that python
725 ;; will add that subdirectory to its module search path.
726 (let* ((out (assoc-ref outputs "out"))
727 (site (string-append out "/lib/python"
728 ,(version-major+minor
729 (package-version python-2))
731 (call-with-output-file (string-append site "/pygtk.pth")
733 (format port "gtk-2.0~%")))))
735 (home-page "http://www.pygtk.org/")
736 (synopsis "Python bindings for GTK+")
738 "PyGTK allows you to write full featured GTK programs in Python. It is
739 targetted at GTK 2.x, and can be used in conjunction with gnome-python to
740 write GNOME applications.")
741 (license license:lgpl2.1+)))