gnu: Add qttools.
[jackhill/guix/guix.git] / gnu / packages / qt.scm
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>
5 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages qt)
23 #:use-module ((guix licenses) #:select (bsd-3 gpl2 gpl3 lgpl2.1 lgpl2.1+ lgpl3 x11-style))
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build utils)
27 #:use-module (guix build-system cmake)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix packages)
30 #:use-module (guix utils)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages bison)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages cups)
35 #:use-module (gnu packages databases)
36 #:use-module (gnu packages fontutils)
37 #:use-module (gnu packages flex)
38 #:use-module (gnu packages freedesktop)
39 #:use-module (gnu packages gl)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gnuzilla)
42 #:use-module (gnu packages gperf)
43 #:use-module (gnu packages gtk)
44 #:use-module (gnu packages icu4c)
45 #:use-module (gnu packages image)
46 #:use-module (gnu packages linux)
47 #:use-module (gnu packages databases)
48 #:use-module (gnu packages pciutils)
49 #:use-module (gnu packages pcre)
50 #:use-module (gnu packages perl)
51 #:use-module (gnu packages pkg-config)
52 #:use-module (gnu packages pulseaudio)
53 #:use-module (gnu packages python)
54 #:use-module (gnu packages ruby)
55 #:use-module (gnu packages tls)
56 #:use-module (gnu packages xdisorg)
57 #:use-module (gnu packages xorg)
58 #:use-module (gnu packages xml))
59
60 (define-public qt
61 (package
62 (name "qt")
63 (version "5.5.1")
64 (source (origin
65 (method url-fetch)
66 (uri
67 (string-append
68 "http://download.qt.io/official_releases/qt/"
69 (version-major+minor version)
70 "/" version
71 "/single/qt-everywhere-opensource-src-"
72 version ".tar.xz"))
73 (sha256
74 (base32
75 "0615cn4n3n78v48lnmapqz2jizm2pzrjwvsjlnsf4awrsiiqw0kg"))
76 (modules '((guix build utils)))
77 (snippet
78 '(begin
79 ;; Remove qtwebengine, which relies on a bundled copy of
80 ;; chromium. Not only does it fail compilation in qt 5.5:
81 ;; 3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc:362:10:
82 ;; error: cannot convert ‘bool’ to ‘boolean’ in return
83 ;; it might also pose security problems.
84 ;; Alternatively, we could use the "-skip qtwebengine"
85 ;; configuration option.
86 (delete-file-recursively "qtwebengine")
87 ;; Remove one of the two bundled harfbuzz copies in addition
88 ;; to passing "-system-harfbuzz".
89 (delete-file-recursively "qtbase/src/3rdparty/harfbuzz-ng")
90 ;; Remove the bundled sqlite copy in addition to
91 ;; passing "-system-sqlite".
92 (delete-file-recursively "qtbase/src/3rdparty/sqlite")))))
93 (build-system gnu-build-system)
94 (propagated-inputs
95 `(("mesa" ,mesa)))
96 (inputs
97 `(("alsa-lib" ,alsa-lib)
98 ("dbus" ,dbus)
99 ("cups" ,cups)
100 ("expat" ,expat)
101 ("fontconfig" ,fontconfig)
102 ("freetype" ,freetype)
103 ("glib" ,glib)
104 ("harfbuzz" ,harfbuzz)
105 ("icu4c" ,icu4c)
106 ("libjpeg" ,libjpeg)
107 ("libmng" ,libmng)
108 ("libpci" ,pciutils)
109 ("libpng" ,libpng)
110 ("libx11" ,libx11)
111 ("libxcomposite" ,libxcomposite)
112 ("libxcursor" ,libxcursor)
113 ("libxfixes" ,libxfixes)
114 ("libxi" ,libxi)
115 ("libxinerama" ,libxinerama)
116 ("libxkbcommon" ,libxkbcommon)
117 ("libxml2" ,libxml2)
118 ("libxrandr" ,libxrandr)
119 ("libxrender" ,libxrender)
120 ("libxslt" ,libxslt)
121 ("libxtst" ,libxtst)
122 ("mtdev" ,mtdev)
123 ("mysql" ,mysql)
124 ("nss" ,nss)
125 ("openssl" ,openssl)
126 ("postgresql" ,postgresql)
127 ("pulseaudio" ,pulseaudio)
128 ("pcre" ,pcre)
129 ("sqlite" ,sqlite)
130 ("udev" ,eudev)
131 ("unixodbc" ,unixodbc)
132 ("xcb-util" ,xcb-util)
133 ("xcb-util-image" ,xcb-util-image)
134 ("xcb-util-keysyms" ,xcb-util-keysyms)
135 ("xcb-util-renderutil" ,xcb-util-renderutil)
136 ("xcb-util-wm" ,xcb-util-wm)
137 ("zlib" ,zlib)))
138 (native-inputs
139 `(("bison" ,bison)
140 ("flex" ,flex)
141 ("gperf" ,gperf)
142 ("perl" ,perl)
143 ("pkg-config" ,pkg-config)
144 ("python" ,python-2)
145 ("ruby" ,ruby)
146 ("which" ,(@ (gnu packages base) which))))
147 (arguments
148 `(;; FIXME: Disabling parallel building is a quick hack to avoid the
149 ;; failure described in
150 ;; https://lists.gnu.org/archive/html/guix-devel/2016-01/msg00837.html
151 ;; A more structural fix is needed.
152 #:parallel-build? #f
153 #:phases
154 (alist-replace
155 'configure
156 (lambda* (#:key outputs #:allow-other-keys)
157 (let ((out (assoc-ref outputs "out")))
158 (substitute* '("configure" "qtbase/configure")
159 (("/bin/pwd") (which "pwd")))
160 (substitute* "qtbase/src/corelib/global/global.pri"
161 (("/bin/ls") (which "ls")))
162 ;; do not pass "--enable-fast-install", which makes the
163 ;; configure process fail
164 (zero? (system*
165 "./configure"
166 "-verbose"
167 "-prefix" out
168 "-opensource"
169 "-confirm-license"
170 ;; Most "-system-..." are automatic, but some use
171 ;; the bundled copy by default.
172 "-system-sqlite"
173 "-system-harfbuzz"
174 ;; explicitly link with openssl instead of dlopening it
175 "-openssl-linked"
176 ;; explicitly link with dbus instead of dlopening it
177 "-dbus-linked"
178 ;; drop special machine instructions not supported
179 ;; on all instances of the target
180 ,@(if (string-prefix? "x86_64"
181 (or (%current-target-system)
182 (%current-system)))
183 '()
184 '("-no-sse2"))
185 "-no-sse3"
186 "-no-ssse3"
187 "-no-sse4.1"
188 "-no-sse4.2"
189 "-no-avx"
190 "-no-avx2"
191 "-no-mips_dsp"
192 "-no-mips_dspr2"))))
193 %standard-phases)))
194 (home-page "http://qt-project.org/")
195 (synopsis "Cross-platform GUI library")
196 (description "Qt is a cross-platform application and UI framework for
197 developers using C++ or QML, a CSS & JavaScript like language.")
198 (license lgpl2.1)
199
200 ;; Qt 4: 'QBasicAtomicPointer' leads to build failures on MIPS;
201 ;; see <http://hydra.gnu.org/build/112828>.
202 ;; Qt 5: assembler error; see <http://hydra.gnu.org/build/112526>.
203 (supported-systems (delete "mips64el-linux" %supported-systems))))
204
205 (define-public qt-4
206 (package (inherit qt)
207 (version "4.8.7")
208 (source (origin
209 (method url-fetch)
210 (uri (string-append "http://download.qt-project.org/official_releases/qt/"
211 (string-copy version 0 (string-rindex version #\.))
212 "/" version
213 "/qt-everywhere-opensource-src-"
214 version ".tar.gz"))
215 (sha256
216 (base32
217 "183fca7n7439nlhxyg1z7aky0izgbyll3iwakw4gwivy16aj5272"))
218 (patches (search-patches "qt4-ldflags.patch"))
219 (modules '((guix build utils)))
220 (snippet
221 ;; Remove webkit module, which is not built.
222 '(delete-file-recursively "src/3rdparty/webkit"))))
223 (inputs `(,@(alist-delete "harfbuzz"
224 (alist-delete "libjpeg" (package-inputs qt)))
225 ("libjepg" ,libjpeg-8)
226 ("libsm" ,libsm)))
227
228 ;; Note: there are 37 MiB of examples and a '-exampledir' configure flags,
229 ;; but we can't make them a separate output because "out" and "examples"
230 ;; would refer to each other.
231 (outputs '("out" ;112MiB core + 37MiB examples
232 "doc")) ;280MiB of HTML + code
233 (arguments
234 `(#:phases
235 (modify-phases %standard-phases
236 (replace
237 'configure
238 (lambda* (#:key outputs #:allow-other-keys)
239 (let ((out (assoc-ref outputs "out"))
240 (doc (assoc-ref outputs "doc")))
241 (substitute* '("configure")
242 (("/bin/pwd") (which "pwd")))
243
244 (zero? (system*
245 "./configure"
246 "-verbose"
247 "-prefix" out
248 ;; Note: Don't pass '-docdir' since 'qmake' and
249 ;; libQtCore would record its value, thereby defeating
250 ;; the whole point of having a separate output.
251 "-datadir" (string-append out "/share/qt-" ,version
252 "/data")
253 "-importdir" (string-append out "/lib/qt-4"
254 "/imports")
255 "-plugindir" (string-append out "/lib/qt-4"
256 "/plugins")
257 "-translationdir" (string-append out "/share/qt-" ,version
258 "/translations")
259 "-demosdir" (string-append out "/share/qt-" ,version
260 "/demos")
261 "-examplesdir" (string-append out "/share/qt-" ,version
262 "/examples")
263 "-opensource"
264 "-confirm-license"
265 ;; explicitly link with dbus instead of dlopening it
266 "-dbus-linked"
267 ;; Skip the webkit module; it fails to build on armhf
268 ;; and, apart from that, may pose security risks.
269 "-no-webkit"
270 ;; drop special machine instructions not supported
271 ;; on all instances of the target
272 ,@(if (string-prefix? "x86_64"
273 (or (%current-target-system)
274 (%current-system)))
275 '()
276 '("-no-mmx"
277 "-no-3dnow"
278 "-no-sse"
279 "-no-sse2"))
280 "-no-sse3"
281 "-no-ssse3"
282 "-no-sse4.1"
283 "-no-sse4.2"
284 "-no-avx")))))
285 (add-after
286 'install 'move-doc
287 (lambda* (#:key outputs #:allow-other-keys)
288 ;; Because of qt4-documentation-path.patch, documentation ends up
289 ;; being installed in OUT. Move it to the right place.
290 (let* ((out (assoc-ref outputs "out"))
291 (doc (assoc-ref outputs "doc"))
292 (olddoc (string-append out "/doc"))
293 (docdir (string-append doc "/share/doc/qt-" ,version)))
294 (mkdir-p (dirname docdir))
295
296 ;; Note: We can't use 'rename-file' here because OUT and DOC are
297 ;; different "devices" due to bind-mounts.
298 (copy-recursively olddoc docdir)
299 (delete-file-recursively olddoc)
300 #t))))))))
301
302 (define-public qtbase
303 (package
304 (name "qtbase")
305 (version "5.6.1")
306 (source (origin
307 (method url-fetch)
308 (uri (string-append "https://download.qt.io/official_releases/qt/"
309 (version-major+minor version) "/" version
310 "/submodules/" name "-opensource-src-"
311 version ".tar.xz"))
312 (sha256
313 (base32
314 "0r3jrqymnnxrig4f11xvs33c26f0kzfakbp3kcbdpv795gpc276h"))
315 (modules '((guix build utils)))
316 (snippet
317 '(begin
318 ;; Remove one of the two bundled harfbuzz copies in addition
319 ;; to passing "-system-harfbuzz".
320 (delete-file-recursively "src/3rdparty/harfbuzz-ng")
321 ;; Remove the bundled sqlite copy in addition to
322 ;; passing "-system-sqlite".
323 (delete-file-recursively "src/3rdparty/sqlite")))))
324 (build-system gnu-build-system)
325 (propagated-inputs
326 `(("mesa" ,mesa)))
327 (inputs
328 `(("alsa-lib" ,alsa-lib)
329 ("cups" ,cups)
330 ("dbus" ,dbus)
331 ("expat" ,expat)
332 ("fontconfig" ,fontconfig)
333 ("freetype" ,freetype)
334 ("glib" ,glib)
335 ("harfbuzz" ,harfbuzz)
336 ("icu4c" ,icu4c)
337 ("libjpeg" ,libjpeg)
338 ("libmng" ,libmng)
339 ("libpng" ,libpng)
340 ("libx11" ,libx11)
341 ("libxcomposite" ,libxcomposite)
342 ("libxcursor" ,libxcursor)
343 ("libxfixes" ,libxfixes)
344 ("libxi" ,libxi)
345 ("libxinerama" ,libxinerama)
346 ("libxkbcommon" ,libxkbcommon)
347 ("libxml2" ,libxml2)
348 ("libxrandr" ,libxrandr)
349 ("libxrender" ,libxrender)
350 ("libxslt" ,libxslt)
351 ("libxtst" ,libxtst)
352 ("mtdev" ,mtdev)
353 ("mysql" ,mysql)
354 ("nss" ,nss)
355 ("openssl" ,openssl)
356 ("pcre" ,pcre)
357 ("postgresql" ,postgresql)
358 ("pulseaudio" ,pulseaudio)
359 ("sqlite" ,sqlite)
360 ("unixodbc" ,unixodbc)
361 ("xcb-util" ,xcb-util)
362 ("xcb-util-image" ,xcb-util-image)
363 ("xcb-util-keysyms" ,xcb-util-keysyms)
364 ("xcb-util-renderutil" ,xcb-util-renderutil)
365 ("xcb-util-wm" ,xcb-util-wm)
366 ("zlib" ,zlib)))
367 (native-inputs
368 `(("bison" ,bison)
369 ("flex" ,flex)
370 ("gperf" ,gperf)
371 ("perl" ,perl)
372 ("pkg-config" ,pkg-config)
373 ("python" ,python-2)
374 ("ruby" ,ruby)
375 ("which" ,(@ (gnu packages base) which))))
376 (arguments
377 `(#:phases
378 (modify-phases %standard-phases
379 (add-after 'configure 'patch-bin-sh
380 (lambda _
381 (substitute* '("config.status"
382 "configure"
383 "mkspecs/features/qt_functions.prf"
384 "qmake/library/qmakebuiltins.cpp")
385 (("/bin/sh") (which "sh")))
386 #t))
387 (replace 'configure
388 (lambda* (#:key outputs #:allow-other-keys)
389 (let ((out (assoc-ref outputs "out")))
390 (substitute* "configure"
391 (("/bin/pwd") (which "pwd")))
392 (substitute* "src/corelib/global/global.pri"
393 (("/bin/ls") (which "ls")))
394 ;; do not pass "--enable-fast-install", which makes the
395 ;; configure process fail
396 (zero? (system*
397 "./configure"
398 "-verbose"
399 "-prefix" out
400 "-opensource"
401 "-confirm-license"
402 ;; Do not build examples; if desired, these could go
403 ;; into a separate output, but for the time being, we
404 ;; prefer to save the space and build time.
405 "-nomake" "examples"
406 ;; Most "-system-..." are automatic, but some use
407 ;; the bundled copy by default.
408 "-system-sqlite"
409 "-system-harfbuzz"
410 ;; explicitly link with openssl instead of dlopening it
411 "-openssl-linked"
412 ;; explicitly link with dbus instead of dlopening it
413 "-dbus-linked"
414 ;; drop special machine instructions not supported
415 ;; on all instances of the target
416 ,@(if (string-prefix? "x86_64"
417 (or (%current-target-system)
418 (%current-system)))
419 '()
420 '("-no-sse2"))
421 "-no-sse3"
422 "-no-ssse3"
423 "-no-sse4.1"
424 "-no-sse4.2"
425 "-no-avx"
426 "-no-avx2"
427 "-no-mips_dsp"
428 "-no-mips_dspr2"))))))))
429 (home-page "https://www.qt.io/")
430 (synopsis "Cross-platform GUI library")
431 (description "Qt is a cross-platform application and UI framework for
432 developers using C++ or QML, a CSS & JavaScript like language.")
433 (license (list lgpl2.1 lgpl3))))
434
435 (define-public qtsvg
436 (package (inherit qtbase)
437 (name "qtsvg")
438 (version "5.6.1")
439 (source (origin
440 (method url-fetch)
441 (uri (string-append "https://download.qt.io/official_releases/qt/"
442 (version-major+minor version) "/" version
443 "/submodules/" name "-opensource-src-"
444 version ".tar.xz"))
445 (sha256
446 (base32
447 "08ca5g46g75acy27jfnvnalmcias5hxmjp7491v3y4k9y7a4ybpi"))))
448 (propagated-inputs `())
449 (native-inputs `(("perl" ,perl)))
450 (inputs
451 `(("mesa" ,mesa)
452 ("qtbase" ,qtbase)
453 ("zlib" ,zlib)))
454 (arguments
455 `(#:phases
456 (modify-phases %standard-phases
457 (replace 'configure
458 (lambda* (#:key outputs #:allow-other-keys)
459 (let ((out (assoc-ref outputs "out")))
460 (zero? (system* "qmake" (string-append "PREFIX=" out))))))
461 (add-before 'install 'fix-Makefiles
462 (lambda* (#:key inputs outputs #:allow-other-keys)
463 (let ((out (assoc-ref outputs "out"))
464 (qtbase (assoc-ref inputs "qtbase")))
465 (substitute* (find-files "." "Makefile")
466 (((string-append "INSTALL_ROOT)" qtbase))
467 (string-append "INSTALL_ROOT)" out)))))))))))
468
469 (define-public qtimageformats
470 (package (inherit qtsvg)
471 (name "qtimageformats")
472 (version "5.6.1")
473 (source (origin
474 (method url-fetch)
475 (uri (string-append "https://download.qt.io/official_releases/qt/"
476 (version-major+minor version) "/" version
477 "/submodules/" name "-opensource-src-"
478 version ".tar.xz"))
479 (sha256
480 (base32
481 "020v1148433zx4g87z2r8fgff32n0laajxqqsja1l3yzz7jbrwvl"))))
482 (native-inputs `())
483 (inputs
484 `(("libmng" ,libmng)
485 ("libtiff" ,libtiff)
486 ("libwebp" ,libwebp)
487 ("mesa" ,mesa)
488 ("qtbase" ,qtbase)
489 ("zlib" ,zlib)))))
490
491 (define-public qtx11extras
492 (package (inherit qtsvg)
493 (name "qtx11extras")
494 (version "5.6.1")
495 (source (origin
496 (method url-fetch)
497 (uri (string-append "https://download.qt.io/official_releases/qt/"
498 (version-major+minor version) "/" version
499 "/submodules/" name "-opensource-src-"
500 version ".tar.xz"))
501 (sha256
502 (base32
503 "0l736qiz8adrnh267xz63hv4sph6nhy90h836qfnnmv3p78ipsz8"))))
504 (native-inputs `(("perl" ,perl)))
505 (inputs
506 `(("mesa" ,mesa)
507 ("qtbase" ,qtbase)))))
508
509 (define-public qtxmlpatterns
510 (package (inherit qtsvg)
511 (name "qtxmlpatterns")
512 (version "5.6.1")
513 (source (origin
514 (method url-fetch)
515 (uri (string-append "https://download.qt.io/official_releases/qt/"
516 (version-major+minor version) "/" version
517 "/submodules/" name "-opensource-src-"
518 version ".tar.xz"))
519 (sha256
520 (base32
521 "0q412jv3xbg7v05b8pbahifwx17gzlp96s90akh6zwhpm8i6xx34"))))
522 (native-inputs `(("perl" ,perl)))
523 (inputs `(("qtbase" ,qtbase)))))
524
525 (define-public qtdeclarative
526 (package (inherit qtsvg)
527 (name "qtdeclarative")
528 (version "5.6.1")
529 (source (origin
530 (method url-fetch)
531 (uri (string-append "https://download.qt.io/official_releases/qt/"
532 (version-major+minor version) "/" version
533 "/submodules/" name "-opensource-src-"
534 version ".tar.xz"))
535 (sha256
536 (base32
537 "1d2217kxk85kpi7ls08b41hqzy26hvch8m4cgzq6km5sqi5zvz0j"))))
538 (native-inputs
539 `(("perl" ,perl)
540 ("pkg-config" ,pkg-config)
541 ("python" ,python-2)
542 ("qtsvg" ,qtsvg)
543 ("qtxmlpatterns" ,qtxmlpatterns)))
544 (inputs
545 `(("mesa" ,mesa)
546 ("qtbase" ,qtbase)))))
547
548 (define-public qtconnectivity
549 (package (inherit qtsvg)
550 (name "qtconnectivity")
551 (version "5.6.1")
552 (source (origin
553 (method url-fetch)
554 (uri (string-append "https://download.qt.io/official_releases/qt/"
555 (version-major+minor version) "/" version
556 "/submodules/" name "-opensource-src-"
557 version ".tar.xz"))
558 (sha256
559 (base32
560 "06fr9321f52kf0nda9zjjfzp5694hbnx0y0v315iw28mnpvandas"))))
561 (native-inputs
562 `(("perl" ,perl)
563 ("pkg-config" ,pkg-config)
564 ("qtdeclarative" ,qtdeclarative)))
565 (inputs
566 `(("bluez" ,bluez)
567 ("qtbase" ,qtbase)))))
568
569 (define-public qtwebsockets
570 (package (inherit qtsvg)
571 (name "qtwebsockets")
572 (version "5.6.1")
573 (source (origin
574 (method url-fetch)
575 (uri (string-append "https://download.qt.io/official_releases/qt/"
576 (version-major+minor version) "/" version
577 "/submodules/" name "-opensource-src-"
578 version ".tar.xz"))
579 (sha256
580 (base32
581 "0fkj52i4yi6gmq4jfjgdij08cspxspac6mbpf0fknnllimmkl7jm"))))
582 (native-inputs
583 `(("perl" ,perl)
584 ("qtdeclarative" ,qtdeclarative)))
585 (inputs `(("qtbase" ,qtbase)))))
586
587 (define-public qtsensors
588 (package (inherit qtsvg)
589 (name "qtsensors")
590 (version "5.6.1")
591 (source (origin
592 (method url-fetch)
593 (uri (string-append "https://download.qt.io/official_releases/qt/"
594 (version-major+minor version) "/" version
595 "/submodules/" name "-opensource-src-"
596 version ".tar.xz"))
597 (sha256
598 (base32
599 "0bll7ll6s5g8w89knyrc0famjwqyfzwpn512m1f96bf6xwacs967"))))
600 (native-inputs
601 `(("perl" ,perl)
602 ("qtdeclarative" ,qtdeclarative)))
603 (inputs `(("qtbase" ,qtbase)))))
604
605 (define-public qtmultimedia
606 (package (inherit qtsvg)
607 (name "qtmultimedia")
608 (version "5.6.1")
609 (source (origin
610 (method url-fetch)
611 (uri (string-append "https://download.qt.io/official_releases/qt/"
612 (version-major+minor version) "/" version
613 "/submodules/" name "-opensource-src-"
614 version ".tar.xz"))
615 (sha256
616 (base32
617 "058523c2qra3d8fq46ygcndnkrbwlh316zy28s2cr5pjr5gmnjyj"))))
618 (native-inputs
619 `(("perl" ,perl)
620 ("pkg-config" ,pkg-config)
621 ("python" ,python-2)
622 ("qtdeclarative" ,qtdeclarative)))
623 (inputs
624 `(("alsa-lib" ,alsa-lib)
625 ("mesa" ,mesa)
626 ("pulseaudio" ,pulseaudio)
627 ("qtbase" ,qtbase)))))
628
629 (define-public qtwayland
630 (package (inherit qtsvg)
631 (name "qtwayland")
632 (version "5.6.1")
633 (source (origin
634 (method url-fetch)
635 (uri (string-append "https://download.qt.io/official_releases/qt/"
636 (version-major+minor version) "/" version
637 "/submodules/" name "-opensource-src-"
638 version ".tar.xz"))
639 (sha256
640 (base32
641 "1jgghjfrg0wwyfzfwgwhagwxz9k936ylv3w2l9bwlpql8rgm8d11"))))
642 (native-inputs
643 `(("glib" ,glib)
644 ("perl" ,perl)
645 ("pkg-config" ,pkg-config)
646 ("qtdeclarative" ,qtdeclarative)))
647 (inputs
648 `(("fontconfig" ,fontconfig)
649 ("freetype" ,freetype)
650 ("libx11" ,libx11)
651 ("libxcomposite" ,libxcomposite)
652 ("libxext" ,libxext)
653 ("libxkbcommon" ,libxkbcommon)
654 ("libxrender" ,libxrender)
655 ("mesa" ,mesa)
656 ("mtdev" ,mtdev)
657 ("qtbase" ,qtbase)
658 ("wayland" ,wayland)))))
659
660 (define-public qtserialport
661 (package (inherit qtsvg)
662 (name "qtserialport")
663 (version "5.6.1")
664 (source (origin
665 (method url-fetch)
666 (uri (string-append "https://download.qt.io/official_releases/qt/"
667 (version-major+minor version) "/" version
668 "/submodules/" name "-opensource-src-"
669 version ".tar.xz"))
670 (sha256
671 (base32
672 "1hp63cgqhps6y1k041lzhcb2b0rcpcmszabnn293q5ilbvla4x0b"))))
673 (native-inputs `(("perl" ,perl)))
674 (inputs `(("qtbase" ,qtbase)))))
675
676 (define-public qtwebchannel
677 (package (inherit qtsvg)
678 (name "qtwebchannel")
679 (version "5.6.1")
680 (source (origin
681 (method url-fetch)
682 (uri (string-append "https://download.qt.io/official_releases/qt/"
683 (version-major+minor version) "/" version
684 "/submodules/" name "-opensource-src-"
685 version ".tar.xz"))
686 (sha256
687 (base32
688 "01q80917a1048hdhaii4v50dqs84h16lc9w3v99r9xvspk8vab7q"))))
689 (native-inputs
690 `(("perl" ,perl)
691 ("qtdeclarative" ,qtdeclarative)
692 ("qtwebsockets" ,qtwebsockets)))
693 (inputs `(("qtbase" ,qtbase)))))
694
695 (define-public qtlocation
696 (package (inherit qtsvg)
697 (name "qtlocation")
698 (version "5.6.1")
699 (source (origin
700 (method url-fetch)
701 (uri (string-append "https://download.qt.io/official_releases/qt/"
702 (version-major+minor version) "/" version
703 "/submodules/" name "-opensource-src-"
704 version ".tar.xz"))
705 (sha256
706 (base32
707 "0qahs7a2n3l4h0bl8bnwci9mzy1vra3zncnzr40csic9ys67ddfk"))))
708 (native-inputs
709 `(("perl" ,perl)
710 ("qtdeclarative" ,qtdeclarative)
711 ;("qtquickcontrols" ,qtquickcontrols)
712 ("qtserialport" ,qtserialport)))
713 (inputs `(("qtbase" ,qtbase)))))
714
715 (define-public qttools
716 (package (inherit qtsvg)
717 (name "qttools")
718 (version "5.6.1")
719 (source (origin
720 (method url-fetch)
721 (uri (string-append "https://download.qt.io/official_releases/qt/"
722 (version-major+minor version) "/" version
723 "/submodules/" name "-opensource-src-"
724 version ".tar.xz"))
725 (sha256
726 (base32
727 "0wbzq60d7lkvlb7b5lqcw87qgy6kyjz1npjavz8f4grdxsaqi8vp"))))
728 (native-inputs
729 `(("perl" ,perl)
730 ("qtdeclarative" ,qtdeclarative)))
731 (inputs
732 `(("mesa" ,mesa)
733 ("qtbase" ,qtbase)))))
734
735 (define-public qjson
736 (package
737 (name "qjson")
738 (version "0.8.1")
739 (source (origin
740 (method url-fetch)
741 (uri (string-append "https://github.com/flavio/qjson/archive/"
742 version ".tar.gz"))
743 (file-name (string-append name "-" version ".tar.gz"))
744 (sha256
745 (base32
746 "163fspi0xc705irv79qw861fmh68pjyla9vx3kqiq6xrdhb9834j"))))
747 (build-system cmake-build-system)
748 (inputs
749 `(("qt" ,qt-4)))
750 (arguments
751 `(#:tests? #f)) ; no test target
752 (home-page "http://qjson.sourceforge.net/")
753 (synopsis "Qt-based library for handling JSON")
754 (description "QJson is a Qt-based library that maps JSON data to QVariant
755 objects and vice versa. JSON arrays are mapped to QVariantList instances,
756 while JSON objects are mapped to QVariantMap.")
757 (license lgpl2.1+)))
758
759 (define-public python-sip
760 (package
761 (name "python-sip")
762 (version "4.18")
763 (source
764 (origin
765 (method url-fetch)
766 (uri
767 (string-append "mirror://sourceforge/pyqt/sip/"
768 "sip-" version "/sip-" version ".tar.gz"))
769 (sha256
770 (base32
771 "1dlw4kyiwd9bzmd1djm79c121r219abaz86lvizdk6ksq20mrp7i"))))
772 (build-system gnu-build-system)
773 (native-inputs
774 `(("python" ,python-wrapper)))
775 (arguments
776 `(#:tests? #f ; no check target
777 #:modules ((srfi srfi-1)
778 ,@%gnu-build-system-modules)
779 #:phases
780 (modify-phases %standard-phases
781 (replace 'configure
782 (lambda* (#:key inputs outputs #:allow-other-keys)
783 (let* ((out (assoc-ref outputs "out"))
784 (bin (string-append out "/bin"))
785 (include (string-append out "/include"))
786 (python (assoc-ref inputs "python"))
787 (python-version
788 (last (string-split python #\-)))
789 (python-major+minor
790 (string-join
791 (take (string-split python-version #\.) 2)
792 "."))
793 (lib (string-append out "/lib/python"
794 python-major+minor
795 "/site-packages")))
796 (zero?
797 (system* "python" "configure.py"
798 "--bindir" bin
799 "--destdir" lib
800 "--incdir" include))))))))
801 (home-page "https://www.riverbankcomputing.com/software/sip/intro")
802 (synopsis "Python binding creator for C and C++ libraries")
803 (description
804 "SIP is a tool to create Python bindings for C and C++ libraries. It
805 was originally developed to create PyQt, the Python bindings for the Qt
806 toolkit, but can be used to create bindings for any C or C++ library.
807
808 SIP comprises a code generator and a Python module. The code generator
809 processes a set of specification files and generates C or C++ code, which
810 is then compiled to create the bindings extension module. The SIP Python
811 module provides support functions to the automatically generated code.")
812 ;; There is a choice between a python like license, gpl2 and gpl3.
813 ;; For compatibility with pyqt, we need gpl3.
814 (license gpl3)))
815
816 (define-public python2-sip
817 (package (inherit python-sip)
818 (name "python2-sip")
819 (native-inputs
820 `(("python" ,python-2)))))
821
822 (define-public python-pyqt
823 (package
824 (name "python-pyqt")
825 (version "5.6")
826 (source
827 (origin
828 (method url-fetch)
829 (uri
830 (string-append "mirror://sourceforge/pyqt/PyQt5/"
831 "PyQt-" version "/PyQt5_gpl-"
832 version ".tar.gz"))
833 (sha256
834 (base32
835 "1qgh42zsr9jppl9k7fcdbhxcd1wrb7wyaj9lng9nxfa19in1lj1f"))
836 (patches (search-patches "pyqt-configure.patch"))))
837 (build-system gnu-build-system)
838 (native-inputs
839 `(("python-sip" ,python-sip)
840 ("qtbase" ,qtbase))) ; for qmake
841 (inputs
842 `(("python" ,python-wrapper)))
843 (arguments
844 `(#:modules ((srfi srfi-1)
845 ,@%gnu-build-system-modules)
846 #:phases
847 (modify-phases %standard-phases
848 (replace 'configure
849 (lambda* (#:key inputs outputs #:allow-other-keys)
850 (let* ((out (assoc-ref outputs "out"))
851 (bin (string-append out "/bin"))
852 (sip (string-append out "/share/sip"))
853 (plugins (string-append out "/plugins"))
854 (designer (string-append plugins "/designer"))
855 (qml (string-append plugins "/PyQt5"))
856 (python (assoc-ref inputs "python"))
857 (python-version
858 (last (string-split python #\-)))
859 (python-major+minor
860 (string-join
861 (take (string-split python-version #\.) 2)
862 "."))
863 (lib (string-append out "/lib/python"
864 python-major+minor
865 "/site-packages")))
866 (zero? (system* "python" "configure.py"
867 "--confirm-license"
868 "--bindir" bin
869 "--destdir" lib
870 "--designer-plugindir" designer
871 "--qml-plugindir" qml
872 "--sipdir" sip))))))))
873 (home-page "https://www.riverbankcomputing.com/software/pyqt/intro")
874 (synopsis "Python bindings for Qt")
875 (description
876 "PyQt is a set of Python v2 and v3 bindings for the Qt application
877 framework. The bindings are implemented as a set of Python modules and
878 contain over 620 classes.")
879 (license gpl3)))
880
881 (define-public python2-pyqt
882 (package (inherit python-pyqt)
883 (name "python2-pyqt")
884 (native-inputs
885 `(("python-sip" ,python2-sip)
886 ("qtbase" ,qtbase)))
887 (inputs
888 `(("python" ,python-2)))))
889
890 (define-public python-pyqt-4
891 (package (inherit python-pyqt)
892 (name "python-pyqt")
893 (version "4.11.4")
894 (source
895 (origin
896 (method url-fetch)
897 (uri
898 (string-append "mirror://sourceforge/pyqt/PyQt4/"
899 "PyQt-" version "/PyQt-x11-gpl-"
900 version ".tar.gz"))
901 (sha256
902 (base32
903 "01zlviy5lq8g6db84wnvvpsrfnip9lbcpxagsyqa6as3jmsff7zw"))))
904 (native-inputs
905 `(("python-sip" ,python-sip)
906 ("qt" ,qt-4)))
907 (arguments
908 `(#:tests? #f ; no check target
909 #:modules ((srfi srfi-1)
910 ,@%gnu-build-system-modules)
911 #:phases
912 (alist-replace
913 'configure
914 (lambda* (#:key inputs outputs #:allow-other-keys)
915 (let* ((out (assoc-ref outputs "out"))
916 (bin (string-append out "/bin"))
917 (sip (string-append out "/share/sip"))
918 (python (assoc-ref inputs "python"))
919 (python-version
920 (last (string-split python #\-)))
921 (python-major+minor
922 (string-join
923 (take (string-split python-version #\.) 2)
924 "."))
925 (lib (string-append out "/lib/python"
926 python-major+minor
927 "/site-packages")))
928 (zero? (system* "python" "configure.py"
929 "--confirm-license"
930 "--bindir" bin
931 "--destdir" lib
932 "--sipdir" sip))))
933 %standard-phases)))
934 (license (list gpl2 gpl3)))) ; choice of either license
935
936 (define-public qtkeychain
937 (package
938 (name "qtkeychain")
939 (version "0.7.0")
940 (source
941 (origin
942 (method url-fetch)
943 (uri (string-append "https://github.com/frankosterfeld/qtkeychain/"
944 "archive/v" version ".tar.gz"))
945 (file-name (string-append name "-" version ".tar.gz"))
946 (sha256
947 (base32 "0fka5q5cdzlf79igcjgbnb2smvwbwfasqawkzkbr34whispgm6lz"))))
948 (build-system cmake-build-system)
949 (inputs
950 `(("qt" ,qt)))
951 (arguments
952 `(#:tests? #f ; No tests included
953 #:phases
954 (modify-phases %standard-phases
955 (add-before
956 'configure 'set-qt-trans-dir
957 (lambda _
958 (substitute* "CMakeLists.txt"
959 (("\\$\\{qt_translations_dir\\}")
960 "${CMAKE_INSTALL_PREFIX}/share/qt/translations")))))))
961 (home-page "https://github.com/frankosterfeld/qtkeychain")
962 (synopsis "Qt API to store passwords")
963 (description
964 "QtKeychain is a Qt library to store passwords and other secret data
965 securely. It will not store any data unencrypted unless explicitly requested.")
966 (license bsd-3)))