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 gtk)
41 #:use-module (gnu packages icu4c)
42 #:use-module (gnu packages image)
43 #:use-module (gnu packages linux)
44 #:use-module (gnu packages databases)
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."))))
103 "http://download.qt.io/official_releases/qt/"
104 (version-major+minor version)
106 "/single/qt-everywhere-opensource-src-"
110 "1by2l8wxbqwvs7anb5ggmqhn2cfmhyw3a23bp1yyd240rdpa38ky"))
111 (patches (list (search-patch "qt5-runpath.patch")))))
112 (build-system gnu-build-system)
116 `(("alsa-lib" ,alsa-lib)
120 ("fontconfig" ,fontconfig)
121 ("freetype" ,freetype)
123 ("harfbuzz" ,harfbuzz)
130 ("libxcomposite" ,libxcomposite)
131 ("libxcursor" ,libxcursor)
132 ("libxfixes" ,libxfixes)
134 ("libxinerama" ,libxinerama)
135 ("libxkbcommon" ,libxkbcommon)
137 ("libxrandr" ,libxrandr)
138 ("libxrender" ,libxrender)
145 ("postgresql" ,postgresql)
146 ("pulseaudio" ,pulseaudio)
150 ("unixodbc" ,unixodbc)
151 ("xcb-util" ,xcb-util)
152 ("xcb-util-image" ,xcb-util-image)
153 ("xcb-util-keysyms" ,xcb-util-keysyms)
154 ("xcb-util-renderutil" ,xcb-util-renderutil)
155 ("xcb-util-wm" ,xcb-util-wm)
161 ;; Ninja is only needed for the disabled qtwebengine
164 ("pkg-config" ,pkg-config)
167 ("which" ,(@ (gnu packages base) which))))
172 (lambda* (#:key outputs #:allow-other-keys)
173 (let ((out (assoc-ref outputs "out")))
174 (substitute* '("configure" "qtbase/configure")
175 (("/bin/pwd") (which "pwd")))
176 (substitute* "qtbase/src/corelib/global/global.pri"
177 (("/bin/ls") (which "ls")))
178 ;; commented out since qtwebengine is not built, but left in
180 ;; (substitute* "qtwebengine/src/3rdparty/chromium/build/common.gypi"
181 ;; (("/bin/echo") (which "echo")))
182 ;; (substitute* "qtwebengine/src/3rdparty/chromium/third_party/\
183 ;; WebKit/Source/build/scripts/scripts.gypi"
184 ;; (("/usr/bin/gcc") (which "gcc")))
185 ;; (setenv "NINJA_PATH" (which "ninja"))
186 ;; do not pass "--enable-fast-install", which makes the
187 ;; configure process fail
195 ;; explicitly link with openssl instead of dlopening it
197 ;; explicitly link with dbus instead of dlopening it
199 ;; drop chromium module (qtwebengine); it fails
200 ;; compilation in qt 5.5:
201 ;; 3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc:362:10:
202 ;; error: cannot convert ‘bool’ to ‘boolean’ in return
203 ;; and might pose security problems.
204 "-skip" "qtwebengine"
205 ;; drop special machine instructions not supported
206 ;; on all instances of the target
207 ,@(if (string-prefix? "x86_64"
208 (or (%current-target-system)
221 (home-page "http://qt-project.org/")
222 (synopsis "Cross-platform GUI library")
223 (description "Qt is a cross-platform application and UI framework for
224 developers using C++ or QML, a CSS & JavaScript like language.")
227 ;; Qt 4: 'QBasicAtomicPointer' leads to build failures on MIPS;
228 ;; see <http://hydra.gnu.org/build/112828>.
229 ;; Qt 5: assembler error; see <http://hydra.gnu.org/build/112526>.
230 (supported-systems (delete "mips64el-linux" %supported-systems))))
233 (package (inherit qt)
237 (uri (string-append "http://download.qt-project.org/official_releases/qt/"
238 (string-copy version 0 (string-rindex version #\.))
240 "/qt-everywhere-opensource-src-"
244 "183fca7n7439nlhxyg1z7aky0izgbyll3iwakw4gwivy16aj5272"))
245 (patches (map search-patch
246 '("qt4-ldflags.patch" "qt4-tests.patch")))))
247 (inputs `(,@(alist-delete "harfbuzz"
248 (alist-delete "libjpeg" (package-inputs qt)))
249 ("libjepg" ,libjpeg-8)
252 ;; Note: there are 37 MiB of examples and a '-exampledir' configure flags,
253 ;; but we can't make them a separate output because "out" and "examples"
254 ;; would refer to each other.
255 (outputs '("out" ;112MiB core + 37MiB examples
256 "doc")) ;280MiB of HTML + code
259 (modify-phases %standard-phases
262 (lambda* (#:key outputs #:allow-other-keys)
263 (let ((out (assoc-ref outputs "out"))
264 (doc (assoc-ref outputs "doc")))
265 (substitute* '("configure")
266 (("/bin/pwd") (which "pwd")))
272 ;; Note: Don't pass '-docdir' since 'qmake' and
273 ;; libQtCore would record its value, thereby defeating
274 ;; the whole point of having a separate output.
275 "-datadir" (string-append out "/share/qt-" ,version
277 "-importdir" (string-append out "/lib/qt-4"
279 "-plugindir" (string-append out "/lib/qt-4"
281 "-translationdir" (string-append out "/share/qt-" ,version
283 "-demosdir" (string-append out "/share/qt-" ,version
285 "-examplesdir" (string-append out "/share/qt-" ,version
289 ;; explicitly link with dbus instead of dlopening it
291 ;; drop special machine instructions not supported
292 ;; on all instances of the target
293 ,@(if (string-prefix? "x86_64"
294 (or (%current-target-system)
308 (lambda* (#:key outputs #:allow-other-keys)
309 ;; Because of qt4-documentation-path.patch, documentation ends up
310 ;; being installed in OUT. Move it to the right place.
311 (let* ((out (assoc-ref outputs "out"))
312 (doc (assoc-ref outputs "doc"))
313 (olddoc (string-append out "/doc"))
314 (docdir (string-append doc "/share/doc/qt-" ,version)))
315 (mkdir-p (dirname docdir))
317 ;; Note: We can't use 'rename-file' here because OUT and DOC are
318 ;; different "devices" due to bind-mounts.
319 (copy-recursively olddoc docdir)
320 (delete-file-recursively olddoc)
323 (define-public python-sip
331 (string-append "mirror://sourceforge/pyqt/sip/"
332 "sip-" version "/sip-"
336 "11qy1z88py2q7rz68rm7214pbd37538hpcbfj5hhzp5y616a62x0"))))
337 (build-system gnu-build-system)
339 `(("python" ,python-wrapper)))
341 `(#:tests? #f ; no check target
345 (lambda* (#:key inputs outputs #:allow-other-keys)
346 (let* ((out (assoc-ref outputs "out"))
347 (bin (string-append out "/bin"))
348 (include (string-append out "/include"))
351 (string-take-right (assoc-ref inputs "python") 5)
353 (lib (string-append out "/lib/python"
357 (system* "python" "configure.py"
360 "--incdir" include))))
362 (home-page "http://www.riverbankcomputing.com/software/sip/intro")
363 (synopsis "Python binding creator for C and C++ libraries")
365 "SIP is a tool to create Python bindings for C and C++ libraries. It
366 was originally developed to create PyQt, the Python bindings for the Qt
367 toolkit, but can be used to create bindings for any C or C++ library.
369 SIP comprises a code generator and a Python module. The code generator
370 processes a set of specification files and generates C or C++ code, which
371 is then compiled to create the bindings extension module. The SIP Python
372 module provides support functions to the automatically generated code.")
373 ;; There is a choice between a python like license, gpl2 and gpl3.
374 ;; For compatibility with pyqt, we need gpl3.
377 (define-public python2-sip
378 (package (inherit python-sip)
381 `(("python" ,python-2)))))
383 (define-public python-pyqt
391 (string-append "mirror://sourceforge/pyqt/PyQt5/"
392 "PyQt-" version "/PyQt-gpl-"
396 "0cbpa63whi8a5akff4pcnfwzpzx7ycac2ynj00ly52m6zbsn80kn"))
397 (patches (list (search-patch "pyqt-configure.patch")))))
398 (build-system gnu-build-system)
400 `(("python-sip" ,python-sip)
401 ("qt" ,qt))) ; for qmake
403 `(("python" ,python-wrapper)))
408 (lambda* (#:key inputs outputs #:allow-other-keys)
409 (let* ((out (assoc-ref outputs "out"))
410 (bin (string-append out "/bin"))
411 (sip (string-append out "/share/sip"))
412 (plugins (string-append out "/plugins"))
413 (designer (string-append plugins "/designer"))
414 (qml (string-append plugins "/PyQt5"))
417 (string-take-right (assoc-ref inputs "python") 5)
419 (lib (string-append out "/lib/python"
422 (zero? (system* "python" "configure.py"
426 "--designer-plugindir" designer
427 "--qml-plugindir" qml
430 (home-page "http://www.riverbankcomputing.com/software/pyqt/intro")
431 (synopsis "Python bindings for Qt")
433 "PyQt is a set of Python v2 and v3 bindings for the Qt application
434 framework. The bindings are implemented as a set of Python modules and
435 contain over 620 classes.")
438 (define-public python2-pyqt
439 (package (inherit python-pyqt)
440 (name "python2-pyqt")
442 `(("python-sip" ,python2-sip)
445 `(("python" ,python-2)))))
447 (define-public python-pyqt-4
448 (package (inherit python-pyqt)
455 (string-append "mirror://sourceforge/pyqt/PyQt4/"
456 "PyQt-" version "/PyQt-x11-gpl-"
460 "11jnfjw79s0b0qdd9s6kd69w87vf16dhagbhbmwbmrp2vgf80dw5"))))
462 `(("python-sip" ,python-sip)
465 `(#:tests? #f ; no check target
469 (lambda* (#:key inputs outputs #:allow-other-keys)
470 (let* ((out (assoc-ref outputs "out"))
471 (bin (string-append out "/bin"))
472 (sip (string-append out "/share/sip"))
475 (string-take-right (assoc-ref inputs "python") 5)
477 (lib (string-append out "/lib/python"
480 (zero? (system* "python" "configure.py"
486 (license (list gpl2 gpl3)))) ; choice of either license
488 (define-public python2-pyqt-4
489 (package (inherit python-pyqt-4)
490 (name "python2-pyqt")
492 `(("python-sip" ,python2-sip)
495 `(("python" ,python-2)))))