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 ng0 <ng0@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>
19 ;;; This file is part of GNU Guix.
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34 (define-module (gnu packages qt)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (guix packages)
37 #:use-module (guix download)
38 #:use-module (guix git-download)
39 #:use-module (guix build-system cmake)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system trivial)
42 #:use-module (guix build-system python)
43 #:use-module (guix packages)
44 #:use-module (guix deprecation)
45 #:use-module (guix utils)
46 #:use-module (gnu packages)
47 #:use-module (gnu packages base)
48 #:use-module (gnu packages bison)
49 #:use-module (gnu packages cmake)
50 #:use-module (gnu packages compression)
51 #:use-module (gnu packages cups)
52 #:use-module (gnu packages curl)
53 #:use-module (gnu packages databases)
54 #:use-module (gnu packages documentation)
55 #:use-module (gnu packages fontutils)
56 #:use-module (gnu packages flex)
57 #:use-module (gnu packages freedesktop)
58 #:use-module (gnu packages gcc)
59 #:use-module (gnu packages ghostscript)
60 #:use-module (gnu packages gl)
61 #:use-module (gnu packages glib)
62 #:use-module (gnu packages gnupg)
63 #:use-module (gnu packages gperf)
64 #:use-module (gnu packages gstreamer)
65 #:use-module (gnu packages gtk)
66 #:use-module (gnu packages icu4c)
67 #:use-module (gnu packages image)
68 #:use-module (gnu packages libevent)
69 #:use-module (gnu packages linux)
70 #:use-module (gnu packages llvm)
71 #:use-module (gnu packages maths)
72 #:use-module (gnu packages ninja)
73 #:use-module (gnu packages nss)
74 #:use-module (gnu packages pciutils)
75 #:use-module (gnu packages pcre)
76 #:use-module (gnu packages perl)
77 #:use-module (gnu packages pkg-config)
78 #:use-module (gnu packages pulseaudio)
79 #:use-module (gnu packages protobuf)
80 #:use-module (gnu packages python)
81 #:use-module (gnu packages python-xyz)
82 #:use-module (gnu packages regex)
83 #:use-module (gnu packages ruby)
84 #:use-module (gnu packages sdl)
85 #:use-module (gnu packages serialization)
86 #:use-module (gnu packages sqlite)
87 #:use-module (gnu packages telephony)
88 #:use-module (gnu packages tls)
89 #:use-module (gnu packages valgrind)
90 #:use-module (gnu packages video)
91 #:use-module (gnu packages vulkan)
92 #:use-module (gnu packages xdisorg)
93 #:use-module (gnu packages xiph)
94 #:use-module (gnu packages xorg)
95 #:use-module (gnu packages xml)
96 #:use-module (srfi srfi-1))
98 (define-public grantlee
106 (url "https://github.com/steveire/grantlee.git")
107 (commit (string-append "v" version))))
108 (file-name (git-file-name name version))
110 (base32 "1dmah2gd6zd4fgz2f4ir11dazqg067hjz8xshhywhfsmavchi626"))))
112 ;; Optional: lcov and cccc, both are for code coverage
113 `(("doxygen" ,doxygen)))
116 ("qtscript" ,qtscript)))
117 (build-system cmake-build-system)
119 `(#:configure-flags '("-DCMAKE_CXX_STANDARD=11")
121 (modify-phases %standard-phases
122 (add-after 'unpack 'delete-broken-tests
124 ;; TODO: Two date tests (for date01 and date02) fail for unknown
126 ;; Actual (result): ""
127 ;; Expected (output): "01"
128 ;; Actual (result): ""
129 ;; Expected (output): "Jan. 1, 2008"
130 (delete-file "templates/tests/testfilters.cpp")
131 (substitute* "templates/tests/CMakeLists.txt"
132 (("testfilters") ""))
134 (add-before 'check 'check-setup
136 ;; make Qt render "offscreen", required for tests
137 (setenv "QT_QPA_PLATFORM" "offscreen")
139 (home-page "https://github.com/steveire/grantlee")
140 (synopsis "Libraries for text templating with Qt")
141 (description "Grantlee Templates can be used for theming and generation of
142 other text such as code. The syntax uses the syntax of the Django template
143 system, and the core design of Django is reused in Grantlee.")
144 (license license:lgpl2.0+)))
152 (uri (string-append "http://download.qt-project.org/archive/qt/"
153 (string-copy version 0 (string-rindex version #\.))
155 "/qt-everywhere-opensource-src-"
159 "183fca7n7439nlhxyg1z7aky0izgbyll3iwakw4gwivy16aj5272"))
160 (patches (search-patches "qt4-ldflags.patch"))
161 (modules '((guix build utils)))
163 ;; Remove webkit module, which is not built.
164 '(begin (delete-file-recursively "src/3rdparty/webkit")
166 (build-system gnu-build-system)
170 `(("alsa-lib" ,alsa-lib)
174 ("double-conversion" ,double-conversion)
176 ("fontconfig" ,fontconfig)
177 ("freetype" ,freetype)
179 ("gstreamer" ,gstreamer)
180 ("gst-plugins-base" ,gst-plugins-base)
183 ("libinput" ,libinput-minimal)
190 ("libxcomposite" ,libxcomposite)
191 ("libxcursor" ,libxcursor)
193 ("libxfixes" ,libxfixes)
195 ("libxinerama" ,libxinerama)
196 ("libxkbcommon" ,libxkbcommon)
198 ("libxrandr" ,libxrandr)
199 ("libxrender" ,libxrender)
203 ("mariadb" ,mariadb "lib")
204 ("mariadb-dev" ,mariadb "dev")
206 ("postgresql" ,postgresql)
207 ("pulseaudio" ,pulseaudio)
211 ("unixodbc" ,unixodbc)
213 ("xcb-util" ,xcb-util)
214 ("xcb-util-image" ,xcb-util-image)
215 ("xcb-util-keysyms" ,xcb-util-keysyms)
216 ("xcb-util-renderutil" ,xcb-util-renderutil)
217 ("xcb-util-wm" ,xcb-util-wm)
219 ("libjpeg" ,libjpeg-turbo)
221 ("openssl" ,openssl-1.0)))
223 `(;; XXX: The JavaScriptCore engine does not build with the C++11 standard.
224 ;; We could build it with -std=gnu++98, but then we'll get in trouble with
225 ;; ICU later. Just keep using GCC 5 for now.
231 ("pkg-config" ,pkg-config)
234 ("which" ,(@ (gnu packages base) which))))
235 ;; Note: there are 37 MiB of examples and a '-exampledir' configure flags,
236 ;; but we can't make them a separate output because "out" and "examples"
237 ;; would refer to each other.
238 (outputs '("out" ;112MiB core + 37MiB examples
239 "doc")) ;280MiB of HTML + code
242 (modify-phases %standard-phases
243 (add-after 'set-paths 'hide-default-gcc
244 (lambda* (#:key inputs #:allow-other-keys)
245 (let ((gcc (assoc-ref inputs "gcc")))
246 ;; Remove the default GCC from CPLUS_INCLUDE_PATH to prevent
247 ;; conflicts with the GCC 5 input.
248 (setenv "CPLUS_INCLUDE_PATH"
250 (delete (string-append gcc "/include/c++")
251 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
256 (lambda* (#:key outputs #:allow-other-keys)
257 (let ((out (assoc-ref outputs "out"))
258 (doc (assoc-ref outputs "doc")))
259 (substitute* '("configure")
260 (("/bin/pwd") (which "pwd")))
261 (substitute* "src/corelib/global/global.pri"
262 (("/bin/ls") (which "ls")))
268 "-nomake" "examples demos"
269 ;; Note: Don't pass '-docdir' since 'qmake' and
270 ;; libQtCore would record its value, thereby defeating
271 ;; the whole point of having a separate output.
272 "-datadir" (string-append out "/share/qt-" ,version
274 "-importdir" (string-append out "/lib/qt-4"
276 "-plugindir" (string-append out "/lib/qt-4"
278 "-translationdir" (string-append out "/share/qt-" ,version
280 "-demosdir" (string-append out "/share/qt-" ,version
282 "-examplesdir" (string-append out "/share/qt-" ,version
286 ;; explicitly link with dbus instead of dlopening it
288 ;; Skip the webkit module; it fails to build on armhf
289 ;; and, apart from that, may pose security risks.
291 ;; don't use the precompiled headers
293 ;; drop special machine instructions not supported
294 ;; on all instances of the target
295 ,@(if (string-prefix? "x86_64"
296 (or (%current-target-system)
310 (lambda* (#:key outputs #:allow-other-keys)
311 ;; Because of qt4-documentation-path.patch, documentation ends up
312 ;; being installed in OUT. Move it to the right place.
313 (let* ((out (assoc-ref outputs "out"))
314 (doc (assoc-ref outputs "doc"))
315 (olddoc (string-append out "/doc"))
316 (docdir (string-append doc "/share/doc/qt-" ,version)))
317 (mkdir-p (dirname docdir))
319 ;; Note: We can't use 'rename-file' here because OUT and DOC are
320 ;; different "devices" due to bind-mounts.
321 (copy-recursively olddoc docdir)
322 (delete-file-recursively olddoc)
325 (list (search-path-specification
326 (variable "QMAKEPATH")
327 (files '("lib/qt5")))
328 (search-path-specification
329 (variable "QML2_IMPORT_PATH")
330 (files '("lib/qt5/qml")))
331 (search-path-specification
332 (variable "QT_PLUGIN_PATH")
333 (files '("lib/qt5/plugins")))
334 (search-path-specification
335 (variable "XDG_DATA_DIRS")
337 (search-path-specification
338 (variable "XDG_CONFIG_DIRS")
339 (files '("etc/xdg")))))
340 (home-page "https://www.qt.io/")
341 (synopsis "Cross-platform GUI library")
342 (description "Qt is a cross-platform application and UI framework for
343 developers using C++ or QML, a CSS & JavaScript like language.")
344 (license (list license:lgpl2.1 license:lgpl3))
346 ;; Qt 4: 'QBasicAtomicPointer' leads to build failures on MIPS;
347 ;; see <http://hydra.gnu.org/build/112828>.
348 ;; Qt 5: assembler error; see <http://hydra.gnu.org/build/112526>.
349 (supported-systems (delete "mips64el-linux" %supported-systems))))
351 (define-public qtbase
357 (uri (string-append "https://download.qt.io/official_releases/qt/"
358 (version-major+minor version) "/" version
359 "/submodules/" name "-everywhere-src-"
363 "0pb68d30clksdhgy8n6rrs838bb3qcsfq4pv463yy2nr4p5kk2di"))
364 ;; Use TZDIR to avoid depending on package "tzdata".
365 (patches (search-patches "qtbase-use-TZDIR.patch"
366 "qtbase-moc-ignore-gcc-macro.patch"
367 "qtbase-QTBUG-81715.patch"))
368 (modules '((guix build utils)))
370 ;; corelib uses bundled harfbuzz, md4, md5, sha3
372 (with-directory-excursion "src/3rdparty"
373 (for-each delete-file-recursively
374 (list "double-conversion" "freetype" "harfbuzz-ng"
375 "libpng" "libjpeg" "pcre2" "sqlite" "xcb"
378 (build-system gnu-build-system)
381 ;; Use which the package, not the function
382 ("which" ,(@ (gnu packages base) which))))
384 `(("alsa-lib" ,alsa-lib)
387 ("double-conversion" ,double-conversion)
390 ("fontconfig" ,fontconfig)
391 ("freetype" ,freetype)
393 ("harfbuzz" ,harfbuzz)
395 ("libinput" ,libinput-minimal)
396 ("libjpeg" ,libjpeg-turbo)
400 ("libxcomposite" ,libxcomposite)
401 ("libxcursor" ,libxcursor)
402 ("libxfixes" ,libxfixes)
404 ("libxinerama" ,libxinerama)
405 ("libxkbcommon" ,libxkbcommon)
407 ("libxrandr" ,libxrandr)
408 ("libxrender" ,libxrender)
412 ("mariadb" ,mariadb "lib")
413 ("mariadb-dev" ,mariadb "dev")
417 ("postgresql" ,postgresql)
418 ("pulseaudio" ,pulseaudio)
420 ("unixodbc" ,unixodbc)
421 ("xcb-util" ,xcb-util)
422 ("xcb-util-image" ,xcb-util-image)
423 ("xcb-util-keysyms" ,xcb-util-keysyms)
424 ("xcb-util-renderutil" ,xcb-util-renderutil)
425 ("xcb-util-wm" ,xcb-util-wm)
426 ("xdg-utils" ,xdg-utils)
433 ("pkg-config" ,pkg-config)
435 ("vulkan-headers" ,vulkan-headers)
439 (modify-phases %standard-phases
440 (add-after 'configure 'patch-bin-sh
442 (substitute* '("config.status"
444 "mkspecs/features/qt_functions.prf"
445 "qmake/library/qmakebuiltins.cpp")
446 (("/bin/sh") (which "sh")))
448 (add-after 'configure 'patch-xdg-open
450 (substitute* '("src/platformsupport/services/genericunix/qgenericunixservices.cpp")
451 (("^.*const char \\*browsers.*$" all)
452 (string-append "*browser = QStringLiteral(\""
454 "\"); return true; \n" all)))
457 (lambda* (#:key outputs #:allow-other-keys)
458 (let ((out (assoc-ref outputs "out")))
459 (substitute* "configure"
460 (("/bin/pwd") (which "pwd")))
461 (substitute* "src/corelib/global/global.pri"
462 (("/bin/ls") (which "ls")))
463 ;; The configuration files for other Qt5 packages are searched
464 ;; through a call to "find_package" in Qt5Config.cmake, which
465 ;; disables the use of CMAKE_PREFIX_PATH via the parameter
466 ;; "NO_DEFAULT_PATH". Re-enable it so that the different
467 ;; components can be installed in different places.
468 (substitute* (find-files "." ".*\\.cmake")
469 (("NO_DEFAULT_PATH") ""))
470 ;; do not pass "--enable-fast-install", which makes the
471 ;; configure process fail
476 "-docdir" (string-append out "/share/doc/qt5")
477 "-headerdir" (string-append out "/include/qt5")
478 "-archdatadir" (string-append out "/lib/qt5")
479 "-datadir" (string-append out "/share/qt5")
480 "-examplesdir" (string-append
481 out "/share/doc/qt5/examples")
485 ;; These features require higher versions of Linux than the
486 ;; minimum version of the glibc. See
487 ;; src/corelib/global/minimum-linux_p.h. By disabling these
488 ;; features Qt5 applications can be used on the oldest
489 ;; kernels that the glibc supports, including the RHEL6
490 ;; (2.6.32) and RHEL7 (3.10) kernels.
491 "-no-feature-getentropy" ; requires Linux 3.17
492 "-no-feature-renameat2" ; requires Linux 3.16
494 ;; Do not build examples; if desired, these could go
495 ;; into a separate output, but for the time being, we
496 ;; prefer to save the space and build time.
497 "-no-compile-examples"
498 ;; Most "-system-..." are automatic, but some use
499 ;; the bundled copy by default.
503 ;; explicitly link with openssl instead of dlopening it
505 ;; explicitly link with dbus instead of dlopening it
507 ;; don't use the precompiled headers
509 ;; drop special machine instructions that do not have
511 ,@(if (string-prefix? "x86_64"
512 (or (%current-target-system)
518 (add-after 'install 'patch-mkspecs
519 (lambda* (#:key outputs #:allow-other-keys)
520 (let* ((out (assoc-ref outputs "out"))
521 (archdata (string-append out "/lib/qt5"))
522 (mkspecs (string-append archdata "/mkspecs"))
523 (qt_config.prf (string-append
524 mkspecs "/features/qt_config.prf")))
525 ;; For each Qt module, let `qmake' uses search paths in the
526 ;; module directory instead of all in QT_INSTALL_PREFIX.
527 (substitute* qt_config.prf
528 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
529 "$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt5))")
530 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
531 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
532 (("\\$\\$\\[QT_HOST_LIBS\\]")
533 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
534 (("\\$\\$\\[QT_INSTALL_BINS\\]")
535 "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))"))
537 ;; Searches Qt tools in the current PATH instead of QT_HOST_BINS.
538 (substitute* (string-append mkspecs "/features/qt_functions.prf")
539 (("cmd = \\$\\$\\[QT_HOST_BINS\\]/\\$\\$2")
540 "cmd = $$system(which $${2}.pl 2>/dev/null || which $${2})"))
542 ;; Resolve qmake spec files within qtbase by absolute paths.
545 (string-append mkspecs "/features/" file))
546 '("device_config.prf" "moc.prf" "qt_build_config.prf"
547 "qt_config.prf" "winrt/package_manifest.prf"))
548 (("\\$\\$\\[QT_HOST_DATA/get\\]") archdata)
549 (("\\$\\$\\[QT_HOST_DATA/src\\]") archdata))
551 (add-after 'patch-mkspecs 'patch-prl-files
552 (lambda* (#:key outputs #:allow-other-keys)
553 (let ((out (assoc-ref outputs "out")))
554 ;; Insert absolute references to the qtbase libraries because
555 ;; QT_INSTALL_LIBS does not always resolve correctly, depending
556 ;; on context. See <https://bugs.gnu.org/38405>
557 (substitute* (find-files (string-append out "/lib") "\\.prl$")
558 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
559 (string-append out "/lib")))
561 (add-after 'unpack 'patch-paths
562 ;; Use the absolute paths for dynamically loaded libs, otherwise
563 ;; the lib will be searched in LD_LIBRARY_PATH which typically is
565 (lambda* (#:key inputs #:allow-other-keys)
567 (let ((glibc (assoc-ref inputs ,(if (%current-target-system)
568 "cross-libc" "libc"))))
569 (substitute* '("src/network/kernel/qdnslookup_unix.cpp"
570 "src/network/kernel/qhostinfo_unix.cpp")
571 (("^\\s*(lib.setFileName\\(QLatin1String\\(\")(resolv\"\\)\\);)" _ a b)
572 (string-append a glibc "/lib/lib" b))))
573 ;; X11/locale (compose path)
574 (substitute* "src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp"
575 ;; Don't search in /usr/…/X11/locale, …
576 (("^\\s*m_possibleLocations.append\\(QStringLiteral\\(\"/usr/.*/X11/locale\"\\)\\);" line)
577 (string-append "// " line))
578 ;; … but use libx11's path
579 (("^\\s*(m_possibleLocations.append\\(QStringLiteral\\()X11_PREFIX \"(/.*/X11/locale\"\\)\\);)" _ a b)
580 (string-append a "\"" (assoc-ref inputs "libx11") b)))
582 (substitute* "src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp"
583 (("^\\s*(QLibrary lib\\(QLatin1String\\(\")(GL\"\\)\\);)" _ a b)
584 (string-append a (assoc-ref inputs "mesa") "/lib/lib" b)))
586 (substitute* "src/plugins/platforms/xcb/qxcbcursor.cpp"
587 (("^\\s*(QLibrary xcursorLib\\(QLatin1String\\(\")(Xcursor\"\\), 1\\);)" _ a b)
588 (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))
589 (("^\\s*(xcursorLib.setFileName\\(QLatin1String\\(\")(Xcursor\"\\)\\);)" _ a b)
590 (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b)))
593 (list (search-path-specification
594 (variable "QMAKEPATH")
595 (files '("lib/qt5")))
596 (search-path-specification
597 (variable "QML2_IMPORT_PATH")
598 (files '("lib/qt5/qml")))
599 (search-path-specification
600 (variable "QT_PLUGIN_PATH")
601 (files '("lib/qt5/plugins")))
602 (search-path-specification
603 (variable "XDG_DATA_DIRS")
605 (search-path-specification
606 (variable "XDG_CONFIG_DIRS")
607 (files '("etc/xdg")))))
608 (home-page "https://www.qt.io/")
609 (synopsis "Cross-platform GUI library")
610 (description "Qt is a cross-platform application and UI framework for
611 developers using C++ or QML, a CSS & JavaScript like language.")
612 (license (list license:lgpl2.1 license:lgpl3))))
614 ;; qt used to refer to the monolithic Qt 5.x package
615 (define-deprecated qt qtbase)
618 (package (inherit qtbase)
623 (uri (string-append "https://download.qt.io/official_releases/qt/"
624 (version-major+minor version) "/" version
625 "/submodules/" name "-everywhere-src-"
629 "1f3vqv3s83gjillhgi0wghyf3825fgy1ffhvkxhdk673shb0kxjb"))))
630 (propagated-inputs `())
631 (native-inputs `(("perl" ,perl)))
638 (modify-phases %standard-phases
639 (add-before 'configure 'configure-qmake
640 (lambda* (#:key inputs outputs #:allow-other-keys)
641 (let* ((out (assoc-ref outputs "out"))
642 (qtbase (assoc-ref inputs "qtbase"))
643 (tmpdir (string-append (getenv "TMPDIR")))
644 (qmake (string-append tmpdir "/qmake"))
645 (qt.conf (string-append tmpdir "/qt.conf")))
646 ;; Use qmake with a customized qt.conf to override install
648 (symlink (which "qmake") qmake)
649 (setenv "PATH" (string-append tmpdir ":" (getenv "PATH")))
650 (with-output-to-file qt.conf
656 Documentation=share/doc/qt5
659 LibraryExecutables=lib/qt5/libexec
662 Plugins=lib/qt5/plugins
663 Imports=lib/qt5/imports
664 Qml2Imports=lib/qt5/qml
665 Translations=share/qt5/translations
667 Examples=share/doc/qt5/examples
673 [EffectiveSourcePaths]
679 (lambda* (#:key inputs outputs #:allow-other-keys)
680 ;; Valid QT_BUILD_PARTS variables are:
681 ;; libs tools tests examples demos docs translations
682 (invoke "qmake" "QT_BUILD_PARTS = libs tools tests")))
683 (add-before 'check 'set-display
685 ;; make Qt render "offscreen", required for tests
686 (setenv "QT_QPA_PLATFORM" "offscreen")
688 (synopsis "Qt module for displaying SVGs")
689 (description "The QtSvg module provides classes for displaying the
690 contents of SVG files.")))
692 (define-public qtimageformats
693 (package (inherit qtsvg)
694 (name "qtimageformats")
698 (uri (string-append "https://download.qt.io/official_releases/qt/"
699 (version-major+minor version) "/" version
700 "/submodules/" name "-everywhere-src-"
704 "02zpcbx71dz6xvga07dnzqwdfz9pjmy673n706fj8pxq9zi9xlcv"))
705 (modules '((guix build utils)))
708 (delete-file-recursively "src/3rdparty")
719 (synopsis "Additional Image Format plugins for Qt")
720 (description "The QtImageFormats module contains plugins for adding
721 support for MNG, TGA, TIFF and WBMP image formats.")))
723 (define-public qtx11extras
724 (package (inherit qtsvg)
729 (uri (string-append "https://download.qt.io/official_releases/qt/"
730 (version-major+minor version) "/" version
731 "/submodules/" name "-everywhere-src-"
735 "15hb90n47khsp3qnzyjd3mh8gi9qvy07dqdr4qspiww43r5mz293"))))
737 (substitute-keyword-arguments (package-arguments qtsvg)
738 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
739 (native-inputs `(("perl" ,perl)))
743 (synopsis "Qt Extras for X11")
744 (description "The QtX11Extras module includes the library to access X11
745 from within Qt 5.")))
747 (define-public qtxmlpatterns
748 (package (inherit qtsvg)
749 (name "qtxmlpatterns")
753 (uri (string-append "https://download.qt.io/official_releases/qt/"
754 (version-major+minor version) "/" version
755 "/submodules/" name "-everywhere-src-"
759 "0ys1kf0zdn8gak1ik9p7i7bdyfz2frvklcyz013s9wm1550h20lh"))))
761 (substitute-keyword-arguments (package-arguments qtsvg)
762 ((#:tests? _ #f) #f) ; TODO: Enable the tests
764 `(modify-phases ,phases
765 (add-after 'unpack 'disable-network-tests
766 (lambda _ (substitute* "tests/auto/auto.pro"
767 (("qxmlquery") "# qxmlquery")
768 (("xmlpatterns ") "# xmlpatterns"))
770 (native-inputs `(("perl" ,perl)
771 ("qtdeclarative" ,qtdeclarative)))
772 (inputs `(("qtbase" ,qtbase)))
773 (synopsis "Qt XML patterns module")
774 (description "The QtXmlPatterns module is a XQuery and XPath engine for
775 XML and custom data models. It contains programs such as xmlpatterns and
776 xmlpatternsvalidator.")))
778 (define-public qtdeclarative
779 (package (inherit qtsvg)
780 (name "qtdeclarative")
784 (uri (string-append "https://download.qt.io/official_releases/qt/"
785 (version-major+minor version) "/" version
786 "/submodules/" name "-everywhere-src-"
790 "1gg9xbv8ah4p55ws97brwn0csl0k3j1x6zdknrrsnh7j6nh0bp2w"))))
792 (substitute-keyword-arguments (package-arguments qtsvg)
793 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
796 ("pkg-config" ,pkg-config)
798 ("python-wrapper" ,python-wrapper)
803 (synopsis "Qt QML module (Quick 2)")
804 (description "The Qt QML module provides a framework for developing
805 applications and libraries with the QML language. It defines and implements the
806 language and engine infrastructure, and provides an API to enable application
807 developers to extend the QML language with custom types and integrate QML code
808 with JavaScript and C++.")))
810 (define-public qtconnectivity
811 (package (inherit qtsvg)
812 (name "qtconnectivity")
816 (uri (string-append "https://download.qt.io/official_releases/qt/"
817 (version-major+minor version) "/" version
818 "/submodules/" name "-everywhere-src-"
822 "06h71pd5w5prh722mcbgmx7l71xvh5xpjrlbg17yblx0n6wlhwb4"))))
825 ("pkg-config" ,pkg-config)
826 ("qtdeclarative" ,qtdeclarative)))
830 (synopsis "Qt Connectivity module")
831 (description "The Qt Connectivity modules provides modules for interacting
832 with Bluetooth and NFC.")))
834 (define-public qtwebsockets
835 (package (inherit qtsvg)
836 (name "qtwebsockets")
840 (uri (string-append "https://download.qt.io/official_releases/qt/"
841 (version-major+minor version) "/" version
842 "/submodules/" name "-everywhere-src-"
846 "05rv52pp5zg4g14zh7c6jc77l426056b8xyr40ps6cpmb0jkrlbg"))))
848 (substitute-keyword-arguments (package-arguments qtsvg)
849 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
852 ("qtdeclarative" ,qtdeclarative)))
853 (inputs `(("qtbase" ,qtbase)))
854 (synopsis "Qt Web Sockets module")
855 (description "WebSocket is a web-based protocol designed to enable two-way
856 communication between a client application and a remote host. The Qt
857 WebSockets module provides C++ and QML interfaces that enable Qt applications
858 to act as a server that can process WebSocket requests, or a client that can
859 consume data received from the server, or both.")))
861 (define-public qtsensors
862 (package (inherit qtsvg)
867 (uri (string-append "https://download.qt.io/official_releases/qt/"
868 (version-major+minor version) "/" version
869 "/submodules/" name "-everywhere-src-"
873 "0h77h34rn6cgy5qiqq163pj3bhbka1ydkfgjcx01ns1g9sgym6ib"))))
875 (substitute-keyword-arguments (package-arguments qtsvg)
876 ((#:parallel-tests? _ #f) #f) ; can lead to race condition
878 `(modify-phases ,phases
879 (add-after 'unpack 'fix-tests
881 (substitute* "tests/auto/qsensorgestures_gestures/tst_sensorgestures_gestures.cpp"
882 (("2000") "5000") ;lengthen test timeout
883 (("QTest::newRow(\"twist\") << \"twist\"") "")) ;failing test
887 ("qtdeclarative" ,qtdeclarative)))
888 (inputs `(("qtbase" ,qtbase)))
889 (synopsis "Qt Sensors module")
890 (description "The Qt Sensors API provides access to sensor hardware via QML
891 and C++ interfaces. The Qt Sensors API also provides a motion gesture
892 recognition API for devices.")))
894 (define-public qtmultimedia
895 (package (inherit qtsvg)
896 (name "qtmultimedia")
900 (uri (string-append "https://download.qt.io/official_releases/qt/"
901 (version-major+minor version) "/" version
902 "/submodules/" name "-everywhere-src-"
906 "07fvnjywn3hkrxfbxasmy83jr6jq9lf1grasfwij54hz6y0smg98"))
907 (modules '((guix build utils)))
910 (delete-file-recursively
911 "examples/multimedia/spectrum/3rdparty")
912 ;; We also prevent the spectrum example from being built.
913 (substitute* "examples/multimedia/multimedia.pro"
917 (substitute-keyword-arguments (package-arguments qtsvg)
919 `(modify-phases ,phases
921 (lambda* (#:key outputs #:allow-other-keys)
922 (let ((out (assoc-ref outputs "out")))
923 (invoke "qmake" "QT_BUILD_PARTS = libs tools tests"
924 (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out "/lib -Wl,-rpath,")
925 (string-append "PREFIX=" out)))))))
926 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
929 ("pkg-config" ,pkg-config)
931 ("qtdeclarative" ,qtdeclarative)))
933 `(("alsa-lib" ,alsa-lib)
935 ("pulseaudio" ,pulseaudio)
937 ;; Gstreamer is needed for the mediaplayer plugin
938 ("gstreamer" ,gstreamer)
939 ("gst-plugins-base" ,gst-plugins-base)))
940 (synopsis "Qt Multimedia module")
941 (description "The Qt Multimedia module provides set of APIs to play and
942 record media, and manage a collection of media content. It also contains a
943 set of plugins for interacting with pulseaudio and GStreamer.")))
945 (define-public qtwayland
946 (package (inherit qtsvg)
951 (uri (string-append "https://download.qt.io/official_releases/qt/"
952 (version-major+minor version) "/" version
953 "/submodules/" name "-everywhere-src-"
957 "1ib61zh6jrab3yz592p47ldfgphi4i184kqf14vhwn31akibh6pw"))
958 (modules '((guix build utils)))
960 ;; The examples try to build and cause the build to fail
962 (delete-file-recursively "examples")
965 (substitute-keyword-arguments (package-arguments qtsvg)
967 `(modify-phases ,phases
968 (add-before 'check 'set-ld-library-path
969 ;; <https://lists.gnu.org/archive/html/guix-devel/2017-09/msg00019.html>
971 ;; Make the uninstalled libQt5WaylandClient.so.5 available to the
972 ;; wayland platform plugin.
974 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/lib"))
979 ("pkg-config" ,pkg-config)
980 ("qtdeclarative" ,qtdeclarative)))
982 `(("fontconfig" ,fontconfig)
983 ("freetype" ,freetype)
985 ("libxcomposite" ,libxcomposite)
987 ("libxkbcommon" ,libxkbcommon)
988 ("libxrender" ,libxrender)
992 ("wayland" ,wayland)))
993 (synopsis "Qt Wayland module")
994 (description "The Qt Wayland module provides the QtWayland client and
995 compositor libraries.")))
997 (define-public qtserialport
998 (package (inherit qtsvg)
999 (name "qtserialport")
1003 (uri (string-append "https://download.qt.io/official_releases/qt/"
1004 (version-major+minor version) "/" version
1005 "/submodules/" name "-everywhere-src-"
1009 "07vjv3p7n7n5v15wdpi8x5sbnvyjqdh85qfzf9mz8l6ppqp2hk12"))))
1010 (native-inputs `(("perl" ,perl)))
1012 `(("qtbase" ,qtbase)
1015 (substitute-keyword-arguments (package-arguments qtsvg)
1017 `(modify-phases ,phases
1018 (add-after 'unpack 'patch-dlopen-paths
1019 (lambda* (#:key inputs #:allow-other-keys)
1020 (substitute* "src/serialport/qtudev_p.h"
1021 ;; Use the absolute paths for dynamically loaded libs,
1022 ;; otherwise the lib will be searched in LD_LIBRARY_PATH which
1023 ;; typically is not set in guix.
1024 (("^\\s*(udevLibrary->setFileNameAndVersion\\(QStringLiteral\\(\")(udev\"\\),\\s*[0-9]+\\);)" _ a b)
1025 (string-append a (assoc-ref inputs "eudev") "/lib/lib" b)))
1027 (synopsis "Qt Serial Port module")
1028 (description "The Qt Serial Port module provides the library for
1029 interacting with serial ports from within Qt.")))
1031 (define-public qtserialbus
1032 (package (inherit qtsvg)
1033 (name "qtserialbus")
1037 (uri (string-append "https://download.qt.io/official_releases/qt/"
1038 (version-major+minor version) "/" version
1039 "/submodules/" name "-everywhere-src-"
1043 "1bkyk1v7bcq657n88a6675lj55vl9y8v46h4kf27v58yjzgiw842"))))
1045 `(("qtbase" ,qtbase)
1046 ("qtserialport" ,qtserialport)))
1047 (synopsis "Qt Serial Bus module")
1048 (description "The Qt Serial Bus API provides classes and functions to
1049 access the various industrial serial buses and protocols, such as CAN, ModBus,
1052 (define-public qtwebchannel
1053 (package (inherit qtsvg)
1054 (name "qtwebchannel")
1058 (uri (string-append "https://download.qt.io/official_releases/qt/"
1059 (version-major+minor version) "/" version
1060 "/submodules/" name "-everywhere-src-"
1064 "0xff3fbbpcl0kkq0rg9npj127ycirygicbkxlf0v593sjpjp5bmh"))))
1067 ("qtdeclarative" ,qtdeclarative)
1068 ("qtwebsockets" ,qtwebsockets)))
1069 (inputs `(("qtbase" ,qtbase)))
1070 (synopsis "Web communication library for Qt")
1071 (description "The Qt WebChannel module enables peer-to-peer communication
1072 between the host (QML/C++ application) and the client (HTML/JavaScript
1073 application). The transport mechanism is supported out of the box by the two
1074 popular web engines, Qt WebKit 2 and Qt WebEngine.")))
1076 (define-public qtwebglplugin
1077 (package (inherit qtsvg)
1078 (name "qtwebglplugin")
1082 (uri (string-append "https://download.qt.io/official_releases/qt/"
1083 (version-major+minor version) "/" version
1084 "/submodules/" name "-everywhere-src-"
1088 "0fswnmhb8fm7wqgzv8cjy1j2sgb5mhx80jl411laawn7bf2ysjg0"))))
1090 (substitute-keyword-arguments (package-arguments qtsvg)
1092 `(modify-phases ,phases
1093 (add-after 'unpack 'disable-network-tests
1094 (lambda _ (substitute* "tests/plugins/platforms/platforms.pro"
1095 (("webgl") "# webgl"))
1101 ("qtdeclarative" ,qtdeclarative)
1102 ("qtwebsockets" ,qtwebsockets)))
1103 (synopsis "QPA plugin for running an application via a browser using
1104 streamed WebGL commands")
1105 (description "Qt back end that uses WebGL for rendering. It allows Qt
1106 applications (with some limitations) to run in a web browser that supports
1107 WebGL. WebGL is a JavaScript API for rendering 2D and 3D graphics within any
1108 compatible web browser without the use of plug-ins. The API is similar to
1109 OpenGL ES 2.0 and can be used in HTML5 canvas elements")))
1111 (define-public qtwebview
1112 (package (inherit qtsvg)
1117 (uri (string-append "https://download.qt.io/official_releases/qt/"
1118 (version-major+minor version) "/" version
1119 "/submodules/" name "-everywhere-src-"
1123 "1rvvkg6dl34hklllnlzlcffik746f15lzxdnwggc97dmx8n2vy6k"))))
1127 `(("qtbase" ,qtbase)
1128 ("qtdeclarative" ,qtdeclarative)))
1129 (synopsis "Display web content in a QML application")
1130 (description "Qt WebView provides a way to display web content in a QML
1131 application without necessarily including a full web browser stack by using
1132 native APIs where it makes sense.")))
1134 (define-public qtlocation
1135 (package (inherit qtsvg)
1140 (uri (string-append "https://download.qt.io/official_releases/qt/"
1141 (version-major+minor version) "/" version
1142 "/submodules/" name "-everywhere-src-"
1146 "07vq4aycayq2bg8yi4awidb25xyvws2ajbnrmad3rnpg1fw0bsfi"))))
1148 (substitute-keyword-arguments (package-arguments qtsvg)
1149 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1152 ("qtdeclarative" ,qtdeclarative)
1153 ("qtquickcontrols" ,qtquickcontrols)
1154 ("qtserialport" ,qtserialport)))
1157 ("openssl" ,openssl)
1160 (synopsis "Qt Location and Positioning modules")
1161 (description "The Qt Location module provides an interface for location,
1162 positioning and geolocation plugins.")))
1164 (define-public qttools
1165 (package (inherit qtsvg)
1170 (uri (string-append "https://download.qt.io/official_releases/qt/"
1171 (version-major+minor version) "/" version
1172 "/submodules/" name "-everywhere-src-"
1176 "0j1rl368sjknsmwp2f7bwqcb0sx13l3l4dxbm70873si9l8rf2l6"))))
1178 (substitute-keyword-arguments (package-arguments qtsvg)
1179 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1182 ("qtdeclarative" ,qtdeclarative)
1183 ("vulkan-headers" ,vulkan-headers)))
1186 ("qtbase" ,qtbase)))
1187 (synopsis "Qt Tools and Designer modules")
1188 (description "The Qt Tools module provides a set of applications to browse
1189 the documentation, translate applications, generate help files and other stuff
1190 that helps in Qt development.")))
1192 (define-public qtscript
1193 (package (inherit qtsvg)
1198 (uri (string-append "https://download.qt.io/official_releases/qt/"
1199 (version-major+minor version) "/" version
1200 "/submodules/" name "-everywhere-src-"
1204 "06a02230mj4bd8qvjaf2q97grzbj1c1rq36x7236fnhjsikbq7fa"))
1205 (patches (search-patches "qtscript-disable-tests.patch"))))
1208 ("qttools" ,qttools)))
1210 `(("qtbase" ,qtbase)))
1211 (synopsis "Qt Script module")
1212 (description "Qt provides support for application scripting with ECMAScript.
1213 The following guides and references cover aspects of programming with
1214 ECMAScript and Qt.")))
1216 (define-public qtquickcontrols
1217 (package (inherit qtsvg)
1218 (name "qtquickcontrols")
1222 (uri (string-append "https://download.qt.io/official_releases/qt/"
1223 (version-major+minor version) "/" version
1224 "/submodules/" name "-everywhere-src-"
1228 "1rar337vv0dx52r2gxwiwy1axn0fpy79rka09xizjlxsdg3vnf0h"))))
1230 (substitute-keyword-arguments (package-arguments qtsvg)
1231 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1233 `(("qtbase" ,qtbase)
1234 ("qtdeclarative" ,qtdeclarative)))
1235 (synopsis "Qt Quick Controls and other Quick modules")
1236 (description "The QtScript module provides classes for making Qt
1237 applications scriptable. This module provides a set of extra components that
1238 can be used to build complete interfaces in Qt Quick.")))
1240 (define-public qtquickcontrols2
1241 (package (inherit qtsvg)
1242 (name "qtquickcontrols2")
1246 (uri (string-append "https://download.qt.io/official_releases/qt/"
1247 (version-major+minor version) "/" version
1248 "/submodules/" name "-everywhere-src-"
1252 "0dx2jag6l5a80220fvmf49z1psliqf1ijqx6jsvvzv81mpjjd59s"))))
1254 (substitute-keyword-arguments (package-arguments qtsvg)
1255 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1257 `(("qtbase" ,qtbase)
1258 ("qtdeclarative" ,qtdeclarative)))
1259 (synopsis "Qt Quick Controls 2 and other Quick 2 modules")
1260 (description "The Qt Quick Controls 2 module contains the Qt Labs Platform
1261 module that provides platform integration: native dialogs, menus and menu bars,
1262 and tray icons. It falls back to Qt Widgets when a native implementation is
1265 (define-public qtgraphicaleffects
1266 (package (inherit qtsvg)
1267 (name "qtgraphicaleffects")
1271 (uri (string-append "https://download.qt.io/official_releases/qt/"
1272 (version-major+minor version) "/" version
1273 "/submodules/" name "-everywhere-src-"
1277 "1knapc14a80cn2f5bbfj7lhq9flr3v0gwjg9ka7xl8y642235w02"))))
1279 (substitute-keyword-arguments (package-arguments qtsvg)
1280 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1282 `(("qtbase" ,qtbase)
1283 ("qtdeclarative" ,qtdeclarative)))
1284 (synopsis "Qt Graphical Effects module")
1285 (description "The Qt Graphical Effects module provides a set of QML types
1286 for adding visually impressive and configurable effects to user interfaces.
1287 Effects are visual items that can be added to Qt Quick user interface as UI
1288 components. The API consists of over 20 effects provided as separate QML
1289 types. The effects cover functional areas such as blending, masking, blurring,
1290 coloring, and many more.")))
1292 (define-public qtgamepad
1293 (package (inherit qtsvg)
1298 (uri (string-append "https://download.qt.io/official_releases/qt/"
1299 (version-major+minor version) "/" version
1300 "/submodules/" name "-everywhere-src-"
1304 "150y7bc755l9y8w7nkg3gfw5n6rlj9hhq0ibc9g1xgllpr18qqq7"))))
1307 ("pkg-config" ,pkg-config)))
1309 `(("fontconfig" ,fontconfig)
1310 ("freetype" ,freetype)
1311 ("libxrender" ,libxrender)
1314 ("qtdeclarative" ,qtdeclarative)))
1315 (synopsis "Qt Gamepad module")
1316 (description "The Qt Gamepad module is an add-on library that enables Qt
1317 applications to support the use of gamepad hardware and in some cases remote
1318 control equipment. The module provides both QML and C++ interfaces. The
1319 primary target audience are embedded devices with fullscreen user interfaces,
1320 and mobile applications targeting TV-like form factors.")))
1322 (define-public qtscxml
1323 (package (inherit qtsvg)
1328 (uri (string-append "https://download.qt.io/official_releases/qt/"
1329 (version-major+minor version) "/" version
1330 "/submodules/" name "-everywhere-src-"
1334 "1dpvjkvwc3fj86vay8q8vzym73cix7ri2ianx87ck0gqjny51adg"))
1335 (modules '((guix build utils)))
1338 (delete-file-recursively "tests/3rdparty")
1339 ;; the scion test refers to the bundled 3rd party test code.
1340 (substitute* "tests/auto/auto.pro"
1344 `(("qtbase" ,qtbase)
1345 ("qtdeclarative" ,qtdeclarative)))
1346 (synopsis "Qt SCXML module")
1347 (description "The Qt SCXML module provides functionality to create state
1348 machines from SCXML files. This includes both dynamically creating state
1349 machines (loading the SCXML file and instantiating states and transitions) and
1350 generating a C++ file that has a class implementing the state machine. It
1351 also contains functionality to support data models and executable content.")))
1353 (define-public qtpurchasing
1354 (package (inherit qtsvg)
1355 (name "qtpurchasing")
1359 (uri (string-append "https://download.qt.io/official_releases/qt/"
1360 (version-major+minor version) "/" version
1361 "/submodules/" name "-everywhere-src-"
1365 "0xjsn7p629ni68vk4xlw2cvcs53ipcqv1pa4hck0nabddcgcnzkg"))))
1367 `(("qtbase" ,qtbase)
1368 ("qtdeclarative" ,qtdeclarative)))
1369 (synopsis "Qt Purchasing module")
1370 (description "The Qt Purchasing module provides and in-app API for
1371 purchasing goods and services.")))
1373 (define-public qtcanvas3d
1374 (package (inherit qtsvg)
1379 (uri (string-append "https://download.qt.io/official_releases/qt/"
1380 (version-major+minor version) "/" version
1381 "/submodules/" name "-everywhere-src-"
1385 "0l0c1p6jwz5rygyxslfw7jw3wbd23w5n9zg04aqlh5g15qx52fmn"))
1386 (modules '((guix build utils)))
1389 (delete-file-recursively "examples/canvas3d/3rdparty")
1392 (substitute-keyword-arguments (package-arguments qtsvg)
1393 ;; Building the tests depends on the bundled 3rd party javascript files,
1394 ;; and the test phase fails to import QtCanvas3D, causing the phase to
1395 ;; fail, so we skip building them for now.
1397 `(modify-phases ,phases
1399 (lambda* (#:key outputs #:allow-other-keys)
1400 (let ((out (assoc-ref outputs "out")))
1401 (invoke "qmake" "QT_BUILD_PARTS = libs tools"
1402 (string-append "PREFIX=" out)))))))
1403 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1406 `(("qtbase" ,qtbase)
1407 ("qtdeclarative" ,qtdeclarative)))
1408 (synopsis "Qt Canvas 3D module")
1409 (description "The Qt Canvas 3D module provides a way to make WebGL-like 3D
1410 drawing calls from Qt Quick JavaScript.")))
1412 (define-public qtcharts
1413 (package (inherit qtsvg)
1418 (uri (string-append "https://download.qt.io/official_releases/qt/"
1419 (version-major+minor version) "/" version
1420 "/submodules/" name "-everywhere-src-"
1424 "0pyg2lpxmhf4amj57zihp5ry0y9m39xq5hbcx4hqj78bdm96ah23"))))
1426 (substitute-keyword-arguments (package-arguments qtsvg)
1427 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1429 `(("qtbase" ,qtbase)
1430 ("qtdeclarative" ,qtdeclarative)))
1431 (synopsis "Qt Charts module")
1432 (description "The Qt Charts module provides a set of easy to use chart
1433 components. It uses the Qt Graphics View Framework, therefore charts can be
1434 easily integrated to modern user interfaces. Qt Charts can be used as QWidgets,
1435 QGraphicsWidget, or QML types. Users can easily create impressive graphs by
1436 selecting one of the charts themes.")
1437 (license license:gpl3)))
1439 (define-public qtdatavis3d
1440 (package (inherit qtsvg)
1441 (name "qtdatavis3d")
1445 (uri (string-append "https://download.qt.io/official_releases/qt/"
1446 (version-major+minor version) "/" version
1447 "/submodules/" name "-everywhere-src-"
1451 "09wbv4g29sq5z2fphk2910albr3iv3l14nch3ml77w6drw9mgzq7"))))
1453 (substitute-keyword-arguments (package-arguments qtsvg)
1454 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1456 `(("qtbase" ,qtbase)
1457 ("qtdeclarative" ,qtdeclarative)))
1458 (synopsis "Qt Data Visualization module")
1459 (description "The Qt Data Visualization module provides a way to visualize
1460 data in 3D as bar, scatter, and surface graphs. It is especially useful for
1461 visualizing depth maps and large quantities of rapidly changing data, such as
1462 data received from multiple sensors. The look and feel of graphs can be
1463 customized by using themes or by adding custom items and labels to them.")
1464 (license license:gpl3)))
1466 (define-public qtnetworkauth
1467 (package (inherit qtsvg)
1468 (name "qtnetworkauth")
1472 (uri (string-append "https://download.qt.io/official_releases/qt/"
1473 (version-major+minor version) "/" version
1474 "/submodules/" name "-everywhere-src-"
1478 "0sspni7zllhspk70yjj2d0li9r4rs3iflnksj8mvjx2yl9qpryyb"))))
1480 (substitute-keyword-arguments (package-arguments qtsvg)
1482 `(modify-phases ,phases
1483 (add-after 'unpack 'remove-failing-test
1485 ;; These tests can't find their test data.
1486 (substitute* "tests/auto/auto.pro"
1487 (("oauth1 ") "# oauth1 "))
1490 `(("qtbase" ,qtbase)))
1491 (synopsis "Qt Network Authorization module")
1492 (description "The Qt Network Authorization module provides an
1493 implementation of OAuth and OAuth2 authenticathon methods for Qt.")))
1495 (define-public qtremoteobjects
1496 (package (inherit qtsvg)
1497 (name "qtremoteobjects")
1501 (uri (string-append "https://download.qt.io/official_releases/qt/"
1502 (version-major+minor version) "/" version
1503 "/submodules/" name "-everywhere-src-"
1507 "03qjj7l63wn1zqkmlja9yrnc38rf6b3apnmsn0kw0h61x72awskd"))))
1509 (substitute-keyword-arguments (package-arguments qtsvg)
1511 `(modify-phases ,phases
1512 (add-after 'unpack 'remove-failing-test
1514 ;; This test can't find its imports.
1515 (substitute* "tests/auto/qml/qml.pro"
1516 (("integration") "# integration")
1517 (("usertypes") "# usertypes"))
1520 `(("qtbase" ,qtbase)
1521 ("qtdeclarative" ,qtdeclarative)))
1522 (synopsis "Qt Remote Objects module")
1523 (description "The Qt Remote Objects module is an @dfn{inter-process
1524 communication} (IPC) module developed for Qt. The idea is to extend existing
1525 Qt's functionalities to enable an easy exchange of information between
1526 processes or computers.")))
1528 (define-public qtspeech
1529 (package (inherit qtsvg)
1534 (uri (string-append "https://download.qt.io/official_releases/qt/"
1535 (version-major+minor version) "/" version
1536 "/submodules/" name "-everywhere-src-"
1540 "0q30m9l28zsdzdmny7wjskd2fjfrgh1l595wir6bhwhil95g3i0c"))))
1543 (substitute-keyword-arguments (package-arguments qtsvg)
1544 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1546 `(("qtbase" ,qtbase)))
1549 ("qtdeclarative" ,qtdeclarative)
1550 ("qtmultimedia" ,qtmultimedia)
1551 ("qtxmlpatterns" ,qtxmlpatterns)))
1552 (synopsis "Qt Speech module")
1553 (description "The Qt Speech module enables a Qt application to support
1554 accessibility features such as text-to-speech, which is useful for end-users
1555 who are visually challenged or cannot access the application for whatever
1556 reason. The most common use case where text-to-speech comes in handy is when
1557 the end-user is driving and cannot attend the incoming messages on the phone.
1558 In such a scenario, the messaging application can read out the incoming
1561 (define-public qtwebengine
1564 (name "qtwebengine")
1565 (version (package-version qtbase))
1569 (uri (string-append "https://download.qt.io/official_releases/qt/"
1570 (version-major+minor version) "/" version
1571 "/submodules/" name "-everywhere-src-"
1575 "1yj6pcj945fpbc7nihav0plxpx8ikylmxjy7wqdv5znslgf59dw3"))
1576 (modules '((ice-9 ftw)
1580 (guix build utils)))
1583 (let ((preserved-third-party-files
1584 '("base/third_party/dmg_fp"
1585 "base/third_party/dynamic_annotations"
1586 "base/third_party/icu"
1587 "base/third_party/libevent"
1588 "base/third_party/nspr"
1589 "base/third_party/superfasthash"
1590 "base/third_party/symbolize"
1591 "base/third_party/xdg_mime"
1592 "base/third_party/xdg_user_dirs"
1593 "net/third_party/http2"
1594 "net/third_party/mozilla_security_manager"
1595 "net/third_party/nss"
1596 "net/third_party/spdy"
1597 "net/third_party/quic"
1598 "third_party/abseil-cpp"
1600 "third_party/angle/src/common/third_party/base"
1601 "third_party/angle/src/common/third_party/smhasher"
1602 "third_party/angle/src/third_party/compiler"
1604 "third_party/boringssl"
1605 "third_party/boringssl/src/third_party/fiat"
1606 "third_party/breakpad"
1607 "third_party/brotli"
1609 "third_party/crc32c"
1610 "third_party/ffmpeg"
1611 "third_party/googletest"
1612 "third_party/hunspell"
1613 "third_party/iccjpeg"
1615 "third_party/inspector_protocol"
1616 "third_party/jinja2"
1617 "third_party/jstemplate"
1618 "third_party/khronos"
1619 "third_party/leveldatabase"
1620 "third_party/libaddressinput"
1621 "third_party/libjingle_xmpp"
1622 "third_party/libpng"
1623 "third_party/libsrtp"
1624 "third_party/libsync"
1625 "third_party/libudev"
1626 "third_party/libvpx"
1627 "third_party/libwebm"
1628 "third_party/libwebp"
1629 "third_party/libxml"
1630 "third_party/libxslt"
1631 "third_party/libyuv"
1633 "third_party/markupsafe"
1635 "third_party/metrics_proto"
1636 "third_party/modp_b64"
1640 "third_party/polymer"
1641 "third_party/protobuf"
1642 "third_party/pyjson5"
1644 "third_party/rnnoise"
1646 "third_party/skia/third_party/gif"
1647 "third_party/skia/third_party/skcms"
1648 "third_party/smhasher"
1649 "third_party/snappy"
1650 "third_party/sqlite"
1651 "third_party/usrsctp"
1652 "third_party/web-animations-js"
1653 "third_party/webrtc"
1654 "third_party/webrtc_overrides"
1655 "third_party/widevine/cdm/widevine_cdm_common.h"
1656 "third_party/widevine/cdm/widevine_cdm_version.h"
1660 "url/third_party/mozilla"
1661 "v8/src/third_party/utf8-decoder"
1662 "v8/src/third_party/valgrind"
1663 "v8/third_party/antlr4"
1664 "v8/third_party/inspector_protocol"))
1665 (protected (make-regexp "\\.(gn|gyp)i?$")))
1666 (define preserved-club
1667 (map (lambda (member)
1668 (string-append "./" member))
1669 preserved-third-party-files))
1670 (define (empty? dir)
1671 (equal? (scandir dir) '("." "..")))
1672 (define (third-party? file)
1673 (string-contains file "third_party/"))
1674 (define (useless? file)
1675 (any (cute string-suffix? <> file)
1676 '(".zip" ".so" ".dll" ".exe" ".jar")))
1677 (define (parents child)
1678 ;; Return all parent directories of CHILD up to and including
1679 ;; the closest "third_party".
1680 (let* ((dirs (match (string-split child #\/)
1681 ((dirs ... last) dirs)))
1682 (closest (list-index (lambda (dir)
1683 (string=? "third_party" dir))
1685 (delim (- (length dirs) closest)))
1686 (fold (lambda (dir prev)
1687 (cons (string-append (car prev) "/" dir)
1689 (list (string-join (list-head dirs delim) "/"))
1690 (list-tail dirs delim))))
1691 (define (remove-loudly file)
1692 (format #t "deleting ~a...~%" file)
1695 (define (delete-unwanted-files child stat flag base level)
1697 ((or 'regular 'symlink 'stale-symlink)
1698 (when (third-party? child)
1699 (unless (or (member child preserved-club)
1700 (any (cute member <> preserved-club)
1702 (regexp-exec protected child))
1703 (remove-loudly child)))
1704 (when (and (useless? child) (file-exists? child))
1705 (remove-loudly child))
1707 ('directory-processed
1708 (when (empty? child)
1713 (with-directory-excursion "src/3rdparty"
1714 ;; TODO: Try removing "gn" too for future versions of qtwebengine.
1715 (delete-file-recursively "ninja")
1717 (with-directory-excursion "chromium"
1718 ;; Delete bundled software and binaries that were not explicitly
1720 (nftw "." delete-unwanted-files 'depth 'physical)
1722 ;; Assert that each preserved item is present to catch removals.
1723 (for-each (lambda (third-party)
1724 (unless (file-exists? third-party)
1725 (error (format #f "~s does not exist!~%" third-party))))
1728 ;; Use relative header locations instead of hard coded ones.
1730 "base/third_party/dynamic_annotations/dynamic_annotations.c"
1731 (("base/third_party/valgrind") "valgrind"))
1733 "third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.h"
1734 (("third_party/curl") "curl"))
1736 ;; Replace Google Analytics bundle with an empty file and hope
1738 (mkdir-p "third_party/analytics")
1739 (call-with-output-file
1740 "third_party/analytics/google-analytics-bundle.js"
1744 ;; Do not enable support for loading the Widevine DRM plugin.
1745 (substitute* "src/core/config/common.pri"
1746 (("enable_widevine=true")
1747 "enable_widevine=false"))
1749 (build-system gnu-build-system)
1756 ("pkg-config" ,pkg-config)
1757 ("python-2" ,python-2)
1760 `(("alsa-lib" ,alsa-lib)
1762 ("cups-minimal" ,cups-minimal)
1766 ("fontconfig" ,fontconfig)
1767 ("harbuzz" ,harfbuzz)
1769 ("jsoncpp" ,jsoncpp)
1772 ("libevent" ,libevent)
1773 ("libgcrypt" ,libgcrypt)
1774 ("libjpeg" ,libjpeg-turbo)
1776 ;; FIXME: configure does not find system lcms
1778 ("libwebp" ,libwebp)
1781 ("libxcomposite" ,libxcomposite)
1782 ("libxcursor" ,libxcursor)
1784 ("libxkbcommon" ,libxkbcommon)
1785 ;; FIXME: libxml2 needs to built with icu support though it links to
1786 ;; libxml2 configure summary still states "Checking for compatible
1787 ;; system libxml2... no"
1788 ("libxml2" ,libxml2)
1789 ("libxrandr" ,libxrandr)
1790 ("libxrender" ,libxrender)
1791 ("libxslt" ,libxslt)
1792 ("libxtst" ,libxtst)
1794 ("minizip" ,minizip)
1797 ("pciutils" ,pciutils)
1798 ("protobuf" ,protobuf)
1799 ("pulseaudio" ,pulseaudio)
1801 ("qtdeclarative" ,qtdeclarative)
1802 ("qtmultimedia" ,qtmultimedia)
1803 ("qtwebchannel" ,qtwebchannel)
1807 ("valgrind" ,valgrind)
1808 ("xcb-util" ,xcb-util)))
1810 (substitute-keyword-arguments (package-arguments qtsvg)
1812 `(modify-phases ,phases
1813 (add-after 'unpack 'fix-build-with-newer-re2
1815 ;; Adjust for API change in re2, taken from
1816 ;; https://chromium-review.googlesource.com/c/chromium/src/+/2145261
1817 (substitute* "src/3rdparty/chromium/components/autofill/core\
1818 /browser/address_rewriter.cc"
1819 (("options\\.set_utf8\\(true\\)")
1820 "options.set_encoding(RE2::Options::EncodingUTF8)"))
1822 (add-after 'unpack 'patch-ninja-version-check
1824 ;; The build system assumes the system Ninja is too old because
1825 ;; it only checks for versions 1.7 through 1.9. We have 1.10.
1826 (substitute* "configure.pri"
1827 (("1\\.\\[7-9\\]\\.\\*")
1828 "1.([7-9]|1[0-9]).*"))
1830 (add-before 'configure 'substitute-source
1831 (lambda* (#:key inputs outputs #:allow-other-keys)
1832 (let ((out (assoc-ref outputs "out"))
1833 (nss (assoc-ref inputs "nss"))
1834 (udev (assoc-ref inputs "udev")))
1835 ;; Qtwebengine is not installed into the same prefix as
1836 ;; qtbase. Some qtbase QTLibraryInfo constants will not
1837 ;; work. Replace with the full path to the qtwebengine
1838 ;; translations and locales in the store.
1839 (substitute* "src/core/web_engine_library_info.cpp"
1840 (("QLibraryInfo::location\\(QLibraryInfo::TranslationsPath\\)")
1841 (string-append "QLatin1String(\"" out "/share/qt5/translations\")"))
1842 (("QLibraryInfo::location\\(QLibraryInfo::DataPath\\)")
1843 (string-append "QLatin1String(\"" out "/share/qt5\")")))
1844 ;; Substitute full dynamic library path for nss.
1845 (substitute* "src/3rdparty/chromium/crypto/nss_util.cc"
1847 (string-append nss "/lib/nss/libnssckbi.so")))
1848 ;; Substitute full dynamic library path for udev.
1849 (substitute* "src/3rdparty/chromium/device/udev_linux/udev1_loader.cc"
1851 (string-append udev "/lib/libudev.so.1")))
1853 (add-before 'configure 'set-env
1855 ;; Avoids potential race conditions.
1856 (setenv "PYTHONDONTWRITEBYTECODE" "1")
1857 (setenv "NINJAFLAGS"
1858 (string-append "-k1" ;less verbose build output
1859 ;; Respect the '--cores' option of 'guix build'.
1860 " -j" (number->string (parallel-job-count))))
1864 ;; Valid QT_BUILD_PARTS variables are:
1865 ;; libs tools tests examples demos docs translations
1866 (invoke "qmake" "QT_BUILD_PARTS = libs tools" "--"
1867 "--webengine-printing-and-pdf=no"
1868 "--webengine-ffmpeg=system"
1869 "--webengine-icu=system"
1870 "--webengine-pepper-plugins=no")))))
1871 ;; Tests are disabled due to "Could not find QtWebEngineProcess error"
1872 ;; It's possible this can be fixed by setting QTWEBENGINEPROCESS_PATH
1873 ;; before running tests.
1874 ((#:tests? _ #f) #f)))
1875 (native-search-paths
1876 (list (search-path-specification
1877 (file-type 'regular)
1879 (variable "QTWEBENGINEPROCESS_PATH")
1880 (files '("lib/qt5/libexec/QtWebEngineProcess")))))
1881 (home-page "https://wiki.qt.io/QtWebEngine")
1882 (synopsis "Qt WebEngine module")
1883 (description "The Qt5WebEngine module provides support for web applications
1884 using the Chromium browser project. The Chromium source code has Google services
1885 and binaries removed, and adds modular support for using system libraries.")
1886 (license license:lgpl2.1+)))
1888 (define-public python-sip
1895 (uri (string-append "https://www.riverbankcomputing.com/static/"
1896 "Downloads/sip/" version "/sip-" version ".tar.gz"))
1899 "07kyd56xgbb40ljb022rq82shgxprlbl0z27mpf1b6zd00w8dgf0"))))
1900 (build-system gnu-build-system)
1902 `(("python" ,python-wrapper)))
1904 `(#:tests? #f ; no check target
1905 #:modules ((srfi srfi-1)
1906 ,@%gnu-build-system-modules)
1908 (modify-phases %standard-phases
1910 (lambda* (#:key inputs outputs #:allow-other-keys)
1911 (let* ((out (assoc-ref outputs "out"))
1912 (bin (string-append out "/bin"))
1913 (include (string-append out "/include"))
1914 (python (assoc-ref inputs "python"))
1916 (last (string-split python #\-)))
1919 (take (string-split python-version #\.) 2)
1921 (lib (string-append out "/lib/python"
1924 (invoke "python" "configure.py"
1927 "--incdir" include)))))))
1928 (home-page "https://www.riverbankcomputing.com/software/sip/intro")
1929 (synopsis "Python binding creator for C and C++ libraries")
1931 "SIP is a tool to create Python bindings for C and C++ libraries. It
1932 was originally developed to create PyQt, the Python bindings for the Qt
1933 toolkit, but can be used to create bindings for any C or C++ library.
1935 SIP comprises a code generator and a Python module. The code generator
1936 processes a set of specification files and generates C or C++ code, which
1937 is then compiled to create the bindings extension module. The SIP Python
1938 module provides support functions to the automatically generated code.")
1939 ;; There is a choice between a python like license, gpl2 and gpl3.
1940 ;; For compatibility with pyqt, we need gpl3.
1941 (license license:gpl3)))
1943 (define-public python2-sip
1944 (package (inherit python-sip)
1945 (name "python2-sip")
1947 `(("python" ,python-2)))))
1949 (define-public python-pyqt
1951 (name "python-pyqt")
1956 (uri (string-append "https://www.riverbankcomputing.com/static/"
1957 "Downloads/PyQt5/" version "/PyQt5_gpl-"
1961 "041155bdzp57jy747p5d59740c55yy3241cy1x2lgcdsvqvzmc0d"))
1962 (patches (search-patches "pyqt-configure.patch"
1963 "pyqt-unbundled-qt.patch"
1964 "pyqt-public-sip.patch"))))
1965 (build-system gnu-build-system)
1967 `(("qtbase" ,qtbase))) ; for qmake
1969 `(("python-sip" ,python-sip)))
1971 `(("python" ,python-wrapper)
1973 ("qtconnectivity" ,qtconnectivity)
1974 ("qtdeclarative" ,qtdeclarative)
1975 ("qtlocation" ,qtlocation)
1976 ("qtmultimedia" ,qtmultimedia)
1977 ("qtsensors" ,qtsensors)
1978 ("qtserialport" ,qtserialport)
1980 ("qttools" ,qttools)
1981 ("qtwebchannel" ,qtwebchannel)
1982 ("qtwebkit" ,qtwebkit)
1983 ("qtwebsockets" ,qtwebsockets)
1984 ("qtx11extras" ,qtx11extras)
1985 ("qtxmlpatterns" ,qtxmlpatterns)))
1987 `(#:modules ((srfi srfi-1)
1988 ,@%gnu-build-system-modules)
1990 (modify-phases %standard-phases
1991 ;; When building python-pyqtwebengine, <qprinter.h> can not be
1992 ;; included. Here we substitute the full path to the header in the
1994 (add-before 'configure 'substitute-source
1995 (lambda* (#:key inputs #:allow-other-keys)
1996 (let* ((qtbase (assoc-ref inputs "qtbase"))
1997 (qtprinter.h (string-append "\"" qtbase "/include/qt5/QtPrintSupport/qprinter.h\"")))
1998 (substitute* "sip/QtPrintSupport/qprinter.sip"
2003 (lambda* (#:key inputs outputs #:allow-other-keys)
2004 (let* ((out (assoc-ref outputs "out"))
2005 (bin (string-append out "/bin"))
2006 (sip (string-append out "/share/sip"))
2007 (plugins (string-append out "/lib/qt5/plugins"))
2008 (designer (string-append plugins "/designer"))
2009 (qml (string-append plugins "/PyQt5"))
2010 (python (assoc-ref inputs "python"))
2012 (last (string-split python #\-)))
2015 (take (string-split python-version #\.) 2)
2017 (lib (string-append out "/lib/python"
2020 (stubs (string-append lib "/PyQt5")))
2021 (invoke "python" "configure.py"
2025 "--designer-plugindir" designer
2026 "--qml-plugindir" qml
2027 ; Where to install the PEP 484 Type Hints stub
2028 ; files. Without this the stubs are tried to be
2029 ; installed into the python package's
2030 ; site-package directory, which is read-only.
2032 "--sipdir" sip)))))))
2033 (home-page "https://www.riverbankcomputing.com/software/pyqt/intro")
2034 (synopsis "Python bindings for Qt")
2036 "PyQt is a set of Python v2 and v3 bindings for the Qt application
2037 framework. The bindings are implemented as a set of Python modules and
2038 contain over 620 classes.")
2039 (license license:gpl3)))
2041 (define-public python-pyqtwebengine
2043 (name "python-pyqtwebengine")
2049 "https://www.riverbankcomputing.com/static/Downloads/PyQtWebEngine/"
2050 version "/PyQtWebEngine_gpl-" version ".tar.gz"))
2053 "0wylkd7fh2g27y3710rpxmj9wx0wpi3z7qbv6khiddm15rkh81w6"))))
2054 (build-system gnu-build-system)
2056 `(("python" ,python)
2057 ("python-sip" ,python-sip)
2058 ;; qtbase is required for qmake
2059 ("qtbase" ,qtbase)))
2061 `(("python" ,python-wrapper)
2062 ("python-sip" ,python-sip)
2063 ("python-pyqt" ,python-pyqt)
2066 ("qtdeclarative" ,qtdeclarative)
2067 ("qtwebchannel" ,qtwebchannel)
2068 ("python-pyqt" ,python-pyqt)
2069 ("qtwebengine" ,qtwebengine)))
2071 `(#:modules ((srfi srfi-1)
2072 ((guix build python-build-system) #:select (python-version))
2073 ,@%gnu-build-system-modules)
2074 #:imported-modules ((guix build python-build-system)
2075 ,@%gnu-build-system-modules)
2077 (modify-phases %standard-phases
2079 (lambda* (#:key inputs outputs #:allow-other-keys)
2080 (let* ((out (assoc-ref outputs "out"))
2081 (sipdir (string-append out "/share/sip"))
2082 (pyqt-sipdir (string-append
2083 (assoc-ref inputs "python-pyqt") "/share/sip"))
2084 (python (assoc-ref inputs "python"))
2085 (lib (string-append out "/lib/python"
2086 (python-version python)
2087 "/site-packages/PyQt5"))
2088 (stubs (string-append lib "/PyQt5")))
2091 (invoke "python" "configure.py"
2098 "--pyqt-sipdir" pyqt-sipdir))))
2099 ;; Because this has a different prefix than python-pyqt then we need
2100 ;; to make this a namespace of it's own
2101 (add-after 'install 'make-namespace
2102 (lambda* (#:key inputs outputs #:allow-other-keys)
2103 (let* ((__init__.py (string-append
2104 (assoc-ref outputs "out")
2106 (python-version (assoc-ref inputs "python"))
2107 "/site-packages/PyQt5/__init__.py")))
2108 (with-output-to-file __init__.py
2109 (lambda _ (display "
2110 from pkgutil import extend_path
2111 __path__ = extend_path(__path__, __name__)
2114 (home-page "https://www.riverbankcomputing.com/software/pyqtwebengine/intro")
2115 (synopsis "Python bindings for QtWebEngine")
2117 "PyQtWebEngine is a set of Python bindings for The Qt Company's Qt
2118 WebEngine libraries. The bindings sit on top of PyQt5 and are implemented as a
2119 set of three modules. Prior to v5.12 these bindings were part of PyQt
2121 (license license:gpl3)))
2123 ;; XXX: This is useful because qtwebkit does not build reliably at this time.
2124 ;; Ultimately, it would be nicer to have a more modular set of python-pyqt-*
2125 ;; packages that could be used together.
2126 (define-public python-pyqt-without-qtwebkit
2127 (package (inherit python-pyqt)
2128 (name "python-pyqt-without-qtwebkit")
2130 (alist-delete "qtwebkit" (package-inputs python-pyqt)))))
2132 (define-public python2-pyqt
2133 (package (inherit python-pyqt)
2134 (name "python2-pyqt")
2136 `(("python-sip" ,python2-sip)
2137 ("qtbase" ,qtbase)))
2139 `(("python" ,python-2)
2140 ("python2-enum34" ,python2-enum34)
2141 ,@(alist-delete "python" (package-inputs python-pyqt))))))
2143 (define-public python2-pyqt-4
2144 (package (inherit python-pyqt)
2145 (name "python2-pyqt")
2151 (string-append "mirror://sourceforge/pyqt/PyQt4/"
2152 "PyQt-" version "/PyQt4_gpl_x11-"
2156 "1nw8r88a5g2d550yvklawlvns8gd5slw53yy688kxnsa65aln79w"))))
2158 `(("python-sip" ,python2-sip)
2160 (inputs `(("python" ,python-2)))
2162 `(#:tests? #f ; no check target
2163 #:modules ((srfi srfi-1)
2164 ,@%gnu-build-system-modules)
2166 (modify-phases %standard-phases
2168 (lambda* (#:key inputs outputs #:allow-other-keys)
2169 (let* ((out (assoc-ref outputs "out"))
2170 (bin (string-append out "/bin"))
2171 (sip (string-append out "/share/sip"))
2172 (python (assoc-ref inputs "python"))
2174 (last (string-split python #\-)))
2177 (take (string-split python-version #\.) 2)
2179 (lib (string-append out "/lib/python"
2182 (invoke "python" "configure.py"
2186 "--sipdir" sip)))))))
2187 (license (list license:gpl2 license:gpl3)))) ; choice of either license
2189 (define-public qscintilla
2195 (uri (string-append "mirror://sourceforge/pyqt/QScintilla2/"
2196 "QScintilla-" version "/QScintilla_gpl-"
2200 "1swjr786w04r514pry9pn32ivza4il1cg35s60qy39cwc175pka6"))))
2201 (build-system gnu-build-system)
2204 (modify-phases %standard-phases
2206 (lambda* (#:key outputs #:allow-other-keys)
2207 (let ((out (assoc-ref outputs "out")))
2209 (substitute* "qscintilla.pro"
2210 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
2211 (string-append out "/lib"))
2212 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
2213 (string-append out "/include"))
2214 (("\\$\\$\\[QT_INSTALL_TRANSLATIONS\\]")
2215 (string-append out "/translations"))
2216 (("\\$\\$\\[QT_INSTALL_DATA\\]")
2217 (string-append out "/lib/qt$${QT_MAJOR_VERSION}"))
2218 (("\\$\\$\\[QT_HOST_DATA\\]")
2219 (string-append out "/lib/qt$${QT_MAJOR_VERSION}")))
2220 (invoke "qmake")))))))
2221 (native-inputs `(("qtbase" ,qtbase)))
2222 (home-page "https://www.riverbankcomputing.co.uk/software/qscintilla/intro")
2223 (synopsis "Qt port of the Scintilla C++ editor control")
2224 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
2225 editor control. QScintilla includes features especially useful when editing
2226 and debugging source code. These include support for syntax styling, error
2227 indicators, code completion and call tips.")
2228 (license license:gpl3+)))
2230 (define-public python-qscintilla
2231 (package (inherit qscintilla)
2232 (name "python-qscintilla")
2235 (list "--pyqt=PyQt5"
2236 (string-append "--pyqt-sipdir="
2237 (assoc-ref %build-inputs "python-pyqt")
2239 (string-append "--qsci-incdir="
2240 (assoc-ref %build-inputs "qscintilla")
2242 (string-append "--qsci-libdir="
2243 (assoc-ref %build-inputs "qscintilla")
2246 (modify-phases %standard-phases
2248 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
2249 (let ((out (assoc-ref outputs "out"))
2250 (python (assoc-ref inputs "python")))
2252 (apply invoke "python3" "configure.py"
2254 ;; Install to the right directory
2255 (substitute* '("Makefile"
2257 (("\\$\\(INSTALL_ROOT\\)/gnu/store/[^/]+") out)
2258 (((string-append python "/lib"))
2259 (string-append out "/lib")))
2260 ;; And fix the installed.txt file
2261 (substitute* "installed.txt"
2262 (("/gnu/store/[^/]+") out)))
2265 `(("qscintilla" ,qscintilla)
2267 ("python-pyqt" ,python-pyqt)))
2268 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
2269 editor control. QScintilla includes features especially useful when editing
2270 and debugging source code. These include support for syntax styling, error
2271 indicators, code completion and call tips.
2273 This package provides the Python bindings.")))
2275 ;; PyQt only looks for modules in its own directory. It ignores environment
2276 ;; variables such as PYTHONPATH, so we need to build a union package to make
2278 (define-public python-pyqt+qscintilla
2279 (package (inherit python-pyqt)
2280 (name "python-pyqt+qscintilla")
2282 (build-system trivial-build-system)
2284 '(#:modules ((guix build union))
2286 (use-modules (ice-9 match)
2288 (match %build-inputs
2289 (((names . directories) ...)
2290 (union-build (assoc-ref %outputs "out")
2294 `(("python-pyqt" ,python-pyqt)
2295 ("python-qscintilla" ,python-qscintilla)))
2296 (synopsis "Union of PyQt and the Qscintilla extension")
2298 "This package contains the union of PyQt and the Qscintilla extension.")))
2300 (define-public qtkeychain
2308 (url "https://github.com/frankosterfeld/qtkeychain/")
2309 (commit (string-append "v" version))))
2310 (file-name (git-file-name name version))
2313 "0h4wgngn2yl35hapbjs24amkjfbzsvnna4ixfhn87snjnq5lmjbc"))))
2314 (build-system cmake-build-system)
2316 `(("pkg-config" ,pkg-config)
2317 ("qttools" ,qttools)))
2319 `(("qtbase" ,qtbase)))
2321 `(#:tests? #f ; No tests included
2323 (modify-phases %standard-phases
2324 (add-before 'configure 'set-qt-trans-dir
2326 (substitute* "CMakeLists.txt"
2327 (("\\$\\{qt_translations_dir\\}")
2328 "${CMAKE_INSTALL_PREFIX}/share/qt5/translations"))
2330 (home-page "https://github.com/frankosterfeld/qtkeychain")
2331 (synopsis "Qt API to store passwords")
2333 "QtKeychain is a Qt library to store passwords and other secret data
2334 securely. It will not store any data unencrypted unless explicitly requested.")
2335 (license license:bsd-3)))
2345 (string-append "mirror://sourceforge/qwt/qwt/"
2346 version "/qwt-" version ".tar.bz2"))
2348 (base32 "1navkcnmn0qz8kzsyqmk32d929zl72l0b580w1ica7z5559j2a8m"))))
2349 (build-system gnu-build-system)
2351 `(("qtbase" ,qtbase)
2353 ("qttools" ,qttools)))
2356 (modify-phases %standard-phases
2358 (lambda* (#:key outputs #:allow-other-keys)
2359 (let* ((out (assoc-ref outputs "out"))
2360 (docdir (string-append out "/share/doc/qwt"))
2361 (incdir (string-append out "/include/qwt"))
2362 (pluginsdir (string-append out "/lib/qt5/plugins/designer"))
2363 (featuresdir (string-append out "/lib/qt5/mkspecs/features")))
2364 (substitute* '("qwtconfig.pri")
2365 (("^(\\s*QWT_INSTALL_PREFIX)\\s*=.*" _ x)
2366 (format #f "~a = ~a\n" x out))
2367 (("^(QWT_INSTALL_DOCS)\\s*=.*" _ x)
2368 (format #f "~a = ~a\n" x docdir))
2369 (("^(QWT_INSTALL_HEADERS)\\s*=.*" _ x)
2370 (format #f "~a = ~a\n" x incdir))
2371 (("^(QWT_INSTALL_PLUGINS)\\s*=.*" _ x)
2372 (format #f "~a = ~a\n" x pluginsdir))
2373 (("^(QWT_INSTALL_FEATURES)\\s*=.*" _ x)
2374 (format #f "~a = ~a\n" x featuresdir)))
2375 (substitute* '("doc/doc.pro")
2376 ;; We'll install them in the 'install-man-pages' phase.
2377 (("^unix:doc\\.files.*") ""))
2379 (add-after 'install 'install-man-pages
2380 (lambda* (#:key outputs #:allow-other-keys)
2381 (let* ((out (assoc-ref outputs "out"))
2382 (man (string-append out "/share/man")))
2383 ;; Remove some incomplete manual pages.
2384 (for-each delete-file (find-files "doc/man/man3" "^_tmp.*"))
2386 (copy-recursively "doc/man" man)
2388 (home-page "http://qwt.sourceforge.net")
2389 (synopsis "Qt widgets for plots, scales, dials and other technical software
2392 "The Qwt library contains widgets and components which are primarily useful
2393 for technical and scientific purposes. It includes a 2-D plotting widget,
2394 different kinds of sliders, and much more.")
2397 ;; The Qwt license is LGPL2.1 with some exceptions.
2398 (license:non-copyleft "http://qwt.sourceforge.net/qwtlicense.html")
2399 ;; textengines/mathml/qwt_mml_document.{cpp,h} is dual LGPL2.1/GPL3 (either).
2400 license:lgpl2.1 license:gpl3))))
2402 (define-public qtwebkit
2405 (version "5.212.0-alpha4")
2409 (uri (string-append "https://github.com/annulen/webkit/releases/download/"
2410 "qtwebkit-" version "/qtwebkit-" version ".tar.xz"))
2413 "1rm9sjkabxna67dl7myx9d9vpdyfxfdhrk9w7b94srkkjbd2d8cw"))
2414 (patches (search-patches "qtwebkit-pbutils-include.patch"))))
2415 (build-system cmake-build-system)
2423 ("pkg-config" ,pkg-config)))
2427 ("gst-plugins-base" ,gst-plugins-base)
2428 ("libjpeg" ,libjpeg-turbo)
2430 ("libwebp" ,libwebp)
2432 ("fontconfig" ,fontconfig)
2433 ("libxrender" ,libxrender)
2435 ("qtdeclarative" ,qtdeclarative)
2436 ("qtlocation" ,qtlocation)
2437 ("qtmultimedia" ,qtmultimedia)
2438 ("qtsensors" ,qtsensors)
2439 ("qtwebchannel" ,qtwebchannel)
2440 ("libxml2" ,libxml2)
2441 ("libxslt" ,libxslt)
2443 ("libxcomposite" ,libxcomposite)))
2445 `(#:tests? #f ; no apparent tests; it might be necessary to set
2446 ; ENABLE_API_TESTS, see CMakeLists.txt
2448 ;; Parallel builds fail due to a race condition:
2449 ;; <https://bugs.gnu.org/34062>.
2450 #:parallel-build? #f
2452 #:configure-flags (list ;"-DENABLE_API_TESTS=TRUE"
2454 "-DUSE_LIBHYPHEN=OFF"
2455 "-DUSE_SYSTEM_MALLOC=ON"
2456 ;; XXX: relative dir installs to build dir?
2457 (string-append "-DECM_MKSPECS_INSTALL_DIR="
2458 %output "/lib/qt5/mkspecs/modules")
2459 ;; Sacrifice a little speed in order to link
2460 ;; libraries and test executables in a
2461 ;; reasonable amount of memory.
2462 "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,--no-keep-memory"
2463 "-DCMAKE_EXE_LINKER_FLAGS=-Wl,--no-keep-memory")))
2464 (home-page "https://www.webkit.org")
2465 (synopsis "Web browser engine and classes to render and interact with web
2467 (description "QtWebKit provides a Web browser engine that makes it easy to
2468 embed content from the World Wide Web into your Qt application. At the same
2469 time Web content can be enhanced with native controls.")
2470 ;; Building QtWebKit takes around 13 hours on an AArch64 machine. Give some
2471 ;; room for slower or busy hardware.
2472 (properties '((timeout . 64800))) ;18 hours
2474 ;; XXX: This consumes too much RAM to successfully build on AArch64 (e.g.,
2475 ;; SoftIron OverDrive with 8 GiB of RAM), so instead of wasting resources,
2476 ;; disable it on non-Intel platforms.
2477 (supported-systems '("x86_64-linux" "i686-linux"))
2479 (license license:lgpl2.1+)))
2481 (define-public dotherside
2489 (url "https://github.com/filcuc/DOtherSide")
2490 (commit (string-append "v" version))))
2491 (file-name (git-file-name name version))
2494 "09fz6v8rp28997f235yaifj8p4vvsyv45knc1iivgdvx7msgcd0m"))))
2495 (build-system cmake-build-system)
2497 `(("qttools" ,qttools)))
2499 `(("qtbase" ,qtbase)
2500 ("qtdeclarative" ,qtdeclarative)))
2501 (home-page "https://filcuc.github.io/DOtherSide/index.html")
2502 (synopsis "C language library for creating bindings for the Qt QML language")
2504 "DOtherSide is a C language library for creating bindings for the
2505 QT QML language. The following features are implementable from
2508 @item Creating custom QObject
2509 @item Creating custom QAbstractListModels
2510 @item Creating custom properties, signals and slots
2511 @item Creating from QML QObject defined in the binded language
2512 @item Creating from Singleton QML QObject defined in the binded language
2514 (license license:lgpl3))) ;version 3 only (+ exception)
2516 ;; There have been no public releases yet.
2517 (define-public qtcolorwidgets
2518 (let ((commit "a95f72e935fe9e046061a1d1c3930cbfbcb533e0")
2521 (name "qtcolorwidgets")
2522 (version (git-version "0" revision commit))
2526 (url "https://gitlab.com/mattia.basaglia/Qt-Color-Widgets")
2528 (file-name (git-file-name name version))
2531 "0dkiwlqh2gwhlp78c1fmchj3shl4p9inspcl96ya5aa8mn6kydy8"))))
2532 (build-system cmake-build-system)
2533 (arguments `(#:tests? #f)) ; There are no tests
2535 `(("qttools" ,qttools)))
2537 `(("qtbase" ,qtbase)))
2538 (home-page "https://gitlab.com/mattia.basaglia/Qt-Color-Widgets")
2539 (synopsis "Color management widgets")
2540 (description "QtColorWidgets provides a Qt color dialog that is more
2541 user-friendly than the default @code{QColorDialog} and several other
2542 color-related widgets.")
2543 ;; Includes a license exception for combining with GPL2 code.
2544 (license license:lgpl3+))))
2546 (define-public python-shiboken-2
2548 (name "python-shiboken-2")
2552 (uri (string-append "https://download.qt.io/official_releases"
2553 "/QtForPython/pyside2/PySide2-" version
2554 "-src/pyside-setup-everywhere-src-"
2558 "1n45l6xxyxs6cfp2l4rp8qs1c2fyfwyrdxa4qcpwfsqsi51rydsk"))))
2559 (build-system cmake-build-system)
2561 `(("clang-toolchain" ,clang-toolchain-6)
2562 ("libxml2" ,libxml2)
2563 ("libxslt" ,libxslt)
2564 ("python-wrapper" ,python-wrapper)
2566 ("qtxmlpatterns" ,qtxmlpatterns)))
2569 ;; FIXME: Building tests fails
2570 #:configure-flags '("-DBUILD_TESTS=off")
2572 (modify-phases %standard-phases
2573 (add-after 'unpack 'use-shiboken-dir-only
2574 (lambda _ (chdir "sources/shiboken2") #t))
2575 (add-before 'configure 'make-files-writable-and-update-timestamps
2577 ;; The build scripts need to modify some files in
2578 ;; the read-only source directory, and also attempts
2579 ;; to create Zip files which fails because the Zip
2580 ;; format does not support timestamps before 1980.
2581 (let ((circa-1980 (* 10 366 24 60 60)))
2582 (for-each (lambda (file)
2583 (make-file-writable file)
2584 (utime file circa-1980 circa-1980))
2587 (add-before 'configure 'set-build-env
2588 (lambda* (#:key inputs #:allow-other-keys)
2589 (let ((llvm (assoc-ref inputs "clang-toolchain")))
2590 (setenv "CLANG_INSTALL_DIR" llvm)
2592 (home-page "https://wiki.qt.io/Qt_for_Python")
2594 "Shiboken generates bindings for C++ libraries using CPython source code")
2596 "Shiboken generates bindings for C++ libraries using CPython source code")
2599 ;; The main code is GPL3 or LGPL3.
2600 ;; Examples are BSD-3.
2605 (define-public python-pyside-2
2607 (name "python-pyside-2")
2608 (version (package-version python-shiboken-2))
2609 (source (package-source python-shiboken-2))
2610 (build-system cmake-build-system)
2612 `(("libxml2" ,libxml2)
2613 ("libxslt" ,libxslt)
2614 ("clang-toolchain" ,clang-toolchain-6)
2616 ("qtdatavis3d" ,qtdatavis3d)
2617 ("qtlocation" ,qtlocation)
2618 ("qtmultimedia" ,qtmultimedia)
2619 ("qtquickcontrols" ,qtquickcontrols)
2620 ("qtscript" ,qtscript)
2621 ("qtscxml" ,qtscxml)
2622 ("qtsensors" ,qtsensors)
2623 ("qtspeech" ,qtspeech)
2625 ("qtwebchannel" ,qtwebchannel)
2626 ("qtwebsockets" ,qtwebsockets)
2627 ("qtx11extras" ,qtx11extras)
2628 ("qtxmlpatterns" ,qtxmlpatterns)))
2630 `(("cmake" ,cmake-minimal)
2631 ("python-shiboken-2" ,python-shiboken-2)
2632 ("python" ,python-wrapper)
2633 ("qttools" ,qttools)
2637 ;; FIXME: Building tests fail.
2639 (list "-DBUILD_TESTS=FALSE"
2640 (string-append "-DPYTHON_EXECUTABLE="
2641 (assoc-ref %build-inputs "python")
2644 (modify-phases %standard-phases
2645 (add-after 'unpack 'go-to-source-dir
2646 (lambda _ (chdir "sources/pyside2") #t))
2647 (add-before 'configure 'set-clang-dir
2648 (lambda* (#:key inputs #:allow-other-keys)
2649 (let ((clang (assoc-ref inputs "clang-toolchain")))
2650 (setenv "CLANG_INSTALL_DIR" clang)
2652 (home-page "https://wiki.qt.io/Qt_for_Python")
2654 "The Qt for Python product enables the use of Qt5 APIs in Python applications")
2656 "The Qt for Python product enables the use of Qt5 APIs in Python
2657 applications. It lets Python developers utilize the full potential of Qt,
2658 using the PySide2 module. The PySide2 module provides access to the
2659 individual Qt modules such as QtCore, QtGui,and so on. Qt for Python also
2660 comes with the Shiboken2 CPython binding code generator, which can be used to
2661 generate Python bindings for your C or C++ code.")
2665 ;; this file may be used under the terms of the GNU General
2666 ;; Public License version 2.0 or (at your option) the GNU
2667 ;; General Public license version 3 or any later version
2668 ;; approved by the KDE Free Qt Foundation.
2669 ;; Thus, it is currently v2 or v3, but no "+".
2673 (define-public python-pyside-2-tools
2675 (name "python-pyside-2-tools")
2676 (version (package-version python-shiboken-2))
2677 (source (package-source python-shiboken-2))
2678 (build-system cmake-build-system)
2680 `(("python-pyside-2" ,python-pyside-2)
2681 ("python-shiboken-2" ,python-shiboken-2)
2682 ("qtbase" ,qtbase)))
2684 `(("python" ,python-wrapper)))
2688 (list "-DBUILD_TESTS=off"
2689 (string-append "-DPYTHON_EXECUTABLE="
2690 (assoc-ref %build-inputs "python")
2692 #:phases (modify-phases %standard-phases
2693 (add-after 'unpack 'go-to-source-dir
2694 (lambda _ (chdir "sources/pyside2-tools") #t)))))
2695 (home-page "https://wiki.qt.io/Qt_for_Python")
2697 "Contains command line tools for PySide2")
2699 "Contains lupdate, rcc and uic tools for PySide2")
2700 (license license:gpl2)))