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 'patch-ninja-version-check
1815 ;; The build system assumes the system Ninja is too old because
1816 ;; it only checks for versions 1.7 through 1.9. We have 1.10.
1817 (substitute* "configure.pri"
1818 (("1\\.\\[7-9\\]\\.\\*")
1819 "1.([7-9]|1[0-9]).*"))
1821 (add-before 'configure 'substitute-source
1822 (lambda* (#:key inputs outputs #:allow-other-keys)
1823 (let ((out (assoc-ref outputs "out"))
1824 (nss (assoc-ref inputs "nss"))
1825 (udev (assoc-ref inputs "udev")))
1826 ;; Qtwebengine is not installed into the same prefix as
1827 ;; qtbase. Some qtbase QTLibraryInfo constants will not
1828 ;; work. Replace with the full path to the qtwebengine
1829 ;; translations and locales in the store.
1830 (substitute* "src/core/web_engine_library_info.cpp"
1831 (("QLibraryInfo::location\\(QLibraryInfo::TranslationsPath\\)")
1832 (string-append "QLatin1String(\"" out "/share/qt5/translations\")"))
1833 (("QLibraryInfo::location\\(QLibraryInfo::DataPath\\)")
1834 (string-append "QLatin1String(\"" out "/share/qt5\")")))
1835 ;; Substitute full dynamic library path for nss.
1836 (substitute* "src/3rdparty/chromium/crypto/nss_util.cc"
1838 (string-append nss "/lib/nss/libnssckbi.so")))
1839 ;; Substitute full dynamic library path for udev.
1840 (substitute* "src/3rdparty/chromium/device/udev_linux/udev1_loader.cc"
1842 (string-append udev "/lib/libudev.so.1")))
1844 (add-before 'configure 'set-env
1846 ;; Avoids potential race conditions.
1847 (setenv "PYTHONDONTWRITEBYTECODE" "1")
1848 (setenv "NINJAFLAGS"
1849 (string-append "-k1" ;less verbose build output
1850 ;; Respect the '--cores' option of 'guix build'.
1851 " -j" (number->string (parallel-job-count))))
1855 ;; Valid QT_BUILD_PARTS variables are:
1856 ;; libs tools tests examples demos docs translations
1857 (invoke "qmake" "QT_BUILD_PARTS = libs tools" "--"
1858 "--webengine-printing-and-pdf=no"
1859 "--webengine-ffmpeg=system"
1860 "--webengine-icu=system"
1861 "--webengine-pepper-plugins=no")))))
1862 ;; Tests are disabled due to "Could not find QtWebEngineProcess error"
1863 ;; It's possible this can be fixed by setting QTWEBENGINEPROCESS_PATH
1864 ;; before running tests.
1865 ((#:tests? _ #f) #f)))
1866 (native-search-paths
1867 (list (search-path-specification
1868 (file-type 'regular)
1870 (variable "QTWEBENGINEPROCESS_PATH")
1871 (files '("lib/qt5/libexec/QtWebEngineProcess")))))
1872 (home-page "https://wiki.qt.io/QtWebEngine")
1873 (synopsis "Qt WebEngine module")
1874 (description "The Qt5WebEngine module provides support for web applications
1875 using the Chromium browser project. The Chromium source code has Google services
1876 and binaries removed, and adds modular support for using system libraries.")
1877 (license license:lgpl2.1+)))
1879 (define-public python-sip
1886 (uri (string-append "https://www.riverbankcomputing.com/static/"
1887 "Downloads/sip/" version "/sip-" version ".tar.gz"))
1890 "07kyd56xgbb40ljb022rq82shgxprlbl0z27mpf1b6zd00w8dgf0"))))
1891 (build-system gnu-build-system)
1893 `(("python" ,python-wrapper)))
1895 `(#:tests? #f ; no check target
1896 #:modules ((srfi srfi-1)
1897 ,@%gnu-build-system-modules)
1899 (modify-phases %standard-phases
1901 (lambda* (#:key inputs outputs #:allow-other-keys)
1902 (let* ((out (assoc-ref outputs "out"))
1903 (bin (string-append out "/bin"))
1904 (include (string-append out "/include"))
1905 (python (assoc-ref inputs "python"))
1907 (last (string-split python #\-)))
1910 (take (string-split python-version #\.) 2)
1912 (lib (string-append out "/lib/python"
1915 (invoke "python" "configure.py"
1918 "--incdir" include)))))))
1919 (home-page "https://www.riverbankcomputing.com/software/sip/intro")
1920 (synopsis "Python binding creator for C and C++ libraries")
1922 "SIP is a tool to create Python bindings for C and C++ libraries. It
1923 was originally developed to create PyQt, the Python bindings for the Qt
1924 toolkit, but can be used to create bindings for any C or C++ library.
1926 SIP comprises a code generator and a Python module. The code generator
1927 processes a set of specification files and generates C or C++ code, which
1928 is then compiled to create the bindings extension module. The SIP Python
1929 module provides support functions to the automatically generated code.")
1930 ;; There is a choice between a python like license, gpl2 and gpl3.
1931 ;; For compatibility with pyqt, we need gpl3.
1932 (license license:gpl3)))
1934 (define-public python2-sip
1935 (package (inherit python-sip)
1936 (name "python2-sip")
1938 `(("python" ,python-2)))))
1940 (define-public python-pyqt
1942 (name "python-pyqt")
1947 (uri (string-append "https://www.riverbankcomputing.com/static/"
1948 "Downloads/PyQt5/" version "/PyQt5_gpl-"
1952 "041155bdzp57jy747p5d59740c55yy3241cy1x2lgcdsvqvzmc0d"))
1953 (patches (search-patches "pyqt-configure.patch"
1954 "pyqt-unbundled-qt.patch"
1955 "pyqt-public-sip.patch"))))
1956 (build-system gnu-build-system)
1958 `(("qtbase" ,qtbase))) ; for qmake
1960 `(("python-sip" ,python-sip)))
1962 `(("python" ,python-wrapper)
1964 ("qtconnectivity" ,qtconnectivity)
1965 ("qtdeclarative" ,qtdeclarative)
1966 ("qtlocation" ,qtlocation)
1967 ("qtmultimedia" ,qtmultimedia)
1968 ("qtsensors" ,qtsensors)
1969 ("qtserialport" ,qtserialport)
1971 ("qttools" ,qttools)
1972 ("qtwebchannel" ,qtwebchannel)
1973 ("qtwebkit" ,qtwebkit)
1974 ("qtwebsockets" ,qtwebsockets)
1975 ("qtx11extras" ,qtx11extras)
1976 ("qtxmlpatterns" ,qtxmlpatterns)))
1978 `(#:modules ((srfi srfi-1)
1979 ,@%gnu-build-system-modules)
1981 (modify-phases %standard-phases
1982 ;; When building python-pyqtwebengine, <qprinter.h> can not be
1983 ;; included. Here we substitute the full path to the header in the
1985 (add-before 'configure 'substitute-source
1986 (lambda* (#:key inputs #:allow-other-keys)
1987 (let* ((qtbase (assoc-ref inputs "qtbase"))
1988 (qtprinter.h (string-append "\"" qtbase "/include/qt5/QtPrintSupport/qprinter.h\"")))
1989 (substitute* "sip/QtPrintSupport/qprinter.sip"
1994 (lambda* (#:key inputs outputs #:allow-other-keys)
1995 (let* ((out (assoc-ref outputs "out"))
1996 (bin (string-append out "/bin"))
1997 (sip (string-append out "/share/sip"))
1998 (plugins (string-append out "/lib/qt5/plugins"))
1999 (designer (string-append plugins "/designer"))
2000 (qml (string-append plugins "/PyQt5"))
2001 (python (assoc-ref inputs "python"))
2003 (last (string-split python #\-)))
2006 (take (string-split python-version #\.) 2)
2008 (lib (string-append out "/lib/python"
2011 (stubs (string-append lib "/PyQt5")))
2012 (invoke "python" "configure.py"
2016 "--designer-plugindir" designer
2017 "--qml-plugindir" qml
2018 ; Where to install the PEP 484 Type Hints stub
2019 ; files. Without this the stubs are tried to be
2020 ; installed into the python package's
2021 ; site-package directory, which is read-only.
2023 "--sipdir" sip)))))))
2024 (home-page "https://www.riverbankcomputing.com/software/pyqt/intro")
2025 (synopsis "Python bindings for Qt")
2027 "PyQt is a set of Python v2 and v3 bindings for the Qt application
2028 framework. The bindings are implemented as a set of Python modules and
2029 contain over 620 classes.")
2030 (license license:gpl3)))
2032 (define-public python-pyqtwebengine
2034 (name "python-pyqtwebengine")
2040 "https://www.riverbankcomputing.com/static/Downloads/PyQtWebEngine/"
2041 version "/PyQtWebEngine_gpl-" version ".tar.gz"))
2044 "0wylkd7fh2g27y3710rpxmj9wx0wpi3z7qbv6khiddm15rkh81w6"))))
2045 (build-system gnu-build-system)
2047 `(("python" ,python)
2048 ("python-sip" ,python-sip)
2049 ;; qtbase is required for qmake
2050 ("qtbase" ,qtbase)))
2052 `(("python" ,python-wrapper)
2053 ("python-sip" ,python-sip)
2054 ("python-pyqt" ,python-pyqt)
2057 ("qtdeclarative" ,qtdeclarative)
2058 ("qtwebchannel" ,qtwebchannel)
2059 ("python-pyqt" ,python-pyqt)
2060 ("qtwebengine" ,qtwebengine)))
2062 `(#:modules ((srfi srfi-1)
2063 ((guix build python-build-system) #:select (python-version))
2064 ,@%gnu-build-system-modules)
2065 #:imported-modules ((guix build python-build-system)
2066 ,@%gnu-build-system-modules)
2068 (modify-phases %standard-phases
2070 (lambda* (#:key inputs outputs #:allow-other-keys)
2071 (let* ((out (assoc-ref outputs "out"))
2072 (sipdir (string-append out "/share/sip"))
2073 (pyqt-sipdir (string-append
2074 (assoc-ref inputs "python-pyqt") "/share/sip"))
2075 (python (assoc-ref inputs "python"))
2076 (lib (string-append out "/lib/python"
2077 (python-version python)
2078 "/site-packages/PyQt5"))
2079 (stubs (string-append lib "/PyQt5")))
2082 (invoke "python" "configure.py"
2089 "--pyqt-sipdir" pyqt-sipdir))))
2090 ;; Because this has a different prefix than python-pyqt then we need
2091 ;; to make this a namespace of it's own
2092 (add-after 'install 'make-namespace
2093 (lambda* (#:key inputs outputs #:allow-other-keys)
2094 (let* ((__init__.py (string-append
2095 (assoc-ref outputs "out")
2097 (python-version (assoc-ref inputs "python"))
2098 "/site-packages/PyQt5/__init__.py")))
2099 (with-output-to-file __init__.py
2100 (lambda _ (display "
2101 from pkgutil import extend_path
2102 __path__ = extend_path(__path__, __name__)
2105 (home-page "https://www.riverbankcomputing.com/software/pyqtwebengine/intro")
2106 (synopsis "Python bindings for QtWebEngine")
2108 "PyQtWebEngine is a set of Python bindings for The Qt Company's Qt
2109 WebEngine libraries. The bindings sit on top of PyQt5 and are implemented as a
2110 set of three modules. Prior to v5.12 these bindings were part of PyQt
2112 (license license:gpl3)))
2114 ;; XXX: This is useful because qtwebkit does not build reliably at this time.
2115 ;; Ultimately, it would be nicer to have a more modular set of python-pyqt-*
2116 ;; packages that could be used together.
2117 (define-public python-pyqt-without-qtwebkit
2118 (package (inherit python-pyqt)
2119 (name "python-pyqt-without-qtwebkit")
2121 (alist-delete "qtwebkit" (package-inputs python-pyqt)))))
2123 (define-public python2-pyqt
2124 (package (inherit python-pyqt)
2125 (name "python2-pyqt")
2127 `(("python-sip" ,python2-sip)
2128 ("qtbase" ,qtbase)))
2130 `(("python" ,python-2)
2131 ("python2-enum34" ,python2-enum34)
2132 ,@(alist-delete "python" (package-inputs python-pyqt))))))
2134 (define-public python2-pyqt-4
2135 (package (inherit python-pyqt)
2136 (name "python2-pyqt")
2142 (string-append "mirror://sourceforge/pyqt/PyQt4/"
2143 "PyQt-" version "/PyQt4_gpl_x11-"
2147 "1nw8r88a5g2d550yvklawlvns8gd5slw53yy688kxnsa65aln79w"))))
2149 `(("python-sip" ,python2-sip)
2151 (inputs `(("python" ,python-2)))
2153 `(#:tests? #f ; no check target
2154 #:modules ((srfi srfi-1)
2155 ,@%gnu-build-system-modules)
2157 (modify-phases %standard-phases
2159 (lambda* (#:key inputs outputs #:allow-other-keys)
2160 (let* ((out (assoc-ref outputs "out"))
2161 (bin (string-append out "/bin"))
2162 (sip (string-append out "/share/sip"))
2163 (python (assoc-ref inputs "python"))
2165 (last (string-split python #\-)))
2168 (take (string-split python-version #\.) 2)
2170 (lib (string-append out "/lib/python"
2173 (invoke "python" "configure.py"
2177 "--sipdir" sip)))))))
2178 (license (list license:gpl2 license:gpl3)))) ; choice of either license
2180 (define-public qscintilla
2186 (uri (string-append "mirror://sourceforge/pyqt/QScintilla2/"
2187 "QScintilla-" version "/QScintilla_gpl-"
2191 "1swjr786w04r514pry9pn32ivza4il1cg35s60qy39cwc175pka6"))))
2192 (build-system gnu-build-system)
2195 (modify-phases %standard-phases
2197 (lambda* (#:key outputs #:allow-other-keys)
2198 (let ((out (assoc-ref outputs "out")))
2200 (substitute* "qscintilla.pro"
2201 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
2202 (string-append out "/lib"))
2203 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
2204 (string-append out "/include"))
2205 (("\\$\\$\\[QT_INSTALL_TRANSLATIONS\\]")
2206 (string-append out "/translations"))
2207 (("\\$\\$\\[QT_INSTALL_DATA\\]")
2208 (string-append out "/lib/qt$${QT_MAJOR_VERSION}"))
2209 (("\\$\\$\\[QT_HOST_DATA\\]")
2210 (string-append out "/lib/qt$${QT_MAJOR_VERSION}")))
2211 (invoke "qmake")))))))
2212 (native-inputs `(("qtbase" ,qtbase)))
2213 (home-page "https://www.riverbankcomputing.co.uk/software/qscintilla/intro")
2214 (synopsis "Qt port of the Scintilla C++ editor control")
2215 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
2216 editor control. QScintilla includes features especially useful when editing
2217 and debugging source code. These include support for syntax styling, error
2218 indicators, code completion and call tips.")
2219 (license license:gpl3+)))
2221 (define-public python-qscintilla
2222 (package (inherit qscintilla)
2223 (name "python-qscintilla")
2226 (list "--pyqt=PyQt5"
2227 (string-append "--pyqt-sipdir="
2228 (assoc-ref %build-inputs "python-pyqt")
2230 (string-append "--qsci-incdir="
2231 (assoc-ref %build-inputs "qscintilla")
2233 (string-append "--qsci-libdir="
2234 (assoc-ref %build-inputs "qscintilla")
2237 (modify-phases %standard-phases
2239 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
2240 (let ((out (assoc-ref outputs "out"))
2241 (python (assoc-ref inputs "python")))
2243 (apply invoke "python3" "configure.py"
2245 ;; Install to the right directory
2246 (substitute* '("Makefile"
2248 (("\\$\\(INSTALL_ROOT\\)/gnu/store/[^/]+") out)
2249 (((string-append python "/lib"))
2250 (string-append out "/lib")))
2251 ;; And fix the installed.txt file
2252 (substitute* "installed.txt"
2253 (("/gnu/store/[^/]+") out)))
2256 `(("qscintilla" ,qscintilla)
2258 ("python-pyqt" ,python-pyqt)))
2259 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
2260 editor control. QScintilla includes features especially useful when editing
2261 and debugging source code. These include support for syntax styling, error
2262 indicators, code completion and call tips.
2264 This package provides the Python bindings.")))
2266 ;; PyQt only looks for modules in its own directory. It ignores environment
2267 ;; variables such as PYTHONPATH, so we need to build a union package to make
2269 (define-public python-pyqt+qscintilla
2270 (package (inherit python-pyqt)
2271 (name "python-pyqt+qscintilla")
2273 (build-system trivial-build-system)
2275 '(#:modules ((guix build union))
2277 (use-modules (ice-9 match)
2279 (match %build-inputs
2280 (((names . directories) ...)
2281 (union-build (assoc-ref %outputs "out")
2285 `(("python-pyqt" ,python-pyqt)
2286 ("python-qscintilla" ,python-qscintilla)))
2287 (synopsis "Union of PyQt and the Qscintilla extension")
2289 "This package contains the union of PyQt and the Qscintilla extension.")))
2291 (define-public qtkeychain
2299 (url "https://github.com/frankosterfeld/qtkeychain/")
2300 (commit (string-append "v" version))))
2301 (file-name (git-file-name name version))
2304 "0h4wgngn2yl35hapbjs24amkjfbzsvnna4ixfhn87snjnq5lmjbc"))))
2305 (build-system cmake-build-system)
2307 `(("pkg-config" ,pkg-config)
2308 ("qttools" ,qttools)))
2310 `(("qtbase" ,qtbase)))
2312 `(#:tests? #f ; No tests included
2314 (modify-phases %standard-phases
2315 (add-before 'configure 'set-qt-trans-dir
2317 (substitute* "CMakeLists.txt"
2318 (("\\$\\{qt_translations_dir\\}")
2319 "${CMAKE_INSTALL_PREFIX}/share/qt5/translations"))
2321 (home-page "https://github.com/frankosterfeld/qtkeychain")
2322 (synopsis "Qt API to store passwords")
2324 "QtKeychain is a Qt library to store passwords and other secret data
2325 securely. It will not store any data unencrypted unless explicitly requested.")
2326 (license license:bsd-3)))
2336 (string-append "mirror://sourceforge/qwt/qwt/"
2337 version "/qwt-" version ".tar.bz2"))
2339 (base32 "1navkcnmn0qz8kzsyqmk32d929zl72l0b580w1ica7z5559j2a8m"))))
2340 (build-system gnu-build-system)
2342 `(("qtbase" ,qtbase)
2344 ("qttools" ,qttools)))
2347 (modify-phases %standard-phases
2349 (lambda* (#:key outputs #:allow-other-keys)
2350 (let* ((out (assoc-ref outputs "out"))
2351 (docdir (string-append out "/share/doc/qwt"))
2352 (incdir (string-append out "/include/qwt"))
2353 (pluginsdir (string-append out "/lib/qt5/plugins/designer"))
2354 (featuresdir (string-append out "/lib/qt5/mkspecs/features")))
2355 (substitute* '("qwtconfig.pri")
2356 (("^(\\s*QWT_INSTALL_PREFIX)\\s*=.*" _ x)
2357 (format #f "~a = ~a\n" x out))
2358 (("^(QWT_INSTALL_DOCS)\\s*=.*" _ x)
2359 (format #f "~a = ~a\n" x docdir))
2360 (("^(QWT_INSTALL_HEADERS)\\s*=.*" _ x)
2361 (format #f "~a = ~a\n" x incdir))
2362 (("^(QWT_INSTALL_PLUGINS)\\s*=.*" _ x)
2363 (format #f "~a = ~a\n" x pluginsdir))
2364 (("^(QWT_INSTALL_FEATURES)\\s*=.*" _ x)
2365 (format #f "~a = ~a\n" x featuresdir)))
2366 (substitute* '("doc/doc.pro")
2367 ;; We'll install them in the 'install-man-pages' phase.
2368 (("^unix:doc\\.files.*") ""))
2370 (add-after 'install 'install-man-pages
2371 (lambda* (#:key outputs #:allow-other-keys)
2372 (let* ((out (assoc-ref outputs "out"))
2373 (man (string-append out "/share/man")))
2374 ;; Remove some incomplete manual pages.
2375 (for-each delete-file (find-files "doc/man/man3" "^_tmp.*"))
2377 (copy-recursively "doc/man" man)
2379 (home-page "http://qwt.sourceforge.net")
2380 (synopsis "Qt widgets for plots, scales, dials and other technical software
2383 "The Qwt library contains widgets and components which are primarily useful
2384 for technical and scientific purposes. It includes a 2-D plotting widget,
2385 different kinds of sliders, and much more.")
2388 ;; The Qwt license is LGPL2.1 with some exceptions.
2389 (license:non-copyleft "http://qwt.sourceforge.net/qwtlicense.html")
2390 ;; textengines/mathml/qwt_mml_document.{cpp,h} is dual LGPL2.1/GPL3 (either).
2391 license:lgpl2.1 license:gpl3))))
2393 (define-public qtwebkit
2396 (version "5.212.0-alpha4")
2400 (uri (string-append "https://github.com/annulen/webkit/releases/download/"
2401 "qtwebkit-" version "/qtwebkit-" version ".tar.xz"))
2404 "1rm9sjkabxna67dl7myx9d9vpdyfxfdhrk9w7b94srkkjbd2d8cw"))
2405 (patches (search-patches "qtwebkit-pbutils-include.patch"))))
2406 (build-system cmake-build-system)
2414 ("pkg-config" ,pkg-config)))
2418 ("gst-plugins-base" ,gst-plugins-base)
2419 ("libjpeg" ,libjpeg-turbo)
2421 ("libwebp" ,libwebp)
2423 ("fontconfig" ,fontconfig)
2424 ("libxrender" ,libxrender)
2426 ("qtdeclarative" ,qtdeclarative)
2427 ("qtlocation" ,qtlocation)
2428 ("qtmultimedia" ,qtmultimedia)
2429 ("qtsensors" ,qtsensors)
2430 ("qtwebchannel" ,qtwebchannel)
2431 ("libxml2" ,libxml2)
2432 ("libxslt" ,libxslt)
2434 ("libxcomposite" ,libxcomposite)))
2436 `(#:tests? #f ; no apparent tests; it might be necessary to set
2437 ; ENABLE_API_TESTS, see CMakeLists.txt
2439 ;; Parallel builds fail due to a race condition:
2440 ;; <https://bugs.gnu.org/34062>.
2441 #:parallel-build? #f
2443 #:configure-flags (list ;"-DENABLE_API_TESTS=TRUE"
2445 "-DUSE_LIBHYPHEN=OFF"
2446 "-DUSE_SYSTEM_MALLOC=ON"
2447 ;; XXX: relative dir installs to build dir?
2448 (string-append "-DECM_MKSPECS_INSTALL_DIR="
2449 %output "/lib/qt5/mkspecs/modules")
2450 ;; Sacrifice a little speed in order to link
2451 ;; libraries and test executables in a
2452 ;; reasonable amount of memory.
2453 "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,--no-keep-memory"
2454 "-DCMAKE_EXE_LINKER_FLAGS=-Wl,--no-keep-memory")))
2455 (home-page "https://www.webkit.org")
2456 (synopsis "Web browser engine and classes to render and interact with web
2458 (description "QtWebKit provides a Web browser engine that makes it easy to
2459 embed content from the World Wide Web into your Qt application. At the same
2460 time Web content can be enhanced with native controls.")
2461 ;; Building QtWebKit takes around 13 hours on an AArch64 machine. Give some
2462 ;; room for slower or busy hardware.
2463 (properties '((timeout . 64800))) ;18 hours
2465 ;; XXX: This consumes too much RAM to successfully build on AArch64 (e.g.,
2466 ;; SoftIron OverDrive with 8 GiB of RAM), so instead of wasting resources,
2467 ;; disable it on non-Intel platforms.
2468 (supported-systems '("x86_64-linux" "i686-linux"))
2470 (license license:lgpl2.1+)))
2472 (define-public dotherside
2480 (url "https://github.com/filcuc/DOtherSide")
2481 (commit (string-append "v" version))))
2482 (file-name (git-file-name name version))
2485 "09fz6v8rp28997f235yaifj8p4vvsyv45knc1iivgdvx7msgcd0m"))))
2486 (build-system cmake-build-system)
2488 `(("qttools" ,qttools)))
2490 `(("qtbase" ,qtbase)
2491 ("qtdeclarative" ,qtdeclarative)))
2492 (home-page "https://filcuc.github.io/DOtherSide/index.html")
2493 (synopsis "C language library for creating bindings for the Qt QML language")
2495 "DOtherSide is a C language library for creating bindings for the
2496 QT QML language. The following features are implementable from
2499 @item Creating custom QObject
2500 @item Creating custom QAbstractListModels
2501 @item Creating custom properties, signals and slots
2502 @item Creating from QML QObject defined in the binded language
2503 @item Creating from Singleton QML QObject defined in the binded language
2505 (license license:lgpl3))) ;version 3 only (+ exception)
2507 ;; There have been no public releases yet.
2508 (define-public qtcolorwidgets
2509 (let ((commit "a95f72e935fe9e046061a1d1c3930cbfbcb533e0")
2512 (name "qtcolorwidgets")
2513 (version (git-version "0" revision commit))
2517 (url "https://gitlab.com/mattia.basaglia/Qt-Color-Widgets")
2519 (file-name (git-file-name name version))
2522 "0dkiwlqh2gwhlp78c1fmchj3shl4p9inspcl96ya5aa8mn6kydy8"))))
2523 (build-system cmake-build-system)
2524 (arguments `(#:tests? #f)) ; There are no tests
2526 `(("qttools" ,qttools)))
2528 `(("qtbase" ,qtbase)))
2529 (home-page "https://gitlab.com/mattia.basaglia/Qt-Color-Widgets")
2530 (synopsis "Color management widgets")
2531 (description "QtColorWidgets provides a Qt color dialog that is more
2532 user-friendly than the default @code{QColorDialog} and several other
2533 color-related widgets.")
2534 ;; Includes a license exception for combining with GPL2 code.
2535 (license license:lgpl3+))))
2537 (define-public python-shiboken-2
2539 (name "python-shiboken-2")
2543 (uri (string-append "https://download.qt.io/official_releases"
2544 "/QtForPython/pyside2/PySide2-" version
2545 "-src/pyside-setup-everywhere-src-"
2549 "1n45l6xxyxs6cfp2l4rp8qs1c2fyfwyrdxa4qcpwfsqsi51rydsk"))))
2550 (build-system cmake-build-system)
2552 `(("clang-toolchain" ,clang-toolchain-6)
2553 ("libxml2" ,libxml2)
2554 ("libxslt" ,libxslt)
2555 ("python-wrapper" ,python-wrapper)
2557 ("qtxmlpatterns" ,qtxmlpatterns)))
2560 ;; FIXME: Building tests fails
2561 #:configure-flags '("-DBUILD_TESTS=off")
2563 (modify-phases %standard-phases
2564 (add-after 'unpack 'use-shiboken-dir-only
2565 (lambda _ (chdir "sources/shiboken2") #t))
2566 (add-before 'configure 'make-files-writable-and-update-timestamps
2568 ;; The build scripts need to modify some files in
2569 ;; the read-only source directory, and also attempts
2570 ;; to create Zip files which fails because the Zip
2571 ;; format does not support timestamps before 1980.
2572 (let ((circa-1980 (* 10 366 24 60 60)))
2573 (for-each (lambda (file)
2574 (make-file-writable file)
2575 (utime file circa-1980 circa-1980))
2578 (add-before 'configure 'set-build-env
2579 (lambda* (#:key inputs #:allow-other-keys)
2580 (let ((llvm (assoc-ref inputs "clang-toolchain")))
2581 (setenv "CLANG_INSTALL_DIR" llvm)
2583 (home-page "https://wiki.qt.io/Qt_for_Python")
2585 "Shiboken generates bindings for C++ libraries using CPython source code")
2587 "Shiboken generates bindings for C++ libraries using CPython source code")
2590 ;; The main code is GPL3 or LGPL3.
2591 ;; Examples are BSD-3.
2596 (define-public python-pyside-2
2598 (name "python-pyside-2")
2599 (version (package-version python-shiboken-2))
2600 (source (package-source python-shiboken-2))
2601 (build-system cmake-build-system)
2603 `(("libxml2" ,libxml2)
2604 ("libxslt" ,libxslt)
2605 ("clang-toolchain" ,clang-toolchain-6)
2607 ("qtdatavis3d" ,qtdatavis3d)
2608 ("qtlocation" ,qtlocation)
2609 ("qtmultimedia" ,qtmultimedia)
2610 ("qtquickcontrols" ,qtquickcontrols)
2611 ("qtscript" ,qtscript)
2612 ("qtscxml" ,qtscxml)
2613 ("qtsensors" ,qtsensors)
2614 ("qtspeech" ,qtspeech)
2616 ("qtwebchannel" ,qtwebchannel)
2617 ("qtwebsockets" ,qtwebsockets)
2618 ("qtx11extras" ,qtx11extras)
2619 ("qtxmlpatterns" ,qtxmlpatterns)))
2621 `(("cmake" ,cmake-minimal)
2622 ("python-shiboken-2" ,python-shiboken-2)
2623 ("python" ,python-wrapper)
2624 ("qttools" ,qttools)
2628 ;; FIXME: Building tests fail.
2630 (list "-DBUILD_TESTS=FALSE"
2631 (string-append "-DPYTHON_EXECUTABLE="
2632 (assoc-ref %build-inputs "python")
2635 (modify-phases %standard-phases
2636 (add-after 'unpack 'go-to-source-dir
2637 (lambda _ (chdir "sources/pyside2") #t))
2638 (add-before 'configure 'set-clang-dir
2639 (lambda* (#:key inputs #:allow-other-keys)
2640 (let ((clang (assoc-ref inputs "clang-toolchain")))
2641 (setenv "CLANG_INSTALL_DIR" clang)
2643 (home-page "https://wiki.qt.io/Qt_for_Python")
2645 "The Qt for Python product enables the use of Qt5 APIs in Python applications")
2647 "The Qt for Python product enables the use of Qt5 APIs in Python
2648 applications. It lets Python developers utilize the full potential of Qt,
2649 using the PySide2 module. The PySide2 module provides access to the
2650 individual Qt modules such as QtCore, QtGui,and so on. Qt for Python also
2651 comes with the Shiboken2 CPython binding code generator, which can be used to
2652 generate Python bindings for your C or C++ code.")
2656 ;; this file may be used under the terms of the GNU General
2657 ;; Public License version 2.0 or (at your option) the GNU
2658 ;; General Public license version 3 or any later version
2659 ;; approved by the KDE Free Qt Foundation.
2660 ;; Thus, it is currently v2 or v3, but no "+".
2664 (define-public python-pyside-2-tools
2666 (name "python-pyside-2-tools")
2667 (version (package-version python-shiboken-2))
2668 (source (package-source python-shiboken-2))
2669 (build-system cmake-build-system)
2671 `(("python-pyside-2" ,python-pyside-2)
2672 ("python-shiboken-2" ,python-shiboken-2)
2673 ("qtbase" ,qtbase)))
2675 `(("python" ,python-wrapper)))
2679 (list "-DBUILD_TESTS=off"
2680 (string-append "-DPYTHON_EXECUTABLE="
2681 (assoc-ref %build-inputs "python")
2683 #:phases (modify-phases %standard-phases
2684 (add-after 'unpack 'go-to-source-dir
2685 (lambda _ (chdir "sources/pyside2-tools") #t)))))
2686 (home-page "https://wiki.qt.io/Qt_for_Python")
2688 "Contains command line tools for PySide2")
2690 "Contains lupdate, rcc and uic tools for PySide2")
2691 (license license:gpl2)))