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, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
5 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
7 ;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
8 ;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2017 Quiliro <quiliro@fsfla.org>
10 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
12 ;;; Copyright © 2018 Hartmut Goebel <h.goebel@crazy-compilers.com>
13 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
14 ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
15 ;;; Copyright © 2018 John Soo <jsoo1@asu.edu>
16 ;;; Copyright © 2020 Mike Rosset <mike.rosset@gmail.com>
17 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
18 ;;; Copyright © 2020 Kei Kebreau <kkebreau@posteo.net>
20 ;;; This file is part of GNU Guix.
22 ;;; GNU Guix is free software; you can redistribute it and/or modify it
23 ;;; under the terms of the GNU General Public License as published by
24 ;;; the Free Software Foundation; either version 3 of the License, or (at
25 ;;; your option) any later version.
27 ;;; GNU Guix is distributed in the hope that it will be useful, but
28 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 ;;; GNU General Public License for more details.
32 ;;; You should have received a copy of the GNU General Public License
33 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35 (define-module (gnu packages qt)
36 #:use-module ((guix licenses) #:prefix license:)
37 #:use-module (guix packages)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix build-system cmake)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix build-system trivial)
43 #:use-module (guix build-system python)
44 #:use-module (guix packages)
45 #:use-module (guix deprecation)
46 #:use-module (guix utils)
47 #:use-module (gnu packages)
48 #:use-module (gnu packages base)
49 #:use-module (gnu packages bison)
50 #:use-module (gnu packages cmake)
51 #:use-module (gnu packages compression)
52 #:use-module (gnu packages cups)
53 #:use-module (gnu packages curl)
54 #:use-module (gnu packages databases)
55 #:use-module (gnu packages documentation)
56 #:use-module (gnu packages fontutils)
57 #:use-module (gnu packages flex)
58 #:use-module (gnu packages freedesktop)
59 #:use-module (gnu packages gcc)
60 #:use-module (gnu packages ghostscript)
61 #:use-module (gnu packages gl)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages gnupg)
64 #:use-module (gnu packages gperf)
65 #:use-module (gnu packages gstreamer)
66 #:use-module (gnu packages gtk)
67 #:use-module (gnu packages icu4c)
68 #:use-module (gnu packages image)
69 #:use-module (gnu packages libevent)
70 #:use-module (gnu packages linux)
71 #:use-module (gnu packages llvm)
72 #:use-module (gnu packages maths)
73 #:use-module (gnu packages ninja)
74 #:use-module (gnu packages nss)
75 #:use-module (gnu packages pciutils)
76 #:use-module (gnu packages pcre)
77 #:use-module (gnu packages perl)
78 #:use-module (gnu packages pkg-config)
79 #:use-module (gnu packages pulseaudio)
80 #:use-module (gnu packages protobuf)
81 #:use-module (gnu packages python)
82 #:use-module (gnu packages python-xyz)
83 #:use-module (gnu packages regex)
84 #:use-module (gnu packages ruby)
85 #:use-module (gnu packages sdl)
86 #:use-module (gnu packages serialization)
87 #:use-module (gnu packages sqlite)
88 #:use-module (gnu packages telephony)
89 #:use-module (gnu packages tls)
90 #:use-module (gnu packages valgrind)
91 #:use-module (gnu packages video)
92 #:use-module (gnu packages vulkan)
93 #:use-module (gnu packages xdisorg)
94 #:use-module (gnu packages xiph)
95 #:use-module (gnu packages xorg)
96 #:use-module (gnu packages xml)
97 #:use-module (srfi srfi-1))
99 (define-public grantlee
107 (url "https://github.com/steveire/grantlee.git")
108 (commit (string-append "v" version))))
109 (file-name (git-file-name name version))
111 (base32 "1dmah2gd6zd4fgz2f4ir11dazqg067hjz8xshhywhfsmavchi626"))))
113 ;; Optional: lcov and cccc, both are for code coverage
114 `(("doxygen" ,doxygen)))
117 ("qtscript" ,qtscript)))
118 (build-system cmake-build-system)
120 `(#:configure-flags '("-DCMAKE_CXX_STANDARD=11")
122 (modify-phases %standard-phases
123 (add-after 'unpack 'delete-broken-tests
125 ;; TODO: Two date tests (for date01 and date02) fail for unknown
127 ;; Actual (result): ""
128 ;; Expected (output): "01"
129 ;; Actual (result): ""
130 ;; Expected (output): "Jan. 1, 2008"
131 (delete-file "templates/tests/testfilters.cpp")
132 (substitute* "templates/tests/CMakeLists.txt"
133 (("testfilters") ""))
135 (add-before 'check 'check-setup
137 ;; make Qt render "offscreen", required for tests
138 (setenv "QT_QPA_PLATFORM" "offscreen")
140 (home-page "https://github.com/steveire/grantlee")
141 (synopsis "Libraries for text templating with Qt")
142 (description "Grantlee Templates can be used for theming and generation of
143 other text such as code. The syntax uses the syntax of the Django template
144 system, and the core design of Django is reused in Grantlee.")
145 (license license:lgpl2.0+)))
153 (uri (string-append "http://download.qt-project.org/archive/qt/"
154 (string-copy version 0 (string-rindex version #\.))
156 "/qt-everywhere-opensource-src-"
160 "183fca7n7439nlhxyg1z7aky0izgbyll3iwakw4gwivy16aj5272"))
161 (patches (search-patches "qt4-ldflags.patch"))
162 (modules '((guix build utils)))
164 ;; Remove webkit module, which is not built.
165 '(begin (delete-file-recursively "src/3rdparty/webkit")
167 (build-system gnu-build-system)
171 `(("alsa-lib" ,alsa-lib)
175 ("double-conversion" ,double-conversion)
177 ("fontconfig" ,fontconfig)
178 ("freetype" ,freetype)
180 ("gstreamer" ,gstreamer)
181 ("gst-plugins-base" ,gst-plugins-base)
184 ("libinput" ,libinput-minimal)
191 ("libxcomposite" ,libxcomposite)
192 ("libxcursor" ,libxcursor)
194 ("libxfixes" ,libxfixes)
196 ("libxinerama" ,libxinerama)
197 ("libxkbcommon" ,libxkbcommon)
199 ("libxrandr" ,libxrandr)
200 ("libxrender" ,libxrender)
204 ("mariadb" ,mariadb "lib")
205 ("mariadb-dev" ,mariadb "dev")
207 ("postgresql" ,postgresql)
208 ("pulseaudio" ,pulseaudio)
212 ("unixodbc" ,unixodbc)
214 ("xcb-util" ,xcb-util)
215 ("xcb-util-image" ,xcb-util-image)
216 ("xcb-util-keysyms" ,xcb-util-keysyms)
217 ("xcb-util-renderutil" ,xcb-util-renderutil)
218 ("xcb-util-wm" ,xcb-util-wm)
220 ("libjpeg" ,libjpeg-turbo)
222 ("openssl" ,openssl-1.0)))
224 `(;; XXX: The JavaScriptCore engine does not build with the C++11 standard.
225 ;; We could build it with -std=gnu++98, but then we'll get in trouble with
226 ;; ICU later. Just keep using GCC 5 for now.
232 ("pkg-config" ,pkg-config)
235 ("which" ,(@ (gnu packages base) which))))
236 ;; Note: there are 37 MiB of examples and a '-exampledir' configure flags,
237 ;; but we can't make them a separate output because "out" and "examples"
238 ;; would refer to each other.
239 (outputs '("out" ;112MiB core + 37MiB examples
240 "doc")) ;280MiB of HTML + code
243 (modify-phases %standard-phases
244 (add-after 'set-paths 'hide-default-gcc
245 (lambda* (#:key inputs #:allow-other-keys)
246 (let ((gcc (assoc-ref inputs "gcc")))
247 ;; Remove the default GCC from CPLUS_INCLUDE_PATH to prevent
248 ;; conflicts with the GCC 5 input.
249 (setenv "CPLUS_INCLUDE_PATH"
251 (delete (string-append gcc "/include/c++")
252 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
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")))
262 (substitute* "src/corelib/global/global.pri"
263 (("/bin/ls") (which "ls")))
269 "-nomake" "examples demos"
270 ;; Note: Don't pass '-docdir' since 'qmake' and
271 ;; libQtCore would record its value, thereby defeating
272 ;; the whole point of having a separate output.
273 "-datadir" (string-append out "/share/qt-" ,version
275 "-importdir" (string-append out "/lib/qt-4"
277 "-plugindir" (string-append out "/lib/qt-4"
279 "-translationdir" (string-append out "/share/qt-" ,version
281 "-demosdir" (string-append out "/share/qt-" ,version
283 "-examplesdir" (string-append out "/share/qt-" ,version
287 ;; explicitly link with dbus instead of dlopening it
289 ;; Skip the webkit module; it fails to build on armhf
290 ;; and, apart from that, may pose security risks.
292 ;; don't use the precompiled headers
294 ;; drop special machine instructions not supported
295 ;; on all instances of the target
296 ,@(if (string-prefix? "x86_64"
297 (or (%current-target-system)
311 (lambda* (#:key outputs #:allow-other-keys)
312 ;; Because of qt4-documentation-path.patch, documentation ends up
313 ;; being installed in OUT. Move it to the right place.
314 (let* ((out (assoc-ref outputs "out"))
315 (doc (assoc-ref outputs "doc"))
316 (olddoc (string-append out "/doc"))
317 (docdir (string-append doc "/share/doc/qt-" ,version)))
318 (mkdir-p (dirname docdir))
320 ;; Note: We can't use 'rename-file' here because OUT and DOC are
321 ;; different "devices" due to bind-mounts.
322 (copy-recursively olddoc docdir)
323 (delete-file-recursively olddoc)
326 (list (search-path-specification
327 (variable "QMAKEPATH")
328 (files '("lib/qt5")))
329 (search-path-specification
330 (variable "QML2_IMPORT_PATH")
331 (files '("lib/qt5/qml")))
332 (search-path-specification
333 (variable "QT_PLUGIN_PATH")
334 (files '("lib/qt5/plugins")))
335 (search-path-specification
336 (variable "XDG_DATA_DIRS")
338 (search-path-specification
339 (variable "XDG_CONFIG_DIRS")
340 (files '("etc/xdg")))))
341 (home-page "https://www.qt.io/")
342 (synopsis "Cross-platform GUI library")
343 (description "Qt is a cross-platform application and UI framework for
344 developers using C++ or QML, a CSS & JavaScript like language.")
345 (license (list license:lgpl2.1 license:lgpl3))
347 ;; Qt 4: 'QBasicAtomicPointer' leads to build failures on MIPS;
348 ;; see <http://hydra.gnu.org/build/112828>.
349 ;; Qt 5: assembler error; see <http://hydra.gnu.org/build/112526>.
350 (supported-systems (delete "mips64el-linux" %supported-systems))))
352 (define-public qtbase
358 (uri (string-append "https://download.qt.io/official_releases/qt/"
359 (version-major+minor version) "/" version
360 "/submodules/" name "-everywhere-src-"
364 "0pb68d30clksdhgy8n6rrs838bb3qcsfq4pv463yy2nr4p5kk2di"))
365 ;; Use TZDIR to avoid depending on package "tzdata".
366 (patches (search-patches "qtbase-use-TZDIR.patch"
367 "qtbase-moc-ignore-gcc-macro.patch"
368 "qtbase-QTBUG-81715.patch"))
369 (modules '((guix build utils)))
371 ;; corelib uses bundled harfbuzz, md4, md5, sha3
373 (with-directory-excursion "src/3rdparty"
374 (for-each delete-file-recursively
375 (list "double-conversion" "freetype" "harfbuzz-ng"
376 "libpng" "libjpeg" "pcre2" "sqlite" "xcb"
379 (build-system gnu-build-system)
382 ;; Use which the package, not the function
383 ("which" ,(@ (gnu packages base) which))))
385 `(("alsa-lib" ,alsa-lib)
388 ("double-conversion" ,double-conversion)
391 ("fontconfig" ,fontconfig)
392 ("freetype" ,freetype)
394 ("harfbuzz" ,harfbuzz)
396 ("libinput" ,libinput-minimal)
397 ("libjpeg" ,libjpeg-turbo)
401 ("libxcomposite" ,libxcomposite)
402 ("libxcursor" ,libxcursor)
403 ("libxfixes" ,libxfixes)
405 ("libxinerama" ,libxinerama)
406 ("libxkbcommon" ,libxkbcommon)
408 ("libxrandr" ,libxrandr)
409 ("libxrender" ,libxrender)
413 ("mariadb" ,mariadb "lib")
414 ("mariadb-dev" ,mariadb "dev")
418 ("postgresql" ,postgresql)
419 ("pulseaudio" ,pulseaudio)
421 ("unixodbc" ,unixodbc)
422 ("xcb-util" ,xcb-util)
423 ("xcb-util-image" ,xcb-util-image)
424 ("xcb-util-keysyms" ,xcb-util-keysyms)
425 ("xcb-util-renderutil" ,xcb-util-renderutil)
426 ("xcb-util-wm" ,xcb-util-wm)
427 ("xdg-utils" ,xdg-utils)
434 ("pkg-config" ,pkg-config)
436 ("vulkan-headers" ,vulkan-headers)
440 (modify-phases %standard-phases
441 (add-after 'configure 'patch-bin-sh
443 (substitute* '("config.status"
445 "mkspecs/features/qt_functions.prf"
446 "qmake/library/qmakebuiltins.cpp")
447 (("/bin/sh") (which "sh")))
449 (add-after 'configure 'patch-xdg-open
451 (substitute* '("src/platformsupport/services/genericunix/qgenericunixservices.cpp")
452 (("^.*const char \\*browsers.*$" all)
453 (string-append "*browser = QStringLiteral(\""
455 "\"); return true; \n" all)))
458 (lambda* (#:key outputs #:allow-other-keys)
459 (let ((out (assoc-ref outputs "out")))
460 (substitute* "configure"
461 (("/bin/pwd") (which "pwd")))
462 (substitute* "src/corelib/global/global.pri"
463 (("/bin/ls") (which "ls")))
464 ;; The configuration files for other Qt5 packages are searched
465 ;; through a call to "find_package" in Qt5Config.cmake, which
466 ;; disables the use of CMAKE_PREFIX_PATH via the parameter
467 ;; "NO_DEFAULT_PATH". Re-enable it so that the different
468 ;; components can be installed in different places.
469 (substitute* (find-files "." ".*\\.cmake")
470 (("NO_DEFAULT_PATH") ""))
471 ;; do not pass "--enable-fast-install", which makes the
472 ;; configure process fail
477 "-docdir" (string-append out "/share/doc/qt5")
478 "-headerdir" (string-append out "/include/qt5")
479 "-archdatadir" (string-append out "/lib/qt5")
480 "-datadir" (string-append out "/share/qt5")
481 "-examplesdir" (string-append
482 out "/share/doc/qt5/examples")
486 ;; These features require higher versions of Linux than the
487 ;; minimum version of the glibc. See
488 ;; src/corelib/global/minimum-linux_p.h. By disabling these
489 ;; features Qt5 applications can be used on the oldest
490 ;; kernels that the glibc supports, including the RHEL6
491 ;; (2.6.32) and RHEL7 (3.10) kernels.
492 "-no-feature-getentropy" ; requires Linux 3.17
493 "-no-feature-renameat2" ; requires Linux 3.16
495 ;; Do not build examples; if desired, these could go
496 ;; into a separate output, but for the time being, we
497 ;; prefer to save the space and build time.
498 "-no-compile-examples"
499 ;; Most "-system-..." are automatic, but some use
500 ;; the bundled copy by default.
504 ;; explicitly link with openssl instead of dlopening it
506 ;; explicitly link with dbus instead of dlopening it
508 ;; don't use the precompiled headers
510 ;; drop special machine instructions that do not have
512 ,@(if (string-prefix? "x86_64"
513 (or (%current-target-system)
519 (add-after 'install 'patch-mkspecs
520 (lambda* (#:key outputs #:allow-other-keys)
521 (let* ((out (assoc-ref outputs "out"))
522 (archdata (string-append out "/lib/qt5"))
523 (mkspecs (string-append archdata "/mkspecs"))
524 (qt_config.prf (string-append
525 mkspecs "/features/qt_config.prf")))
526 ;; For each Qt module, let `qmake' uses search paths in the
527 ;; module directory instead of all in QT_INSTALL_PREFIX.
528 (substitute* qt_config.prf
529 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
530 "$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt5))")
531 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
532 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
533 (("\\$\\$\\[QT_HOST_LIBS\\]")
534 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
535 (("\\$\\$\\[QT_INSTALL_BINS\\]")
536 "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))"))
538 ;; Searches Qt tools in the current PATH instead of QT_HOST_BINS.
539 (substitute* (string-append mkspecs "/features/qt_functions.prf")
540 (("cmd = \\$\\$\\[QT_HOST_BINS\\]/\\$\\$2")
541 "cmd = $$system(which $${2}.pl 2>/dev/null || which $${2})"))
543 ;; Resolve qmake spec files within qtbase by absolute paths.
546 (string-append mkspecs "/features/" file))
547 '("device_config.prf" "moc.prf" "qt_build_config.prf"
548 "qt_config.prf" "winrt/package_manifest.prf"))
549 (("\\$\\$\\[QT_HOST_DATA/get\\]") archdata)
550 (("\\$\\$\\[QT_HOST_DATA/src\\]") archdata))
552 (add-after 'patch-mkspecs 'patch-prl-files
553 (lambda* (#:key outputs #:allow-other-keys)
554 (let ((out (assoc-ref outputs "out")))
555 ;; Insert absolute references to the qtbase libraries because
556 ;; QT_INSTALL_LIBS does not always resolve correctly, depending
557 ;; on context. See <https://bugs.gnu.org/38405>
558 (substitute* (find-files (string-append out "/lib") "\\.prl$")
559 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
560 (string-append out "/lib")))
562 (add-after 'unpack 'patch-paths
563 ;; Use the absolute paths for dynamically loaded libs, otherwise
564 ;; the lib will be searched in LD_LIBRARY_PATH which typically is
566 (lambda* (#:key inputs #:allow-other-keys)
568 (let ((glibc (assoc-ref inputs ,(if (%current-target-system)
569 "cross-libc" "libc"))))
570 (substitute* '("src/network/kernel/qdnslookup_unix.cpp"
571 "src/network/kernel/qhostinfo_unix.cpp")
572 (("^\\s*(lib.setFileName\\(QLatin1String\\(\")(resolv\"\\)\\);)" _ a b)
573 (string-append a glibc "/lib/lib" b))))
574 ;; X11/locale (compose path)
575 (substitute* "src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp"
576 ;; Don't search in /usr/…/X11/locale, …
577 (("^\\s*m_possibleLocations.append\\(QStringLiteral\\(\"/usr/.*/X11/locale\"\\)\\);" line)
578 (string-append "// " line))
579 ;; … but use libx11's path
580 (("^\\s*(m_possibleLocations.append\\(QStringLiteral\\()X11_PREFIX \"(/.*/X11/locale\"\\)\\);)" _ a b)
581 (string-append a "\"" (assoc-ref inputs "libx11") b)))
583 (substitute* "src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp"
584 (("^\\s*(QLibrary lib\\(QLatin1String\\(\")(GL\"\\)\\);)" _ a b)
585 (string-append a (assoc-ref inputs "mesa") "/lib/lib" b)))
587 (substitute* "src/plugins/platforms/xcb/qxcbcursor.cpp"
588 (("^\\s*(QLibrary xcursorLib\\(QLatin1String\\(\")(Xcursor\"\\), 1\\);)" _ a b)
589 (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))
590 (("^\\s*(xcursorLib.setFileName\\(QLatin1String\\(\")(Xcursor\"\\)\\);)" _ a b)
591 (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b)))
594 (list (search-path-specification
595 (variable "QMAKEPATH")
596 (files '("lib/qt5")))
597 (search-path-specification
598 (variable "QML2_IMPORT_PATH")
599 (files '("lib/qt5/qml")))
600 (search-path-specification
601 (variable "QT_PLUGIN_PATH")
602 (files '("lib/qt5/plugins")))
603 (search-path-specification
604 (variable "XDG_DATA_DIRS")
606 (search-path-specification
607 (variable "XDG_CONFIG_DIRS")
608 (files '("etc/xdg")))))
609 (home-page "https://www.qt.io/")
610 (synopsis "Cross-platform GUI library")
611 (description "Qt is a cross-platform application and UI framework for
612 developers using C++ or QML, a CSS & JavaScript like language.")
613 (license (list license:lgpl2.1 license:lgpl3))))
615 ;; qt used to refer to the monolithic Qt 5.x package
616 (define-deprecated qt qtbase)
619 (package (inherit qtbase)
624 (uri (string-append "https://download.qt.io/official_releases/qt/"
625 (version-major+minor version) "/" version
626 "/submodules/" name "-everywhere-src-"
630 "1f3vqv3s83gjillhgi0wghyf3825fgy1ffhvkxhdk673shb0kxjb"))))
631 (propagated-inputs `())
632 (native-inputs `(("perl" ,perl)))
639 (modify-phases %standard-phases
640 (add-before 'configure 'configure-qmake
641 (lambda* (#:key inputs outputs #:allow-other-keys)
642 (let* ((out (assoc-ref outputs "out"))
643 (qtbase (assoc-ref inputs "qtbase"))
644 (tmpdir (string-append (getenv "TMPDIR")))
645 (qmake (string-append tmpdir "/qmake"))
646 (qt.conf (string-append tmpdir "/qt.conf")))
647 ;; Use qmake with a customized qt.conf to override install
649 (symlink (which "qmake") qmake)
650 (setenv "PATH" (string-append tmpdir ":" (getenv "PATH")))
651 (with-output-to-file qt.conf
657 Documentation=share/doc/qt5
660 LibraryExecutables=lib/qt5/libexec
663 Plugins=lib/qt5/plugins
664 Imports=lib/qt5/imports
665 Qml2Imports=lib/qt5/qml
666 Translations=share/qt5/translations
668 Examples=share/doc/qt5/examples
674 [EffectiveSourcePaths]
680 (lambda* (#:key inputs outputs #:allow-other-keys)
681 ;; Valid QT_BUILD_PARTS variables are:
682 ;; libs tools tests examples demos docs translations
683 (invoke "qmake" "QT_BUILD_PARTS = libs tools tests")))
684 (add-before 'check 'set-display
686 ;; make Qt render "offscreen", required for tests
687 (setenv "QT_QPA_PLATFORM" "offscreen")
689 (synopsis "Qt module for displaying SVGs")
690 (description "The QtSvg module provides classes for displaying the
691 contents of SVG files.")))
693 (define-public qtimageformats
694 (package (inherit qtsvg)
695 (name "qtimageformats")
699 (uri (string-append "https://download.qt.io/official_releases/qt/"
700 (version-major+minor version) "/" version
701 "/submodules/" name "-everywhere-src-"
705 "02zpcbx71dz6xvga07dnzqwdfz9pjmy673n706fj8pxq9zi9xlcv"))
706 (modules '((guix build utils)))
709 (delete-file-recursively "src/3rdparty")
720 (synopsis "Additional Image Format plugins for Qt")
721 (description "The QtImageFormats module contains plugins for adding
722 support for MNG, TGA, TIFF and WBMP image formats.")))
724 (define-public qtx11extras
725 (package (inherit qtsvg)
730 (uri (string-append "https://download.qt.io/official_releases/qt/"
731 (version-major+minor version) "/" version
732 "/submodules/" name "-everywhere-src-"
736 "15hb90n47khsp3qnzyjd3mh8gi9qvy07dqdr4qspiww43r5mz293"))))
738 (substitute-keyword-arguments (package-arguments qtsvg)
739 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
740 (native-inputs `(("perl" ,perl)))
744 (synopsis "Qt Extras for X11")
745 (description "The QtX11Extras module includes the library to access X11
746 from within Qt 5.")))
748 (define-public qtxmlpatterns
749 (package (inherit qtsvg)
750 (name "qtxmlpatterns")
754 (uri (string-append "https://download.qt.io/official_releases/qt/"
755 (version-major+minor version) "/" version
756 "/submodules/" name "-everywhere-src-"
760 "0ys1kf0zdn8gak1ik9p7i7bdyfz2frvklcyz013s9wm1550h20lh"))))
762 (substitute-keyword-arguments (package-arguments qtsvg)
763 ((#:tests? _ #f) #f) ; TODO: Enable the tests
765 `(modify-phases ,phases
766 (add-after 'unpack 'disable-network-tests
767 (lambda _ (substitute* "tests/auto/auto.pro"
768 (("qxmlquery") "# qxmlquery")
769 (("xmlpatterns ") "# xmlpatterns"))
771 (native-inputs `(("perl" ,perl)
772 ("qtdeclarative" ,qtdeclarative)))
773 (inputs `(("qtbase" ,qtbase)))
774 (synopsis "Qt XML patterns module")
775 (description "The QtXmlPatterns module is a XQuery and XPath engine for
776 XML and custom data models. It contains programs such as xmlpatterns and
777 xmlpatternsvalidator.")))
779 (define-public qtdeclarative
780 (package (inherit qtsvg)
781 (name "qtdeclarative")
785 (uri (string-append "https://download.qt.io/official_releases/qt/"
786 (version-major+minor version) "/" version
787 "/submodules/" name "-everywhere-src-"
791 "1gg9xbv8ah4p55ws97brwn0csl0k3j1x6zdknrrsnh7j6nh0bp2w"))))
793 (substitute-keyword-arguments (package-arguments qtsvg)
794 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
797 ("pkg-config" ,pkg-config)
799 ("python-wrapper" ,python-wrapper)
804 (synopsis "Qt QML module (Quick 2)")
805 (description "The Qt QML module provides a framework for developing
806 applications and libraries with the QML language. It defines and implements the
807 language and engine infrastructure, and provides an API to enable application
808 developers to extend the QML language with custom types and integrate QML code
809 with JavaScript and C++.")))
811 (define-public qtconnectivity
812 (package (inherit qtsvg)
813 (name "qtconnectivity")
817 (uri (string-append "https://download.qt.io/official_releases/qt/"
818 (version-major+minor version) "/" version
819 "/submodules/" name "-everywhere-src-"
823 "06h71pd5w5prh722mcbgmx7l71xvh5xpjrlbg17yblx0n6wlhwb4"))))
826 ("pkg-config" ,pkg-config)
827 ("qtdeclarative" ,qtdeclarative)))
831 (synopsis "Qt Connectivity module")
832 (description "The Qt Connectivity modules provides modules for interacting
833 with Bluetooth and NFC.")))
835 (define-public qtwebsockets
836 (package (inherit qtsvg)
837 (name "qtwebsockets")
841 (uri (string-append "https://download.qt.io/official_releases/qt/"
842 (version-major+minor version) "/" version
843 "/submodules/" name "-everywhere-src-"
847 "05rv52pp5zg4g14zh7c6jc77l426056b8xyr40ps6cpmb0jkrlbg"))))
849 (substitute-keyword-arguments (package-arguments qtsvg)
850 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
853 ("qtdeclarative" ,qtdeclarative)))
854 (inputs `(("qtbase" ,qtbase)))
855 (synopsis "Qt Web Sockets module")
856 (description "WebSocket is a web-based protocol designed to enable two-way
857 communication between a client application and a remote host. The Qt
858 WebSockets module provides C++ and QML interfaces that enable Qt applications
859 to act as a server that can process WebSocket requests, or a client that can
860 consume data received from the server, or both.")))
862 (define-public qtsensors
863 (package (inherit qtsvg)
868 (uri (string-append "https://download.qt.io/official_releases/qt/"
869 (version-major+minor version) "/" version
870 "/submodules/" name "-everywhere-src-"
874 "0h77h34rn6cgy5qiqq163pj3bhbka1ydkfgjcx01ns1g9sgym6ib"))))
876 (substitute-keyword-arguments (package-arguments qtsvg)
877 ((#:parallel-tests? _ #f) #f) ; can lead to race condition
879 `(modify-phases ,phases
880 (add-after 'unpack 'fix-tests
882 (substitute* "tests/auto/qsensorgestures_gestures/tst_sensorgestures_gestures.cpp"
883 (("2000") "5000") ;lengthen test timeout
884 (("QTest::newRow(\"twist\") << \"twist\"") "")) ;failing test
888 ("qtdeclarative" ,qtdeclarative)))
889 (inputs `(("qtbase" ,qtbase)))
890 (synopsis "Qt Sensors module")
891 (description "The Qt Sensors API provides access to sensor hardware via QML
892 and C++ interfaces. The Qt Sensors API also provides a motion gesture
893 recognition API for devices.")))
895 (define-public qtmultimedia
896 (package (inherit qtsvg)
897 (name "qtmultimedia")
901 (uri (string-append "https://download.qt.io/official_releases/qt/"
902 (version-major+minor version) "/" version
903 "/submodules/" name "-everywhere-src-"
907 "07fvnjywn3hkrxfbxasmy83jr6jq9lf1grasfwij54hz6y0smg98"))
908 (modules '((guix build utils)))
911 (delete-file-recursively
912 "examples/multimedia/spectrum/3rdparty")
913 ;; We also prevent the spectrum example from being built.
914 (substitute* "examples/multimedia/multimedia.pro"
918 (substitute-keyword-arguments (package-arguments qtsvg)
920 `(modify-phases ,phases
922 (lambda* (#:key outputs #:allow-other-keys)
923 (let ((out (assoc-ref outputs "out")))
924 (invoke "qmake" "QT_BUILD_PARTS = libs tools tests"
925 (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out "/lib -Wl,-rpath,")
926 (string-append "PREFIX=" out)))))))
927 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
930 ("pkg-config" ,pkg-config)
932 ("qtdeclarative" ,qtdeclarative)))
934 `(("alsa-lib" ,alsa-lib)
936 ("pulseaudio" ,pulseaudio)
938 ;; Gstreamer is needed for the mediaplayer plugin
939 ("gstreamer" ,gstreamer)
940 ("gst-plugins-base" ,gst-plugins-base)))
941 (synopsis "Qt Multimedia module")
942 (description "The Qt Multimedia module provides set of APIs to play and
943 record media, and manage a collection of media content. It also contains a
944 set of plugins for interacting with pulseaudio and GStreamer.")))
946 (define-public qtwayland
947 (package (inherit qtsvg)
952 (uri (string-append "https://download.qt.io/official_releases/qt/"
953 (version-major+minor version) "/" version
954 "/submodules/" name "-everywhere-src-"
958 "1ib61zh6jrab3yz592p47ldfgphi4i184kqf14vhwn31akibh6pw"))
959 (modules '((guix build utils)))
961 ;; The examples try to build and cause the build to fail
963 (delete-file-recursively "examples")
966 (substitute-keyword-arguments (package-arguments qtsvg)
968 `(modify-phases ,phases
969 (add-before 'check 'set-ld-library-path
970 ;; <https://lists.gnu.org/archive/html/guix-devel/2017-09/msg00019.html>
972 ;; Make the uninstalled libQt5WaylandClient.so.5 available to the
973 ;; wayland platform plugin.
975 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/lib"))
980 ("pkg-config" ,pkg-config)
981 ("qtdeclarative" ,qtdeclarative)))
983 `(("fontconfig" ,fontconfig)
984 ("freetype" ,freetype)
986 ("libxcomposite" ,libxcomposite)
988 ("libxkbcommon" ,libxkbcommon)
989 ("libxrender" ,libxrender)
993 ("wayland" ,wayland)))
994 (synopsis "Qt Wayland module")
995 (description "The Qt Wayland module provides the QtWayland client and
996 compositor libraries.")))
998 (define-public qtserialport
999 (package (inherit qtsvg)
1000 (name "qtserialport")
1004 (uri (string-append "https://download.qt.io/official_releases/qt/"
1005 (version-major+minor version) "/" version
1006 "/submodules/" name "-everywhere-src-"
1010 "07vjv3p7n7n5v15wdpi8x5sbnvyjqdh85qfzf9mz8l6ppqp2hk12"))))
1011 (native-inputs `(("perl" ,perl)))
1013 `(("qtbase" ,qtbase)
1016 (substitute-keyword-arguments (package-arguments qtsvg)
1018 `(modify-phases ,phases
1019 (add-after 'unpack 'patch-dlopen-paths
1020 (lambda* (#:key inputs #:allow-other-keys)
1021 (substitute* "src/serialport/qtudev_p.h"
1022 ;; Use the absolute paths for dynamically loaded libs,
1023 ;; otherwise the lib will be searched in LD_LIBRARY_PATH which
1024 ;; typically is not set in guix.
1025 (("^\\s*(udevLibrary->setFileNameAndVersion\\(QStringLiteral\\(\")(udev\"\\),\\s*[0-9]+\\);)" _ a b)
1026 (string-append a (assoc-ref inputs "eudev") "/lib/lib" b)))
1028 (synopsis "Qt Serial Port module")
1029 (description "The Qt Serial Port module provides the library for
1030 interacting with serial ports from within Qt.")))
1032 (define-public qtserialbus
1033 (package (inherit qtsvg)
1034 (name "qtserialbus")
1038 (uri (string-append "https://download.qt.io/official_releases/qt/"
1039 (version-major+minor version) "/" version
1040 "/submodules/" name "-everywhere-src-"
1044 "1bkyk1v7bcq657n88a6675lj55vl9y8v46h4kf27v58yjzgiw842"))))
1046 `(("qtbase" ,qtbase)
1047 ("qtserialport" ,qtserialport)))
1048 (synopsis "Qt Serial Bus module")
1049 (description "The Qt Serial Bus API provides classes and functions to
1050 access the various industrial serial buses and protocols, such as CAN, ModBus,
1053 (define-public qtwebchannel
1054 (package (inherit qtsvg)
1055 (name "qtwebchannel")
1059 (uri (string-append "https://download.qt.io/official_releases/qt/"
1060 (version-major+minor version) "/" version
1061 "/submodules/" name "-everywhere-src-"
1065 "0xff3fbbpcl0kkq0rg9npj127ycirygicbkxlf0v593sjpjp5bmh"))))
1068 ("qtdeclarative" ,qtdeclarative)
1069 ("qtwebsockets" ,qtwebsockets)))
1070 (inputs `(("qtbase" ,qtbase)))
1071 (synopsis "Web communication library for Qt")
1072 (description "The Qt WebChannel module enables peer-to-peer communication
1073 between the host (QML/C++ application) and the client (HTML/JavaScript
1074 application). The transport mechanism is supported out of the box by the two
1075 popular web engines, Qt WebKit 2 and Qt WebEngine.")))
1077 (define-public qtwebglplugin
1078 (package (inherit qtsvg)
1079 (name "qtwebglplugin")
1083 (uri (string-append "https://download.qt.io/official_releases/qt/"
1084 (version-major+minor version) "/" version
1085 "/submodules/" name "-everywhere-src-"
1089 "0fswnmhb8fm7wqgzv8cjy1j2sgb5mhx80jl411laawn7bf2ysjg0"))))
1091 (substitute-keyword-arguments (package-arguments qtsvg)
1093 `(modify-phases ,phases
1094 (add-after 'unpack 'disable-network-tests
1095 (lambda _ (substitute* "tests/plugins/platforms/platforms.pro"
1096 (("webgl") "# webgl"))
1102 ("qtdeclarative" ,qtdeclarative)
1103 ("qtwebsockets" ,qtwebsockets)))
1104 (synopsis "QPA plugin for running an application via a browser using
1105 streamed WebGL commands")
1106 (description "Qt back end that uses WebGL for rendering. It allows Qt
1107 applications (with some limitations) to run in a web browser that supports
1108 WebGL. WebGL is a JavaScript API for rendering 2D and 3D graphics within any
1109 compatible web browser without the use of plug-ins. The API is similar to
1110 OpenGL ES 2.0 and can be used in HTML5 canvas elements")))
1112 (define-public qtwebview
1113 (package (inherit qtsvg)
1118 (uri (string-append "https://download.qt.io/official_releases/qt/"
1119 (version-major+minor version) "/" version
1120 "/submodules/" name "-everywhere-src-"
1124 "1rvvkg6dl34hklllnlzlcffik746f15lzxdnwggc97dmx8n2vy6k"))))
1128 `(("qtbase" ,qtbase)
1129 ("qtdeclarative" ,qtdeclarative)))
1130 (synopsis "Display web content in a QML application")
1131 (description "Qt WebView provides a way to display web content in a QML
1132 application without necessarily including a full web browser stack by using
1133 native APIs where it makes sense.")))
1135 (define-public qtlocation
1136 (package (inherit qtsvg)
1141 (uri (string-append "https://download.qt.io/official_releases/qt/"
1142 (version-major+minor version) "/" version
1143 "/submodules/" name "-everywhere-src-"
1147 "07vq4aycayq2bg8yi4awidb25xyvws2ajbnrmad3rnpg1fw0bsfi"))))
1149 (substitute-keyword-arguments (package-arguments qtsvg)
1150 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1153 ("qtdeclarative" ,qtdeclarative)
1154 ("qtquickcontrols" ,qtquickcontrols)
1155 ("qtserialport" ,qtserialport)))
1158 ("openssl" ,openssl)
1161 (synopsis "Qt Location and Positioning modules")
1162 (description "The Qt Location module provides an interface for location,
1163 positioning and geolocation plugins.")))
1165 (define-public qttools
1166 (package (inherit qtsvg)
1171 (uri (string-append "https://download.qt.io/official_releases/qt/"
1172 (version-major+minor version) "/" version
1173 "/submodules/" name "-everywhere-src-"
1177 "0j1rl368sjknsmwp2f7bwqcb0sx13l3l4dxbm70873si9l8rf2l6"))))
1179 (substitute-keyword-arguments (package-arguments qtsvg)
1180 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1183 ("qtdeclarative" ,qtdeclarative)
1184 ("vulkan-headers" ,vulkan-headers)))
1187 ("qtbase" ,qtbase)))
1188 (synopsis "Qt Tools and Designer modules")
1189 (description "The Qt Tools module provides a set of applications to browse
1190 the documentation, translate applications, generate help files and other stuff
1191 that helps in Qt development.")))
1193 (define-public qtscript
1194 (package (inherit qtsvg)
1199 (uri (string-append "https://download.qt.io/official_releases/qt/"
1200 (version-major+minor version) "/" version
1201 "/submodules/" name "-everywhere-src-"
1205 "06a02230mj4bd8qvjaf2q97grzbj1c1rq36x7236fnhjsikbq7fa"))
1206 (patches (search-patches "qtscript-disable-tests.patch"))))
1209 ("qttools" ,qttools)))
1211 `(("qtbase" ,qtbase)))
1212 (synopsis "Qt Script module")
1213 (description "Qt provides support for application scripting with ECMAScript.
1214 The following guides and references cover aspects of programming with
1215 ECMAScript and Qt.")))
1217 (define-public qtquickcontrols
1218 (package (inherit qtsvg)
1219 (name "qtquickcontrols")
1223 (uri (string-append "https://download.qt.io/official_releases/qt/"
1224 (version-major+minor version) "/" version
1225 "/submodules/" name "-everywhere-src-"
1229 "1rar337vv0dx52r2gxwiwy1axn0fpy79rka09xizjlxsdg3vnf0h"))))
1231 (substitute-keyword-arguments (package-arguments qtsvg)
1232 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1234 `(("qtbase" ,qtbase)
1235 ("qtdeclarative" ,qtdeclarative)))
1236 (synopsis "Qt Quick Controls and other Quick modules")
1237 (description "The QtScript module provides classes for making Qt
1238 applications scriptable. This module provides a set of extra components that
1239 can be used to build complete interfaces in Qt Quick.")))
1241 (define-public qtquickcontrols2
1242 (package (inherit qtsvg)
1243 (name "qtquickcontrols2")
1247 (uri (string-append "https://download.qt.io/official_releases/qt/"
1248 (version-major+minor version) "/" version
1249 "/submodules/" name "-everywhere-src-"
1253 "0dx2jag6l5a80220fvmf49z1psliqf1ijqx6jsvvzv81mpjjd59s"))))
1255 (substitute-keyword-arguments (package-arguments qtsvg)
1256 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1258 `(("qtbase" ,qtbase)
1259 ("qtdeclarative" ,qtdeclarative)))
1260 (synopsis "Qt Quick Controls 2 and other Quick 2 modules")
1261 (description "The Qt Quick Controls 2 module contains the Qt Labs Platform
1262 module that provides platform integration: native dialogs, menus and menu bars,
1263 and tray icons. It falls back to Qt Widgets when a native implementation is
1266 (define-public qtgraphicaleffects
1267 (package (inherit qtsvg)
1268 (name "qtgraphicaleffects")
1272 (uri (string-append "https://download.qt.io/official_releases/qt/"
1273 (version-major+minor version) "/" version
1274 "/submodules/" name "-everywhere-src-"
1278 "1knapc14a80cn2f5bbfj7lhq9flr3v0gwjg9ka7xl8y642235w02"))))
1280 (substitute-keyword-arguments (package-arguments qtsvg)
1281 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1283 `(("qtbase" ,qtbase)
1284 ("qtdeclarative" ,qtdeclarative)))
1285 (synopsis "Qt Graphical Effects module")
1286 (description "The Qt Graphical Effects module provides a set of QML types
1287 for adding visually impressive and configurable effects to user interfaces.
1288 Effects are visual items that can be added to Qt Quick user interface as UI
1289 components. The API consists of over 20 effects provided as separate QML
1290 types. The effects cover functional areas such as blending, masking, blurring,
1291 coloring, and many more.")))
1293 (define-public qtgamepad
1294 (package (inherit qtsvg)
1299 (uri (string-append "https://download.qt.io/official_releases/qt/"
1300 (version-major+minor version) "/" version
1301 "/submodules/" name "-everywhere-src-"
1305 "150y7bc755l9y8w7nkg3gfw5n6rlj9hhq0ibc9g1xgllpr18qqq7"))))
1308 ("pkg-config" ,pkg-config)))
1310 `(("fontconfig" ,fontconfig)
1311 ("freetype" ,freetype)
1312 ("libxrender" ,libxrender)
1315 ("qtdeclarative" ,qtdeclarative)))
1316 (synopsis "Qt Gamepad module")
1317 (description "The Qt Gamepad module is an add-on library that enables Qt
1318 applications to support the use of gamepad hardware and in some cases remote
1319 control equipment. The module provides both QML and C++ interfaces. The
1320 primary target audience are embedded devices with fullscreen user interfaces,
1321 and mobile applications targeting TV-like form factors.")))
1323 (define-public qtscxml
1324 (package (inherit qtsvg)
1329 (uri (string-append "https://download.qt.io/official_releases/qt/"
1330 (version-major+minor version) "/" version
1331 "/submodules/" name "-everywhere-src-"
1335 "1dpvjkvwc3fj86vay8q8vzym73cix7ri2ianx87ck0gqjny51adg"))
1336 (modules '((guix build utils)))
1339 (delete-file-recursively "tests/3rdparty")
1340 ;; the scion test refers to the bundled 3rd party test code.
1341 (substitute* "tests/auto/auto.pro"
1345 `(("qtbase" ,qtbase)
1346 ("qtdeclarative" ,qtdeclarative)))
1347 (synopsis "Qt SCXML module")
1348 (description "The Qt SCXML module provides functionality to create state
1349 machines from SCXML files. This includes both dynamically creating state
1350 machines (loading the SCXML file and instantiating states and transitions) and
1351 generating a C++ file that has a class implementing the state machine. It
1352 also contains functionality to support data models and executable content.")))
1354 (define-public qtpurchasing
1355 (package (inherit qtsvg)
1356 (name "qtpurchasing")
1360 (uri (string-append "https://download.qt.io/official_releases/qt/"
1361 (version-major+minor version) "/" version
1362 "/submodules/" name "-everywhere-src-"
1366 "0xjsn7p629ni68vk4xlw2cvcs53ipcqv1pa4hck0nabddcgcnzkg"))))
1368 `(("qtbase" ,qtbase)
1369 ("qtdeclarative" ,qtdeclarative)))
1370 (synopsis "Qt Purchasing module")
1371 (description "The Qt Purchasing module provides and in-app API for
1372 purchasing goods and services.")))
1374 (define-public qtcanvas3d
1375 (package (inherit qtsvg)
1380 (uri (string-append "https://download.qt.io/official_releases/qt/"
1381 (version-major+minor version) "/" version
1382 "/submodules/" name "-everywhere-src-"
1386 "0l0c1p6jwz5rygyxslfw7jw3wbd23w5n9zg04aqlh5g15qx52fmn"))
1387 (modules '((guix build utils)))
1390 (delete-file-recursively "examples/canvas3d/3rdparty")
1393 (substitute-keyword-arguments (package-arguments qtsvg)
1394 ;; Building the tests depends on the bundled 3rd party javascript files,
1395 ;; and the test phase fails to import QtCanvas3D, causing the phase to
1396 ;; fail, so we skip building them for now.
1398 `(modify-phases ,phases
1400 (lambda* (#:key outputs #:allow-other-keys)
1401 (let ((out (assoc-ref outputs "out")))
1402 (invoke "qmake" "QT_BUILD_PARTS = libs tools"
1403 (string-append "PREFIX=" out)))))))
1404 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1407 `(("qtbase" ,qtbase)
1408 ("qtdeclarative" ,qtdeclarative)))
1409 (synopsis "Qt Canvas 3D module")
1410 (description "The Qt Canvas 3D module provides a way to make WebGL-like 3D
1411 drawing calls from Qt Quick JavaScript.")))
1413 (define-public qtcharts
1414 (package (inherit qtsvg)
1419 (uri (string-append "https://download.qt.io/official_releases/qt/"
1420 (version-major+minor version) "/" version
1421 "/submodules/" name "-everywhere-src-"
1425 "0pyg2lpxmhf4amj57zihp5ry0y9m39xq5hbcx4hqj78bdm96ah23"))))
1427 (substitute-keyword-arguments (package-arguments qtsvg)
1428 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1430 `(("qtbase" ,qtbase)
1431 ("qtdeclarative" ,qtdeclarative)))
1432 (synopsis "Qt Charts module")
1433 (description "The Qt Charts module provides a set of easy to use chart
1434 components. It uses the Qt Graphics View Framework, therefore charts can be
1435 easily integrated to modern user interfaces. Qt Charts can be used as QWidgets,
1436 QGraphicsWidget, or QML types. Users can easily create impressive graphs by
1437 selecting one of the charts themes.")
1438 (license license:gpl3)))
1440 (define-public qtdatavis3d
1441 (package (inherit qtsvg)
1442 (name "qtdatavis3d")
1446 (uri (string-append "https://download.qt.io/official_releases/qt/"
1447 (version-major+minor version) "/" version
1448 "/submodules/" name "-everywhere-src-"
1452 "09wbv4g29sq5z2fphk2910albr3iv3l14nch3ml77w6drw9mgzq7"))))
1454 (substitute-keyword-arguments (package-arguments qtsvg)
1455 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1457 `(("qtbase" ,qtbase)
1458 ("qtdeclarative" ,qtdeclarative)))
1459 (synopsis "Qt Data Visualization module")
1460 (description "The Qt Data Visualization module provides a way to visualize
1461 data in 3D as bar, scatter, and surface graphs. It is especially useful for
1462 visualizing depth maps and large quantities of rapidly changing data, such as
1463 data received from multiple sensors. The look and feel of graphs can be
1464 customized by using themes or by adding custom items and labels to them.")
1465 (license license:gpl3)))
1467 (define-public qtnetworkauth
1468 (package (inherit qtsvg)
1469 (name "qtnetworkauth")
1473 (uri (string-append "https://download.qt.io/official_releases/qt/"
1474 (version-major+minor version) "/" version
1475 "/submodules/" name "-everywhere-src-"
1479 "0sspni7zllhspk70yjj2d0li9r4rs3iflnksj8mvjx2yl9qpryyb"))))
1481 (substitute-keyword-arguments (package-arguments qtsvg)
1483 `(modify-phases ,phases
1484 (add-after 'unpack 'remove-failing-test
1486 ;; These tests can't find their test data.
1487 (substitute* "tests/auto/auto.pro"
1488 (("oauth1 ") "# oauth1 "))
1491 `(("qtbase" ,qtbase)))
1492 (synopsis "Qt Network Authorization module")
1493 (description "The Qt Network Authorization module provides an
1494 implementation of OAuth and OAuth2 authenticathon methods for Qt.")))
1496 (define-public qtremoteobjects
1497 (package (inherit qtsvg)
1498 (name "qtremoteobjects")
1502 (uri (string-append "https://download.qt.io/official_releases/qt/"
1503 (version-major+minor version) "/" version
1504 "/submodules/" name "-everywhere-src-"
1508 "03qjj7l63wn1zqkmlja9yrnc38rf6b3apnmsn0kw0h61x72awskd"))))
1510 (substitute-keyword-arguments (package-arguments qtsvg)
1512 `(modify-phases ,phases
1513 (add-after 'unpack 'remove-failing-test
1515 ;; This test can't find its imports.
1516 (substitute* "tests/auto/qml/qml.pro"
1517 (("integration") "# integration")
1518 (("usertypes") "# usertypes"))
1521 `(("qtbase" ,qtbase)
1522 ("qtdeclarative" ,qtdeclarative)))
1523 (synopsis "Qt Remote Objects module")
1524 (description "The Qt Remote Objects module is an @dfn{inter-process
1525 communication} (IPC) module developed for Qt. The idea is to extend existing
1526 Qt's functionalities to enable an easy exchange of information between
1527 processes or computers.")))
1529 (define-public qtspeech
1530 (package (inherit qtsvg)
1535 (uri (string-append "https://download.qt.io/official_releases/qt/"
1536 (version-major+minor version) "/" version
1537 "/submodules/" name "-everywhere-src-"
1541 "0q30m9l28zsdzdmny7wjskd2fjfrgh1l595wir6bhwhil95g3i0c"))))
1544 (substitute-keyword-arguments (package-arguments qtsvg)
1545 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1547 `(("qtbase" ,qtbase)))
1550 ("qtdeclarative" ,qtdeclarative)
1551 ("qtmultimedia" ,qtmultimedia)
1552 ("qtxmlpatterns" ,qtxmlpatterns)))
1553 (synopsis "Qt Speech module")
1554 (description "The Qt Speech module enables a Qt application to support
1555 accessibility features such as text-to-speech, which is useful for end-users
1556 who are visually challenged or cannot access the application for whatever
1557 reason. The most common use case where text-to-speech comes in handy is when
1558 the end-user is driving and cannot attend the incoming messages on the phone.
1559 In such a scenario, the messaging application can read out the incoming
1562 (define-public qtwebengine
1565 (name "qtwebengine")
1566 (version (package-version qtbase))
1570 (uri (string-append "https://download.qt.io/official_releases/qt/"
1571 (version-major+minor version) "/" version
1572 "/submodules/" name "-everywhere-src-"
1576 "1yj6pcj945fpbc7nihav0plxpx8ikylmxjy7wqdv5znslgf59dw3"))
1577 (modules '((ice-9 ftw)
1581 (guix build utils)))
1584 (let ((preserved-third-party-files
1585 '("base/third_party/dmg_fp"
1586 "base/third_party/dynamic_annotations"
1587 "base/third_party/icu"
1588 "base/third_party/libevent"
1589 "base/third_party/nspr"
1590 "base/third_party/superfasthash"
1591 "base/third_party/symbolize"
1592 "base/third_party/xdg_mime"
1593 "base/third_party/xdg_user_dirs"
1594 "net/third_party/http2"
1595 "net/third_party/mozilla_security_manager"
1596 "net/third_party/nss"
1597 "net/third_party/spdy"
1598 "net/third_party/quic"
1599 "third_party/abseil-cpp"
1601 "third_party/angle/src/common/third_party/base"
1602 "third_party/angle/src/common/third_party/smhasher"
1603 "third_party/angle/src/third_party/compiler"
1605 "third_party/boringssl"
1606 "third_party/boringssl/src/third_party/fiat"
1607 "third_party/breakpad"
1608 "third_party/brotli"
1610 "third_party/crc32c"
1611 "third_party/ffmpeg"
1612 "third_party/googletest"
1613 "third_party/hunspell"
1614 "third_party/iccjpeg"
1616 "third_party/inspector_protocol"
1617 "third_party/jinja2"
1618 "third_party/jstemplate"
1619 "third_party/khronos"
1620 "third_party/leveldatabase"
1621 "third_party/libaddressinput"
1622 "third_party/libjingle_xmpp"
1623 "third_party/libpng"
1624 "third_party/libsrtp"
1625 "third_party/libsync"
1626 "third_party/libudev"
1627 "third_party/libvpx"
1628 "third_party/libwebm"
1629 "third_party/libwebp"
1630 "third_party/libxml"
1631 "third_party/libxslt"
1632 "third_party/libyuv"
1634 "third_party/markupsafe"
1636 "third_party/metrics_proto"
1637 "third_party/modp_b64"
1641 "third_party/polymer"
1642 "third_party/protobuf"
1643 "third_party/pyjson5"
1645 "third_party/rnnoise"
1647 "third_party/skia/third_party/gif"
1648 "third_party/skia/third_party/skcms"
1649 "third_party/smhasher"
1650 "third_party/snappy"
1651 "third_party/sqlite"
1652 "third_party/usrsctp"
1653 "third_party/web-animations-js"
1654 "third_party/webrtc"
1655 "third_party/webrtc_overrides"
1656 "third_party/widevine/cdm/widevine_cdm_common.h"
1657 "third_party/widevine/cdm/widevine_cdm_version.h"
1661 "url/third_party/mozilla"
1662 "v8/src/third_party/utf8-decoder"
1663 "v8/src/third_party/valgrind"
1664 "v8/third_party/antlr4"
1665 "v8/third_party/inspector_protocol"))
1666 (protected (make-regexp "\\.(gn|gyp)i?$")))
1667 (define preserved-club
1668 (map (lambda (member)
1669 (string-append "./" member))
1670 preserved-third-party-files))
1671 (define (empty? dir)
1672 (equal? (scandir dir) '("." "..")))
1673 (define (third-party? file)
1674 (string-contains file "third_party/"))
1675 (define (useless? file)
1676 (any (cute string-suffix? <> file)
1677 '(".zip" ".so" ".dll" ".exe" ".jar")))
1678 (define (parents child)
1679 ;; Return all parent directories of CHILD up to and including
1680 ;; the closest "third_party".
1681 (let* ((dirs (match (string-split child #\/)
1682 ((dirs ... last) dirs)))
1683 (closest (list-index (lambda (dir)
1684 (string=? "third_party" dir))
1686 (delim (- (length dirs) closest)))
1687 (fold (lambda (dir prev)
1688 (cons (string-append (car prev) "/" dir)
1690 (list (string-join (list-head dirs delim) "/"))
1691 (list-tail dirs delim))))
1692 (define (remove-loudly file)
1693 (format #t "deleting ~a...~%" file)
1696 (define (delete-unwanted-files child stat flag base level)
1698 ((or 'regular 'symlink 'stale-symlink)
1699 (when (third-party? child)
1700 (unless (or (member child preserved-club)
1701 (any (cute member <> preserved-club)
1703 (regexp-exec protected child))
1704 (remove-loudly child)))
1705 (when (and (useless? child) (file-exists? child))
1706 (remove-loudly child))
1708 ('directory-processed
1709 (when (empty? child)
1714 (with-directory-excursion "src/3rdparty"
1715 ;; TODO: Try removing "gn" too for future versions of qtwebengine.
1716 (delete-file-recursively "ninja")
1718 (with-directory-excursion "chromium"
1719 ;; Delete bundled software and binaries that were not explicitly
1721 (nftw "." delete-unwanted-files 'depth 'physical)
1723 ;; Assert that each preserved item is present to catch removals.
1724 (for-each (lambda (third-party)
1725 (unless (file-exists? third-party)
1726 (error (format #f "~s does not exist!~%" third-party))))
1729 ;; Use relative header locations instead of hard coded ones.
1731 "base/third_party/dynamic_annotations/dynamic_annotations.c"
1732 (("base/third_party/valgrind") "valgrind"))
1734 "third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.h"
1735 (("third_party/curl") "curl"))
1737 ;; Replace Google Analytics bundle with an empty file and hope
1739 (mkdir-p "third_party/analytics")
1740 (call-with-output-file
1741 "third_party/analytics/google-analytics-bundle.js"
1745 ;; Do not enable support for loading the Widevine DRM plugin.
1746 (substitute* "src/core/config/common.pri"
1747 (("enable_widevine=true")
1748 "enable_widevine=false"))
1750 (build-system gnu-build-system)
1757 ("pkg-config" ,pkg-config)
1758 ("python-2" ,python-2)
1761 `(("alsa-lib" ,alsa-lib)
1763 ("cups-minimal" ,cups-minimal)
1767 ("fontconfig" ,fontconfig)
1768 ("harbuzz" ,harfbuzz)
1770 ("jsoncpp" ,jsoncpp)
1773 ("libevent" ,libevent)
1774 ("libgcrypt" ,libgcrypt)
1775 ("libjpeg" ,libjpeg-turbo)
1777 ;; FIXME: configure does not find system lcms
1779 ("libwebp" ,libwebp)
1782 ("libxcomposite" ,libxcomposite)
1783 ("libxcursor" ,libxcursor)
1785 ("libxkbcommon" ,libxkbcommon)
1786 ;; FIXME: libxml2 needs to built with icu support though it links to
1787 ;; libxml2 configure summary still states "Checking for compatible
1788 ;; system libxml2... no"
1789 ("libxml2" ,libxml2)
1790 ("libxrandr" ,libxrandr)
1791 ("libxrender" ,libxrender)
1792 ("libxslt" ,libxslt)
1793 ("libxtst" ,libxtst)
1795 ("minizip" ,minizip)
1798 ("pciutils" ,pciutils)
1799 ("protobuf" ,protobuf)
1800 ("pulseaudio" ,pulseaudio)
1802 ("qtdeclarative" ,qtdeclarative)
1803 ("qtmultimedia" ,qtmultimedia)
1804 ("qtwebchannel" ,qtwebchannel)
1808 ("valgrind" ,valgrind)
1809 ("xcb-util" ,xcb-util)))
1811 (substitute-keyword-arguments (package-arguments qtsvg)
1813 `(modify-phases ,phases
1814 (add-after 'unpack 'fix-build-with-newer-re2
1816 ;; Adjust for API change in re2, taken from
1817 ;; https://chromium-review.googlesource.com/c/chromium/src/+/2145261
1818 (substitute* "src/3rdparty/chromium/components/autofill/core\
1819 /browser/address_rewriter.cc"
1820 (("options\\.set_utf8\\(true\\)")
1821 "options.set_encoding(RE2::Options::EncodingUTF8)"))
1823 (add-after 'unpack 'patch-ninja-version-check
1825 ;; The build system assumes the system Ninja is too old because
1826 ;; it only checks for versions 1.7 through 1.9. We have 1.10.
1827 (substitute* "configure.pri"
1828 (("1\\.\\[7-9\\]\\.\\*")
1829 "1.([7-9]|1[0-9]).*"))
1831 (add-before 'configure 'substitute-source
1832 (lambda* (#:key inputs outputs #:allow-other-keys)
1833 (let ((out (assoc-ref outputs "out"))
1834 (nss (assoc-ref inputs "nss"))
1835 (udev (assoc-ref inputs "udev")))
1836 ;; Qtwebengine is not installed into the same prefix as
1837 ;; qtbase. Some qtbase QTLibraryInfo constants will not
1838 ;; work. Replace with the full path to the qtwebengine
1839 ;; translations and locales in the store.
1840 (substitute* "src/core/web_engine_library_info.cpp"
1841 (("QLibraryInfo::location\\(QLibraryInfo::TranslationsPath\\)")
1842 (string-append "QLatin1String(\"" out "/share/qt5/translations\")"))
1843 (("QLibraryInfo::location\\(QLibraryInfo::DataPath\\)")
1844 (string-append "QLatin1String(\"" out "/share/qt5\")")))
1845 ;; Substitute full dynamic library path for nss.
1846 (substitute* "src/3rdparty/chromium/crypto/nss_util.cc"
1848 (string-append nss "/lib/nss/libnssckbi.so")))
1849 ;; Substitute full dynamic library path for udev.
1850 (substitute* "src/3rdparty/chromium/device/udev_linux/udev1_loader.cc"
1852 (string-append udev "/lib/libudev.so.1")))
1854 (add-before 'configure 'set-env
1856 ;; Avoids potential race conditions.
1857 (setenv "PYTHONDONTWRITEBYTECODE" "1")
1858 (setenv "NINJAFLAGS"
1859 (string-append "-k1" ;less verbose build output
1860 ;; Respect the '--cores' option of 'guix build'.
1861 " -j" (number->string (parallel-job-count))))
1865 ;; Valid QT_BUILD_PARTS variables are:
1866 ;; libs tools tests examples demos docs translations
1867 (invoke "qmake" "QT_BUILD_PARTS = libs tools" "--"
1868 "--webengine-printing-and-pdf=no"
1869 "--webengine-ffmpeg=system"
1870 "--webengine-icu=system"
1871 "--webengine-pepper-plugins=no")))))
1872 ;; Tests are disabled due to "Could not find QtWebEngineProcess error"
1873 ;; It's possible this can be fixed by setting QTWEBENGINEPROCESS_PATH
1874 ;; before running tests.
1875 ((#:tests? _ #f) #f)))
1876 (native-search-paths
1877 (list (search-path-specification
1878 (file-type 'regular)
1880 (variable "QTWEBENGINEPROCESS_PATH")
1881 (files '("lib/qt5/libexec/QtWebEngineProcess")))))
1882 (home-page "https://wiki.qt.io/QtWebEngine")
1883 (synopsis "Qt WebEngine module")
1884 (description "The Qt5WebEngine module provides support for web applications
1885 using the Chromium browser project. The Chromium source code has Google services
1886 and binaries removed, and adds modular support for using system libraries.")
1887 (license license:lgpl2.1+)))
1889 (define-public python-sip
1896 (uri (string-append "https://www.riverbankcomputing.com/static/"
1897 "Downloads/sip/" version "/sip-" version ".tar.gz"))
1900 "07kyd56xgbb40ljb022rq82shgxprlbl0z27mpf1b6zd00w8dgf0"))))
1901 (build-system gnu-build-system)
1903 `(("python" ,python-wrapper)))
1905 `(#:tests? #f ; no check target
1906 #:modules ((srfi srfi-1)
1907 ,@%gnu-build-system-modules)
1909 (modify-phases %standard-phases
1911 (lambda* (#:key inputs outputs #:allow-other-keys)
1912 (let* ((out (assoc-ref outputs "out"))
1913 (bin (string-append out "/bin"))
1914 (include (string-append out "/include"))
1915 (python (assoc-ref inputs "python"))
1917 (last (string-split python #\-)))
1920 (take (string-split python-version #\.) 2)
1922 (lib (string-append out "/lib/python"
1925 (invoke "python" "configure.py"
1928 "--incdir" include)))))))
1929 (home-page "https://www.riverbankcomputing.com/software/sip/intro")
1930 (synopsis "Python binding creator for C and C++ libraries")
1932 "SIP is a tool to create Python bindings for C and C++ libraries. It
1933 was originally developed to create PyQt, the Python bindings for the Qt
1934 toolkit, but can be used to create bindings for any C or C++ library.
1936 SIP comprises a code generator and a Python module. The code generator
1937 processes a set of specification files and generates C or C++ code, which
1938 is then compiled to create the bindings extension module. The SIP Python
1939 module provides support functions to the automatically generated code.")
1940 ;; There is a choice between a python like license, gpl2 and gpl3.
1941 ;; For compatibility with pyqt, we need gpl3.
1942 (license license:gpl3)))
1944 (define-public python2-sip
1945 (package (inherit python-sip)
1946 (name "python2-sip")
1948 `(("python" ,python-2)))))
1950 (define-public python-pyqt
1952 (name "python-pyqt")
1957 (uri (string-append "https://www.riverbankcomputing.com/static/"
1958 "Downloads/PyQt5/" version "/PyQt5_gpl-"
1962 "041155bdzp57jy747p5d59740c55yy3241cy1x2lgcdsvqvzmc0d"))
1963 (patches (search-patches "pyqt-configure.patch"
1964 "pyqt-unbundled-qt.patch"
1965 "pyqt-public-sip.patch"))))
1966 (build-system gnu-build-system)
1968 `(("qtbase" ,qtbase))) ; for qmake
1970 `(("python-sip" ,python-sip)))
1972 `(("python" ,python-wrapper)
1974 ("qtconnectivity" ,qtconnectivity)
1975 ("qtdeclarative" ,qtdeclarative)
1976 ("qtlocation" ,qtlocation)
1977 ("qtmultimedia" ,qtmultimedia)
1978 ("qtsensors" ,qtsensors)
1979 ("qtserialport" ,qtserialport)
1981 ("qttools" ,qttools)
1982 ("qtwebchannel" ,qtwebchannel)
1983 ("qtwebkit" ,qtwebkit)
1984 ("qtwebsockets" ,qtwebsockets)
1985 ("qtx11extras" ,qtx11extras)
1986 ("qtxmlpatterns" ,qtxmlpatterns)))
1988 `(#:modules ((srfi srfi-1)
1989 ,@%gnu-build-system-modules)
1991 (modify-phases %standard-phases
1992 ;; When building python-pyqtwebengine, <qprinter.h> can not be
1993 ;; included. Here we substitute the full path to the header in the
1995 (add-before 'configure 'substitute-source
1996 (lambda* (#:key inputs #:allow-other-keys)
1997 (let* ((qtbase (assoc-ref inputs "qtbase"))
1998 (qtprinter.h (string-append "\"" qtbase "/include/qt5/QtPrintSupport/qprinter.h\"")))
1999 (substitute* "sip/QtPrintSupport/qprinter.sip"
2004 (lambda* (#:key inputs outputs #:allow-other-keys)
2005 (let* ((out (assoc-ref outputs "out"))
2006 (bin (string-append out "/bin"))
2007 (sip (string-append out "/share/sip"))
2008 (plugins (string-append out "/lib/qt5/plugins"))
2009 (designer (string-append plugins "/designer"))
2010 (qml (string-append plugins "/PyQt5"))
2011 (python (assoc-ref inputs "python"))
2013 (last (string-split python #\-)))
2016 (take (string-split python-version #\.) 2)
2018 (lib (string-append out "/lib/python"
2021 (stubs (string-append lib "/PyQt5")))
2022 (invoke "python" "configure.py"
2026 "--designer-plugindir" designer
2027 "--qml-plugindir" qml
2028 ; Where to install the PEP 484 Type Hints stub
2029 ; files. Without this the stubs are tried to be
2030 ; installed into the python package's
2031 ; site-package directory, which is read-only.
2033 "--sipdir" sip)))))))
2034 (home-page "https://www.riverbankcomputing.com/software/pyqt/intro")
2035 (synopsis "Python bindings for Qt")
2037 "PyQt is a set of Python v2 and v3 bindings for the Qt application
2038 framework. The bindings are implemented as a set of Python modules and
2039 contain over 620 classes.")
2040 (license license:gpl3)))
2042 (define-public python-pyqtwebengine
2044 (name "python-pyqtwebengine")
2050 "https://www.riverbankcomputing.com/static/Downloads/PyQtWebEngine/"
2051 version "/PyQtWebEngine_gpl-" version ".tar.gz"))
2054 "0wylkd7fh2g27y3710rpxmj9wx0wpi3z7qbv6khiddm15rkh81w6"))))
2055 (build-system gnu-build-system)
2057 `(("python" ,python)
2058 ("python-sip" ,python-sip)
2059 ;; qtbase is required for qmake
2060 ("qtbase" ,qtbase)))
2062 `(("python" ,python-wrapper)
2063 ("python-sip" ,python-sip)
2064 ("python-pyqt" ,python-pyqt)
2067 ("qtdeclarative" ,qtdeclarative)
2068 ("qtwebchannel" ,qtwebchannel)
2069 ("python-pyqt" ,python-pyqt)
2070 ("qtwebengine" ,qtwebengine)))
2072 `(#:modules ((srfi srfi-1)
2073 ((guix build python-build-system) #:select (python-version))
2074 ,@%gnu-build-system-modules)
2075 #:imported-modules ((guix build python-build-system)
2076 ,@%gnu-build-system-modules)
2078 (modify-phases %standard-phases
2080 (lambda* (#:key inputs outputs #:allow-other-keys)
2081 (let* ((out (assoc-ref outputs "out"))
2082 (sipdir (string-append out "/share/sip"))
2083 (pyqt-sipdir (string-append
2084 (assoc-ref inputs "python-pyqt") "/share/sip"))
2085 (python (assoc-ref inputs "python"))
2086 (lib (string-append out "/lib/python"
2087 (python-version python)
2088 "/site-packages/PyQt5"))
2089 (stubs (string-append lib "/PyQt5")))
2092 (invoke "python" "configure.py"
2099 "--pyqt-sipdir" pyqt-sipdir))))
2100 ;; Because this has a different prefix than python-pyqt then we need
2101 ;; to make this a namespace of it's own
2102 (add-after 'install 'make-namespace
2103 (lambda* (#:key inputs outputs #:allow-other-keys)
2104 (let* ((__init__.py (string-append
2105 (assoc-ref outputs "out")
2107 (python-version (assoc-ref inputs "python"))
2108 "/site-packages/PyQt5/__init__.py")))
2109 (with-output-to-file __init__.py
2110 (lambda _ (display "
2111 from pkgutil import extend_path
2112 __path__ = extend_path(__path__, __name__)
2115 (home-page "https://www.riverbankcomputing.com/software/pyqtwebengine/intro")
2116 (synopsis "Python bindings for QtWebEngine")
2118 "PyQtWebEngine is a set of Python bindings for The Qt Company's Qt
2119 WebEngine libraries. The bindings sit on top of PyQt5 and are implemented as a
2120 set of three modules. Prior to v5.12 these bindings were part of PyQt
2122 (license license:gpl3)))
2124 ;; XXX: This is useful because qtwebkit does not build reliably at this time.
2125 ;; Ultimately, it would be nicer to have a more modular set of python-pyqt-*
2126 ;; packages that could be used together.
2127 (define-public python-pyqt-without-qtwebkit
2128 (package (inherit python-pyqt)
2129 (name "python-pyqt-without-qtwebkit")
2131 (alist-delete "qtwebkit" (package-inputs python-pyqt)))))
2133 (define-public python2-pyqt
2134 (package (inherit python-pyqt)
2135 (name "python2-pyqt")
2137 `(("python-sip" ,python2-sip)
2138 ("qtbase" ,qtbase)))
2140 `(("python" ,python-2)
2141 ("python2-enum34" ,python2-enum34)
2142 ,@(alist-delete "python" (package-inputs python-pyqt))))))
2144 (define-public python2-pyqt-4
2145 (package (inherit python-pyqt)
2146 (name "python2-pyqt")
2152 (string-append "mirror://sourceforge/pyqt/PyQt4/"
2153 "PyQt-" version "/PyQt4_gpl_x11-"
2157 "1nw8r88a5g2d550yvklawlvns8gd5slw53yy688kxnsa65aln79w"))))
2159 `(("python-sip" ,python2-sip)
2161 (inputs `(("python" ,python-2)))
2163 `(#:tests? #f ; no check target
2164 #:modules ((srfi srfi-1)
2165 ,@%gnu-build-system-modules)
2167 (modify-phases %standard-phases
2169 (lambda* (#:key inputs outputs #:allow-other-keys)
2170 (let* ((out (assoc-ref outputs "out"))
2171 (bin (string-append out "/bin"))
2172 (sip (string-append out "/share/sip"))
2173 (python (assoc-ref inputs "python"))
2175 (last (string-split python #\-)))
2178 (take (string-split python-version #\.) 2)
2180 (lib (string-append out "/lib/python"
2183 (invoke "python" "configure.py"
2187 "--sipdir" sip)))))))
2188 (license (list license:gpl2 license:gpl3)))) ; choice of either license
2190 (define-public qscintilla
2196 (uri (string-append "mirror://sourceforge/pyqt/QScintilla2/"
2197 "QScintilla-" version "/QScintilla_gpl-"
2201 "1swjr786w04r514pry9pn32ivza4il1cg35s60qy39cwc175pka6"))))
2202 (build-system gnu-build-system)
2205 (modify-phases %standard-phases
2207 (lambda* (#:key outputs #:allow-other-keys)
2208 (let ((out (assoc-ref outputs "out")))
2210 (substitute* "qscintilla.pro"
2211 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
2212 (string-append out "/lib"))
2213 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
2214 (string-append out "/include"))
2215 (("\\$\\$\\[QT_INSTALL_TRANSLATIONS\\]")
2216 (string-append out "/translations"))
2217 (("\\$\\$\\[QT_INSTALL_DATA\\]")
2218 (string-append out "/lib/qt$${QT_MAJOR_VERSION}"))
2219 (("\\$\\$\\[QT_HOST_DATA\\]")
2220 (string-append out "/lib/qt$${QT_MAJOR_VERSION}")))
2221 (invoke "qmake")))))))
2222 (native-inputs `(("qtbase" ,qtbase)))
2223 (home-page "https://www.riverbankcomputing.co.uk/software/qscintilla/intro")
2224 (synopsis "Qt port of the Scintilla C++ editor control")
2225 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
2226 editor control. QScintilla includes features especially useful when editing
2227 and debugging source code. These include support for syntax styling, error
2228 indicators, code completion and call tips.")
2229 (license license:gpl3+)))
2231 (define-public python-qscintilla
2232 (package (inherit qscintilla)
2233 (name "python-qscintilla")
2236 (list "--pyqt=PyQt5"
2237 (string-append "--pyqt-sipdir="
2238 (assoc-ref %build-inputs "python-pyqt")
2240 (string-append "--qsci-incdir="
2241 (assoc-ref %build-inputs "qscintilla")
2243 (string-append "--qsci-libdir="
2244 (assoc-ref %build-inputs "qscintilla")
2247 (modify-phases %standard-phases
2249 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
2250 (let ((out (assoc-ref outputs "out"))
2251 (python (assoc-ref inputs "python")))
2253 (apply invoke "python3" "configure.py"
2255 ;; Install to the right directory
2256 (substitute* '("Makefile"
2258 (("\\$\\(INSTALL_ROOT\\)/gnu/store/[^/]+") out)
2259 (((string-append python "/lib"))
2260 (string-append out "/lib")))
2261 ;; And fix the installed.txt file
2262 (substitute* "installed.txt"
2263 (("/gnu/store/[^/]+") out)))
2266 `(("qscintilla" ,qscintilla)
2268 ("python-pyqt" ,python-pyqt)))
2269 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
2270 editor control. QScintilla includes features especially useful when editing
2271 and debugging source code. These include support for syntax styling, error
2272 indicators, code completion and call tips.
2274 This package provides the Python bindings.")))
2276 ;; PyQt only looks for modules in its own directory. It ignores environment
2277 ;; variables such as PYTHONPATH, so we need to build a union package to make
2279 (define-public python-pyqt+qscintilla
2280 (package (inherit python-pyqt)
2281 (name "python-pyqt+qscintilla")
2283 (build-system trivial-build-system)
2285 '(#:modules ((guix build union))
2287 (use-modules (ice-9 match)
2289 (match %build-inputs
2290 (((names . directories) ...)
2291 (union-build (assoc-ref %outputs "out")
2295 `(("python-pyqt" ,python-pyqt)
2296 ("python-qscintilla" ,python-qscintilla)))
2297 (synopsis "Union of PyQt and the Qscintilla extension")
2299 "This package contains the union of PyQt and the Qscintilla extension.")))
2301 (define-public qtkeychain
2309 (url "https://github.com/frankosterfeld/qtkeychain/")
2310 (commit (string-append "v" version))))
2311 (file-name (git-file-name name version))
2314 "0h4wgngn2yl35hapbjs24amkjfbzsvnna4ixfhn87snjnq5lmjbc"))))
2315 (build-system cmake-build-system)
2317 `(("pkg-config" ,pkg-config)
2318 ("qttools" ,qttools)))
2320 `(("qtbase" ,qtbase)))
2322 `(#:tests? #f ; No tests included
2324 (modify-phases %standard-phases
2325 (add-before 'configure 'set-qt-trans-dir
2327 (substitute* "CMakeLists.txt"
2328 (("\\$\\{qt_translations_dir\\}")
2329 "${CMAKE_INSTALL_PREFIX}/share/qt5/translations"))
2331 (home-page "https://github.com/frankosterfeld/qtkeychain")
2332 (synopsis "Qt API to store passwords")
2334 "QtKeychain is a Qt library to store passwords and other secret data
2335 securely. It will not store any data unencrypted unless explicitly requested.")
2336 (license license:bsd-3)))
2346 (string-append "mirror://sourceforge/qwt/qwt/"
2347 version "/qwt-" version ".tar.bz2"))
2349 (base32 "1navkcnmn0qz8kzsyqmk32d929zl72l0b580w1ica7z5559j2a8m"))))
2350 (build-system gnu-build-system)
2352 `(("qtbase" ,qtbase)
2354 ("qttools" ,qttools)))
2357 (modify-phases %standard-phases
2359 (lambda* (#:key outputs #:allow-other-keys)
2360 (let* ((out (assoc-ref outputs "out"))
2361 (docdir (string-append out "/share/doc/qwt"))
2362 (incdir (string-append out "/include/qwt"))
2363 (pluginsdir (string-append out "/lib/qt5/plugins/designer"))
2364 (featuresdir (string-append out "/lib/qt5/mkspecs/features")))
2365 (substitute* '("qwtconfig.pri")
2366 (("^(\\s*QWT_INSTALL_PREFIX)\\s*=.*" _ x)
2367 (format #f "~a = ~a\n" x out))
2368 (("^(QWT_INSTALL_DOCS)\\s*=.*" _ x)
2369 (format #f "~a = ~a\n" x docdir))
2370 (("^(QWT_INSTALL_HEADERS)\\s*=.*" _ x)
2371 (format #f "~a = ~a\n" x incdir))
2372 (("^(QWT_INSTALL_PLUGINS)\\s*=.*" _ x)
2373 (format #f "~a = ~a\n" x pluginsdir))
2374 (("^(QWT_INSTALL_FEATURES)\\s*=.*" _ x)
2375 (format #f "~a = ~a\n" x featuresdir)))
2376 (substitute* '("doc/doc.pro")
2377 ;; We'll install them in the 'install-man-pages' phase.
2378 (("^unix:doc\\.files.*") ""))
2380 (add-after 'install 'install-man-pages
2381 (lambda* (#:key outputs #:allow-other-keys)
2382 (let* ((out (assoc-ref outputs "out"))
2383 (man (string-append out "/share/man")))
2384 ;; Remove some incomplete manual pages.
2385 (for-each delete-file (find-files "doc/man/man3" "^_tmp.*"))
2387 (copy-recursively "doc/man" man)
2389 (home-page "http://qwt.sourceforge.net")
2390 (synopsis "Qt widgets for plots, scales, dials and other technical software
2393 "The Qwt library contains widgets and components which are primarily useful
2394 for technical and scientific purposes. It includes a 2-D plotting widget,
2395 different kinds of sliders, and much more.")
2398 ;; The Qwt license is LGPL2.1 with some exceptions.
2399 (license:non-copyleft "http://qwt.sourceforge.net/qwtlicense.html")
2400 ;; textengines/mathml/qwt_mml_document.{cpp,h} is dual LGPL2.1/GPL3 (either).
2401 license:lgpl2.1 license:gpl3))))
2403 (define-public qtwebkit
2406 (version "5.212.0-alpha4")
2410 (uri (string-append "https://github.com/annulen/webkit/releases/download/"
2411 "qtwebkit-" version "/qtwebkit-" version ".tar.xz"))
2414 "1rm9sjkabxna67dl7myx9d9vpdyfxfdhrk9w7b94srkkjbd2d8cw"))
2415 (patches (search-patches "qtwebkit-pbutils-include.patch"))))
2416 (build-system cmake-build-system)
2424 ("pkg-config" ,pkg-config)))
2428 ("gst-plugins-base" ,gst-plugins-base)
2429 ("libjpeg" ,libjpeg-turbo)
2431 ("libwebp" ,libwebp)
2433 ("fontconfig" ,fontconfig)
2434 ("libxrender" ,libxrender)
2436 ("qtdeclarative" ,qtdeclarative)
2437 ("qtlocation" ,qtlocation)
2438 ("qtmultimedia" ,qtmultimedia)
2439 ("qtsensors" ,qtsensors)
2440 ("qtwebchannel" ,qtwebchannel)
2441 ("libxml2" ,libxml2)
2442 ("libxslt" ,libxslt)
2444 ("libxcomposite" ,libxcomposite)))
2446 `(#:tests? #f ; no apparent tests; it might be necessary to set
2447 ; ENABLE_API_TESTS, see CMakeLists.txt
2449 ;; Parallel builds fail due to a race condition:
2450 ;; <https://bugs.gnu.org/34062>.
2451 #:parallel-build? #f
2453 #:configure-flags (list ;"-DENABLE_API_TESTS=TRUE"
2455 "-DUSE_LIBHYPHEN=OFF"
2456 "-DUSE_SYSTEM_MALLOC=ON"
2457 ;; XXX: relative dir installs to build dir?
2458 (string-append "-DECM_MKSPECS_INSTALL_DIR="
2459 %output "/lib/qt5/mkspecs/modules")
2460 ;; Sacrifice a little speed in order to link
2461 ;; libraries and test executables in a
2462 ;; reasonable amount of memory.
2463 "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,--no-keep-memory"
2464 "-DCMAKE_EXE_LINKER_FLAGS=-Wl,--no-keep-memory")))
2465 (home-page "https://www.webkit.org")
2466 (synopsis "Web browser engine and classes to render and interact with web
2468 (description "QtWebKit provides a Web browser engine that makes it easy to
2469 embed content from the World Wide Web into your Qt application. At the same
2470 time Web content can be enhanced with native controls.")
2471 ;; Building QtWebKit takes around 13 hours on an AArch64 machine. Give some
2472 ;; room for slower or busy hardware.
2473 (properties '((timeout . 64800))) ;18 hours
2475 ;; XXX: This consumes too much RAM to successfully build on AArch64 (e.g.,
2476 ;; SoftIron OverDrive with 8 GiB of RAM), so instead of wasting resources,
2477 ;; disable it on non-Intel platforms.
2478 (supported-systems '("x86_64-linux" "i686-linux"))
2480 (license license:lgpl2.1+)))
2482 (define-public dotherside
2490 (url "https://github.com/filcuc/DOtherSide")
2491 (commit (string-append "v" version))))
2492 (file-name (git-file-name name version))
2495 "09fz6v8rp28997f235yaifj8p4vvsyv45knc1iivgdvx7msgcd0m"))))
2496 (build-system cmake-build-system)
2498 `(("qttools" ,qttools)))
2500 `(("qtbase" ,qtbase)
2501 ("qtdeclarative" ,qtdeclarative)))
2502 (home-page "https://filcuc.github.io/DOtherSide/index.html")
2503 (synopsis "C language library for creating bindings for the Qt QML language")
2505 "DOtherSide is a C language library for creating bindings for the
2506 QT QML language. The following features are implementable from
2509 @item Creating custom QObject
2510 @item Creating custom QAbstractListModels
2511 @item Creating custom properties, signals and slots
2512 @item Creating from QML QObject defined in the binded language
2513 @item Creating from Singleton QML QObject defined in the binded language
2515 (license license:lgpl3))) ;version 3 only (+ exception)
2517 ;; There have been no public releases yet.
2518 (define-public qtcolorwidgets
2519 (let ((commit "a95f72e935fe9e046061a1d1c3930cbfbcb533e0")
2522 (name "qtcolorwidgets")
2523 (version (git-version "0" revision commit))
2527 (url "https://gitlab.com/mattia.basaglia/Qt-Color-Widgets")
2529 (file-name (git-file-name name version))
2532 "0dkiwlqh2gwhlp78c1fmchj3shl4p9inspcl96ya5aa8mn6kydy8"))))
2533 (build-system cmake-build-system)
2534 (arguments `(#:tests? #f)) ; There are no tests
2536 `(("qttools" ,qttools)))
2538 `(("qtbase" ,qtbase)))
2539 (home-page "https://gitlab.com/mattia.basaglia/Qt-Color-Widgets")
2540 (synopsis "Color management widgets")
2541 (description "QtColorWidgets provides a Qt color dialog that is more
2542 user-friendly than the default @code{QColorDialog} and several other
2543 color-related widgets.")
2544 ;; Includes a license exception for combining with GPL2 code.
2545 (license license:lgpl3+))))
2547 (define-public python-shiboken-2
2549 (name "python-shiboken-2")
2553 (uri (string-append "https://download.qt.io/official_releases"
2554 "/QtForPython/pyside2/PySide2-" version
2555 "-src/pyside-setup-everywhere-src-"
2559 "1n45l6xxyxs6cfp2l4rp8qs1c2fyfwyrdxa4qcpwfsqsi51rydsk"))))
2560 (build-system cmake-build-system)
2562 `(("clang-toolchain" ,clang-toolchain-6)
2563 ("libxml2" ,libxml2)
2564 ("libxslt" ,libxslt)
2565 ("python-wrapper" ,python-wrapper)
2567 ("qtxmlpatterns" ,qtxmlpatterns)))
2570 ;; FIXME: Building tests fails
2571 #:configure-flags '("-DBUILD_TESTS=off")
2573 (modify-phases %standard-phases
2574 (add-after 'unpack 'use-shiboken-dir-only
2575 (lambda _ (chdir "sources/shiboken2") #t))
2576 (add-before 'configure 'make-files-writable-and-update-timestamps
2578 ;; The build scripts need to modify some files in
2579 ;; the read-only source directory, and also attempts
2580 ;; to create Zip files which fails because the Zip
2581 ;; format does not support timestamps before 1980.
2582 (let ((circa-1980 (* 10 366 24 60 60)))
2583 (for-each (lambda (file)
2584 (make-file-writable file)
2585 (utime file circa-1980 circa-1980))
2588 (add-before 'configure 'set-build-env
2589 (lambda* (#:key inputs #:allow-other-keys)
2590 (let ((llvm (assoc-ref inputs "clang-toolchain")))
2591 (setenv "CLANG_INSTALL_DIR" llvm)
2593 (home-page "https://wiki.qt.io/Qt_for_Python")
2595 "Shiboken generates bindings for C++ libraries using CPython source code")
2597 "Shiboken generates bindings for C++ libraries using CPython source code")
2600 ;; The main code is GPL3 or LGPL3.
2601 ;; Examples are BSD-3.
2606 (define-public python-pyside-2
2608 (name "python-pyside-2")
2609 (version (package-version python-shiboken-2))
2610 (source (package-source python-shiboken-2))
2611 (build-system cmake-build-system)
2613 `(("libxml2" ,libxml2)
2614 ("libxslt" ,libxslt)
2615 ("clang-toolchain" ,clang-toolchain-6)
2617 ("qtdatavis3d" ,qtdatavis3d)
2618 ("qtlocation" ,qtlocation)
2619 ("qtmultimedia" ,qtmultimedia)
2620 ("qtquickcontrols" ,qtquickcontrols)
2621 ("qtscript" ,qtscript)
2622 ("qtscxml" ,qtscxml)
2623 ("qtsensors" ,qtsensors)
2624 ("qtspeech" ,qtspeech)
2626 ("qtwebchannel" ,qtwebchannel)
2627 ("qtwebsockets" ,qtwebsockets)
2628 ("qtx11extras" ,qtx11extras)
2629 ("qtxmlpatterns" ,qtxmlpatterns)))
2631 `(("cmake" ,cmake-minimal)
2632 ("python-shiboken-2" ,python-shiboken-2)
2633 ("python" ,python-wrapper)
2634 ("qttools" ,qttools)
2638 ;; FIXME: Building tests fail.
2640 (list "-DBUILD_TESTS=FALSE"
2641 (string-append "-DPYTHON_EXECUTABLE="
2642 (assoc-ref %build-inputs "python")
2645 (modify-phases %standard-phases
2646 (add-after 'unpack 'go-to-source-dir
2647 (lambda _ (chdir "sources/pyside2") #t))
2648 (add-before 'configure 'set-clang-dir
2649 (lambda* (#:key inputs #:allow-other-keys)
2650 (let ((clang (assoc-ref inputs "clang-toolchain")))
2651 (setenv "CLANG_INSTALL_DIR" clang)
2653 (home-page "https://wiki.qt.io/Qt_for_Python")
2655 "The Qt for Python product enables the use of Qt5 APIs in Python applications")
2657 "The Qt for Python product enables the use of Qt5 APIs in Python
2658 applications. It lets Python developers utilize the full potential of Qt,
2659 using the PySide2 module. The PySide2 module provides access to the
2660 individual Qt modules such as QtCore, QtGui,and so on. Qt for Python also
2661 comes with the Shiboken2 CPython binding code generator, which can be used to
2662 generate Python bindings for your C or C++ code.")
2666 ;; this file may be used under the terms of the GNU General
2667 ;; Public License version 2.0 or (at your option) the GNU
2668 ;; General Public license version 3 or any later version
2669 ;; approved by the KDE Free Qt Foundation.
2670 ;; Thus, it is currently v2 or v3, but no "+".
2674 (define-public python-pyside-2-tools
2676 (name "python-pyside-2-tools")
2677 (version (package-version python-shiboken-2))
2678 (source (package-source python-shiboken-2))
2679 (build-system cmake-build-system)
2681 `(("python-pyside-2" ,python-pyside-2)
2682 ("python-shiboken-2" ,python-shiboken-2)
2683 ("qtbase" ,qtbase)))
2685 `(("python" ,python-wrapper)))
2689 (list "-DBUILD_TESTS=off"
2690 (string-append "-DPYTHON_EXECUTABLE="
2691 (assoc-ref %build-inputs "python")
2693 #:phases (modify-phases %standard-phases
2694 (add-after 'unpack 'go-to-source-dir
2695 (lambda _ (chdir "sources/pyside2-tools") #t)))))
2696 (home-page "https://wiki.qt.io/Qt_for_Python")
2698 "Contains command line tools for PySide2")
2700 "Contains lupdate, rcc and uic tools for PySide2")
2701 (license license:gpl2)))
2703 (define-public libqglviewer
2705 (name "libqglviewer")
2710 (string-append "http://libqglviewer.com/src/libQGLViewer-"
2714 "023w7da1fyn2z69nbkp2rndiv886zahmc5cmira79zswxjfpklp2"))))
2715 (build-system gnu-build-system)
2717 '(#:tests? #f ; no check target
2719 (list (string-append "PREFIX="
2720 (assoc-ref %outputs "out")))
2722 (modify-phases %standard-phases
2724 (lambda* (#:key make-flags #:allow-other-keys)
2725 (apply invoke (cons "qmake" make-flags)))))))
2727 `(("qtbase" ,qtbase)
2728 ("qttools" ,qttools)))
2731 (home-page "http://libqglviewer.com")
2732 (synopsis "Qt-based C++ library for the creation of OpenGL 3D viewers")
2734 "@code{libQGLViewer} is a C++ library based on Qt that eases the creation
2735 of OpenGL 3D viewers.
2737 It provides some of the typical 3D viewer functionalities, such as the
2738 possibility to move the camera using the mouse, which lacks in most of the
2739 other APIs. Other features include mouse manipulated frames, interpolated
2740 keyFrames, object selection, stereo display, screenshot saving and much more.
2741 It can be used by OpenGL beginners as well as to create complex applications,
2742 being fully customizable and easy to extend.")
2743 ;; According to LICENSE, either version 2 or version 3 of the GNU GPL may
2745 (license (list license:gpl2 license:gpl3))))