1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
4 ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
6 ;;; This file is part of GNU Guix.
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages qt)
22 #:use-module ((guix licenses) #:select (gpl2 gpl3 lgpl2.1 x11-style))
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build utils)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix packages)
28 #:use-module (guix utils)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages bison)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages cups)
33 #:use-module (gnu packages databases)
34 #:use-module (gnu packages fontutils)
35 #:use-module (gnu packages flex)
36 #:use-module (gnu packages gl)
37 #:use-module (gnu packages glib)
38 #:use-module (gnu packages gnuzilla)
39 #:use-module (gnu packages gperf)
40 #:use-module (gnu packages icu4c)
41 #:use-module (gnu packages image)
42 #:use-module (gnu packages linux)
43 #:use-module (gnu packages databases)
44 #:use-module (gnu packages ninja)
45 #:use-module (gnu packages pciutils)
46 #:use-module (gnu packages pcre)
47 #:use-module (gnu packages perl)
48 #:use-module (gnu packages pkg-config)
49 #:use-module (gnu packages pulseaudio)
50 #:use-module (gnu packages python)
51 #:use-module (gnu packages ruby)
52 #:use-module (gnu packages tls)
53 #:use-module (gnu packages xdisorg)
54 #:use-module (gnu packages xorg)
55 #:use-module (gnu packages xml))
57 (define-public libxkbcommon
63 (uri (string-append "http://xkbcommon.org/download/" name "-"
67 "176ii5dn2wh74q48sd8ac37ljlvgvp5f506glr96z6ibfhj7igch"))))
68 (build-system gnu-build-system)
72 ("xkeyboard-config" ,xkeyboard-config)))
75 ("pkg-config" ,pkg-config)))
78 (list (string-append "--with-xkb-config-root="
79 (assoc-ref %build-inputs "xkeyboard-config")
81 (string-append "--with-x-locale-root="
82 (assoc-ref %build-inputs "libx11")
83 "/share/X11/locale"))))
84 (home-page "http://xkbcommon.org/")
85 (synopsis "Library to handle keyboard descriptions")
86 (description "Xkbcommon is a library to handle keyboard descriptions,
87 including loading them from disk, parsing them and handling their
88 state. It is mainly meant for client toolkits, window systems, and other
89 system applications; currently that includes Wayland, kmscon, GTK+, Qt,
90 Clutter, and more. Despite the name, it is not currently used by anything
92 (license (x11-style "file://COPYING"
93 "See 'COPYING' in the distribution."))))
101 (uri (string-append "http://download.qt-project.org/official_releases/qt/"
102 (string-copy version 0 (string-rindex version #\.))
104 "/single/qt-everywhere-opensource-src-"
108 "09gay5cimfdb0apy60v7z4r4zkl2vjysdppzihpla8dp2c30fvcc"))
109 (patches (list (search-patch "qt5-conflicting-typedefs.patch")
110 (search-patch "qt5-runpath.patch")))
113 ;; Remove broken symlinks.
114 (delete-file "qtwebengine/src/3rdparty/chromium/third_party/\
115 mesa/src/src/gallium/state_trackers/d3d1x/w32api")
116 (delete-file "qtwebengine/src/3rdparty/chromium/third_party/\
117 webrtc/tools/e2e_quality/audio/perf")))))
118 (build-system gnu-build-system)
122 `(("alsa-lib" ,alsa-lib)
126 ("fontconfig" ,fontconfig)
127 ("freetype" ,freetype)
135 ("libxcomposite" ,libxcomposite)
136 ("libxcursor" ,libxcursor)
137 ("libxfixes" ,libxfixes)
139 ("libxinerama" ,libxinerama)
140 ("libxkbcommon" ,libxkbcommon)
142 ("libxrandr" ,libxrandr)
143 ("libxrender" ,libxrender)
150 ("postgresql" ,postgresql)
151 ("pulseaudio" ,pulseaudio)
155 ("unixodbc" ,unixodbc)
156 ("xcb-util" ,xcb-util)
157 ("xcb-util-image" ,xcb-util-image)
158 ("xcb-util-keysyms" ,xcb-util-keysyms)
159 ("xcb-util-renderutil" ,xcb-util-renderutil)
160 ("xcb-util-wm" ,xcb-util-wm)
168 ("pkg-config" ,pkg-config)
171 ("which" ,(@ (gnu packages base) which))))
176 (lambda* (#:key outputs #:allow-other-keys)
177 (let ((out (assoc-ref outputs "out")))
178 (substitute* '("configure" "qtbase/configure")
179 (("/bin/pwd") (which "pwd")))
180 (substitute* "qtbase/src/corelib/global/global.pri"
181 (("/bin/ls") (which "ls")))
182 (substitute* "qtwebengine/src/3rdparty/chromium/build/common.gypi"
183 (("/bin/echo") (which "echo")))
184 (substitute* "qtwebengine/src/3rdparty/chromium/third_party/\
185 WebKit/Source/build/scripts/scripts.gypi"
186 (("/usr/bin/gcc") (which "gcc")))
187 (setenv "NINJA_PATH" (which "ninja"))
188 ;; do not pass "--enable-fast-install", which makes the
189 ;; configure process fail
197 ;; explicitly link with openssl instead of dlopening it
199 ;; explicitly link with dbus instead of dlopening it
201 ;; drop special machine instructions not supported
202 ;; on all instances of the target
203 ,@(if (string-prefix? "x86_64"
204 (or (%current-target-system)
217 (home-page "http://qt-project.org/")
218 (synopsis "Cross-platform GUI library")
219 (description "Qt is a cross-platform application and UI framework for
220 developers using C++ or QML, a CSS & JavaScript like language.")
223 ;; Qt 4: 'QBasicAtomicPointer' leads to build failures on MIPS;
224 ;; see <http://hydra.gnu.org/build/112828>.
225 ;; Qt 5: assembler error; see <http://hydra.gnu.org/build/112526>.
226 (supported-systems (delete "mips64el-linux" %supported-systems))))
229 (package (inherit qt)
233 (uri (string-append "http://download.qt-project.org/official_releases/qt/"
234 (string-copy version 0 (string-rindex version #\.))
236 "/qt-everywhere-opensource-src-"
240 "183fca7n7439nlhxyg1z7aky0izgbyll3iwakw4gwivy16aj5272"))
241 (patches (map search-patch
242 '("qt4-ldflags.patch" "qt4-tests.patch")))))
243 (inputs `(,@(alist-delete "libjpeg" (package-inputs qt))
244 ("libjepg" ,libjpeg-8)
247 ;; Note: there are 37 MiB of examples and a '-exampledir' configure flags,
248 ;; but we can't make them a separate output because "out" and "examples"
249 ;; would refer to each other.
250 (outputs '("out" ;112MiB core + 37MiB examples
251 "doc")) ;280MiB of HTML + code
254 (modify-phases %standard-phases
257 (lambda* (#:key outputs #:allow-other-keys)
258 (let ((out (assoc-ref outputs "out"))
259 (doc (assoc-ref outputs "doc")))
260 (substitute* '("configure")
261 (("/bin/pwd") (which "pwd")))
267 ;; Note: Don't pass '-docdir' since 'qmake' and
268 ;; libQtCore would record its value, thereby defeating
269 ;; the whole point of having a separate output.
270 "-datadir" (string-append out "/share/qt-" ,version
272 "-importdir" (string-append out "/lib/qt-4"
274 "-plugindir" (string-append out "/lib/qt-4"
276 "-translationdir" (string-append out "/share/qt-" ,version
278 "-demosdir" (string-append out "/share/qt-" ,version
280 "-examplesdir" (string-append out "/share/qt-" ,version
284 ;; explicitly link with dbus instead of dlopening it
286 ;; drop special machine instructions not supported
287 ;; on all instances of the target
288 ,@(if (string-prefix? "x86_64"
289 (or (%current-target-system)
303 (lambda* (#:key outputs #:allow-other-keys)
304 ;; Because of qt4-documentation-path.patch, documentation ends up
305 ;; being installed in OUT. Move it to the right place.
306 (let* ((out (assoc-ref outputs "out"))
307 (doc (assoc-ref outputs "doc"))
308 (olddoc (string-append out "/doc"))
309 (docdir (string-append doc "/share/doc/qt-" ,version)))
310 (mkdir-p (dirname docdir))
312 ;; Note: We can't use 'rename-file' here because OUT and DOC are
313 ;; different "devices" due to bind-mounts.
314 (copy-recursively olddoc docdir)
315 (delete-file-recursively olddoc)
318 (define-public python-sip
326 (string-append "mirror://sourceforge/pyqt/sip/"
327 "sip-" version "/sip-"
331 "11qy1z88py2q7rz68rm7214pbd37538hpcbfj5hhzp5y616a62x0"))))
332 (build-system gnu-build-system)
334 `(("python" ,python-wrapper)))
336 `(#:tests? #f ; no check target
340 (lambda* (#:key inputs outputs #:allow-other-keys)
341 (let* ((out (assoc-ref outputs "out"))
342 (bin (string-append out "/bin"))
343 (include (string-append out "/include"))
346 (string-take-right (assoc-ref inputs "python") 5)
348 (lib (string-append out "/lib/python"
352 (system* "python" "configure.py"
355 "--incdir" include))))
357 (home-page "http://www.riverbankcomputing.com/software/sip/intro")
358 (synopsis "Python binding creator for C and C++ libraries")
360 "SIP is a tool to create Python bindings for C and C++ libraries. It
361 was originally developed to create PyQt, the Python bindings for the Qt
362 toolkit, but can be used to create bindings for any C or C++ library.
364 SIP comprises a code generator and a Python module. The code generator
365 processes a set of specification files and generates C or C++ code, which
366 is then compiled to create the bindings extension module. The SIP Python
367 module provides support functions to the automatically generated code.")
368 ;; There is a choice between a python like license, gpl2 and gpl3.
369 ;; For compatibility with pyqt, we need gpl3.
372 (define-public python2-sip
373 (package (inherit python-sip)
376 `(("python" ,python-2)))))
378 (define-public python-pyqt
386 (string-append "mirror://sourceforge/pyqt/PyQt5/"
387 "PyQt-" version "/PyQt-gpl-"
391 "0cbpa63whi8a5akff4pcnfwzpzx7ycac2ynj00ly52m6zbsn80kn"))
392 (patches (list (search-patch "pyqt-configure.patch")))))
393 (build-system gnu-build-system)
395 `(("python-sip" ,python-sip)
396 ("qt" ,qt))) ; for qmake
398 `(("python" ,python-wrapper)))
403 (lambda* (#:key inputs outputs #:allow-other-keys)
404 (let* ((out (assoc-ref outputs "out"))
405 (bin (string-append out "/bin"))
406 (sip (string-append out "/share/sip"))
407 (plugins (string-append out "/plugins"))
408 (designer (string-append plugins "/designer"))
409 (qml (string-append plugins "/PyQt5"))
412 (string-take-right (assoc-ref inputs "python") 5)
414 (lib (string-append out "/lib/python"
417 (zero? (system* "python" "configure.py"
421 "--designer-plugindir" designer
422 "--qml-plugindir" qml
425 (home-page "http://www.riverbankcomputing.com/software/pyqt/intro")
426 (synopsis "Python bindings for Qt")
428 "PyQt is a set of Python v2 and v3 bindings for the Qt application
429 framework. The bindings are implemented as a set of Python modules and
430 contain over 620 classes.")
433 (define-public python2-pyqt
434 (package (inherit python-pyqt)
435 (name "python2-pyqt")
437 `(("python-sip" ,python2-sip)
440 `(("python" ,python-2)))))
442 (define-public python-pyqt-4
443 (package (inherit python-pyqt)
450 (string-append "mirror://sourceforge/pyqt/PyQt4/"
451 "PyQt-" version "/PyQt-x11-gpl-"
455 "11jnfjw79s0b0qdd9s6kd69w87vf16dhagbhbmwbmrp2vgf80dw5"))))
457 `(("python-sip" ,python-sip)
460 `(#:tests? #f ; no check target
464 (lambda* (#:key inputs outputs #:allow-other-keys)
465 (let* ((out (assoc-ref outputs "out"))
466 (bin (string-append out "/bin"))
467 (sip (string-append out "/share/sip"))
470 (string-take-right (assoc-ref inputs "python") 5)
472 (lib (string-append out "/lib/python"
475 (zero? (system* "python" "configure.py"
481 (license (list gpl2 gpl3)))) ; choice of either license
483 (define-public python2-pyqt-4
484 (package (inherit python-pyqt-4)
485 (name "python2-pyqt")
487 `(("python-sip" ,python2-sip)
490 `(("python" ,python-2)))))