gnu: Move content of openssl module into tls module.
[jackhill/guix/guix.git] / gnu / packages / qt.scm
CommitLineData
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>
31580979 4;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
bd677c2d
AE
5;;;
6;;; This file is part of GNU Guix.
7;;;
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.
12;;;
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.
17;;;
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/>.
20
21(define-module (gnu packages qt)
3e291958 22 #:use-module ((guix licenses) #:select (gpl2 gpl3 lgpl2.1 x11-style))
bd677c2d
AE
23 #:use-module (guix packages)
24 #:use-module (guix download)
f198ffd0 25 #:use-module (guix build utils)
bd677c2d 26 #:use-module (guix build-system gnu)
84ef83dd
AE
27 #:use-module (guix packages)
28 #:use-module (guix utils)
1e9ed0e3 29 #:use-module (gnu packages)
b332e366
AE
30 #:use-module (gnu packages bison)
31 #:use-module (gnu packages compression)
2cba3d6f
SB
32 #:use-module (gnu packages cups)
33 #:use-module (gnu packages databases)
b332e366 34 #:use-module (gnu packages fontutils)
0009ed71 35 #:use-module (gnu packages flex)
8b6a5e0f 36 #:use-module (gnu packages gl)
b332e366 37 #:use-module (gnu packages glib)
0009ed71
SB
38 #:use-module (gnu packages gnuzilla)
39 #:use-module (gnu packages gperf)
b332e366 40 #:use-module (gnu packages icu4c)
e55354b8 41 #:use-module (gnu packages image)
b332e366 42 #:use-module (gnu packages linux)
5f96f303 43 #:use-module (gnu packages databases)
0009ed71 44 #:use-module (gnu packages ninja)
0009ed71
SB
45 #:use-module (gnu packages pciutils)
46 #:use-module (gnu packages pcre)
b332e366
AE
47 #:use-module (gnu packages perl)
48 #:use-module (gnu packages pkg-config)
39fa8f6c 49 #:use-module (gnu packages pulseaudio)
b332e366 50 #:use-module (gnu packages python)
8b6a5e0f 51 #:use-module (gnu packages ruby)
cc2b77df 52 #:use-module (gnu packages tls)
0009ed71
SB
53 #:use-module (gnu packages xdisorg)
54 #:use-module (gnu packages xorg)
55 #:use-module (gnu packages xml))
bd677c2d
AE
56
57(define-public libxkbcommon
58 (package
59 (name "libxkbcommon")
ff53457d 60 (version "0.5.0")
bd677c2d
AE
61 (source (origin
62 (method url-fetch)
63 (uri (string-append "http://xkbcommon.org/download/" name "-"
64 version ".tar.xz"))
65 (sha256
66 (base32
ff53457d 67 "176ii5dn2wh74q48sd8ac37ljlvgvp5f506glr96z6ibfhj7igch"))))
bd677c2d 68 (build-system gnu-build-system)
ff53457d 69 (inputs
5dee80dd
AE
70 `(("libx11" ,libx11)
71 ("libxcb" ,libxcb)
72 ("xkeyboard-config" ,xkeyboard-config)))
c4c4cc05 73 (native-inputs
ff53457d
AE
74 `(("bison" ,bison)
75 ("pkg-config" ,pkg-config)))
5dee80dd
AE
76 (arguments
77 `(#:configure-flags
78 (list (string-append "--with-xkb-config-root="
79 (assoc-ref %build-inputs "xkeyboard-config")
80 "/share/X11/xkb")
81 (string-append "--with-x-locale-root="
82 (assoc-ref %build-inputs "libx11")
83 "/share/X11/locale"))))
bd677c2d 84 (home-page "http://xkbcommon.org/")
35b9e423 85 (synopsis "Library to handle keyboard descriptions")
bd677c2d
AE
86 (description "Xkbcommon is a library to handle keyboard descriptions,
87including loading them from disk, parsing them and handling their
88state. It is mainly meant for client toolkits, window systems, and other
89system applications; currently that includes Wayland, kmscon, GTK+, Qt,
90Clutter, and more. Despite the name, it is not currently used by anything
91X11 (yet).")
92 (license (x11-style "file://COPYING"
93 "See 'COPYING' in the distribution."))))
b332e366
AE
94
95(define-public qt
96 (package
97 (name "qt")
a33b8449 98 (version "5.4.2")
b332e366
AE
99 (source (origin
100 (method url-fetch)
101 (uri (string-append "http://download.qt-project.org/official_releases/qt/"
102 (string-copy version 0 (string-rindex version #\.))
103 "/" version
104 "/single/qt-everywhere-opensource-src-"
f198ffd0 105 version ".tar.xz"))
b332e366
AE
106 (sha256
107 (base32
a33b8449 108 "09gay5cimfdb0apy60v7z4r4zkl2vjysdppzihpla8dp2c30fvcc"))
9e63a388
TUBK
109 (patches (list (search-patch "qt5-conflicting-typedefs.patch")
110 (search-patch "qt5-runpath.patch")))
5b490ab5
SB
111 (snippet
112 '(begin
113 ;; Remove broken symlinks.
114 (delete-file "qtwebengine/src/3rdparty/chromium/third_party/\
115mesa/src/src/gallium/state_trackers/d3d1x/w32api")
116 (delete-file "qtwebengine/src/3rdparty/chromium/third_party/\
117webrtc/tools/e2e_quality/audio/perf")))))
b332e366 118 (build-system gnu-build-system)
ef0cf53e
AE
119 (propagated-inputs
120 `(("mesa" ,mesa)))
b332e366 121 (inputs
b332e366
AE
122 `(("alsa-lib" ,alsa-lib)
123 ("dbus" ,dbus)
2cba3d6f 124 ("cups" ,cups)
0009ed71 125 ("expat" ,expat)
b332e366
AE
126 ("fontconfig" ,fontconfig)
127 ("freetype" ,freetype)
128 ("glib" ,glib)
129 ("icu4c" ,icu4c)
f198ffd0 130 ("libjpeg" ,libjpeg)
2cba3d6f 131 ("libmng" ,libmng)
0009ed71 132 ("libpci" ,pciutils)
b332e366
AE
133 ("libpng" ,libpng)
134 ("libx11" ,libx11)
0009ed71
SB
135 ("libxcomposite" ,libxcomposite)
136 ("libxcursor" ,libxcursor)
137 ("libxfixes" ,libxfixes)
b332e366 138 ("libxi" ,libxi)
0009ed71 139 ("libxinerama" ,libxinerama)
b332e366 140 ("libxkbcommon" ,libxkbcommon)
0009ed71
SB
141 ("libxml2" ,libxml2)
142 ("libxrandr" ,libxrandr)
b332e366 143 ("libxrender" ,libxrender)
0009ed71
SB
144 ("libxslt" ,libxslt)
145 ("libxtst" ,libxtst)
146 ("mtdev" ,mtdev)
b332e366 147 ("mysql" ,mysql)
0009ed71 148 ("nss" ,nss)
b332e366 149 ("openssl" ,openssl)
2cba3d6f 150 ("postgresql" ,postgresql)
39fa8f6c 151 ("pulseaudio" ,pulseaudio)
0009ed71
SB
152 ("pcre" ,pcre)
153 ("sqlite" ,sqlite)
154 ("udev" ,eudev)
2cba3d6f 155 ("unixodbc" ,unixodbc)
b332e366
AE
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)
161 ("zlib" ,zlib)))
c4c4cc05 162 (native-inputs
0009ed71
SB
163 `(("bison" ,bison)
164 ("flex" ,flex)
165 ("gperf" ,gperf)
166 ("ninja" ,ninja)
167 ("perl" ,perl)
168 ("pkg-config" ,pkg-config)
169 ("python" ,python-2)
170 ("ruby" ,ruby)
ce0614dd 171 ("which" ,(@ (gnu packages base) which))))
b332e366
AE
172 (arguments
173 `(#:phases
174 (alist-replace
175 'configure
176 (lambda* (#:key outputs #:allow-other-keys)
177 (let ((out (assoc-ref outputs "out")))
178 (substitute* '("configure" "qtbase/configure")
5b490ab5
SB
179 (("/bin/pwd") (which "pwd")))
180 (substitute* "qtbase/src/corelib/global/global.pri"
181 (("/bin/ls") (which "ls")))
0009ed71
SB
182 (substitute* "qtwebengine/src/3rdparty/chromium/build/common.gypi"
183 (("/bin/echo") (which "echo")))
184 (substitute* "qtwebengine/src/3rdparty/chromium/third_party/\
185WebKit/Source/build/scripts/scripts.gypi"
186 (("/usr/bin/gcc") (which "gcc")))
187 (setenv "NINJA_PATH" (which "ninja"))
b332e366
AE
188 ;; do not pass "--enable-fast-install", which makes the
189 ;; configure process fail
206a5208
AE
190 (zero? (system*
191 "./configure"
192 "-verbose"
193 "-prefix" out
194 "-opensource"
195 "-confirm-license"
0009ed71
SB
196 "-system-sqlite"
197 ;; explicitly link with openssl instead of dlopening it
198 "-openssl-linked"
ff0a8c59
AE
199 ;; explicitly link with dbus instead of dlopening it
200 "-dbus-linked"
206a5208
AE
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)
205 (%current-system)))
206 '()
207 '("-no-sse2"))
208 "-no-sse3"
209 "-no-ssse3"
210 "-no-sse4.1"
211 "-no-sse4.2"
212 "-no-avx"
213 "-no-avx2"
206a5208
AE
214 "-no-mips_dsp"
215 "-no-mips_dspr2"))))
b332e366
AE
216 %standard-phases)))
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
220developers using C++ or QML, a CSS & JavaScript like language.")
f47638a3
LC
221 (license lgpl2.1)
222
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))))
1e9ed0e3
AE
227
228(define-public qt-4
229 (package (inherit qt)
d22b9397 230 (version "4.8.7")
1e9ed0e3
AE
231 (source (origin
232 (method url-fetch)
233 (uri (string-append "http://download.qt-project.org/official_releases/qt/"
234 (string-copy version 0 (string-rindex version #\.))
235 "/" version
89059aa1 236 "/qt-everywhere-opensource-src-"
1e9ed0e3
AE
237 version ".tar.gz"))
238 (sha256
239 (base32
d22b9397 240 "183fca7n7439nlhxyg1z7aky0izgbyll3iwakw4gwivy16aj5272"))
d2984346
LC
241 (patches (map search-patch
242 '("qt4-ldflags.patch" "qt4-tests.patch")))))
f198ffd0 243 (inputs `(,@(alist-delete "libjpeg" (package-inputs qt))
e7e5a4f8
AE
244 ("libjepg" ,libjpeg-8)
245 ("libsm" ,libsm)))
31580979
LC
246
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
1e9ed0e3
AE
252 (arguments
253 `(#:phases
cba632c4
LC
254 (modify-phases %standard-phases
255 (replace
1e9ed0e3
AE
256 'configure
257 (lambda* (#:key outputs #:allow-other-keys)
31580979
LC
258 (let ((out (assoc-ref outputs "out"))
259 (doc (assoc-ref outputs "doc")))
1e9ed0e3 260 (substitute* '("configure")
d2984346
LC
261 (("/bin/pwd") (which "pwd")))
262
206a5208
AE
263 (zero? (system*
264 "./configure"
265 "-verbose"
266 "-prefix" out
4b0f2ef7
LC
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.
ff1989a5
LC
270 "-datadir" (string-append out "/share/qt-" ,version
271 "/data")
272 "-importdir" (string-append out "/lib/qt-4"
273 "/imports")
274 "-plugindir" (string-append out "/lib/qt-4"
275 "/plugins")
276 "-translationdir" (string-append out "/share/qt-" ,version
277 "/translations")
31580979
LC
278 "-demosdir" (string-append out "/share/qt-" ,version
279 "/demos")
280 "-examplesdir" (string-append out "/share/qt-" ,version
281 "/examples")
206a5208
AE
282 "-opensource"
283 "-confirm-license"
ff0a8c59
AE
284 ;; explicitly link with dbus instead of dlopening it
285 "-dbus-linked"
206a5208
AE
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)
290 (%current-system)))
291 '()
292 '("-no-mmx"
1e9ed0e3
AE
293 "-no-3dnow"
294 "-no-sse"
206a5208
AE
295 "-no-sse2"))
296 "-no-sse3"
297 "-no-ssse3"
298 "-no-sse4.1"
299 "-no-sse4.2"
300 "-no-avx"
4b0f2ef7
LC
301 "-no-neon")))))
302 (add-after
303 'install 'move-doc
304 (lambda* (#:key outputs #:allow-other-keys)
305 ;; Because of qt4-documentation-path.patch, documentation ends up
306 ;; being installed in OUT. Move it to the right place.
307 (let* ((out (assoc-ref outputs "out"))
308 (doc (assoc-ref outputs "doc"))
309 (olddoc (string-append out "/doc"))
310 (docdir (string-append doc "/share/doc/qt-" ,version)))
311 (mkdir-p (dirname docdir))
312
313 ;; Note: We can't use 'rename-file' here because OUT and DOC are
314 ;; different "devices" due to bind-mounts.
315 (copy-recursively olddoc docdir)
316 (delete-file-recursively olddoc)
317 #t))))))))
84ef83dd
AE
318
319(define-public python-sip
320 (package
321 (name "python-sip")
322 (version "4.16.5")
323 (source
324 (origin
325 (method url-fetch)
326 (uri
327 (string-append "mirror://sourceforge/pyqt/sip/"
328 "sip-" version "/sip-"
329 version ".tar.gz"))
330 (sha256
331 (base32
332 "11qy1z88py2q7rz68rm7214pbd37538hpcbfj5hhzp5y616a62x0"))))
333 (build-system gnu-build-system)
334 (native-inputs
335 `(("python" ,python-wrapper)))
336 (arguments
337 `(#:tests? #f ; no check target
338 #:phases
339 (alist-replace
340 'configure
341 (lambda* (#:key inputs outputs #:allow-other-keys)
342 (let* ((out (assoc-ref outputs "out"))
343 (bin (string-append out "/bin"))
344 (include (string-append out "/include"))
345 (python-version
346 (string-take
347 (string-take-right (assoc-ref inputs "python") 5)
348 3))
349 (lib (string-append out "/lib/python"
350 python-version
351 "/site-packages")))
352 (zero?
353 (system* "python" "configure.py"
354 "--bindir" bin
355 "--destdir" lib
356 "--incdir" include))))
357 %standard-phases)))
358 (home-page "http://www.riverbankcomputing.com/software/sip/intro")
359 (synopsis "Python binding creator for C and C++ libraries")
360 (description
361 "SIP is a tool to create Python bindings for C and C++ libraries. It
362was originally developed to create PyQt, the Python bindings for the Qt
363toolkit, but can be used to create bindings for any C or C++ library.
364
365SIP comprises a code generator and a Python module. The code generator
366processes a set of specification files and generates C or C++ code, which
367is then compiled to create the bindings extension module. The SIP Python
368module provides support functions to the automatically generated code.")
369 ;; There is a choice between a python like license, gpl2 and gpl3.
370 ;; For compatibility with pyqt, we need gpl3.
371 (license gpl3)))
372
373(define-public python2-sip
374 (package (inherit python-sip)
375 (name "python2-sip")
376 (native-inputs
377 `(("python" ,python-2)))))
014e7dd8
AE
378
379(define-public python-pyqt
380 (package
381 (name "python-pyqt")
382 (version "5.4")
383 (source
384 (origin
385 (method url-fetch)
386 (uri
387 (string-append "mirror://sourceforge/pyqt/PyQt5/"
388 "PyQt-" version "/PyQt-gpl-"
389 version ".tar.gz"))
390 (sha256
391 (base32
392 "0cbpa63whi8a5akff4pcnfwzpzx7ycac2ynj00ly52m6zbsn80kn"))
393 (patches (list (search-patch "pyqt-configure.patch")))))
394 (build-system gnu-build-system)
395 (native-inputs
396 `(("python-sip" ,python-sip)
397 ("qt" ,qt))) ; for qmake
398 (inputs
399 `(("python" ,python-wrapper)))
400 (arguments
401 `(#:phases
402 (alist-replace
403 'configure
404 (lambda* (#:key inputs outputs #:allow-other-keys)
405 (let* ((out (assoc-ref outputs "out"))
406 (bin (string-append out "/bin"))
407 (sip (string-append out "/share/sip"))
408 (plugins (string-append out "/plugins"))
409 (designer (string-append plugins "/designer"))
410 (qml (string-append plugins "/PyQt5"))
411 (python-version
412 (string-take
413 (string-take-right (assoc-ref inputs "python") 5)
414 3))
415 (lib (string-append out "/lib/python"
416 python-version
417 "/site-packages")))
418 (zero? (system* "python" "configure.py"
419 "--confirm-license"
420 "--bindir" bin
421 "--destdir" lib
422 "--designer-plugindir" designer
423 "--qml-plugindir" qml
424 "--sipdir" sip))))
425 %standard-phases)))
426 (home-page "http://www.riverbankcomputing.com/software/pyqt/intro")
427 (synopsis "Python bindings for Qt")
428 (description
429 "PyQt is a set of Python v2 and v3 bindings for the Qt application
430framework. The bindings are implemented as a set of Python modules and
431contain over 620 classes.")
432 (license gpl3)))
433
434(define-public python2-pyqt
435 (package (inherit python-pyqt)
436 (name "python2-pyqt")
437 (native-inputs
438 `(("python-sip" ,python2-sip)
439 ("qt" ,qt)))
440 (inputs
441 `(("python" ,python-2)))))
3e291958
AE
442
443(define-public python-pyqt-4
444 (package (inherit python-pyqt)
445 (name "python-pyqt")
446 (version "4.11.3")
447 (source
448 (origin
449 (method url-fetch)
450 (uri
451 (string-append "mirror://sourceforge/pyqt/PyQt4/"
452 "PyQt-" version "/PyQt-x11-gpl-"
453 version ".tar.gz"))
454 (sha256
455 (base32
456 "11jnfjw79s0b0qdd9s6kd69w87vf16dhagbhbmwbmrp2vgf80dw5"))))
457 (native-inputs
458 `(("python-sip" ,python-sip)
459 ("qt" ,qt-4)))
460 (arguments
461 `(#:tests? #f ; no check target
462 #:phases
463 (alist-replace
464 'configure
465 (lambda* (#:key inputs outputs #:allow-other-keys)
466 (let* ((out (assoc-ref outputs "out"))
467 (bin (string-append out "/bin"))
468 (sip (string-append out "/share/sip"))
469 (python-version
470 (string-take
471 (string-take-right (assoc-ref inputs "python") 5)
472 3))
473 (lib (string-append out "/lib/python"
474 python-version
475 "/site-packages")))
476 (zero? (system* "python" "configure.py"
477 "--confirm-license"
478 "--bindir" bin
479 "--destdir" lib
480 "--sipdir" sip))))
481 %standard-phases)))
482 (license (list gpl2 gpl3)))) ; choice of either license
483
484(define-public python2-pyqt-4
485 (package (inherit python-pyqt-4)
486 (name "python2-pyqt")
487 (native-inputs
488 `(("python-sip" ,python2-sip)
489 ("qt" ,qt-4)))
490 (inputs
491 `(("python" ,python-2)))))