Commit | Line | Data |
---|---|---|
bd677c2d | 1 | ;;; GNU Guix --- Functional package management for GNU |
84ef83dd | 2 | ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr> |
5b490ab5 | 3 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> |
bd677c2d AE |
4 | ;;; |
5 | ;;; This file is part of GNU Guix. | |
6 | ;;; | |
7 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
8 | ;;; under the terms of the GNU General Public License as published by | |
9 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
10 | ;;; your option) any later version. | |
11 | ;;; | |
12 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
13 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | ;;; GNU General Public License for more details. | |
16 | ;;; | |
17 | ;;; You should have received a copy of the GNU General Public License | |
18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
19 | ||
20 | (define-module (gnu packages qt) | |
84ef83dd | 21 | #:use-module ((guix licenses) #:select (gpl3 lgpl2.1 x11-style)) |
bd677c2d AE |
22 | #:use-module (guix packages) |
23 | #:use-module (guix download) | |
f198ffd0 | 24 | #:use-module (guix build utils) |
bd677c2d | 25 | #:use-module (guix build-system gnu) |
84ef83dd AE |
26 | #:use-module (guix packages) |
27 | #:use-module (guix utils) | |
1e9ed0e3 | 28 | #:use-module (gnu packages) |
b332e366 AE |
29 | #:use-module (gnu packages bison) |
30 | #:use-module (gnu packages compression) | |
31 | #:use-module (gnu packages fontutils) | |
0009ed71 | 32 | #:use-module (gnu packages flex) |
8b6a5e0f | 33 | #:use-module (gnu packages gl) |
b332e366 | 34 | #:use-module (gnu packages glib) |
0009ed71 SB |
35 | #:use-module (gnu packages gnuzilla) |
36 | #:use-module (gnu packages gperf) | |
b332e366 | 37 | #:use-module (gnu packages icu4c) |
e55354b8 | 38 | #:use-module (gnu packages image) |
b332e366 | 39 | #:use-module (gnu packages linux) |
5f96f303 | 40 | #:use-module (gnu packages databases) |
0009ed71 | 41 | #:use-module (gnu packages ninja) |
b332e366 | 42 | #:use-module (gnu packages openssl) |
0009ed71 SB |
43 | #:use-module (gnu packages pciutils) |
44 | #:use-module (gnu packages pcre) | |
b332e366 AE |
45 | #:use-module (gnu packages perl) |
46 | #:use-module (gnu packages pkg-config) | |
39fa8f6c | 47 | #:use-module (gnu packages pulseaudio) |
b332e366 | 48 | #:use-module (gnu packages python) |
8b6a5e0f | 49 | #:use-module (gnu packages ruby) |
0009ed71 SB |
50 | #:use-module (gnu packages xdisorg) |
51 | #:use-module (gnu packages xorg) | |
52 | #:use-module (gnu packages xml)) | |
bd677c2d AE |
53 | |
54 | (define-public libxkbcommon | |
55 | (package | |
56 | (name "libxkbcommon") | |
ff53457d | 57 | (version "0.5.0") |
bd677c2d AE |
58 | (source (origin |
59 | (method url-fetch) | |
60 | (uri (string-append "http://xkbcommon.org/download/" name "-" | |
61 | version ".tar.xz")) | |
62 | (sha256 | |
63 | (base32 | |
ff53457d | 64 | "176ii5dn2wh74q48sd8ac37ljlvgvp5f506glr96z6ibfhj7igch")))) |
bd677c2d | 65 | (build-system gnu-build-system) |
ff53457d | 66 | (inputs |
5dee80dd AE |
67 | `(("libx11" ,libx11) |
68 | ("libxcb" ,libxcb) | |
69 | ("xkeyboard-config" ,xkeyboard-config))) | |
c4c4cc05 | 70 | (native-inputs |
ff53457d AE |
71 | `(("bison" ,bison) |
72 | ("pkg-config" ,pkg-config))) | |
5dee80dd AE |
73 | (arguments |
74 | `(#:configure-flags | |
75 | (list (string-append "--with-xkb-config-root=" | |
76 | (assoc-ref %build-inputs "xkeyboard-config") | |
77 | "/share/X11/xkb") | |
78 | (string-append "--with-x-locale-root=" | |
79 | (assoc-ref %build-inputs "libx11") | |
80 | "/share/X11/locale")))) | |
bd677c2d | 81 | (home-page "http://xkbcommon.org/") |
35b9e423 | 82 | (synopsis "Library to handle keyboard descriptions") |
bd677c2d AE |
83 | (description "Xkbcommon is a library to handle keyboard descriptions, |
84 | including loading them from disk, parsing them and handling their | |
85 | state. It is mainly meant for client toolkits, window systems, and other | |
86 | system applications; currently that includes Wayland, kmscon, GTK+, Qt, | |
87 | Clutter, and more. Despite the name, it is not currently used by anything | |
88 | X11 (yet).") | |
89 | (license (x11-style "file://COPYING" | |
90 | "See 'COPYING' in the distribution.")))) | |
b332e366 AE |
91 | |
92 | (define-public qt | |
93 | (package | |
94 | (name "qt") | |
5b490ab5 | 95 | (version "5.4.0") |
b332e366 AE |
96 | (source (origin |
97 | (method url-fetch) | |
98 | (uri (string-append "http://download.qt-project.org/official_releases/qt/" | |
99 | (string-copy version 0 (string-rindex version #\.)) | |
100 | "/" version | |
101 | "/single/qt-everywhere-opensource-src-" | |
f198ffd0 | 102 | version ".tar.xz")) |
b332e366 AE |
103 | (sha256 |
104 | (base32 | |
5b490ab5 SB |
105 | "176351k8ngczb324i8bbkrsz9pby7cvy2qnixfjwybzxp53xzndj")) |
106 | (snippet | |
107 | '(begin | |
108 | ;; Remove broken symlinks. | |
109 | (delete-file "qtwebengine/src/3rdparty/chromium/third_party/\ | |
110 | mesa/src/src/gallium/state_trackers/d3d1x/w32api") | |
111 | (delete-file "qtwebengine/src/3rdparty/chromium/third_party/\ | |
112 | webrtc/tools/e2e_quality/audio/perf"))))) | |
b332e366 | 113 | (build-system gnu-build-system) |
ef0cf53e AE |
114 | (propagated-inputs |
115 | `(("mesa" ,mesa))) | |
b332e366 | 116 | (inputs |
b332e366 AE |
117 | `(("alsa-lib" ,alsa-lib) |
118 | ("dbus" ,dbus) | |
0009ed71 | 119 | ("expat" ,expat) |
b332e366 AE |
120 | ("fontconfig" ,fontconfig) |
121 | ("freetype" ,freetype) | |
122 | ("glib" ,glib) | |
123 | ("icu4c" ,icu4c) | |
f198ffd0 | 124 | ("libjpeg" ,libjpeg) |
0009ed71 | 125 | ("libpci" ,pciutils) |
b332e366 AE |
126 | ("libpng" ,libpng) |
127 | ("libx11" ,libx11) | |
0009ed71 SB |
128 | ("libxcomposite" ,libxcomposite) |
129 | ("libxcursor" ,libxcursor) | |
130 | ("libxfixes" ,libxfixes) | |
b332e366 | 131 | ("libxi" ,libxi) |
0009ed71 | 132 | ("libxinerama" ,libxinerama) |
b332e366 | 133 | ("libxkbcommon" ,libxkbcommon) |
0009ed71 SB |
134 | ("libxml2" ,libxml2) |
135 | ("libxrandr" ,libxrandr) | |
b332e366 | 136 | ("libxrender" ,libxrender) |
0009ed71 SB |
137 | ("libxslt" ,libxslt) |
138 | ("libxtst" ,libxtst) | |
139 | ("mtdev" ,mtdev) | |
b332e366 | 140 | ("mysql" ,mysql) |
0009ed71 | 141 | ("nss" ,nss) |
b332e366 | 142 | ("openssl" ,openssl) |
39fa8f6c | 143 | ("pulseaudio" ,pulseaudio) |
0009ed71 SB |
144 | ("pcre" ,pcre) |
145 | ("sqlite" ,sqlite) | |
146 | ("udev" ,eudev) | |
b332e366 AE |
147 | ("xcb-util" ,xcb-util) |
148 | ("xcb-util-image" ,xcb-util-image) | |
149 | ("xcb-util-keysyms" ,xcb-util-keysyms) | |
150 | ("xcb-util-renderutil" ,xcb-util-renderutil) | |
151 | ("xcb-util-wm" ,xcb-util-wm) | |
152 | ("zlib" ,zlib))) | |
c4c4cc05 | 153 | (native-inputs |
0009ed71 SB |
154 | `(("bison" ,bison) |
155 | ("flex" ,flex) | |
156 | ("gperf" ,gperf) | |
157 | ("ninja" ,ninja) | |
158 | ("perl" ,perl) | |
159 | ("pkg-config" ,pkg-config) | |
160 | ("python" ,python-2) | |
161 | ("ruby" ,ruby) | |
162 | ("which" ,(@ (gnu packages which) which)))) | |
b332e366 AE |
163 | (arguments |
164 | `(#:phases | |
165 | (alist-replace | |
166 | 'configure | |
167 | (lambda* (#:key outputs #:allow-other-keys) | |
168 | (let ((out (assoc-ref outputs "out"))) | |
169 | (substitute* '("configure" "qtbase/configure") | |
5b490ab5 SB |
170 | (("/bin/pwd") (which "pwd"))) |
171 | (substitute* "qtbase/src/corelib/global/global.pri" | |
172 | (("/bin/ls") (which "ls"))) | |
0009ed71 SB |
173 | (substitute* "qtwebengine/src/3rdparty/chromium/build/common.gypi" |
174 | (("/bin/echo") (which "echo"))) | |
175 | (substitute* "qtwebengine/src/3rdparty/chromium/third_party/\ | |
176 | WebKit/Source/build/scripts/scripts.gypi" | |
177 | (("/usr/bin/gcc") (which "gcc"))) | |
178 | (setenv "NINJA_PATH" (which "ninja")) | |
b332e366 AE |
179 | ;; do not pass "--enable-fast-install", which makes the |
180 | ;; configure process fail | |
206a5208 AE |
181 | (zero? (system* |
182 | "./configure" | |
183 | "-verbose" | |
184 | "-prefix" out | |
185 | "-opensource" | |
186 | "-confirm-license" | |
0009ed71 SB |
187 | "-system-sqlite" |
188 | ;; explicitly link with openssl instead of dlopening it | |
189 | "-openssl-linked" | |
ff0a8c59 AE |
190 | ;; explicitly link with dbus instead of dlopening it |
191 | "-dbus-linked" | |
206a5208 AE |
192 | ;; drop special machine instructions not supported |
193 | ;; on all instances of the target | |
194 | ,@(if (string-prefix? "x86_64" | |
195 | (or (%current-target-system) | |
196 | (%current-system))) | |
197 | '() | |
198 | '("-no-sse2")) | |
199 | "-no-sse3" | |
200 | "-no-ssse3" | |
201 | "-no-sse4.1" | |
202 | "-no-sse4.2" | |
203 | "-no-avx" | |
204 | "-no-avx2" | |
206a5208 AE |
205 | "-no-mips_dsp" |
206 | "-no-mips_dspr2")))) | |
b332e366 AE |
207 | %standard-phases))) |
208 | (home-page "http://qt-project.org/") | |
209 | (synopsis "Cross-platform GUI library") | |
210 | (description "Qt is a cross-platform application and UI framework for | |
211 | developers using C++ or QML, a CSS & JavaScript like language.") | |
f47638a3 LC |
212 | (license lgpl2.1) |
213 | ||
214 | ;; Qt 4: 'QBasicAtomicPointer' leads to build failures on MIPS; | |
215 | ;; see <http://hydra.gnu.org/build/112828>. | |
216 | ;; Qt 5: assembler error; see <http://hydra.gnu.org/build/112526>. | |
217 | (supported-systems (delete "mips64el-linux" %supported-systems)))) | |
1e9ed0e3 AE |
218 | |
219 | (define-public qt-4 | |
220 | (package (inherit qt) | |
c98f2ff3 | 221 | (version "4.8.6") |
1e9ed0e3 AE |
222 | (source (origin |
223 | (method url-fetch) | |
224 | (uri (string-append "http://download.qt-project.org/official_releases/qt/" | |
225 | (string-copy version 0 (string-rindex version #\.)) | |
226 | "/" version | |
89059aa1 | 227 | "/qt-everywhere-opensource-src-" |
1e9ed0e3 AE |
228 | version ".tar.gz")) |
229 | (sha256 | |
230 | (base32 | |
c98f2ff3 | 231 | "0b036iqgmbbv37dgwwfihw3mihjbnw3kb5kaisdy0qi8nn8xs54b")) |
1e9ed0e3 | 232 | (patches (list (search-patch "qt4-tests.patch"))))) |
f198ffd0 | 233 | (inputs `(,@(alist-delete "libjpeg" (package-inputs qt)) |
e7e5a4f8 AE |
234 | ("libjepg" ,libjpeg-8) |
235 | ("libsm" ,libsm))) | |
1e9ed0e3 AE |
236 | (arguments |
237 | `(#:phases | |
238 | (alist-replace | |
239 | 'configure | |
240 | (lambda* (#:key outputs #:allow-other-keys) | |
241 | (let ((out (assoc-ref outputs "out"))) | |
242 | (substitute* '("configure") | |
243 | (("/bin/pwd") (which "pwd"))) | |
47e225cd AE |
244 | ;; Explicitly link with icui18n, which is dlopened by |
245 | ;; QtCore.so. The LDFLAGS are in fact added to other flags | |
246 | ;; determined by the configure phase. | |
247 | ;; According to the nix recipe, this may be necessary for | |
248 | ;; further libraries (cups, gtk-x11-2.0, libgdk-x11-2.0). | |
249 | (setenv "LDFLAGS" "-licui18n") | |
1e9ed0e3 AE |
250 | ;; do not pass "--enable-fast-install", which makes the |
251 | ;; configure process fail | |
206a5208 AE |
252 | (zero? (system* |
253 | "./configure" | |
254 | "-verbose" | |
255 | "-prefix" out | |
256 | "-opensource" | |
257 | "-confirm-license" | |
ff0a8c59 AE |
258 | ;; explicitly link with dbus instead of dlopening it |
259 | "-dbus-linked" | |
206a5208 AE |
260 | ;; drop special machine instructions not supported |
261 | ;; on all instances of the target | |
262 | ,@(if (string-prefix? "x86_64" | |
263 | (or (%current-target-system) | |
264 | (%current-system))) | |
265 | '() | |
266 | '("-no-mmx" | |
1e9ed0e3 AE |
267 | "-no-3dnow" |
268 | "-no-sse" | |
206a5208 AE |
269 | "-no-sse2")) |
270 | "-no-sse3" | |
271 | "-no-ssse3" | |
272 | "-no-sse4.1" | |
273 | "-no-sse4.2" | |
274 | "-no-avx" | |
275 | "-no-neon")))) | |
1e9ed0e3 | 276 | %standard-phases))))) |
84ef83dd AE |
277 | |
278 | (define-public python-sip | |
279 | (package | |
280 | (name "python-sip") | |
281 | (version "4.16.5") | |
282 | (source | |
283 | (origin | |
284 | (method url-fetch) | |
285 | (uri | |
286 | (string-append "mirror://sourceforge/pyqt/sip/" | |
287 | "sip-" version "/sip-" | |
288 | version ".tar.gz")) | |
289 | (sha256 | |
290 | (base32 | |
291 | "11qy1z88py2q7rz68rm7214pbd37538hpcbfj5hhzp5y616a62x0")))) | |
292 | (build-system gnu-build-system) | |
293 | (native-inputs | |
294 | `(("python" ,python-wrapper))) | |
295 | (arguments | |
296 | `(#:tests? #f ; no check target | |
297 | #:phases | |
298 | (alist-replace | |
299 | 'configure | |
300 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
301 | (let* ((out (assoc-ref outputs "out")) | |
302 | (bin (string-append out "/bin")) | |
303 | (include (string-append out "/include")) | |
304 | (python-version | |
305 | (string-take | |
306 | (string-take-right (assoc-ref inputs "python") 5) | |
307 | 3)) | |
308 | (lib (string-append out "/lib/python" | |
309 | python-version | |
310 | "/site-packages"))) | |
311 | (zero? | |
312 | (system* "python" "configure.py" | |
313 | "--bindir" bin | |
314 | "--destdir" lib | |
315 | "--incdir" include)))) | |
316 | %standard-phases))) | |
317 | (home-page "http://www.riverbankcomputing.com/software/sip/intro") | |
318 | (synopsis "Python binding creator for C and C++ libraries") | |
319 | (description | |
320 | "SIP is a tool to create Python bindings for C and C++ libraries. It | |
321 | was originally developed to create PyQt, the Python bindings for the Qt | |
322 | toolkit, but can be used to create bindings for any C or C++ library. | |
323 | ||
324 | SIP comprises a code generator and a Python module. The code generator | |
325 | processes a set of specification files and generates C or C++ code, which | |
326 | is then compiled to create the bindings extension module. The SIP Python | |
327 | module provides support functions to the automatically generated code.") | |
328 | ;; There is a choice between a python like license, gpl2 and gpl3. | |
329 | ;; For compatibility with pyqt, we need gpl3. | |
330 | (license gpl3))) | |
331 | ||
332 | (define-public python2-sip | |
333 | (package (inherit python-sip) | |
334 | (name "python2-sip") | |
335 | (native-inputs | |
336 | `(("python" ,python-2))))) | |
014e7dd8 AE |
337 | |
338 | (define-public python-pyqt | |
339 | (package | |
340 | (name "python-pyqt") | |
341 | (version "5.4") | |
342 | (source | |
343 | (origin | |
344 | (method url-fetch) | |
345 | (uri | |
346 | (string-append "mirror://sourceforge/pyqt/PyQt5/" | |
347 | "PyQt-" version "/PyQt-gpl-" | |
348 | version ".tar.gz")) | |
349 | (sha256 | |
350 | (base32 | |
351 | "0cbpa63whi8a5akff4pcnfwzpzx7ycac2ynj00ly52m6zbsn80kn")) | |
352 | (patches (list (search-patch "pyqt-configure.patch"))))) | |
353 | (build-system gnu-build-system) | |
354 | (native-inputs | |
355 | `(("python-sip" ,python-sip) | |
356 | ("qt" ,qt))) ; for qmake | |
357 | (inputs | |
358 | `(("python" ,python-wrapper))) | |
359 | (arguments | |
360 | `(#:phases | |
361 | (alist-replace | |
362 | 'configure | |
363 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
364 | (let* ((out (assoc-ref outputs "out")) | |
365 | (bin (string-append out "/bin")) | |
366 | (sip (string-append out "/share/sip")) | |
367 | (plugins (string-append out "/plugins")) | |
368 | (designer (string-append plugins "/designer")) | |
369 | (qml (string-append plugins "/PyQt5")) | |
370 | (python-version | |
371 | (string-take | |
372 | (string-take-right (assoc-ref inputs "python") 5) | |
373 | 3)) | |
374 | (lib (string-append out "/lib/python" | |
375 | python-version | |
376 | "/site-packages"))) | |
377 | (zero? (system* "python" "configure.py" | |
378 | "--confirm-license" | |
379 | "--bindir" bin | |
380 | "--destdir" lib | |
381 | "--designer-plugindir" designer | |
382 | "--qml-plugindir" qml | |
383 | "--sipdir" sip)))) | |
384 | %standard-phases))) | |
385 | (home-page "http://www.riverbankcomputing.com/software/pyqt/intro") | |
386 | (synopsis "Python bindings for Qt") | |
387 | (description | |
388 | "PyQt is a set of Python v2 and v3 bindings for the Qt application | |
389 | framework. The bindings are implemented as a set of Python modules and | |
390 | contain over 620 classes.") | |
391 | (license gpl3))) | |
392 | ||
393 | (define-public python2-pyqt | |
394 | (package (inherit python-pyqt) | |
395 | (name "python2-pyqt") | |
396 | (native-inputs | |
397 | `(("python-sip" ,python2-sip) | |
398 | ("qt" ,qt))) | |
399 | (inputs | |
400 | `(("python" ,python-2))))) |