gnu: libxkbcommon: Update to 0.5.0.
[jackhill/guix/guix.git] / gnu / packages / qt.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages qt)
20 #:use-module ((guix licenses) #:select (lgpl2.1 x11-style))
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix build utils)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages bison)
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages fontutils)
29 #:use-module (gnu packages glib)
30 #:use-module (gnu packages icu4c)
31 #:use-module (gnu packages image)
32 #:use-module (gnu packages linux)
33 #:use-module (gnu packages databases)
34 #:use-module (gnu packages openssl)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages pulseaudio)
38 #:use-module (gnu packages python)
39 #:use-module (gnu packages gl)
40 #:use-module (gnu packages xorg))
41
42 (define-public libxkbcommon
43 (package
44 (name "libxkbcommon")
45 (version "0.5.0")
46 (source (origin
47 (method url-fetch)
48 (uri (string-append "http://xkbcommon.org/download/" name "-"
49 version ".tar.xz"))
50 (sha256
51 (base32
52 "176ii5dn2wh74q48sd8ac37ljlvgvp5f506glr96z6ibfhj7igch"))))
53 (build-system gnu-build-system)
54 (inputs
55 `(("libxcb" ,libxcb)))
56 (native-inputs
57 `(("bison" ,bison)
58 ("pkg-config" ,pkg-config)))
59 (home-page "http://xkbcommon.org/")
60 (synopsis "Library to handle keyboard descriptions")
61 (description "Xkbcommon is a library to handle keyboard descriptions,
62 including loading them from disk, parsing them and handling their
63 state. It is mainly meant for client toolkits, window systems, and other
64 system applications; currently that includes Wayland, kmscon, GTK+, Qt,
65 Clutter, and more. Despite the name, it is not currently used by anything
66 X11 (yet).")
67 (license (x11-style "file://COPYING"
68 "See 'COPYING' in the distribution."))))
69
70 (define-public qt
71 (package
72 (name "qt")
73 (version "5.3.2")
74 (source (origin
75 (method url-fetch)
76 (uri (string-append "http://download.qt-project.org/official_releases/qt/"
77 (string-copy version 0 (string-rindex version #\.))
78 "/" version
79 "/single/qt-everywhere-opensource-src-"
80 version ".tar.xz"))
81 (sha256
82 (base32
83 "1w4v53889kqpwxw45wcqz5bi6zx8xp434jpafk1vlmyb8hrzjnvz"))))
84 (build-system gnu-build-system)
85 (propagated-inputs
86 `(("mesa" ,mesa)))
87 (inputs
88 ;; FIXME: Add input ruby once available.
89 `(("alsa-lib" ,alsa-lib)
90 ("dbus" ,dbus)
91 ("fontconfig" ,fontconfig)
92 ("freetype" ,freetype)
93 ("glib" ,glib)
94 ("icu4c" ,icu4c)
95 ("libjpeg" ,libjpeg)
96 ("libpng" ,libpng)
97 ("libx11" ,libx11)
98 ("libxi" ,libxi)
99 ("libxkbcommon" ,libxkbcommon)
100 ("libxrender" ,libxrender)
101 ("mysql" ,mysql)
102 ("openssl" ,openssl)
103 ("pulseaudio" ,pulseaudio)
104 ("python-wrapper" ,python-wrapper)
105 ("xcb-util" ,xcb-util)
106 ("xcb-util-image" ,xcb-util-image)
107 ("xcb-util-keysyms" ,xcb-util-keysyms)
108 ("xcb-util-renderutil" ,xcb-util-renderutil)
109 ("xcb-util-wm" ,xcb-util-wm)
110 ("zlib" ,zlib)))
111 (native-inputs
112 `(("perl" ,perl)
113 ("pkg-config" ,pkg-config)))
114 (arguments
115 `(#:phases
116 (alist-replace
117 'configure
118 (lambda* (#:key outputs #:allow-other-keys)
119 (let ((out (assoc-ref outputs "out")))
120 (substitute* '("configure" "qtbase/configure")
121 (("/bin/pwd") (which "pwd")))
122 ;; do not pass "--enable-fast-install", which makes the
123 ;; configure process fail
124 (zero? (system*
125 "./configure"
126 "-verbose"
127 "-prefix" out
128 "-opensource"
129 "-confirm-license"
130 ;; explicitly link with dbus instead of dlopening it
131 "-dbus-linked"
132 ;; drop special machine instructions not supported
133 ;; on all instances of the target
134 ,@(if (string-prefix? "x86_64"
135 (or (%current-target-system)
136 (%current-system)))
137 '()
138 '("-no-sse2"))
139 "-no-sse3"
140 "-no-ssse3"
141 "-no-sse4.1"
142 "-no-sse4.2"
143 "-no-avx"
144 "-no-avx2"
145 "-no-mips_dsp"
146 "-no-mips_dspr2"))))
147 %standard-phases)))
148 (home-page "http://qt-project.org/")
149 (synopsis "Cross-platform GUI library")
150 (description "Qt is a cross-platform application and UI framework for
151 developers using C++ or QML, a CSS & JavaScript like language.")
152 (license lgpl2.1)
153
154 ;; Qt 4: 'QBasicAtomicPointer' leads to build failures on MIPS;
155 ;; see <http://hydra.gnu.org/build/112828>.
156 ;; Qt 5: assembler error; see <http://hydra.gnu.org/build/112526>.
157 (supported-systems (delete "mips64el-linux" %supported-systems))))
158
159 (define-public qt-4
160 (package (inherit qt)
161 (version "4.8.6")
162 (source (origin
163 (method url-fetch)
164 (uri (string-append "http://download.qt-project.org/official_releases/qt/"
165 (string-copy version 0 (string-rindex version #\.))
166 "/" version
167 "/qt-everywhere-opensource-src-"
168 version ".tar.gz"))
169 (sha256
170 (base32
171 "0b036iqgmbbv37dgwwfihw3mihjbnw3kb5kaisdy0qi8nn8xs54b"))
172 (patches (list (search-patch "qt4-tests.patch")))))
173 (inputs `(,@(alist-delete "libjpeg" (package-inputs qt))
174 ("libjepg" ,libjpeg-8)
175 ("libsm" ,libsm)))
176 (arguments
177 `(#:phases
178 (alist-replace
179 'configure
180 (lambda* (#:key outputs #:allow-other-keys)
181 (let ((out (assoc-ref outputs "out")))
182 (substitute* '("configure")
183 (("/bin/pwd") (which "pwd")))
184 ;; Explicitly link with icui18n, which is dlopened by
185 ;; QtCore.so. The LDFLAGS are in fact added to other flags
186 ;; determined by the configure phase.
187 ;; According to the nix recipe, this may be necessary for
188 ;; further libraries (cups, gtk-x11-2.0, libgdk-x11-2.0).
189 (setenv "LDFLAGS" "-licui18n")
190 ;; do not pass "--enable-fast-install", which makes the
191 ;; configure process fail
192 (zero? (system*
193 "./configure"
194 "-verbose"
195 "-prefix" out
196 "-opensource"
197 "-confirm-license"
198 ;; explicitly link with dbus instead of dlopening it
199 "-dbus-linked"
200 ;; drop special machine instructions not supported
201 ;; on all instances of the target
202 ,@(if (string-prefix? "x86_64"
203 (or (%current-target-system)
204 (%current-system)))
205 '()
206 '("-no-mmx"
207 "-no-3dnow"
208 "-no-sse"
209 "-no-sse2"))
210 "-no-sse3"
211 "-no-ssse3"
212 "-no-sse4.1"
213 "-no-sse4.2"
214 "-no-avx"
215 "-no-neon"))))
216 %standard-phases)))))