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, 2021 Ludovic Courtès <ludo@gnu.org>
5 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
7 ;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
8 ;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2017 Quiliro <quiliro@fsfla.org>
10 ;;; Copyright © 2017, 2018, 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018, 2020, 2022 Nicolas Goaziou <mail@nicolasgoaziou.fr>
12 ;;; Copyright © 2018 Hartmut Goebel <h.goebel@crazy-compilers.com>
13 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
14 ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
15 ;;; Copyright © 2018 John Soo <jsoo1@asu.edu>
16 ;;; Copyright © 2020 Mike Rosset <mike.rosset@gmail.com>
17 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
18 ;;; Copyright © 2020 Kei Kebreau <kkebreau@posteo.net>
19 ;;; Copyright © 2020 TomZ <tomz@freedommail.ch>
20 ;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
21 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
22 ;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
23 ;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
24 ;;; Copyright © 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
25 ;;; Copyright © 2021 Nicolò Balzarotti <nicolo@nixo.xyz>
26 ;;; Copyright © 2022 Foo Chuan Wei <chuanwei.foo@hotmail.com>
28 ;;; This file is part of GNU Guix.
30 ;;; GNU Guix is free software; you can redistribute it and/or modify it
31 ;;; under the terms of the GNU General Public License as published by
32 ;;; the Free Software Foundation; either version 3 of the License, or (at
33 ;;; your option) any later version.
35 ;;; GNU Guix is distributed in the hope that it will be useful, but
36 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
37 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38 ;;; GNU General Public License for more details.
40 ;;; You should have received a copy of the GNU General Public License
41 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
43 (define-module (gnu packages qt)
44 #:use-module ((guix licenses) #:prefix license:)
45 #:use-module (guix packages)
46 #:use-module (guix download)
47 #:use-module (guix git-download)
48 #:use-module (guix build-system cmake)
49 #:use-module (guix build-system gnu)
50 #:use-module (guix build-system trivial)
51 #:use-module (guix build-system python)
52 #:use-module (guix build-system qt)
53 #:use-module (guix gexp)
54 #:use-module (guix packages)
55 #:use-module (guix deprecation)
56 #:use-module (guix utils)
57 #:use-module (gnu packages)
58 #:use-module (gnu packages bash)
59 #:use-module (gnu packages base)
60 #:use-module (gnu packages bison)
61 #:use-module (gnu packages cmake)
62 #:use-module (gnu packages compression)
63 #:use-module (gnu packages cups)
64 #:use-module (gnu packages curl)
65 #:use-module (gnu packages databases)
66 #:use-module (gnu packages documentation)
67 #:use-module (gnu packages enchant)
68 #:use-module (gnu packages fontutils)
69 #:use-module (gnu packages flex)
70 #:use-module (gnu packages freedesktop)
71 #:use-module (gnu packages gcc)
72 #:use-module (gnu packages ghostscript)
73 #:use-module (gnu packages gl)
74 #:use-module (gnu packages glib)
75 #:use-module (gnu packages gnome)
76 #:use-module (gnu packages gnupg)
77 #:use-module (gnu packages gperf)
78 #:use-module (gnu packages graphics)
79 #:use-module (gnu packages gstreamer)
80 #:use-module (gnu packages gtk)
81 #:use-module (gnu packages icu4c)
82 #:use-module (gnu packages image)
83 #:use-module (gnu packages kde-frameworks)
84 #:use-module (gnu packages libevent)
85 #:use-module (gnu packages linux)
86 #:use-module (gnu packages llvm)
87 #:use-module (gnu packages maths)
88 #:use-module (gnu packages markup)
89 #:use-module (gnu packages networking)
90 #:use-module (gnu packages ninja)
91 #:use-module (gnu packages node)
92 #:use-module (gnu packages nss)
93 #:use-module (gnu packages pciutils)
94 #:use-module (gnu packages pcre)
95 #:use-module (gnu packages perl)
96 #:use-module (gnu packages pkg-config)
97 #:use-module (gnu packages pulseaudio)
98 #:use-module (gnu packages protobuf)
99 #:use-module (gnu packages python)
100 #:use-module (gnu packages python-build)
101 #:use-module (gnu packages python-xyz)
102 #:use-module (gnu packages python-web)
103 #:use-module (gnu packages regex)
104 #:use-module (gnu packages ruby)
105 #:use-module (gnu packages sdl)
106 #:use-module (gnu packages serialization)
107 #:use-module (gnu packages sqlite)
108 #:use-module (gnu packages telephony)
109 #:use-module (gnu packages tls)
110 #:use-module (gnu packages valgrind)
111 #:use-module (gnu packages video)
112 #:use-module (gnu packages vulkan)
113 #:use-module (gnu packages xdisorg)
114 #:use-module (gnu packages xiph)
115 #:use-module (gnu packages xorg)
116 #:use-module (gnu packages xml)
117 #:use-module (srfi srfi-1))
120 (let ((commit "75fb3b6bbd5c6a5a8fc35e08a6efbfb588ed546a")
124 (version (git-version "0" revision commit))
130 (url "https://github.com/Ri0n/qite")
132 (file-name (git-file-name name version))
134 (base32 "0jmmgy9pvk9hwwph1nwy7hxhczy8drhl4ymhnjjn6yx7bckssvsq"))))
135 (build-system qt-build-system)
137 `(#:tests? #f ; no target
139 (modify-phases %standard-phases
140 (add-after 'unpack 'chdir
145 (list qtbase-5 qtmultimedia-5))
146 (home-page "https://github.com/Ri0n/qite/")
147 (synopsis "Qt Interactive Text Elements")
148 (description "Qite manages interactive elements on QTextEdit.")
149 (license license:asl2.0))))
159 (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
161 (base32 "14742vs32m98nbfb5mad0i8ciff5f45gfcb5v03p4hh2dvhhqgfn"))))
162 (build-system qt-build-system)
165 #:tests? #f ; No target
167 #~(modify-phases %standard-phases
168 (add-after 'unpack 'patch
170 (substitute* '("src/qt5ct-qtplugin/CMakeLists.txt"
171 "src/qt5ct-style/CMakeLists.txt")
172 (("\\$\\{PLUGINDIR\\}")
173 (string-append #$output "/lib/qt5/plugins"))))))))
178 (synopsis "Qt5 Configuration Tool")
179 (description "Qt5CT is a program that allows users to configure Qt5
180 settings (such as icons, themes, and fonts) in desktop environments or
181 window managers, that don't provide Qt integration by themselves.")
182 (home-page "https://qt5ct.sourceforge.io/")
183 (license license:bsd-2)))
185 (define-public materialdecoration
186 (let ((commit "6a5de23f2e5162fbee39d16f938473ff970a2ec0")
189 (name "materialdecoration")
191 (git-version "1.1.0" revision commit))
197 (url "https://github.com/lirios/materialdecoration.git")
200 (git-file-name name version))
202 (base32 "1zdrcb39fhhmn76w8anv1dnspz26pdl6izmj1mlm02aza4y8ffp4"))
203 (modules '((guix build utils)
208 (delete-file-recursively "cmake/3rdparty")))))
209 (build-system qt-build-system)
211 `(#:tests? #f ; No target
214 (string-append "-DCMAKE_CXX_FLAGS=-I"
215 #$(this-package-input "qtbase")
216 "/include/qt5/QtXkbCommonSupport/"
217 #$(package-version qtbase-5)))))
219 (list cmake-shared extra-cmake-modules pkg-config))
221 `(("qtbase" ,qtbase-5)
222 ("qtwayland" ,qtwayland)
224 ("xkbcommon" ,libxkbcommon)))
225 (synopsis "Material Decoration for Qt")
226 (description "MaterialDecoration is a client-side decoration for Qt
227 applications on Wayland.")
228 (home-page "https://github.com/lirios/materialdecoration")
229 (license license:lgpl3+))))
231 (define-public grantlee
239 (url "https://github.com/steveire/grantlee")
240 (commit (string-append "v" version))))
241 (file-name (git-file-name name version))
243 (base32 "02dyqxjyxiqxrlz5g7v9ly8f095vs3iha39l75q6s8axs36y01lq"))))
245 ;; Optional: lcov and cccc, both are for code coverage
248 (list qtbase-5 qtdeclarative-5 qtscript))
249 (build-system cmake-build-system)
252 (modify-phases %standard-phases
253 (add-before 'check 'check-setup
255 ;; make Qt render "offscreen", required for tests
256 (setenv "QT_QPA_PLATFORM" "offscreen")
258 (home-page "https://github.com/steveire/grantlee")
259 (synopsis "Libraries for text templating with Qt")
260 (description "Grantlee Templates can be used for theming and generation of
261 other text such as code. The syntax uses the syntax of the Django template
262 system, and the core design of Django is reused in Grantlee.")
263 (license license:lgpl2.1+)))
265 (define (qt5-urls component version)
266 "Return a list of URLs for VERSION of the Qt5 COMPONENT."
267 ;; We can't use a mirror:// scheme because these URLs are not exact copies:
268 ;; the layout differs between them.
269 (list (string-append "https://download.qt.io/official_releases/qt/"
270 (version-major+minor version) "/" version
271 "/submodules/" component "-everywhere-src-"
273 (string-append "https://download.qt.io/archive/qt/"
274 (version-major+minor version) "/" version
275 "/submodules/" component "-everywhere-src-"
277 (let ((directory (string-append "qt5" (string-drop component 2))))
278 (string-append "http://sources.buildroot.net/" directory "/"
279 component "-everywhere-src-" version ".tar.xz"))
280 (string-append "https://distfiles.macports.org/qt5/"
281 component "-everywhere-src-" version ".tar.xz")))
283 (define-public qtbase-5
289 (uri (qt5-urls name version))
292 "1y70libf2x52lpbqvhz10lpk7nyl1ajjwzjxly9pjdpfj4jsv7wh"))
293 ;; Use TZDIR to avoid depending on package "tzdata".
294 (patches (search-patches "qtbase-use-TZDIR.patch"
295 "qtbase-moc-ignore-gcc-macro.patch"
296 "qtbase-absolute-runpath.patch"))
297 (modules '((guix build utils)))
299 ;; corelib uses bundled harfbuzz, md4, md5, sha3
301 (with-directory-excursion "src/3rdparty"
302 (for-each delete-file-recursively
303 (list "double-conversion" "freetype" "harfbuzz-ng"
304 "libpng" "libjpeg" "pcre2" "sqlite" "xcb"
306 (build-system gnu-build-system)
307 (outputs '("out" "debug"))
310 ;; Use which the package, not the function
311 (@ (gnu packages base) which)))
313 `(("alsa-lib" ,alsa-lib)
316 ("double-conversion" ,double-conversion)
319 ("fontconfig" ,fontconfig)
320 ("freetype" ,freetype)
322 ("gtk+" ,gtk+) ;for GTK theme support
323 ("harfbuzz" ,harfbuzz)
325 ("libinput" ,libinput-minimal)
326 ("libjpeg" ,libjpeg-turbo)
330 ("libxcomposite" ,libxcomposite)
331 ("libxcursor" ,libxcursor)
332 ("libxfixes" ,libxfixes)
334 ("libxinerama" ,libxinerama)
335 ("libxkbcommon" ,libxkbcommon)
337 ("libxrandr" ,libxrandr)
338 ("libxrender" ,libxrender)
342 ("mariadb-dev" ,mariadb "dev")
346 ;; TODO: Switch to 'postgres' in the next rebuild cycle.
347 ("postgresql" ,postgresql-13)
348 ("pulseaudio" ,pulseaudio)
350 ("unixodbc" ,unixodbc)
351 ("xcb-util" ,xcb-util)
352 ("xcb-util-image" ,xcb-util-image)
353 ("xcb-util-keysyms" ,xcb-util-keysyms)
354 ("xcb-util-renderutil" ,xcb-util-renderutil)
355 ("xcb-util-wm" ,xcb-util-wm)
356 ("xdg-utils" ,xdg-utils)
369 (let ((out (assoc-ref %outputs "out")))
372 "-docdir" (string-append out "/share/doc/qt5")
373 "-headerdir" (string-append out "/include/qt5")
374 "-archdatadir" (string-append out "/lib/qt5")
375 "-datadir" (string-append out "/share/qt5")
376 "-examplesdir" (string-append
377 out "/share/doc/qt5/examples")
381 ;; Later stripped into the :debug output.
384 ;; These features require higher versions of Linux than the
385 ;; minimum version of the glibc. See
386 ;; src/corelib/global/minimum-linux_p.h. By disabling these
387 ;; features Qt5 applications can be used on the oldest
388 ;; kernels that the glibc supports, including the RHEL6
389 ;; (2.6.32) and RHEL7 (3.10) kernels.
390 "-no-feature-getentropy" ; requires Linux 3.17
391 "-no-feature-renameat2" ; requires Linux 3.16
393 ;; Do not build examples; if desired, these could go
394 ;; into a separate output, but for the time being, we
395 ;; prefer to save the space and build time.
396 "-no-compile-examples"
397 ;; Most "-system-..." are automatic, but some use
398 ;; the bundled copy by default.
402 ;; explicitly link with openssl instead of dlopening it
404 ;; explicitly link with dbus instead of dlopening it
406 ;; don't use the precompiled headers
408 ;; drop special machine instructions that do not have
410 ,@(if (string-prefix? "x86_64"
411 (or (%current-target-system)
418 (modify-phases %standard-phases
419 (add-after 'configure 'patch-bin-sh
421 (substitute* '("config.status"
423 "mkspecs/features/qt_functions.prf"
424 "qmake/library/qmakebuiltins.cpp")
425 (("/bin/sh") (which "sh")))))
426 (add-after 'configure 'patch-xdg-open
428 (substitute* '("src/platformsupport/services/genericunix/qgenericunixservices.cpp")
429 (("^.*const char \\*browsers.*$" all)
430 (string-append "*browser = QStringLiteral(\""
432 "\"); return true; \n" all)))))
434 ;; Overridden to not pass "--enable-fast-install", which makes the
435 ;; configure process fail.
436 (lambda* (#:key outputs configure-flags #:allow-other-keys)
437 (let ((out (assoc-ref outputs "out")))
438 (substitute* "configure"
439 (("/bin/pwd") (which "pwd")))
440 (substitute* "src/corelib/global/global.pri"
441 (("/bin/ls") (which "ls")))
442 ;; The configuration files for other Qt5 packages are searched
443 ;; through a call to "find_package" in Qt5Config.cmake, which
444 ;; disables the use of CMAKE_PREFIX_PATH via the parameter
445 ;; "NO_DEFAULT_PATH". Re-enable it so that the different
446 ;; components can be installed in different places.
447 (substitute* (find-files "." ".*\\.cmake")
448 (("NO_DEFAULT_PATH") ""))
449 (format #t "build directory: ~s~%" (getcwd))
450 (format #t "configure flags: ~s~%" configure-flags)
451 (apply invoke "./configure" configure-flags))))
452 (add-after 'install 'patch-mkspecs
453 (lambda* (#:key outputs #:allow-other-keys)
454 (let* ((out (assoc-ref outputs "out"))
455 (archdata (string-append out "/lib/qt5"))
456 (mkspecs (string-append archdata "/mkspecs"))
457 (qt_config.prf (string-append
458 mkspecs "/features/qt_config.prf")))
459 ;; For each Qt module, let `qmake' uses search paths in the
460 ;; module directory instead of all in QT_INSTALL_PREFIX.
461 (substitute* qt_config.prf
462 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
463 "$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt5))")
464 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
465 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
466 (("\\$\\$\\[QT_HOST_LIBS\\]")
467 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
468 (("\\$\\$\\[QT_INSTALL_BINS\\]")
469 "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))"))
471 ;; Searches Qt tools in the current PATH instead of QT_HOST_BINS.
472 (substitute* (string-append mkspecs "/features/qt_functions.prf")
473 (("cmd = \\$\\$\\[QT_HOST_BINS\\]/\\$\\$2")
474 "cmd = $$system(which $${2}.pl 2>/dev/null || which $${2})"))
476 ;; Resolve qmake spec files within qtbase by absolute paths.
479 (string-append mkspecs "/features/" file))
480 '("device_config.prf" "moc.prf" "qt_build_config.prf"
481 "qt_config.prf" "winrt/package_manifest.prf"))
482 (("\\$\\$\\[QT_HOST_DATA/get\\]") archdata)
483 (("\\$\\$\\[QT_HOST_DATA/src\\]") archdata)))))
484 (add-after 'patch-mkspecs 'patch-prl-files
485 (lambda* (#:key outputs #:allow-other-keys)
486 (let ((out (assoc-ref outputs "out")))
487 ;; Insert absolute references to the qtbase libraries because
488 ;; QT_INSTALL_LIBS does not always resolve correctly, depending
489 ;; on context. See <https://bugs.gnu.org/38405>
490 (substitute* (find-files (string-append out "/lib") "\\.prl$")
491 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
492 (string-append out "/lib"))))))
493 (add-after 'unpack 'patch-paths
494 ;; Use the absolute paths for dynamically loaded libs, otherwise
495 ;; the lib will be searched in LD_LIBRARY_PATH which typically is
497 (lambda* (#:key inputs #:allow-other-keys)
499 (let ((glibc (assoc-ref inputs ,(if (%current-target-system)
500 "cross-libc" "libc"))))
501 (substitute* '("src/network/kernel/qdnslookup_unix.cpp"
502 "src/network/kernel/qhostinfo_unix.cpp")
503 (("^\\s*(lib.setFileName\\(QLatin1String\\(\")(resolv\"\\)\\);)" _ a b)
504 (string-append a glibc "/lib/lib" b))))
506 (substitute* "src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp"
507 (("^\\s*(QLibrary lib\\(QLatin1String\\(\")(GL\"\\)\\);)" _ a b)
508 (string-append a (assoc-ref inputs "mesa") "/lib/lib" b)))
510 (substitute* "src/plugins/platforms/xcb/qxcbcursor.cpp"
511 (("^\\s*(QLibrary xcursorLib\\(QLatin1String\\(\")(Xcursor\"\\), 1\\);)" _ a b)
512 (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))
513 (("^\\s*(xcursorLib.setFileName\\(QLatin1String\\(\")(Xcursor\"\\)\\);)" _ a b)
514 (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))))))))
516 (list (search-path-specification
517 (variable "QMAKEPATH")
518 (files '("lib/qt5")))
519 (search-path-specification
520 (variable "QML2_IMPORT_PATH")
521 (files '("lib/qt5/qml")))
522 (search-path-specification
523 (variable "QT_PLUGIN_PATH")
524 (files '("lib/qt5/plugins")))
525 (search-path-specification
526 (variable "XDG_DATA_DIRS")
528 (search-path-specification
529 (variable "XDG_CONFIG_DIRS")
530 (files '("etc/xdg")))))
531 (home-page "https://www.qt.io/")
532 (synopsis "Cross-platform GUI library")
533 (description "Qt is a cross-platform application and UI framework for
534 developers using C++ or QML, a CSS & JavaScript like language.")
535 (license (list license:lgpl2.1 license:lgpl3))))
537 (define-public qtbase
538 (package/inherit qtbase-5
542 (inherit (package-source qtbase-5))
543 (uri (qt5-urls name version))
546 "00sfya41ihqb0zwg6wf1kiy02iymj6mk584hhk2c4s94khfl4r0a"))
547 (modules '((guix build utils)))
549 ;; corelib uses bundled harfbuzz, md4, md5, sha3
550 '(with-directory-excursion "src/3rdparty"
551 (for-each delete-file-recursively
552 ;; The bundled pcre2 copy is kept, as its headers
553 ;; are required by some internal bootstrap target
554 ;; used for the tools.
555 (list "double-conversion" "freetype" "harfbuzz-ng"
556 "libpng" "libjpeg" "sqlite" "xcb" "zlib"))))))
557 (build-system cmake-build-system)
559 (substitute-keyword-arguments (package-arguments qtbase-5)
560 ((#:configure-flags _ ''())
561 `(let ((out (assoc-ref %outputs "out")))
562 (list "-GNinja" ;the build fails otherwise
563 "-DQT_BUILD_TESTS=ON"
564 (string-append "-DINSTALL_ARCHDATADIR=" out "/lib/qt6")
565 (string-append "-DINSTALL_DATADIR=" out "/share/qt6")
566 (string-append "-DINSTALL_DOCDIR=" out "/share/doc/qt6")
567 (string-append "-DINSTALL_MKSPECSDIR=" out "/lib/qt6/mkspecs")
568 (string-append "-DINSTALL_EXAMPLESDIR=" out
569 "/share/doc/qt6/examples")
570 (string-append "-DINSTALL_INCLUDEDIR=" out "/include/qt6")
571 ;; Link with DBus and OpenSSL so they don't get dlopen'ed.
572 "-DINPUT_dbus=linked"
573 "-DINPUT_openssl=linked"
574 ;; These features require higher versions of Linux than the
575 ;; minimum version of the glibc. See
576 ;; src/corelib/global/minimum-linux_p.h. By disabling these
577 ;; features Qt applications can be used on the oldest kernels
578 ;; that the glibc supports, including the RHEL6 (2.6.32) and
579 ;; RHEL7 (3.10) kernels.
580 "-DFEATURE_getentropy=OFF" ; requires Linux 3.17
581 "-DFEATURE_renameat2=OFF" ; requires Linux 3.16
582 ;; Most system libraries are used by default, except in some
583 ;; cases such as for those below.
584 "-DFEATURE_system_pcre2=ON"
585 "-DFEATURE_system_sqlite=ON"
586 "-DFEATURE_system_xcb_xinput=ON"
587 ;; Don't use the precompiled headers.
588 "-DBUILD_WITH_PCH=OFF"
589 ;; Drop special machine instructions that do not have runtime
591 ,@(if (string-prefix? "x86_64"
592 (or (%current-target-system)
594 '() ;implicitly enabled
595 '("-DFEATURE_sse2=OFF"
597 "-DFEATURE_ssse3=OFF"
598 "-DFEATURE_sse4_1=OFF"
599 "-DFEATURE_sse4_2=OFF"))
600 "-DFEATURE_mips_dsp=OFF"
601 "-DFEATURE_mips_dspr2=OFF")))
603 #~(modify-phases #$phases
604 (add-after 'unpack 'honor-CMAKE_PREFIX_PATH
606 ;; The configuration files for other Qt packages are searched
607 ;; through a call to "find_package" in Qt5Config.cmake, which
608 ;; disables the use of CMAKE_PREFIX_PATH via the parameter
609 ;; "NO_DEFAULT_PATH". Re-enable it so that the different
610 ;; components can be installed in different places.
611 (substitute* (find-files "." "\\.cmake(\\.in)?$")
612 (("\\bNO_DEFAULT_PATH\\b") ""))
613 ;; Because Qt goes against the grain of CMake and set
614 ;; NO_DEFAULT_PATH, it needs to invent yet another variable
615 ;; to do what CMAKE_PREFIX_PATH could have done:
616 ;; QT_ADDITIONAL_PACKAGES_PREFIX_PATH. Since we patch out
617 ;; the NO_DEFAULT_PATH, we can set the default value of
618 ;; QT_ADDITIONAL_PACKAGES_PREFIX_PATH to that of
619 ;; CMAKE_PREFIX_PATH to ensure tools such as
620 ;; 'qmlimportscanner' from qtdeclarative work out of the
622 (substitute* "cmake/QtConfig.cmake.in"
623 (("(set\\(QT_ADDITIONAL_PACKAGES_PREFIX_PATH )\"\"" _ head)
624 (string-append head "\"$ENV{CMAKE_PREFIX_PATH}\"")))))
625 (delete 'patch-bin-sh)
626 (delete 'patch-xdg-open)
627 (add-after 'patch-paths 'patch-more-paths
628 (lambda* (#:key inputs #:allow-other-keys)
629 (substitute* (find-files "bin" "\\.in$")
631 (search-input-file inputs "bin/pwd")))
632 (substitute* "src/gui/platform/unix/qgenericunixservices.cpp"
634 (format #f "~s" (search-input-file inputs "bin/xdg-open"))))
635 (substitute* '("mkspecs/features/qt_functions.prf"
636 "qmake/library/qmakebuiltins.cpp")
638 (search-input-file inputs "bin/bash")))
639 (substitute* "src/corelib/CMakeLists.txt"
641 (search-input-file inputs "bin/ls")))))
643 (assoc-ref %standard-phases 'configure))
645 (lambda* (#:key parallel-build? #:allow-other-keys)
646 (apply invoke "cmake" "--build" "."
648 `("--parallel" ,(number->string (parallel-job-count)))
650 (delete 'check) ;move after patch-prl-files
651 (add-after 'patch-prl-files 'check
652 (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
654 ;; The tests expect to find the modules provided by this
655 ;; package; extend the environment variables needed to do so.
656 (setenv "CMAKE_PREFIX_PATH"
657 (string-append #$output
658 ":" (getenv "CMAKE_PREFIX_PATH")))
659 (setenv "QMAKEPATH" (string-append #$output "/lib/qt6"))
660 (setenv "QML2_IMPORT_PATH"
661 (string-append #$output "/lib/qt6/qml"))
662 (setenv "QT_PLUGIN_PATH"
663 (string-append #$output "/lib/qt6/plugins"))
664 (setenv "QT_QPA_PLATFORM" "offscreen")
665 ;; Skip tests known to fail on GNU/Linux, in a CI context or
666 ;; due to bitness (see: https://code.qt.io/cgit/qt/qtbase.git
667 ;; /tree/src/testlib/qtestblacklist.cpp).
668 (setenv "QTEST_ENVIRONMENT" "linux ci 32bit")
669 (setenv "HOME" "/tmp") ;some tests require a writable HOME
671 "xvfb-run" "ctest" "--output-on-failure"
672 "-j" (if parallel-tests?
673 (number->string (parallel-job-count))
675 "-E" ;disable problematic tests
680 ;; The 'tst_moc' test fails with "'fi.exists()' returned FALSE".
682 ;; The 'test_rcc' test fails on a comparison:
684 ;; 0x0,0x0,0x0,0x0,0x0,0x0,0x3,0xe8,
686 ;; 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
689 ;; The 'tst_qtemporarydir' and 'tst_qtemporaryfile'
690 ;; tests depend on '/home' not being writable.
693 ;; The 'tst_qdir' compares two directories which are
694 ;; unexpectedly different when inside the build
697 ;; This checks the last modified time of '/', and fails
698 ;; because Epoch 0 is considered to be invalid.
699 "tst_qresourceengine"
700 ;; The 'tst_qfilesystemwatcher' installs a watcher on
701 ;; '/home', which doesn't exist in the build container.
702 "tst_qfilesystemwatcher"
703 ;; The 'mockplugins' test fail following error: "Unknown
704 ;; platform linux-g++", and the other plugin tests
707 "test_plugin_flavor.*"
708 ;; The 'test_import_plugins' fails with "Could NOT find
710 "test_import_plugins"
711 ;; The 'tst_QTimeZone::systemZone' validates the
712 ;; currently set timezone and fails.
714 ;; The 'tst_qdatetime' fails with:
715 ;; FAIL! : tst_QDateTime::offsetFromUtc() Compared values are not the same
716 ;; Actual (dt5.offsetFromUtc()): 0
717 ;; Expected (46800) : 46800
719 ;; The 'tst_QSettings::fromFile' assumes the data
720 ;; location to be relative to the root directory and
723 ;; The 'tst_qaddpreroutine',
724 ;; 'test_generating_cpp_exports' and
725 ;; 'test_static_resources' tests fail with: "Unknown
726 ;; platform linux-g++.
728 "test_generating_cpp_exports"
729 "test_static_resources"
730 ;; The 'tst_qfile' fails since there is no /home in the
733 ;; The 'tst_QGlyphRun::mixedScripts' test fails with:
734 ;; Actual (glyphRuns.size()): 1
737 ;; The 'tst_qx11info' test fails with "Internal error:
738 ;; QPA plugin doesn't implement generatePeekerId",
739 ;; likely requires a real display.
741 ;; The 'tst_qgraphicswidget' test fails because "This
742 ;; plugin does not support propagateSizeHints".
743 "tst_qgraphicswidget"
744 ;; The 'tst_qdnslookup' test requires networking.
746 ;; The 'tst_qcompleter' and 'tst_QFiledialog::completer'
747 ;; attempt to complete paths they assume exist, such as
748 ;; "/home", "/etc" or "/root" and fail.
750 "tst_qfiledialog") "|")
754 (invoke "cmake" "--install" ".")))
755 (replace 'patch-mkspecs
756 (lambda* (#:key outputs #:allow-other-keys)
757 (let* ((archdata (search-input-directory outputs "lib/qt6"))
758 (mkspecs (search-input-directory outputs
762 outputs "lib/qt6/mkspecs/features/qt_config.prf"))
765 outputs "lib/qt6/mkspecs/features/qt_functions.prf")))
766 ;; For each Qt module, let `qmake' uses search paths in the
767 ;; module directory instead of all in QT_INSTALL_PREFIX.
768 (substitute* qt_config.prf
769 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
770 "$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt6))")
771 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
772 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
773 (("\\$\\$\\[QT_HOST_LIBS\\]")
774 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
775 (("\\$\\$\\[QT_INSTALL_BINS\\]")
776 "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))"))
778 ;; Searches Qt tools in the current PATH instead of QT_HOST_BINS.
779 (substitute* qt_functions.prf
780 (("cmd = \\$\\$\\[QT_HOST_BINS\\]/\\$\\$2")
781 "cmd = $$system(which $${2}.pl 2>/dev/null || which $${2})"))
783 ;; Resolve qmake spec files within qtbase by absolute paths.
788 (string-append "lib/qt6/mkspecs/features/" file)))
789 '("device_config.prf" "moc.prf" "qt_build_config.prf"
791 (("\\$\\$\\[QT_HOST_DATA/get\\]") archdata)
792 (("\\$\\$\\[QT_HOST_DATA/src\\]") archdata)))))))))
794 (modify-inputs (package-native-inputs qtbase-5)
799 (modify-inputs (package-inputs qtbase-5)
800 (prepend bash-minimal coreutils-minimal libxcb md4c)
801 (replace "postgresql" postgresql))) ;use latest postgresql
803 (list (search-path-specification
804 (variable "QMAKEPATH")
805 (files '("lib/qt6")))
806 (search-path-specification
807 (variable "QML2_IMPORT_PATH")
808 (files '("lib/qt6/qml")))
809 (search-path-specification
810 (variable "QT_PLUGIN_PATH")
811 (files '("lib/qt6/plugins")))
812 (search-path-specification
813 (variable "XDG_DATA_DIRS")
815 (search-path-specification
816 (variable "XDG_CONFIG_DIRS")
817 (files '("etc/xdg")))))))
819 (define-public qt5compat
825 (uri (qt5-urls name version))
828 "1zbcaswpl79ixcxzj85qzjq73962s4c7316pibwfrskqswmwcgm4"))))
829 (build-system cmake-build-system)
832 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
833 #:phases #~(modify-phases %standard-phases
834 (add-after 'install 'delete-installed-tests
836 (delete-file-recursively
837 (string-append #$output "/tests")))))))
838 (native-inputs (list perl))
839 (inputs (list icu4c libxkbcommon qtbase qtdeclarative qtshadertools))
840 (home-page (package-home-page qtbase))
841 (synopsis "Legacy Qt 5 APIs ported to Qt 6")
842 (description "The @code{qt5compat} package includes application
843 programming interfaces (APIs) from Qt 5 that were ported to Qt 6, to ease
844 migration. It provides for example the @code{GraphicalEffects} module that
845 came with the @{qtgraphicaleffects} Qt 5 package.")
846 (license (list license:gpl2+ license:lgpl3+)))) ;dual licensed
848 (define-public qtsvg-5
855 (uri (qt5-urls name version))
858 "0pjqrdmd1991x9h4rl8sf81pkd89hfd5h1a2gp3fjw96pk0w5hwb"))))
859 (propagated-inputs `())
860 (native-inputs (list perl))
862 (list mesa qtbase-5 zlib))
865 (modify-phases %standard-phases
866 (add-before 'configure 'configure-qmake
867 (lambda* (#:key inputs outputs #:allow-other-keys)
868 (let* ((out (assoc-ref outputs "out"))
869 (qtbase (assoc-ref inputs "qtbase"))
870 (tmpdir (string-append (getenv "TMPDIR")))
871 (qmake (string-append tmpdir "/qmake"))
872 (qt.conf (string-append tmpdir "/qt.conf")))
873 ;; Use qmake with a customized qt.conf to override install
875 (symlink (which "qmake") qmake)
876 (setenv "PATH" (string-append tmpdir ":" (getenv "PATH")))
877 (with-output-to-file qt.conf
883 Documentation=share/doc/qt5
886 LibraryExecutables=lib/qt5/libexec
889 Plugins=lib/qt5/plugins
890 Imports=lib/qt5/imports
891 Qml2Imports=lib/qt5/qml
892 Translations=share/qt5/translations
894 Examples=share/doc/qt5/examples
900 [EffectiveSourcePaths]
906 (lambda* (#:key inputs outputs #:allow-other-keys)
907 ;; Valid QT_BUILD_PARTS variables are:
908 ;; libs tools tests examples demos docs translations
909 (invoke "qmake" "QT_BUILD_PARTS = libs tools tests")))
910 (add-before 'check 'set-display
912 ;; make Qt render "offscreen", required for tests
913 (setenv "QT_QPA_PLATFORM" "offscreen")
915 (synopsis "Qt module for displaying SVGs")
916 (description "The QtSvg module provides classes for displaying the
917 contents of SVG files.")))
925 (uri (qt5-urls name version))
928 "1xvxz2jfpr1al85rhwss7ji5vkxa812d0b888hry5f7pwqcg86bv"))))
929 (build-system cmake-build-system)
932 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
934 #~(modify-phases %standard-phases
935 (add-before 'check 'set-display
937 ;; Make Qt render "offscreen", required for tests.
938 (setenv "QT_QPA_PLATFORM" "offscreen")))
939 (add-after 'install 'delete-installed-tests
941 (delete-file-recursively (string-append #$output "/tests")))))))
942 (native-inputs (list perl))
943 (inputs (list libxkbcommon mesa qtbase zlib))
944 (synopsis "Qt module for displaying SVGs")
945 (description "The QtSvg module provides classes for displaying the
946 contents of SVG files.")
947 (home-page (package-home-page qtbase))
948 (license (package-license qtbase))))
950 (define-public qtimageformats
951 (package (inherit qtsvg-5)
952 (name "qtimageformats")
956 (uri (qt5-urls name version))
959 "1msk8a0z8rr16hkp2fnv668vf6wayiydqgc2mcklaa04rv3qb0mz"))
960 (modules '((guix build utils)))
963 (delete-file-recursively "src/3rdparty")
966 (substitute-keyword-arguments (package-arguments qtsvg-5)
968 `(modify-phases ,phases
969 (add-after 'unpack 'fix-build
971 (substitute* "src/plugins/imageformats/jp2/qjp2handler.cpp"
972 (("^#include <jasper/jasper.h>")
973 "#include <jasper/jasper.h>\n#include <QtCore/qmath.h>"))
984 (synopsis "Additional Image Format plugins for Qt")
985 (description "The QtImageFormats module contains plugins for adding
986 support for MNG, TGA, TIFF and WBMP image formats.")))
988 (define-public qtx11extras
989 (package (inherit qtsvg-5)
994 (uri (qt5-urls name version))
997 "0gkfzj195v9flwljnqpdz3a532618yn4h2577nlsai56x4p7053h"))))
999 (substitute-keyword-arguments (package-arguments qtsvg-5)
1000 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1001 (native-inputs (list perl))
1003 (list mesa qtbase-5))
1004 (synopsis "Qt Extras for X11")
1005 (description "The QtX11Extras module includes the library to access X11
1006 from within Qt 5.")))
1008 (define-public qtxmlpatterns
1009 (package (inherit qtsvg-5)
1010 (name "qtxmlpatterns")
1014 (uri (qt5-urls name version))
1017 "1ypj5jpa31rlx8yfw3y9jia212lfnxvnqkvygs6ihjf3lxi23skn"))))
1019 (substitute-keyword-arguments (package-arguments qtsvg-5)
1020 ((#:tests? _ #f) #f) ; TODO: Enable the tests
1022 `(modify-phases ,phases
1023 (add-after 'unpack 'disable-network-tests
1024 (lambda _ (substitute* "tests/auto/auto.pro"
1025 (("qxmlquery") "# qxmlquery")
1026 (("xmlpatterns ") "# xmlpatterns"))
1028 (native-inputs (list perl qtdeclarative-5))
1029 (inputs (list qtbase-5))
1030 (synopsis "Qt XML patterns module")
1031 (description "The QtXmlPatterns module is a XQuery and XPath engine for
1032 XML and custom data models. It contains programs such as xmlpatterns and
1033 xmlpatternsvalidator.")))
1035 (define-public qtdeclarative-5
1036 (package (inherit qtsvg-5)
1037 (name "qtdeclarative")
1041 (uri (qt5-urls name version))
1044 "0lancdn7y0lrlmyn5cbdm0izd5yprvd5n77nhkb7a3wl2sbx0066"))))
1046 (substitute-keyword-arguments (package-arguments qtsvg-5)
1047 ((#:tests? _ #f) #f) ;TODO: Enable the tests
1049 `(modify-phases ,phases
1050 (add-after 'build 'fix-qt5core-install-prefix
1051 (lambda* (#:key outputs #:allow-other-keys)
1052 (let ((out (assoc-ref outputs "out")))
1053 ;; The Qt5Core install prefix is set to qtbase, but qmlcachegen
1054 ;; is provided by qtdeclarative-5.
1056 "lib/cmake/Qt5QuickCompiler/Qt5QuickCompilerConfig.cmake"
1057 (("\\$\\{_qt5Core_install_prefix\\}") out)))
1067 (list mesa qtbase-5))
1068 (synopsis "Qt QML module (Quick 2)")
1069 (description "The Qt QML module provides a framework for developing
1070 applications and libraries with the QML language. It defines and implements the
1071 language and engine infrastructure, and provides an API to enable application
1072 developers to extend the QML language with custom types and integrate QML code
1073 with JavaScript and C++.")))
1075 (define-public qtdeclarative
1077 (name "qtdeclarative")
1079 ;; TODO: Package 'masm' and unbundle from sources.
1082 (uri (qt5-urls name version))
1085 "1s268fha3650dn1lqxf8jfa07wxpw09f6p7rjyiwq3w24d0nkrq3"))))
1086 (build-system cmake-build-system)
1089 #:configure-flags #~(list "-GNinja" ;about twice as fast!
1090 "-DQT_BUILD_TESTS=ON")
1092 #~(modify-phases %standard-phases
1093 (add-after 'unpack 'honor-cmake-install-rpath
1094 ;; The build system goes out of its way to compute a runpath it
1095 ;; thinks makes more sense, and fails. Revert to the default
1096 ;; behavior, which is to honor CMAKE_INSTALL_RPATH.
1098 (substitute* "src/qml/Qt6QmlMacros.cmake"
1099 (("set_target_properties.*PROPERTIES.*INSTALL_RPATH.*" all)
1100 (string-append "# " all)))))
1101 (add-after 'unpack 'patch-qlibraryinfo-paths
1103 ;; The QLibraryInfo paths are hard-coded to point to the qtbase
1104 ;; installation, but all the tools used in the test suite come
1105 ;; from this package.
1106 (substitute* (find-files "tests" "\\.cpp$")
1107 (("QLibraryInfo::path\\(QLibraryInfo::BinariesPath)")
1108 (string-append "QStringLiteral(\"" #$output "/bin\")"))
1109 (("QLibraryInfo::path\\(QLibraryInfo::LibraryExecutablesPath)")
1110 (string-append "QStringLiteral(\"" #$output
1111 "/lib/qt6/libexec\")"))
1112 (("QLibraryInfo::path\\(QLibraryInfo::QmlImportsPath)")
1113 (string-append "QStringLiteral(\"" #$output
1114 "/lib/qt6/qml\")")))))
1116 (lambda* (#:key parallel-build? #:allow-other-keys)
1117 (apply invoke "cmake" "--build" "."
1119 `("--parallel" ,(number->string (parallel-job-count)))
1121 (delete 'check) ;move after the install phase
1124 (invoke "cmake" "--install" ".")))
1125 (add-after 'install 'check
1126 (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
1128 ;; The tests expect to find the modules provided by this
1129 ;; package; extend the environment variables needed to do so.
1130 ;(setenv "CMAKE_PREFIX_PATH" #$output)
1131 (setenv "QML2_IMPORT_PATH"
1132 (string-append #$output "/lib/qt6/qml"))
1133 (setenv "QT_PLUGIN_PATH"
1134 (string-append #$output "/lib/qt6/plugins:"
1135 (getenv "QT_PLUGIN_PATH")))
1136 (setenv "QT_QPA_PLATFORM" "offscreen")
1137 ;; Skip tests known to fail on GNU/Linux, in a CI context or
1138 ;; due to bitness (see: https://code.qt.io/cgit/qt/qtbase.git
1139 ;; /tree/src/testlib/qtestblacklist.cpp).
1140 (setenv "QTEST_ENVIRONMENT" "linux ci 32bit")
1141 (setenv "HOME" "/tmp") ;a few tests require a writable HOME
1143 "ctest" "--output-on-failure"
1144 "-j" (if parallel-tests?
1145 (number->string (parallel-job-count))
1147 "-E" ;exclude some tests by regex
1152 ;; This test is marked as flaky upstream (see:
1153 ;; https://bugreports.qt.io/browse/QTBUG-101488).
1154 "tst_qquickfiledialogimpl"
1155 ;; These tests all fail because 'test_overlappingHandles'
1156 ;; (see: https://bugreports.qt.io/browse/QTBUG-95750).
1162 ;; Fails due to using the wrong lib/qt6/qml prefix:
1163 ;; "Warning: Failed to find the following builtins:
1164 ;; builtins.qmltypes, jsroot.qmltypes (so will use
1165 ;; qrc). Import paths used:
1166 ;; /gnu/store/...-qtbase-6.3.1/lib/qt6/qml"
1167 "tst_qmltc_qprocess"
1168 ;; These test fail when running qmlimportscanner; perhaps
1169 ;; an extra CMAKE_PREFIX_PATH location is missing to
1170 ;; correctly locate the imports.
1173 "cmake_tooling_imports"
1174 ;; This test seems to hangs for a long time, possibly
1175 ;; waiting for a killed process, which becomes a zombie in
1176 ;; the build container (perhaps solved after
1177 ;; fixing/applying #30948).
1178 "tst_qqmlpreview") "|")
1180 (add-after 'install 'delete-installed-tests
1182 (delete-file-recursively (string-append #$output "/tests")))))))
1194 (home-page (package-home-page qtbase))
1195 (synopsis "Qt QML module (Quick 2)")
1196 (description "The Qt QML module provides a framework for developing
1197 applications and libraries with the QML language. It defines and implements
1198 the language and engine infrastructure, and provides an API to enable
1199 application developers to extend the QML language with custom types and
1200 integrate QML code with JavaScript and C++.")
1201 (license (package-license qtbase))))
1203 (define-public qtconnectivity
1204 (package (inherit qtsvg-5)
1205 (name "qtconnectivity")
1209 (uri (qt5-urls name version))
1212 "185zci61ip1wpjrygcw2m6v55lvninc0b8y2p3jh6qgpf5w35003"))))
1214 (list perl pkg-config qtdeclarative-5))
1216 (list bluez qtbase-5))
1217 (synopsis "Qt Connectivity module")
1218 (description "The Qt Connectivity modules provides modules for interacting
1219 with Bluetooth and NFC.")))
1221 (define-public qtwebsockets-5
1222 (package (inherit qtsvg-5)
1223 (name "qtwebsockets")
1227 (uri (qt5-urls name version))
1230 "0gr399fn5n8j3m9d3vv01vcbr1cb7pw043j04cnnxzrlvn2jvd50"))))
1232 (substitute-keyword-arguments (package-arguments qtsvg-5)
1233 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1235 (list perl qtdeclarative-5))
1236 (inputs (list qtbase-5))
1237 (synopsis "Qt Web Sockets module")
1238 (description "WebSocket is a web-based protocol designed to enable two-way
1239 communication between a client application and a remote host. The Qt
1240 WebSockets module provides C++ and QML interfaces that enable Qt applications
1241 to act as a server that can process WebSocket requests, or a client that can
1242 consume data received from the server, or both.")))
1244 (define-public qtwebsockets
1246 (name "qtwebsockets")
1250 (uri (qt5-urls name version))
1253 "06hj0pkdzjicmbiinjp1dk1ziz8cb3fgcwy7a0dxxjvzr680v64z"))))
1254 (build-system cmake-build-system)
1257 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
1258 #:phases #~(modify-phases %standard-phases
1259 (delete 'check) ;move after install
1260 (add-after 'install 'prepare-for-tests
1262 (setenv "QT_QPA_PLATFORM" "offscreen")
1263 (setenv "QML2_IMPORT_PATH"
1264 (string-append #$output "/lib/qt6/qml:"
1265 (getenv "QML2_IMPORT_PATH")))))
1266 (add-after 'prepare-for-tests 'check
1267 (assoc-ref %standard-phases 'check))
1268 (add-after 'check 'delete-installed-tests
1270 (delete-file-recursively
1271 (string-append #$output "/tests")))))))
1272 (native-inputs (list perl))
1273 (inputs (list qtbase qtdeclarative))
1274 (synopsis "Qt Web Sockets module")
1275 (description "WebSocket is a web-based protocol designed to enable two-way
1276 communication between a client application and a remote host. The Qt
1277 WebSockets module provides C++ and QML interfaces that enable Qt applications
1278 to act as a server that can process WebSocket requests, or a client that can
1279 consume data received from the server, or both.")
1280 (home-page (package-home-page qtbase))
1281 (license (package-license qtbase))))
1283 (define-public qtsensors
1284 (package (inherit qtsvg-5)
1289 (uri (qt5-urls name version))
1292 "0fa81r7bn1mf9ynwsx524a55dx1q0jb4vda6j48ssb4lx7wi201z"))))
1294 (substitute-keyword-arguments (package-arguments qtsvg-5)
1295 ((#:parallel-tests? _ #f) #f) ; can lead to race condition
1297 `(modify-phases ,phases
1298 (add-after 'unpack 'fix-tests
1300 (substitute* "tests/auto/qsensorgestures_gestures/tst_sensorgestures_gestures.cpp"
1301 (("2000") "5000") ;lengthen test timeout
1302 (("QTest::newRow(\"twist\") << \"twist\"") "")) ;failing test
1305 (list perl qtdeclarative-5))
1306 (inputs (list qtbase-5))
1307 (synopsis "Qt Sensors module")
1308 (description "The Qt Sensors API provides access to sensor hardware via QML
1309 and C++ interfaces. The Qt Sensors API also provides a motion gesture
1310 recognition API for devices.")))
1312 (define-public qtmultimedia-5
1315 (name "qtmultimedia")
1319 (uri (qt5-urls name version))
1322 "1xbd6kc7i0iablqdkvfrajpi32cbq7j6ajbfyyyalcai1s0mhdqc"))
1323 (modules '((guix build utils)))
1326 (delete-file-recursively
1327 "examples/multimedia/spectrum/3rdparty")
1328 ;; We also prevent the spectrum example from being built.
1329 (substitute* "examples/multimedia/multimedia.pro"
1333 (substitute-keyword-arguments (package-arguments qtsvg-5)
1335 `(modify-phases ,phases
1337 (lambda* (#:key outputs #:allow-other-keys)
1338 (let ((out (assoc-ref outputs "out")))
1339 (invoke "qmake" "QT_BUILD_PARTS = libs tools tests"
1340 (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out "/lib -Wl,-rpath,")
1341 (string-append "PREFIX=" out)))))))
1342 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1344 (list perl pkg-config python qtdeclarative-5))
1350 ;; Gstreamer is needed for the mediaplayer plugin
1353 (synopsis "Qt Multimedia module")
1354 (description "The Qt Multimedia module provides set of APIs to play and
1355 record media, and manage a collection of media content. It also contains a
1356 set of plugins for interacting with pulseaudio and GStreamer.")))
1358 (define-public qtshadertools
1360 (name "qtshadertools")
1364 (uri (qt5-urls name version))
1365 ;; Note: the source bundles *patched* glslang and SPIRV-Cross
1369 "0nj35s2z5n438q7nqf6bnj3slwz2am3169ck1ixwqa0mjrv73dsr"))))
1370 (build-system cmake-build-system)
1373 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
1374 #:phases #~(modify-phases %standard-phases
1375 (add-before 'check 'prepare-for-tests
1377 (setenv "QT_QPA_PLATFORM" "offscreen"))))))
1378 (native-inputs (list perl))
1379 (inputs (list glslang libxkbcommon qtbase))
1380 (home-page (package-home-page qtbase))
1381 (synopsis "Shader pipeline API and and tools for Qt")
1382 (description "The @code{qtshadertools} module provides APIs and tools
1383 supporting shader pipeline functionality as offered in Qt Quick to operate on
1384 Vulkan, OpenGL and other main graphic APIs.")
1385 (license (package-home-page qtbase))))
1387 (define-public qtmultimedia
1389 (name "qtmultimedia")
1393 (uri (qt5-urls name version))
1396 "0dkk3lmzi2fs13cnj8q1lpcs6gghj219826gkwnzyd6nmlm280vy"))
1397 (modules '((guix build utils)))
1400 (delete-file-recursively
1401 "examples/multimedia/spectrum/3rdparty")
1402 ;; We also prevent the spectrum example from being built.
1403 (substitute* "examples/multimedia/multimedia.pro"
1404 (("spectrum") "#"))))))
1405 (build-system cmake-build-system)
1408 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON"
1409 "-DQT_FEATURE_pulseaudio=ON")
1411 #~(modify-phases %standard-phases
1412 (add-after 'unpack 'disable-integration-tests
1414 ;; XXX: The tst_qaudiodecoderbackend, tst_qaudiodevice,
1415 ;; tst_qaudiosource, tst_qmediaplayerbackend and
1416 ;; tst_qcamerabackend tests fail, presumably because they
1417 ;; require a functional pulseaudio daemon (which requires a dbus
1418 ;; session bus, which requires an X11 server, and then is still
1420 (substitute* "tests/auto/CMakeLists.txt"
1421 (("add_subdirectory\\(integration)") ""))))
1422 (add-before 'check 'prepare-for-tests
1424 (setenv "QT_QPA_PLATFORM" "offscreen")))
1425 (add-after 'install 'delete-installed-tests
1427 (delete-file-recursively (string-append #$output "/tests")))))))
1437 gst-plugins-base ;gstreamer-gl
1438 gst-plugins-good ;camera support, additional plugins
1439 gst-libav ;ffmpeg plugin
1445 (home-page (package-home-page qtbase))
1446 (synopsis "Qt Multimedia module")
1447 (description "The Qt Multimedia module provides set of APIs to play and
1448 record media, and manage a collection of media content. It also contains a
1449 set of plugins for interacting with pulseaudio and GStreamer.")
1450 (license (package-license qtbase))))
1452 (define-public qtwayland
1453 (package (inherit qtsvg-5)
1458 (uri (qt5-urls name version))
1461 "1ddfx4nak16xx0zh1kl836zxvpbixmmjyplsmfmg65pqkwi34dqr"))))
1463 (substitute-keyword-arguments (package-arguments qtsvg-5)
1465 `(modify-phases ,phases
1466 (add-after 'unpack 'disable-failing-tests
1468 ;; FIXME: tst_seatv4::animatedCursor() fails for no good
1469 ;; reason and breaks these two tests.
1470 (substitute* "tests/auto/client/seatv4/tst_seatv4.cpp"
1471 (((string-append "QVERIFY\\(!cursorSurface\\(\\)->"
1472 "m_waitingFrameCallbacks\\.empty\\(\\)\\);"))
1474 (("QTRY_COMPARE\\(bufferSpy\\.count\\(\\), 1\\);")
1477 (add-before 'check 'set-test-environment
1479 ;; Do not fail just because /etc/machine-id is missing.
1480 (setenv "DBUS_FATAL_WARNINGS" "0")
1483 (list glib perl pkg-config qtdeclarative-5))
1485 `(("fontconfig" ,fontconfig)
1486 ("freetype" ,freetype)
1488 ("libxcomposite" ,libxcomposite)
1489 ("libxext" ,libxext)
1490 ("libxkbcommon" ,libxkbcommon)
1491 ("libxrender" ,libxrender)
1494 ("qtbase" ,qtbase-5)
1495 ("vulkan-headers" ,vulkan-headers)
1496 ("wayland" ,wayland)))
1497 (synopsis "Qt Wayland module")
1498 (description "The Qt Wayland module provides the QtWayland client and
1499 compositor libraries.")))
1501 (define-public qtserialport
1502 (package (inherit qtsvg-5)
1503 (name "qtserialport")
1507 (uri (qt5-urls name version))
1510 "17gp5qzg4wdg8qlxk2p3mh8x1vk33rf33wic3fy0cws193bmkiar"))))
1511 (native-inputs (list perl))
1513 (list qtbase-5 eudev))
1515 (substitute-keyword-arguments (package-arguments qtsvg-5)
1517 `(modify-phases ,phases
1518 (add-after 'unpack 'patch-dlopen-paths
1519 (lambda* (#:key inputs #:allow-other-keys)
1520 (substitute* "src/serialport/qtudev_p.h"
1521 ;; Use the absolute paths for dynamically loaded libs,
1522 ;; otherwise the lib will be searched in LD_LIBRARY_PATH which
1523 ;; typically is not set in guix.
1524 (("^\\s*(udevLibrary->setFileNameAndVersion\\(QStringLiteral\\(\")(udev\"\\),\\s*[0-9]+\\);)" _ a b)
1525 (string-append a (assoc-ref inputs "eudev") "/lib/lib" b)))
1527 (synopsis "Qt Serial Port module")
1528 (description "The Qt Serial Port module provides the library for
1529 interacting with serial ports from within Qt.")))
1531 (define-public qtserialbus
1532 (package (inherit qtsvg-5)
1533 (name "qtserialbus")
1537 (uri (qt5-urls name version))
1540 "125x6756fjpldqy6wbw6cg7ngjh2016aiq92bchh719z1mf7xsxf"))))
1542 (substitute-keyword-arguments (package-arguments qtsvg-5)
1543 ((#:phases phases '%standard-phases)
1544 `(modify-phases ,phases
1545 (add-after 'unpack 'patch-libsocketcan-reference
1546 (lambda* (#:key inputs #:allow-other-keys)
1547 (let* ((libcansocket (assoc-ref inputs "libsocketcan"))
1548 (libcansocket.so (string-append libcansocket
1549 "/lib/libsocketcan.so")))
1550 (substitute* "src/plugins/canbus/socketcan/libsocketcan.cpp"
1551 (("QStringLiteral\\(\"socketcan\"\\)")
1552 (format #f "QStringLiteral(~s)" libcansocket.so)))
1555 (list libsocketcan qtbase-5 qtserialport))
1556 (synopsis "Qt Serial Bus module")
1557 (description "The Qt Serial Bus API provides classes and functions to
1558 access the various industrial serial buses and protocols, such as CAN, ModBus,
1561 (define-public qtwebchannel-5
1562 (package (inherit qtsvg-5)
1563 (name "qtwebchannel")
1567 (uri (qt5-urls name version))
1570 "1h9y634phvvk557mhmf9z4lmxr41rl8x9mqy2lzp31mk8ffffzqj"))))
1572 (list perl qtdeclarative-5 qtwebsockets-5))
1573 (inputs (list qtbase-5))
1574 (synopsis "Web communication library for Qt")
1575 (description "The Qt WebChannel module enables peer-to-peer communication
1576 between the host (QML/C++ application) and the client (HTML/JavaScript
1577 application). The transport mechanism is supported out of the box by the two
1578 popular web engines, Qt WebKit 2 and Qt WebEngine.")))
1580 (define-public qtwebchannel
1582 (name "qtwebchannel")
1586 (uri (qt5-urls name version))
1589 "0s16zx3qn3byldvhmsnwijm8rmizk8vpqj7fnwhjg6c67z10m8ma"))))
1590 (build-system cmake-build-system)
1593 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
1594 #:phases #~(modify-phases %standard-phases
1595 (delete 'check) ;move after install
1596 (add-after 'install 'prepare-for-tests
1598 (setenv "QT_QPA_PLATFORM" "offscreen")
1599 (setenv "QML2_IMPORT_PATH"
1600 (string-append #$output "/lib/qt6/qml:"
1601 (getenv "QML2_IMPORT_PATH")))))
1602 (add-after 'prepare-for-tests 'check
1603 (assoc-ref %standard-phases 'check))
1604 (add-after 'check 'delete-installed-tests
1606 (delete-file-recursively
1607 (string-append #$output "/tests")))))))
1608 (native-inputs (list perl))
1609 (inputs (list qtbase qtdeclarative qtwebsockets))
1610 (home-page (package-home-page qtbase))
1611 (synopsis "Web communication library for Qt")
1612 (description "The Qt WebChannel module enables peer-to-peer communication
1613 between the host (QML/C++ application) and the client (HTML/JavaScript
1615 (license (package-license qtbase))))
1617 (define-public qtwebglplugin
1618 (package (inherit qtsvg-5)
1619 (name "qtwebglplugin")
1623 (uri (qt5-urls name version))
1626 "0ihlnhv8ldkqz82v3j7j22lrhk17b6ghra8sx85y2agd2ysq5rw1"))))
1628 (substitute-keyword-arguments (package-arguments qtsvg-5)
1630 `(modify-phases ,phases
1631 (add-after 'unpack 'disable-network-tests
1632 (lambda _ (substitute* "tests/plugins/platforms/platforms.pro"
1633 (("webgl") "# webgl"))
1637 (list mesa qtbase-5 qtdeclarative-5 qtwebsockets-5 zlib))
1638 (synopsis "QPA plugin for running an application via a browser using
1639 streamed WebGL commands")
1640 (description "Qt back end that uses WebGL for rendering. It allows Qt
1641 applications (with some limitations) to run in a web browser that supports
1642 WebGL. WebGL is a JavaScript API for rendering 2D and 3D graphics within any
1643 compatible web browser without the use of plug-ins. The API is similar to
1644 OpenGL ES 2.0 and can be used in HTML5 canvas elements")))
1646 (define-public qtwebview
1647 (package (inherit qtsvg-5)
1652 (uri (qt5-urls name version))
1655 "1rw1wibmbxlj6xc86qs3y8h42al1vczqiksyxzaylxs9gqb4d7xy"))))
1659 (list qtbase-5 qtdeclarative-5))
1660 (synopsis "Display web content in a QML application")
1661 (description "Qt WebView provides a way to display web content in a QML
1662 application without necessarily including a full web browser stack by using
1663 native APIs where it makes sense.")))
1665 (define-public qtlocation
1666 (package (inherit qtsvg-5)
1671 (uri (string-append "https://download.qt.io/official_releases/qt/"
1672 (version-major+minor version) "/" version
1673 "/submodules/" name "-everywhere-src-"
1677 "184jychnlfhplpwc5cdcsapwljgwvzk5qpf3val4kpq8w44wnkwq"))))
1679 (substitute-keyword-arguments (package-arguments qtsvg-5)
1680 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1682 (list perl qtdeclarative-5 qtquickcontrols-5 qtserialport))
1684 (list icu4c openssl qtbase-5 zlib))
1685 (synopsis "Qt Location and Positioning modules")
1686 (description "The Qt Location module provides an interface for location,
1687 positioning and geolocation plugins.")))
1689 (define-public qtlottie
1695 (uri (qt5-urls name version))
1698 "1x8wmc6gwmxk92zjcsrbhrbqbfvnk7302ggghld5wk8jk5lsf2vl"))))
1699 (build-system cmake-build-system)
1702 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
1704 #~(modify-phases %standard-phases
1705 (delete 'check) ;move after install
1706 (add-after 'install 'prepare-for-tests
1708 (setenv "QT_QPA_PLATFORM" "offscreen")
1709 (setenv "QML2_IMPORT_PATH"
1710 (string-append #$output "/lib/qt6/qml:"
1711 (getenv "QML2_IMPORT_PATH"))))))))
1712 (native-inputs (list perl))
1713 (inputs (list libxkbcommon qtbase qtdeclarative))
1714 (home-page (package-home-page qtbase))
1715 (synopsis "QML API for rendering Bodymovin graphics and animations")
1716 (description "Qt Lottie Animation provides a QML API for rendering
1717 graphics and animations that are exported in JSON format by the Bodymovin
1718 plugin for Adobe After Effects.")
1719 (license (package-license qtbase))))
1721 (define-public qttools-5
1722 (package (inherit qtsvg-5)
1727 (uri (qt5-urls name version))
1730 "1k618f7v6jaj0ygy8d7jvgb8zjr47sn55kiskbdkkizp3z7d12f1"))))
1732 (substitute-keyword-arguments (package-arguments qtsvg-5)
1733 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1735 (list perl qtdeclarative-5 vulkan-headers))
1737 (list mesa qtbase-5))
1738 (synopsis "Qt Tools and Designer modules")
1739 (description "The Qt Tools module provides a set of applications to browse
1740 the documentation, translate applications, generate help files and other stuff
1741 that helps in Qt development.")))
1743 (define-public qttools
1749 (uri (qt5-urls name version))
1752 "1h96w4bzkbd80vr7lh6hnypdlmbzc1y52c2zrqzvkgm3587pa4n4"))))
1753 (build-system cmake-build-system)
1756 ;; The build system attempts to fetch online resources and fails when
1757 ;; building the test suite.
1758 #:configure-flags #~(list "-DQT_BUILD_TESTS=OFF")))
1759 (native-inputs (list perl qtdeclarative vulkan-headers))
1760 (inputs (list libxkbcommon mesa qtbase))
1761 (home-page (package-home-page qtbase))
1762 (synopsis "Qt Tools and Designer modules")
1763 (description "The Qt Tools module provides a set of applications to browse
1764 the documentation, translate applications, generate help files and other stuff
1765 that helps in Qt development.")
1766 ;; GPL 3 only with Qt GPL exception 1.0 (see:
1767 ;; LICENSES/Qt-GPL-exception-1.0.txt).
1768 (license (list license:gpl3))))
1770 (define-public qtscript
1771 (package (inherit qtsvg-5)
1776 (uri (qt5-urls name version))
1779 "0gk74hk488k9ldacxbxcranr3arf8ifqg8kz9nm1rgdgd59p36d2"))
1780 (patches (search-patches "qtscript-disable-tests.patch"))))
1782 (list perl qttools-5))
1785 (synopsis "Qt Script module")
1786 (description "Qt provides support for application scripting with ECMAScript.
1787 The following guides and references cover aspects of programming with
1788 ECMAScript and Qt.")))
1790 (define-public qtquickcontrols-5
1791 (package (inherit qtsvg-5)
1792 (name "qtquickcontrols")
1796 (uri (qt5-urls name version))
1799 "1dczakl868mg0lnwpf082jjc5976ycn879li1vqlgw5ihirzp4y3"))))
1801 (substitute-keyword-arguments (package-arguments qtsvg-5)
1802 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1804 (list qtbase-5 qtdeclarative-5))
1805 (synopsis "Qt Quick Controls and other Quick modules")
1806 (description "The QtScript module provides classes for making Qt
1807 applications scriptable. This module provides a set of extra components that
1808 can be used to build complete interfaces in Qt Quick.")))
1810 (define-public qtquickcontrols2-5
1811 (package (inherit qtsvg-5)
1812 (name "qtquickcontrols2")
1816 (uri (qt5-urls name version))
1819 "06c9vrwvbjmzapmfa25y34lgjkzg57xxbm92nr6wkv5qykjnq6v7"))))
1821 (substitute-keyword-arguments (package-arguments qtsvg-5)
1822 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1824 (list qtbase-5 qtdeclarative-5))
1825 (synopsis "Qt Quick Controls 2 and other Quick 2 modules")
1826 (description "The Qt Quick Controls 2 module contains the Qt Labs Platform
1827 module that provides platform integration: native dialogs, menus and menu bars,
1828 and tray icons. It falls back to Qt Widgets when a native implementation is
1831 (define-public qtquickcontrols2
1832 ;; qtquickcontrols2 still exist, but was merged into qtdeclarative.
1833 ;; Unfortunately that hasn't been well communicated at all (see:
1834 ;; https://bugreports.qt.io/browse/QTBUG-79454).
1835 (deprecated-package "qtquickcontrols2" qtdeclarative))
1837 (define-public qtgraphicaleffects
1838 (package (inherit qtsvg-5)
1839 (name "qtgraphicaleffects")
1843 (uri (qt5-urls name version))
1846 "1r6zfc0qga2ax155js7c8y5rx6vgayf582s921j09mb797v6g3gc"))))
1848 (substitute-keyword-arguments (package-arguments qtsvg-5)
1849 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1851 (list qtbase-5 qtdeclarative-5))
1852 (synopsis "Qt Graphical Effects module")
1853 (description "The Qt Graphical Effects module provides a set of QML types
1854 for adding visually impressive and configurable effects to user interfaces.
1855 Effects are visual items that can be added to Qt Quick user interface as UI
1856 components. The API consists of over 20 effects provided as separate QML
1857 types. The effects cover functional areas such as blending, masking, blurring,
1858 coloring, and many more.")))
1860 (define-public qtgamepad
1861 (package (inherit qtsvg-5)
1866 (uri (qt5-urls name version))
1869 "0p07bg93fdfn4gr2kv38qgnws5znhswajrxdfs8xc9l3i7vi2xn7"))))
1871 (list perl pkg-config))
1873 `(("fontconfig" ,fontconfig)
1874 ("freetype" ,freetype)
1875 ("libxrender" ,libxrender)
1877 ("qtbase" ,qtbase-5)
1878 ("qtdeclarative-5" ,qtdeclarative-5)))
1879 (synopsis "Qt Gamepad module")
1880 (description "The Qt Gamepad module is an add-on library that enables Qt
1881 applications to support the use of gamepad hardware and in some cases remote
1882 control equipment. The module provides both QML and C++ interfaces. The
1883 primary target audience are embedded devices with fullscreen user interfaces,
1884 and mobile applications targeting TV-like form factors.")))
1886 (define-public qtscxml
1887 (package (inherit qtsvg-5)
1892 (uri (qt5-urls name version))
1895 "1p5771b9hnpchfcdgy0zkhwg09a6xq88934aggp0rij1k85mkfb0"))
1896 (modules '((guix build utils)))
1899 (delete-file-recursively "tests/3rdparty")
1900 ;; the scion test refers to the bundled 3rd party test code.
1901 (substitute* "tests/auto/auto.pro"
1905 (list qtbase-5 qtdeclarative-5))
1906 (synopsis "Qt SCXML module")
1907 (description "The Qt SCXML module provides functionality to create state
1908 machines from SCXML files. This includes both dynamically creating state
1909 machines (loading the SCXML file and instantiating states and transitions) and
1910 generating a C++ file that has a class implementing the state machine. It
1911 also contains functionality to support data models and executable content.")))
1913 (define-public qtpositioning
1915 (name "qtpositioning")
1919 (uri (qt5-urls name version))
1922 "0v78wamvdw02kf9rq7m5v24q2g6jmgq4ch0fnfa014p1r978wy06"))))
1923 (build-system cmake-build-system)
1926 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
1927 #:phases #~(modify-phases %standard-phases
1928 (add-after 'install 'delete-installed-tests
1930 (delete-file-recursively
1931 (string-append #$output "/tests")))))))
1932 (inputs (list perl qtbase))
1933 (home-page (package-home-page qtbase))
1934 (synopsis "QML and C++ positioning information API")
1935 (description "The Qt Positioning API provides positioning information via
1936 QML and C++ interfaces. The Qt Positioning API lets you to determine a
1937 position by using a variety of possible sources, including satellite, wifi, or
1938 text files. That information can then be used to, for example, determine a
1939 position on a map. In addition, you can use to the API to retrieve satellite
1940 information and perform area based monitoring.")
1941 (license (package-license qtbase))))
1943 (define-public qtpurchasing
1944 (package (inherit qtsvg-5)
1945 (name "qtpurchasing")
1949 (uri (qt5-urls name version))
1952 "09rjx53519dfk4qj2gbn3vlxyriasyb747wpg1p11y7jkwqhs4l7"))))
1954 (list qtbase-5 qtdeclarative-5))
1955 (synopsis "Qt Purchasing module")
1956 (description "The Qt Purchasing module provides and in-app API for
1957 purchasing goods and services.")))
1959 (define-public qtcharts
1960 (package (inherit qtsvg-5)
1965 (uri (qt5-urls name version))
1968 "049x7z8zcp9jixmdv2fjscy2ggpd6za9hkdbb2bqp2mxjm0hwxg0"))))
1970 (substitute-keyword-arguments (package-arguments qtsvg-5)
1971 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1973 (list qtbase-5 qtdeclarative-5))
1974 (synopsis "Qt Charts module")
1975 (description "The Qt Charts module provides a set of easy to use chart
1976 components. It uses the Qt Graphics View Framework, therefore charts can be
1977 easily integrated to modern user interfaces. Qt Charts can be used as QWidgets,
1978 QGraphicsWidget, or QML types. Users can easily create impressive graphs by
1979 selecting one of the charts themes.")
1980 (license license:gpl3)))
1982 (define-public qtdatavis3d
1983 (package (inherit qtsvg-5)
1984 (name "qtdatavis3d")
1988 (uri (qt5-urls name version))
1991 "1zdn3vm0nfy9ny7c783aabp3mhlnqhi9fw2rljn7ibbksmsnasi2"))))
1993 (substitute-keyword-arguments (package-arguments qtsvg-5)
1994 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1996 (list qtbase-5 qtdeclarative-5))
1997 (synopsis "Qt Data Visualization module")
1998 (description "The Qt Data Visualization module provides a way to visualize
1999 data in 3D as bar, scatter, and surface graphs. It is especially useful for
2000 visualizing depth maps and large quantities of rapidly changing data, such as
2001 data received from multiple sensors. The look and feel of graphs can be
2002 customized by using themes or by adding custom items and labels to them.")
2003 (license license:gpl3)))
2005 (define-public qtnetworkauth-5
2006 (package (inherit qtsvg-5)
2007 (name "qtnetworkauth")
2011 (uri (qt5-urls name version))
2014 "11fdgacv4syr8bff2vdw7rb0dg1gcqpdf37hm3pn31d6z91frhpw"))))
2016 (substitute-keyword-arguments (package-arguments qtsvg-5)
2018 `(modify-phases ,phases
2019 (add-after 'unpack 'remove-failing-test
2021 ;; These tests can't find their test data.
2022 (substitute* "tests/auto/auto.pro"
2023 (("oauth1 ") "# oauth1 "))
2027 (synopsis "Qt Network Authorization module")
2028 (description "The Qt Network Authorization module provides an
2029 implementation of OAuth and OAuth2 authenticathon methods for Qt.")))
2031 (define-public qtnetworkauth
2033 (name "qtnetworkauth")
2037 (uri (qt5-urls name version))
2040 "0apvsb2ip1m3kw8vi9spvf6f6q72ys8vr40rpyysi7shsjwm83yn"))))
2041 (build-system cmake-build-system)
2042 (arguments (list #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")))
2043 (native-inputs (list perl))
2044 (inputs (list qtbase))
2045 (home-page (package-home-page qtbase))
2046 (synopsis "Qt Network Authorization module")
2047 (description "The Qt Network Authorization module provides an
2048 implementation of OAuth and OAuth2 authenticathon methods for Qt.")
2049 (license (package-license qtbase))))
2051 (define-public qtremoteobjects
2052 (package (inherit qtsvg-5)
2053 (name "qtremoteobjects")
2057 (uri (qt5-urls name version))
2060 "1hngbp0vkr35rpsrac7b9vx6f360v8v2g0fffzm590l8j2ybd0b7"))))
2062 (substitute-keyword-arguments (package-arguments qtsvg-5)
2064 `(modify-phases ,phases
2065 (add-after 'unpack 'remove-failing-test
2067 ;; This test can't find its imports.
2068 (substitute* "tests/auto/qml/qml.pro"
2069 (("integration") "# integration")
2070 (("usertypes") "# usertypes"))
2071 ;; disable failing tests: they need network
2072 (substitute* "tests/auto/auto.pro"
2073 (("integration_multiprocess proxy_multiprocess integration_external restart")
2074 "integration_multiprocess"))
2077 (list qtbase-5 qtdeclarative-5))
2078 (synopsis "Qt Remote Objects module")
2079 (description "The Qt Remote Objects module is an @dfn{inter-process
2080 communication} (IPC) module developed for Qt. The idea is to extend existing
2081 Qt's functionalities to enable an easy exchange of information between
2082 processes or computers.")))
2084 (define-public qtspeech
2085 (package (inherit qtsvg-5)
2090 (uri (qt5-urls name version))
2093 "1xc3x3ghnhgchsg1kgj156yg69wn4rwjx8r28i1jd05hxjggn468"))))
2096 (substitute-keyword-arguments (package-arguments qtsvg-5)
2097 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
2101 (list perl qtdeclarative-5 qtmultimedia-5 qtxmlpatterns))
2102 (synopsis "Qt Speech module")
2103 (description "The Qt Speech module enables a Qt application to support
2104 accessibility features such as text-to-speech, which is useful for end-users
2105 who are visually challenged or cannot access the application for whatever
2106 reason. The most common use case where text-to-speech comes in handy is when
2107 the end-user is driving and cannot attend the incoming messages on the phone.
2108 In such a scenario, the messaging application can read out the incoming
2111 (define-public qtspell
2119 (url "https://github.com/manisandro/qtspell")
2121 (file-name (git-file-name name version))
2123 (base32 "19ff6jzm699wrxrk57w3d4kl9qxgdipdikpwls9n4aqv4mw7g969"))))
2124 (build-system cmake-build-system)
2126 `(#:tests? #f)) ;no test
2128 (list pkg-config qttools-5))
2130 (list enchant qtbase-5))
2131 (home-page "https://github.com/manisandro/qtspell")
2132 (synopsis "Spell checking for Qt text widgets")
2134 "QtSpell adds spell-checking functionality to Qt's text widgets,
2135 using the Enchant spell-checking library.")
2136 ;; COPYING file specify GPL3, but source code files all refer to GPL2+.
2137 (license license:gpl2+)))
2139 (define-public qtwebengine-5
2142 (name "qtwebengine")
2143 (version (package-version qtbase-5))
2147 (uri (qt5-urls name version))
2150 "1q4idxdm81sx102xc12ixj0xpfx52d6vwvs3jpapnkyq8c7cmby8"))
2151 (modules '((ice-9 ftw)
2155 (guix build utils)))
2158 (let ((preserved-third-party-files
2159 '("base/third_party/double_conversion"
2160 "base/third_party/cityhash"
2161 "base/third_party/cityhash_v103"
2162 "base/third_party/dynamic_annotations"
2163 "base/third_party/icu"
2164 "base/third_party/libevent"
2165 "base/third_party/nspr"
2166 "base/third_party/superfasthash"
2167 "base/third_party/symbolize"
2168 "base/third_party/xdg_mime"
2169 "base/third_party/xdg_user_dirs"
2170 "net/third_party/mozilla_security_manager"
2171 "net/third_party/nss"
2172 "net/third_party/quiche"
2173 "net/third_party/uri_template"
2174 "third_party/abseil-cpp"
2176 "third_party/angle/src/common/third_party/base"
2177 "third_party/angle/src/common/third_party/smhasher"
2178 "third_party/angle/src/common/third_party/xxhash"
2179 "third_party/angle/src/third_party/compiler"
2180 "third_party/axe-core"
2182 "third_party/boringssl"
2183 "third_party/boringssl/src/third_party/fiat"
2184 "third_party/breakpad"
2185 "third_party/brotli"
2188 "third_party/closure_compiler"
2189 "third_party/crashpad"
2190 "third_party/crashpad/crashpad/third_party/lss"
2191 "third_party/crashpad/crashpad/third_party/zlib"
2192 "third_party/crc32c"
2195 "third_party/devtools-frontend"
2196 "third_party/devtools-frontend/src/front_end/third_party/fabricjs"
2197 "third_party/devtools-frontend/src/front_end/third_party/lighthouse"
2198 "third_party/devtools-frontend/src/front_end/third_party/wasmparser"
2199 "third_party/devtools-frontend/src/third_party/axe-core"
2200 "third_party/emoji-segmenter"
2201 "third_party/ffmpeg"
2202 "third_party/googletest"
2203 "third_party/harfbuzz-ng/utils"
2204 "third_party/hunspell"
2205 "third_party/iccjpeg"
2207 "third_party/inspector_protocol"
2208 "third_party/jinja2"
2209 "third_party/jsoncpp"
2210 "third_party/jstemplate"
2211 "third_party/khronos"
2212 "third_party/leveldatabase"
2213 "third_party/libaddressinput"
2214 "third_party/libgifcodec"
2215 "third_party/libjingle_xmpp"
2216 "third_party/libjpeg_turbo"
2217 "third_party/libpng"
2218 "third_party/libsrtp"
2219 "third_party/libsync"
2220 "third_party/libudev"
2221 "third_party/libvpx"
2222 "third_party/libwebm"
2223 "third_party/libwebp"
2224 "third_party/libxml"
2225 "third_party/libxslt"
2226 "third_party/libyuv"
2229 "third_party/markupsafe"
2230 "third_party/mesa_headers"
2231 "third_party/metrics_proto"
2232 "third_party/modp_b64"
2234 "third_party/one_euro_filter"
2235 "third_party/openh264/src/codec/api/svc"
2238 "third_party/pdfium"
2239 "third_party/pdfium/third_party/agg23"
2240 "third_party/pdfium/third_party/base"
2241 "third_party/pdfium/third_party/freetype"
2242 "third_party/pdfium/third_party/lcms"
2243 "third_party/pdfium/third_party/libopenjpeg20"
2244 "third_party/pdfium/third_party/skia_shared"
2245 "third_party/perfetto"
2248 "third_party/polymer"
2249 "third_party/protobuf"
2250 "third_party/protobuf/third_party/six"
2251 "third_party/pyjson5"
2253 "third_party/rnnoise"
2255 "third_party/skia/include/third_party/skcms/skcms.h"
2256 "third_party/skia/include/third_party/vulkan"
2257 "third_party/skia/third_party/skcms"
2258 "third_party/skia/third_party/vulkanmemoryallocator"
2259 "third_party/smhasher"
2260 "third_party/snappy"
2261 "third_party/sqlite"
2262 "third_party/usb_ids"
2263 "third_party/usrsctp"
2264 "third_party/web-animations-js"
2265 "third_party/webrtc"
2266 "third_party/webrtc/common_audio/third_party/fft4g"
2267 "third_party/webrtc/common_audio/third_party/spl_sqrt_floor"
2268 "third_party/webrtc/modules/third_party/fft"
2269 "third_party/webrtc/modules/third_party/g711"
2270 "third_party/webrtc/modules/third_party/g722"
2271 "third_party/webrtc/rtc_base/third_party/base64"
2272 "third_party/webrtc/rtc_base/third_party/sigslot"
2273 "third_party/webrtc_overrides"
2274 "third_party/widevine/cdm/widevine_cdm_common.h"
2275 "third_party/widevine/cdm/widevine_cdm_version.h"
2279 "url/third_party/mozilla"
2280 "v8/src/third_party/utf8-decoder"
2281 "v8/src/third_party/valgrind"
2282 "v8/src/third_party/siphash"
2283 "v8/third_party/v8/builtins"
2284 "v8/third_party/inspector_protocol"))
2285 (protected (make-regexp "\\.(gn|gyp)i?$")))
2286 (define preserved-club
2287 (map (lambda (member)
2288 (string-append "./" member))
2289 preserved-third-party-files))
2290 (define (empty? dir)
2291 (equal? (scandir dir) '("." "..")))
2292 (define (third-party? file)
2293 (string-contains file "third_party/"))
2294 (define (useless? file)
2295 (any (cute string-suffix? <> file)
2296 '(".zip" ".so" ".dll" ".exe" ".jar")))
2297 (define (parents child)
2298 ;; Return all parent directories of CHILD up to and including
2299 ;; the closest "third_party".
2300 (let* ((dirs (match (string-split child #\/)
2301 ((dirs ... last) dirs)))
2302 (closest (list-index (lambda (dir)
2303 (string=? "third_party" dir))
2305 (delim (- (length dirs) closest)))
2306 (fold (lambda (dir prev)
2307 (cons (string-append (car prev) "/" dir)
2309 (list (string-join (list-head dirs delim) "/"))
2310 (list-tail dirs delim))))
2311 (define (remove-loudly file)
2312 (format #t "deleting ~a...~%" file)
2315 (define (delete-unwanted-files child stat flag base level)
2317 ((or 'regular 'symlink 'stale-symlink)
2318 (when (third-party? child)
2319 (unless (or (member child preserved-club)
2320 (any (cute member <> preserved-club)
2322 (regexp-exec protected child))
2323 (remove-loudly child)))
2324 (when (and (useless? child) (file-exists? child))
2325 (remove-loudly child))
2327 ('directory-processed
2328 (when (empty? child)
2333 (with-directory-excursion "src/3rdparty"
2334 ;; TODO: Try removing "gn" too for future versions of qtwebengine-5.
2335 (delete-file-recursively "ninja")
2337 (with-directory-excursion "chromium"
2338 ;; Delete bundled software and binaries that were not explicitly
2340 (nftw "." delete-unwanted-files 'depth 'physical)
2342 ;; Assert that each preserved item is present to catch removals.
2343 (for-each (lambda (third-party)
2344 (unless (file-exists? third-party)
2345 (error (format #f "~s does not exist!~%" third-party))))
2348 ;; Use relative header locations instead of hard coded ones.
2350 "base/third_party/dynamic_annotations/dynamic_annotations.c"
2351 (("base/third_party/valgrind") "valgrind"))
2353 "third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.h"
2354 (("third_party/curl") "curl"))
2356 '("components/viz/common/gpu/vulkan_context_provider.h"
2357 "components/viz/common/resources/resource_format_utils_vulkan.h"
2358 "gpu/config/gpu_util.cc")
2359 (("third_party/vulkan/include/")
2362 ;; Replace Google Analytics bundle with an empty file and hope
2364 (mkdir-p "third_party/analytics")
2365 (call-with-output-file
2366 "third_party/analytics/google-analytics-bundle.js"
2369 ;; Do not enable support for loading the Widevine DRM plugin.
2370 (substitute* "src/buildtools/config/common.pri"
2371 (("enable_widevine=true")
2372 "enable_widevine=false")))))))
2373 (build-system gnu-build-system)
2408 ;; FIXME: libxml2 needs to built with icu support though it links to
2409 ;; libxml2 configure summary still states "Checking for compatible
2410 ;; system libxml2... no"
2435 (substitute-keyword-arguments (package-arguments qtsvg-5)
2436 ((#:modules modules '())
2437 `((guix build gnu-build-system)
2439 (ice-9 textual-ports)))
2441 `(modify-phases ,phases
2442 (add-before 'configure 'substitute-source
2443 (lambda* (#:key inputs outputs #:allow-other-keys)
2444 (let ((out (assoc-ref outputs "out")))
2445 (with-atomic-file-replacement
2446 "src/buildtools/config/linux.pri"
2448 (display (get-string-all in) out)
2449 (display "\ngn_args += use_system_openh264=true\n" out)))
2450 ;; Qtwebengine is not installed into the same prefix as
2451 ;; qtbase. Some qtbase QTLibraryInfo constants will not
2452 ;; work. Replace with the full path to the qtwebengine-5
2453 ;; translations and locales in the store.
2454 (substitute* "src/core/web_engine_library_info.cpp"
2455 (("QLibraryInfo::location\\(QLibraryInfo::TranslationsPath\\)")
2456 (string-append "QLatin1String(\"" out "/share/qt5/translations\")"))
2457 (("QLibraryInfo::location\\(QLibraryInfo::DataPath\\)")
2458 (string-append "QLatin1String(\"" out "/share/qt5\")")))
2459 ;; Substitute full dynamic library path for nss.
2460 (substitute* "src/3rdparty/chromium/crypto/nss_util.cc"
2462 (search-input-file inputs "lib/nss/libnssckbi.so")))
2463 ;; Substitute full dynamic library path for udev.
2464 (substitute* "src/3rdparty/chromium/device/udev_linux/udev1_loader.cc"
2466 (search-input-file inputs "lib/libudev.so.1"))))))
2467 (add-before 'configure 'set-env
2469 ;; Avoids potential race conditions.
2470 (setenv "PYTHONDONTWRITEBYTECODE" "1")
2471 (setenv "NINJAFLAGS"
2472 (string-append "-k1" ;less verbose build output
2473 ;; Respect the '--cores' option of 'guix build'.
2474 " -j" (number->string (parallel-job-count))))))
2477 ;; Valid QT_BUILD_PARTS variables are:
2478 ;; libs tools tests examples demos docs translations
2479 (invoke "qmake" "QT_BUILD_PARTS = libs tools" "--"
2480 "--webengine-printing-and-pdf=no"
2481 "--webengine-ffmpeg=system"
2482 ;; FIXME: Building qtwebengine-5 5.12.2 with
2483 ;; icu4c >= 68 fails.
2484 ;;"--webengine-icu=system"
2485 "--webengine-pepper-plugins=no"
2486 "-webengine-proprietary-codecs")))))
2487 ;; Tests are disabled due to "Could not find QtWebEngineProcess error"
2488 ;; It's possible this can be fixed by setting QTWEBENGINEPROCESS_PATH
2489 ;; before running tests.
2490 ((#:tests? _ #f) #f)))
2491 (native-search-paths
2492 (list (search-path-specification
2493 (file-type 'regular)
2495 (variable "QTWEBENGINEPROCESS_PATH")
2496 (files '("lib/qt5/libexec/QtWebEngineProcess")))))
2497 (home-page "https://wiki.qt.io/QtWebEngine")
2498 (synopsis "Qt WebEngine module")
2499 (description "The Qt5WebEngine module provides support for web applications
2500 using the Chromium browser project. The Chromium source code has Google services
2501 and binaries removed, and adds modular support for using system libraries.")
2502 (license license:lgpl2.1+)))
2504 (define-public qtwebengine
2506 (name "qtwebengine")
2511 (uri (qt5-urls name version))
2514 "0ivfsqd5c0cxsnssj6z37901cf6a47w50zaqgjiysvcm3ar36ymd"))
2515 (modules '((ice-9 ftw)
2519 (guix build utils)))
2522 (let ((preserved-third-party-files
2523 '("base/third_party/double_conversion"
2524 "base/third_party/cityhash"
2525 "base/third_party/cityhash_v103"
2526 "base/third_party/dynamic_annotations"
2527 "base/third_party/icu"
2528 "base/third_party/libevent"
2529 "base/third_party/nspr"
2530 "base/third_party/superfasthash"
2531 "base/third_party/symbolize"
2532 "base/third_party/xdg_mime"
2533 "base/third_party/xdg_user_dirs"
2534 "net/third_party/mozilla_security_manager"
2535 "net/third_party/nss"
2536 "net/third_party/quiche"
2537 "net/third_party/uri_template"
2538 "third_party/abseil-cpp"
2540 "third_party/angle/src/common/third_party/base"
2541 "third_party/angle/src/common/third_party/smhasher"
2542 "third_party/angle/src/common/third_party/xxhash"
2543 "third_party/axe-core"
2545 "third_party/boringssl"
2546 "third_party/boringssl/src/third_party/fiat"
2547 "third_party/breakpad"
2548 "third_party/brotli"
2551 "third_party/closure_compiler"
2552 "third_party/crashpad"
2553 "third_party/crashpad/crashpad/third_party/lss"
2554 "third_party/crashpad/crashpad/third_party/zlib"
2555 "third_party/crc32c"
2558 "third_party/devtools-frontend"
2559 "third_party/devtools-frontend/src/front_end/third_party/lighthouse"
2560 "third_party/devtools-frontend/src/front_end/third_party/wasmparser"
2561 "third_party/emoji-segmenter"
2562 "third_party/ffmpeg"
2563 "third_party/googletest"
2564 "third_party/harfbuzz-ng/utils"
2565 "third_party/hunspell"
2566 "third_party/iccjpeg"
2568 "third_party/inspector_protocol"
2569 "third_party/jinja2"
2570 "third_party/jsoncpp"
2571 "third_party/jstemplate"
2572 "third_party/khronos"
2573 "third_party/leveldatabase"
2574 "third_party/libaddressinput"
2575 "third_party/libgifcodec"
2576 "third_party/libjingle_xmpp"
2577 "third_party/libjpeg_turbo"
2578 "third_party/libpng"
2579 "third_party/libsrtp"
2580 "third_party/libsync"
2581 "third_party/libudev"
2582 "third_party/libvpx"
2583 "third_party/libwebm"
2584 "third_party/libwebp"
2585 "third_party/libxml"
2586 "third_party/libxslt"
2587 "third_party/libyuv"
2590 "third_party/markupsafe"
2591 "third_party/mesa_headers"
2592 "third_party/metrics_proto"
2593 "third_party/modp_b64"
2595 "third_party/one_euro_filter"
2596 "third_party/openh264/src/codec/api/svc"
2599 "third_party/pdfium"
2600 "third_party/pdfium/third_party/agg23"
2601 "third_party/pdfium/third_party/base"
2602 "third_party/pdfium/third_party/freetype"
2603 "third_party/pdfium/third_party/lcms"
2604 "third_party/pdfium/third_party/libopenjpeg20"
2605 "third_party/pdfium/third_party/skia_shared"
2606 "third_party/perfetto"
2609 "third_party/polymer"
2610 "third_party/protobuf"
2611 "third_party/protobuf/third_party/six"
2612 "third_party/pyjson5"
2614 "third_party/rnnoise"
2616 "third_party/skia/include/third_party/skcms/skcms.h"
2617 "third_party/skia/include/third_party/vulkan"
2618 "third_party/skia/third_party/skcms"
2619 "third_party/skia/third_party/vulkanmemoryallocator"
2620 "third_party/smhasher"
2621 "third_party/snappy"
2622 "third_party/sqlite"
2623 "third_party/usb_ids"
2624 "third_party/usrsctp"
2625 "third_party/web-animations-js"
2626 "third_party/webrtc"
2627 "third_party/webrtc/common_audio/third_party/ooura"
2628 "third_party/webrtc/common_audio/third_party/spl_sqrt_floor"
2629 "third_party/webrtc/modules/third_party/fft"
2630 "third_party/webrtc/modules/third_party/g711"
2631 "third_party/webrtc/modules/third_party/g722"
2632 "third_party/webrtc/rtc_base/third_party/base64"
2633 "third_party/webrtc/rtc_base/third_party/sigslot"
2634 "third_party/webrtc_overrides"
2635 "third_party/widevine/cdm/widevine_cdm_common.h"
2636 "third_party/widevine/cdm/widevine_cdm_version.h"
2639 "url/third_party/mozilla"
2640 "v8/src/third_party/utf8-decoder"
2641 "v8/src/third_party/valgrind"
2642 "v8/src/third_party/siphash"
2643 "v8/third_party/v8/builtins"
2644 "v8/third_party/inspector_protocol"))
2645 (protected (make-regexp "\\.(gn|gyp)i?$")))
2646 (define preserved-club
2647 (map (lambda (member)
2648 (string-append "./" member))
2649 preserved-third-party-files))
2650 (define (empty? dir)
2651 (equal? (scandir dir) '("." "..")))
2652 (define (third-party? file)
2653 (string-contains file "third_party/"))
2654 (define (useless? file)
2655 (any (cute string-suffix? <> file)
2656 '(".zip" ".so" ".dll" ".exe" ".jar")))
2657 (define (parents child)
2658 ;; Return all parent directories of CHILD up to and including
2659 ;; the closest "third_party".
2660 (let* ((dirs (match (string-split child #\/)
2661 ((dirs ... last) dirs)))
2662 (closest (list-index (lambda (dir)
2663 (string=? "third_party" dir))
2665 (delim (- (length dirs) closest)))
2666 (fold (lambda (dir prev)
2667 (cons (string-append (car prev) "/" dir)
2669 (list (string-join (list-head dirs delim) "/"))
2670 (list-tail dirs delim))))
2671 (define (remove-loudly file)
2672 (format #t "deleting ~a...~%" file)
2675 (define (delete-unwanted-files child stat flag base level)
2677 ((or 'regular 'symlink 'stale-symlink)
2678 (when (third-party? child)
2679 (unless (or (member child preserved-club)
2680 (any (cute member <> preserved-club)
2682 (regexp-exec protected child))
2683 (remove-loudly child)))
2684 (when (and (useless? child) (file-exists? child))
2685 (remove-loudly child)))
2686 ('directory-processed
2687 (when (empty? child)
2691 (with-directory-excursion "src/3rdparty"
2692 (delete-file-recursively "ninja")
2694 (with-directory-excursion "chromium"
2695 ;; Delete bundled software and binaries that were not
2696 ;; explicitly preserved above.
2697 (nftw "." delete-unwanted-files 'depth 'physical)
2699 ;; Assert that each preserved item is present to catch
2701 (for-each (lambda (third-party)
2702 (unless (file-exists? third-party)
2703 (error (format #f "~s does not exist!~%"
2707 ;; Use relative header locations instead of hard coded ones.
2709 "base/third_party/dynamic_annotations/dynamic_annotations.c"
2710 (("base/third_party/valgrind") "valgrind"))
2711 (substitute* "third_party/breakpad/breakpad/src/common/\
2712 linux/libcurl_wrapper.h"
2713 (("third_party/curl") "curl"))
2715 '("components/viz/common/gpu/vulkan_context_provider.h"
2716 "gpu/config/gpu_util.cc")
2717 (("third_party/vulkan/include/")
2720 ;; Replace Google Analytics bundle with an empty file and
2721 ;; hope no one notices.
2722 (mkdir-p "third_party/analytics")
2723 (call-with-output-file
2724 "third_party/analytics/google-analytics-bundle.js"
2727 ;; Do not enable support for loading the Widevine DRM plugin.
2728 (substitute* "src/core/CMakeLists.txt"
2729 (("enable_widevine=true")
2730 "enable_widevine=false")))))))
2731 (build-system cmake-build-system)
2734 ;; XXX: The test suite is not built by default; leave it off to save
2735 ;; some build time and resources.
2738 ;; Use the CMake ninja generator, otherwise the build fails (see:
2739 ;; https://bugreports.qt.io/browse/QTBUG-96897).
2741 ;; Manually add the NSS library prefix to the linker
2742 ;; search path, otherwise it fails to be linked (see:
2743 ;; https://bugreports.qt.io/browse/QTBUG-105053).
2744 (string-append "-DCMAKE_SHARED_LINKER_FLAGS=-L"
2745 (search-input-directory %build-inputs "lib/nss"))
2747 ;; The PDF renderer plugin fails to build with errors such as
2748 ;; "src/3rdparty/chromium/components/pdf
2749 ;; /renderer/pdf_accessibility_tree.cc:1373:39:
2750 ;; error: use of undeclared identifier 'IDS_PDF_PAGE_INDEX'";
2752 "-DQT_FEATURE_webengine_printing_and_pdf=OFF"
2753 "-DQT_FEATURE_webengine_pepper_plugins=OFF" ;widevine
2754 "-DQT_FEATURE_system_ffmpeg=ON"
2755 ;; Do not artificially limit codec support; video decoding is
2757 "-DQT_FEATURE_webengine_proprietary_codecs=ON"
2758 "-DQT_FEATURE_webengine_system_alsa=ON"
2759 "-DQT_FEATURE_webengine_system_icu=ON"
2760 "-DQT_FEATURE_webengine_system_libxml=ON"
2761 "-DQT_FEATURE_webengine_system_libpci=ON"
2762 "-DQT_FEATURE_webengine_system_libpng=ON"
2763 "-DQT_FEATURE_webengine_system_pulseaudio=ON"
2764 "-DQT_FEATURE_webengine_system_zlib=ON")
2766 #~(modify-phases %standard-phases
2767 (add-after 'unpack 'patch-paths
2768 (lambda* (#:key inputs #:allow-other-keys)
2769 ;; Qtwebengine is not installed into the same prefix as qtbase.
2770 ;; Some qtbase QTLibraryInfo constants will not work. Replace
2771 ;; with the full path to the qtwebengine translations and
2772 ;; locales in the store.
2773 (substitute* "src/core/web_engine_library_info.cpp"
2774 (("QLibraryInfo::path\\(QLibraryInfo::TranslationsPath)")
2775 (string-append "QLatin1String(\"" #$output
2776 "/share/qt6/translations\")"))
2777 (("QLibraryInfo::path\\(QLibraryInfo::DataPath)")
2778 (string-append "QLatin1String(\"" #$output
2780 ;; Substitute full dynamic library path for nss.
2781 (substitute* "src/3rdparty/chromium/crypto/nss_util.cc"
2783 (search-input-file inputs "lib/nss/libnssckbi.so")))
2784 ;; Substitute full dynamic library path for udev.
2785 (substitute* "src/3rdparty/chromium/device/udev_linux/udev1_loader.cc"
2787 (search-input-file inputs "lib/libudev.so.1")))
2788 ;; Patch the location of the X11 keywoard layouts, otherwise
2789 ;; webengine *crashes* at run time when the default directory,
2790 ;; '/usr/share/X11/xkb' is empty (see:
2791 ;; https://bugreports.qt.io/browse/QTBUG-105124).
2792 (substitute* "src/3rdparty/chromium/ui/events/ozone/layout/xkb\
2793 /xkb_keyboard_layout_engine.cc"
2794 (("/usr/share/X11/xkb")
2795 (search-input-directory inputs "share/X11/xkb")))))
2796 (add-before 'configure 'prepare-build-environment
2798 ;; Avoids potential race conditions.
2799 (setenv "PYTHONDONTWRITEBYTECODE" "1")
2800 (setenv "NINJAFLAGS"
2802 "-k1" ;less verbose build output
2803 ;; Respect the '--cores' option of 'guix build'.
2804 " -j" (number->string (parallel-job-count))))
2805 ;; Use Clang/LDD to help tame the memory requirements and hasten
2807 (setenv "AR" "llvm-ar") (setenv "NM" "llvm-nm")
2808 (setenv "CC" "clang") (setenv "CXX" "clang++")))
2810 (lambda* (#:key parallel-build? #:allow-other-keys)
2811 (apply invoke "cmake" "--build" "."
2813 `("--parallel" ,(number->string (parallel-job-count)))
2817 (invoke "cmake" "--install" "."))))))
2819 (modify-inputs (package-native-inputs qtwebengine-5)
2820 (delete "python2" "python2-six")
2827 (modify-inputs (package-inputs qtwebengine-5)
2828 (replace "qtbase" qtbase)
2829 (replace "qtdeclarative" qtdeclarative)
2830 (replace "qtmultimedia" qtmultimedia)
2831 (replace "qtwebchannel" qtwebchannel)
2832 (append libxkbfile xkeyboard-config)))
2833 (native-search-paths
2834 (list (search-path-specification
2835 (file-type 'regular)
2837 (variable "QTWEBENGINEPROCESS_PATH")
2838 (files '("lib/qt5/libexec/QtWebEngineProcess")))))
2839 (home-page "https://wiki.qt.io/QtWebEngine")
2840 (synopsis "Qt WebEngine module")
2841 (description "The Qt WebEngine module provides support for web
2842 applications using the Chromium browser project. The Chromium source code has
2843 Google services and binaries removed, and adds modular support for using
2845 (license license:lgpl2.1+)))
2847 (define-public single-application-qt5
2848 ;; Change in function signature, nheko requires at least this commit
2849 (let ((commit "dc8042b5db58f36e06ba54f16f38b16c5eea9053"))
2851 (name "single-application-qt5")
2852 (version (string-append "3.2.0-" (string-take commit 7)))
2858 (url "https://github.com/itay-grudev/SingleApplication")
2860 (file-name (git-file-name name version))
2863 "163aa2x2qb0h8w26si5ql833ilj427jjbdwlz1p2p8iaq6dh0vq1"))))
2864 (build-system cmake-build-system)
2866 `(#:tests? #f ; no check target
2867 ;; Projects can decide how to build this library. You might need to
2868 ;; override this flag (QApplication, QGuiApplication or
2869 ;; QCoreApplication).
2870 #:configure-flags '("-DQAPPLICATION_CLASS=QApplication")
2872 (modify-phases %standard-phases
2873 ;; No install target, install things manually
2875 (lambda* (#:key inputs outputs source #:allow-other-keys)
2876 (let* ((qt (assoc-ref inputs "qtbase"))
2877 (qt-version ,(version-major (package-version qtbase-5)))
2878 (out (assoc-ref outputs "out")))
2880 "libSingleApplication.a" (string-append out "/lib"))
2884 (string-append source "/" file)
2885 (string-append out "/include")))
2886 '("SingleApplication"
2887 "singleapplication.h" "singleapplication_p.h"))
2891 (home-page "https://github.com/itay-grudev/SingleApplication")
2892 (synopsis "Replacement of QtSingleApplication for Qt5 and Qt6")
2894 "SingleApplication is a replacement of the QtSingleApplication for Qt5 and Qt6.
2896 It keeps the Primary Instance of your Application and kills each subsequent
2897 instances. It can (if enabled) spawn secondary (non-related to the primary)
2898 instances and can send data to the primary instance from secondary
2900 (license license:expat))))
2902 (define-public python-sip
2909 (uri (list (pypi-uri "sip" version)
2910 (string-append "https://www.riverbankcomputing.com/static/"
2911 "Downloads/sip/" version
2912 "/sip-" version ".tar.gz")))
2915 "1idaivamp1jvbbai9yzv471c62xbqxhaawccvskaizihkd0lq0jx"))))
2916 (build-system python-build-system)
2918 (list python-wrapper))
2920 (list python-toml python-packaging))
2921 (home-page "https://www.riverbankcomputing.com/software/sip/intro")
2922 (synopsis "Python binding creator for C and C++ libraries")
2924 "SIP is a tool to create Python bindings for C and C++ libraries. It
2925 was originally developed to create PyQt, the Python bindings for the Qt
2926 toolkit, but can be used to create bindings for any C or C++ library.
2928 SIP comprises a code generator and a Python module. The code generator
2929 processes a set of specification files and generates C or C++ code, which
2930 is then compiled to create the bindings extension module. The SIP Python
2931 module provides support functions to the automatically generated code.")
2932 ;; There is a choice between a python like license, gpl2 and gpl3.
2933 ;; For compatibility with pyqt, we need gpl3.
2934 (license license:gpl3)))
2936 (define-public python-sip-4
2938 (inherit python-sip)
2944 (uri (list (pypi-uri "sip" version)
2945 (string-append "https://www.riverbankcomputing.com/static/"
2946 "Downloads/sip/" version
2947 "/sip-" version ".tar.gz")))
2950 "04a23cgsnx150xq86w1z44b6vr2zyazysy9mqax0fy346zlr77dk"))))
2951 (build-system gnu-build-system)
2953 `(("python" ,python-wrapper)))
2954 (propagated-inputs `())
2956 `(#:tests? #f ; no check target
2957 #:imported-modules ((guix build python-build-system)
2958 ,@%gnu-build-system-modules)
2959 #:modules ((srfi srfi-1)
2960 ((guix build python-build-system) #:select (python-version))
2961 ,@%gnu-build-system-modules)
2963 (modify-phases %standard-phases
2965 (lambda* (#:key inputs outputs #:allow-other-keys)
2966 (let* ((out (assoc-ref outputs "out"))
2967 (bin (string-append out "/bin"))
2968 (include (string-append out "/include"))
2969 (python (assoc-ref inputs "python"))
2970 (lib (string-append out "/lib/python"
2971 (python-version python)
2973 (invoke "python" "configure.py"
2976 "--incdir" include)))))))
2977 (license license:gpl3)))
2979 (define-public python-pyqt
2981 (name "python-pyqt")
2986 ;; PyPI is the canonical distribution point of PyQt. Older
2987 ;; releases are available from the web site.
2988 (uri (list (pypi-uri "PyQt5" version)
2989 (string-append "https://www.riverbankcomputing.com/static/"
2990 "Downloads/PyQt5/" version "/PyQt5-"
2991 version ".tar.gz")))
2992 (file-name (string-append "PyQt5-" version ".tar.gz"))
2995 "1z74295i69cha52llsqffzhb5zz7qnbjc64h8qg21l91jgf0harp"))
2996 (patches (search-patches "pyqt-configure.patch"))))
2997 (build-system gnu-build-system)
2999 (list qtbase-5)) ; for qmake
3001 (list python-sip python-pyqt5-sip))
3003 `(("python" ,python-wrapper)
3004 ("qtbase" ,qtbase-5)
3005 ("qtconnectivity" ,qtconnectivity)
3006 ("qtdeclarative-5" ,qtdeclarative-5)
3007 ("qtlocation" ,qtlocation)
3008 ("qtmultimedia-5" ,qtmultimedia-5)
3009 ("qtsensors" ,qtsensors)
3010 ("qtserialport" ,qtserialport)
3011 ("qtsvg-5" ,qtsvg-5)
3012 ("qttools-5" ,qttools-5)
3013 ("qtwebchannel-5" ,qtwebchannel-5)
3014 ("qtwebkit" ,qtwebkit)
3015 ("qtwebsockets-5" ,qtwebsockets-5)
3016 ("qtx11extras" ,qtx11extras)
3017 ("qtxmlpatterns" ,qtxmlpatterns)))
3019 `(#:modules ((srfi srfi-1)
3020 ((guix build python-build-system) #:select (python-version))
3021 ,@%gnu-build-system-modules)
3022 #:imported-modules ((guix build python-build-system)
3023 ,@%gnu-build-system-modules)
3025 (modify-phases %standard-phases
3026 ;; When building python-pyqtwebengine, <qprinter.h> can not be
3027 ;; included. Here we substitute the full path to the header in the
3029 (add-before 'configure 'substitute-source
3030 (lambda* (#:key inputs #:allow-other-keys)
3031 (let* ((qtbase (assoc-ref inputs "qtbase"))
3032 (qtprinter.h (string-append "\"" qtbase "/include/qt5/QtPrintSupport/qprinter.h\"")))
3033 (substitute* "sip/QtPrintSupport/qprinter.sip"
3038 (lambda* (#:key inputs outputs #:allow-other-keys)
3039 (let* ((out (assoc-ref outputs "out"))
3040 (bin (string-append out "/bin"))
3041 (sip (string-append out "/share/sip"))
3042 (plugins (string-append out "/lib/qt5/plugins"))
3043 (designer (string-append plugins "/designer"))
3044 (qml (string-append plugins "/PyQt5"))
3045 (python (assoc-ref inputs "python"))
3046 (lib (string-append out "/lib/python"
3047 (python-version python)
3049 (stubs (string-append lib "/PyQt5")))
3050 (invoke "python" "configure.py"
3054 "--designer-plugindir" designer
3055 "--qml-plugindir" qml
3056 ; Where to install the PEP 484 Type Hints stub
3057 ; files. Without this the stubs are tried to be
3058 ; installed into the python package's
3059 ; site-package directory, which is read-only.
3061 "--sipdir" sip)))))))
3062 (home-page "https://www.riverbankcomputing.com/software/pyqt/intro")
3063 (synopsis "Python bindings for Qt")
3065 "PyQt is a set of Python v2 and v3 bindings for the Qt application
3066 framework. The bindings are implemented as a set of Python modules and
3067 contain over 620 classes.")
3068 (license license:gpl3)))
3070 (define-public python-pyqt5-sip
3072 (name "python-pyqt5-sip")
3077 (uri (pypi-uri "PyQt5_sip" version))
3080 "1gg032ys4pccwkdzmdryadc9a4lq85nr05pag9swrsdykbdl9s9h"))))
3081 (build-system python-build-system)
3083 `(#:tests? #f)) ;; No test code.
3084 (home-page "https://www.riverbankcomputing.com/software/sip/")
3085 (synopsis "Sip module support for PyQt5")
3086 (description "Sip module support for PyQt5")
3087 (license license:lgpl2.1+)))
3089 (define-public python-pyqtwebengine
3091 (name "python-pyqtwebengine")
3096 ;; The newest releases are only available on PyPI. Older ones
3097 ;; are mirrored at the upstream home page.
3098 (uri (list (pypi-uri "PyQtWebEngine" version)
3099 (string-append "https://www.riverbankcomputing.com/static"
3100 "/Downloads/PyQtWebEngine/" version
3101 "/PyQtWebEngine-" version ".tar.gz")))
3104 "0d56ak71r14w4f9r96vaj34qcn2rbln3s6ildvvyc707fjkzwwjd"))))
3105 (build-system gnu-build-system)
3107 (list python python-sip
3108 ;; qtbase is required for qmake
3111 `(("python" ,python-wrapper)
3112 ("python-sip" ,python-sip)
3113 ("python-pyqt" ,python-pyqt-without-qtwebkit)
3114 ("qtbase" ,qtbase-5)
3115 ("qtsvg-5" ,qtsvg-5)
3116 ("qtdeclarative-5" ,qtdeclarative-5)
3117 ("qtwebchannel-5" ,qtwebchannel-5)
3118 ("qtwebengine-5" ,qtwebengine-5)))
3120 `(#:modules ((srfi srfi-1)
3121 ((guix build python-build-system) #:select (python-version))
3122 ,@%gnu-build-system-modules)
3123 #:imported-modules ((guix build python-build-system)
3124 ,@%gnu-build-system-modules)
3126 (modify-phases %standard-phases
3128 (lambda* (#:key inputs outputs #:allow-other-keys)
3129 (let* ((out (assoc-ref outputs "out"))
3130 (sipdir (string-append out "/share/sip"))
3131 (pyqt-sipdir (string-append
3132 (assoc-ref inputs "python-pyqt") "/share/sip"))
3133 (python (assoc-ref inputs "python"))
3134 (lib (string-append out "/lib/python"
3135 (python-version python)
3136 "/site-packages/PyQt5"))
3137 (stubs (string-append lib "/PyQt5")))
3140 (invoke "python" "configure.py"
3147 "--pyqt-sipdir" pyqt-sipdir))))
3148 ;; Because this has a different prefix than python-pyqt then we need
3149 ;; to make this a namespace of its own.
3150 (add-after 'install 'make-namespace
3151 (lambda* (#:key inputs outputs #:allow-other-keys)
3152 (let* ((__init__.py (string-append
3153 (assoc-ref outputs "out")
3155 (python-version (assoc-ref inputs "python"))
3156 "/site-packages/PyQt5/__init__.py")))
3157 (with-output-to-file __init__.py
3158 (lambda _ (display "
3159 from pkgutil import extend_path
3160 __path__ = extend_path(__path__, __name__)
3163 (home-page "https://www.riverbankcomputing.com/software/pyqtwebengine/intro")
3164 (synopsis "Python bindings for QtWebEngine")
3166 "PyQtWebEngine is a set of Python bindings for The Qt Company's Qt
3167 WebEngine libraries. The bindings sit on top of PyQt5 and are implemented as a
3168 set of three modules. Prior to v5.12 these bindings were part of PyQt
3170 (license license:gpl3)))
3172 ;; XXX: This is useful for removing qtwebkit from other packages' dependency
3173 ;; graphs, as well as for preventing python-pyqtwebengine from transitively
3174 ;; depending on qtwebkit.
3175 ;; Ultimately, it would be nicer to have a more modular set of python-pyqt-*
3176 ;; packages that could be used together.
3177 (define-public python-pyqt-without-qtwebkit
3178 (package/inherit python-pyqt
3179 (name "python-pyqt-without-qtwebkit")
3181 (alist-delete "qtwebkit" (package-inputs python-pyqt)))))
3183 (define-public python-pyqt-builder
3185 (name "python-pyqt-builder")
3190 (uri (pypi-uri "PyQt-builder" version))
3193 "0nh0054c54ji3sm6d268fccf0y5f613spswwgwqd3rnn816hnljl"))))
3194 (build-system python-build-system)
3197 (home-page "https://www.riverbankcomputing.com/static/Docs/PyQt-builder/")
3198 (synopsis "PEP 517 compliant PyQt build system")
3199 (description "PyQt-builder is a tool for generating Python bindings for C++
3200 libraries that use the Qt application framework. The bindings are built on
3201 top of the PyQt bindings for Qt. PyQt-builder is used to build PyQt itself.")
3202 ;; Either version 2 or 3, but no other version. See the file
3203 ;; 'pyqtbuild/builder.py' in the source distribution for more information.
3204 (license (list license:gpl2 license:gpl3))))
3206 (define-public python-qtpy
3208 (name "python-qtpy")
3213 (uri (pypi-uri "QtPy" version))
3216 "13zbhnl2rm30xafwrzfwdb4mjp7gk4s9h2xagbf83pnjzczhgzdd"))))
3217 (build-system python-build-system)
3218 (propagated-inputs (list python-packaging))
3220 `(;; Not all supported bindings are packaged. Especially PyQt4.
3222 (home-page "https://github.com/spyder-ide/qtpy")
3224 "Qt bindings (PyQt5, PyQt4 and PySide) and additional custom QWidgets")
3226 "Provides an abstraction layer on top of the various Qt bindings
3227 (PyQt5, PyQt4 and PySide) and additional custom QWidgets.")
3228 (license license:expat)))
3230 (define-public qscintilla
3236 (uri (string-append "https://www.riverbankcomputing.com/static"
3237 "/Downloads/QScintilla/" version
3238 "/QScintilla-" version ".tar.gz"))
3241 "19r0vpqb4m9bqwxmjp9w6x0hgahkrg7zryk78hwgplj7vdbn0d77"))))
3242 (build-system gnu-build-system)
3245 (modify-phases %standard-phases
3247 (lambda* (#:key outputs #:allow-other-keys)
3248 (let ((out (assoc-ref outputs "out")))
3250 (substitute* "qscintilla.pro"
3251 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
3252 (string-append out "/lib"))
3253 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
3254 (string-append out "/include"))
3255 (("\\$\\$\\[QT_INSTALL_TRANSLATIONS\\]")
3256 (string-append out "/translations"))
3257 (("\\$\\$\\[QT_INSTALL_DATA\\]")
3258 (string-append out "/lib/qt$${QT_MAJOR_VERSION}"))
3259 (("\\$\\$\\[QT_HOST_DATA\\]")
3260 (string-append out "/lib/qt$${QT_MAJOR_VERSION}")))
3261 (invoke "qmake")))))))
3262 (native-inputs (list qtbase-5))
3263 (home-page "https://www.riverbankcomputing.co.uk/software/qscintilla/intro")
3264 (synopsis "Qt port of the Scintilla C++ editor control")
3265 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
3266 editor control. QScintilla includes features especially useful when editing
3267 and debugging source code. These include support for syntax styling, error
3268 indicators, code completion and call tips.")
3269 (license license:gpl3+)))
3271 (define-public python-qscintilla
3272 (package/inherit qscintilla
3273 (name "python-qscintilla")
3276 (list "--pyqt=PyQt5"
3277 (string-append "--pyqt-sipdir="
3278 (assoc-ref %build-inputs "python-pyqt")
3280 (string-append "--qsci-incdir="
3281 (assoc-ref %build-inputs "qscintilla")
3283 (string-append "--qsci-libdir="
3284 (assoc-ref %build-inputs "qscintilla")
3287 (modify-phases %standard-phases
3289 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
3290 (let ((out (assoc-ref outputs "out"))
3291 (python (assoc-ref inputs "python")))
3293 (apply invoke "python3" "configure.py"
3295 ;; Install to the right directory
3296 (substitute* '("Makefile"
3298 (("\\$\\(INSTALL_ROOT\\)/gnu/store/[^/]+") out)
3299 (((string-append python "/lib"))
3300 (string-append out "/lib")))
3301 ;; And fix the installed.txt file
3302 (substitute* "installed.txt"
3303 (("/gnu/store/[^/]+") out)))
3306 `(("qscintilla" ,qscintilla)
3308 ("python-pyqt" ,python-pyqt)))
3309 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
3310 editor control. QScintilla includes features especially useful when editing
3311 and debugging source code. These include support for syntax styling, error
3312 indicators, code completion and call tips.
3314 This package provides the Python bindings.")))
3316 ;; PyQt only looks for modules in its own directory. It ignores environment
3317 ;; variables such as PYTHONPATH, so we need to build a union package to make
3319 (define-public python-pyqt+qscintilla
3320 (package/inherit python-pyqt
3321 (name "python-pyqt+qscintilla")
3323 (build-system trivial-build-system)
3325 '(#:modules ((guix build union))
3327 (use-modules (ice-9 match)
3329 (match %build-inputs
3330 (((names . directories) ...)
3331 (union-build (assoc-ref %outputs "out")
3335 `(("python-pyqt" ,python-pyqt)
3336 ("python-qscintilla" ,python-qscintilla)))
3337 (synopsis "Union of PyQt and the Qscintilla extension")
3339 "This package contains the union of PyQt and the Qscintilla extension.")))
3341 (define-public qtkeychain
3349 (url "https://github.com/frankosterfeld/qtkeychain/")
3350 (commit (string-append "v" version))))
3351 (file-name (git-file-name name version))
3354 "1zk6r2vc1q48qs7mw2h47bpgrfbb9r7lf9cwq4sb1a4nls87zznk"))))
3355 (build-system cmake-build-system)
3357 (list pkg-config qttools-5))
3359 (list libsecret qtbase-5))
3361 `(#:tests? #f ; No tests included
3363 (modify-phases %standard-phases
3364 (add-before 'configure 'set-qt-trans-dir
3366 (substitute* "CMakeLists.txt"
3367 (("\\$\\{qt_translations_dir\\}")
3368 "${CMAKE_INSTALL_PREFIX}/share/qt5/translations")))))))
3369 (home-page "https://github.com/frankosterfeld/qtkeychain")
3370 (synopsis "Qt API to store passwords")
3372 "QtKeychain is a Qt library to store passwords and other secret data
3373 securely. It will not store any data unencrypted unless explicitly requested.")
3374 (license license:bsd-3)))
3376 (define-public qtsolutions
3377 (let ((commit "9568abd142d581b67b86a5f63d823a34b0612702")
3380 (name "qtsolutions")
3381 (version (git-version "0" revision commit))
3386 (url "https://github.com/qtproject/qt-solutions")
3388 (file-name (git-file-name name version))
3390 (base32 "17fnmassflm3vxi0krpr6fff368jy38cby31a48rban4nqqmgx7n"))
3391 (modules '((guix build utils)
3395 ;; Unvendor QtLockFile from QtSingleApplication.
3397 (with-directory-excursion "qtsingleapplication/src"
3398 (for-each delete-file
3399 (find-files "." "qtlockedfile.*\\.(h|cpp)"))
3400 (substitute* "qtsingleapplication.pri"
3401 ;; Add include path of LockedFile.
3402 (("INCLUDEPATH \\+=")
3403 "INCLUDEPATH += ../../qtlockedfile/src")
3404 ;; Link library of LockedFile.
3406 "LIBS += -lQtSolutions_LockedFile"))
3407 (substitute* '("qtlocalpeer.h" "qtlocalpeer.cpp")
3408 (("#include \"qtlockedfile.*\\.cpp\"") "")
3409 ;; Unwrap namespace added in the vendoring process.
3410 (("QtLP_Private::QtLockedFile")
3413 (build-system gnu-build-system)
3415 `(#:tests? #f ; No target
3417 ((guix build copy-build-system)
3418 ,@%gnu-build-system-modules)
3420 (((guix build copy-build-system) #:prefix copy:)
3421 (guix build gnu-build-system)
3424 (modify-phases %standard-phases
3425 (add-after 'unpack 'patch-source
3426 (lambda* (#:key outputs #:allow-other-keys)
3427 (substitute* (find-files "." "common.pri")
3428 ;; Remove unnecessary prefixes/suffixes in library names.
3431 ;; Disable building of examples.
3432 (substitute* (find-files "." "\\.pro$")
3433 (("SUBDIRS\\+=examples") ""))
3434 ;; Fix deprecated functions.
3435 (substitute* "qtsoap/src/qtsoap.cpp"
3436 (("toAscii") "toUtf8"))
3440 (for-each (lambda (solution)
3441 (with-directory-excursion solution
3442 (invoke "./configure" "-library")
3444 '("qtlockedfile" "qtpropertybrowser" "qtservice"
3445 "qtsingleapplication" "qtsoap"))
3449 (for-each (lambda (solution)
3450 (with-directory-excursion solution
3452 '("qtlockedfile" "qtpropertybrowser" "qtservice"
3453 "qtsingleapplication" "qtsoap"))
3457 (for-each (lambda (solution)
3458 (with-directory-excursion solution
3460 (assoc-ref copy:%standard-phases 'install)
3462 '(("src" "include" #:include-regexp ("\\.h$"))
3465 '("qtlockedfile" "qtpropertybrowser" "qtservice"
3466 "qtsingleapplication" "qtsoap")))))))
3469 (synopsis "Collection of Qt extensions")
3470 (description "QtSolutions is a set of components extending Qt.
3472 @item QtLockedFile: A class that extends QFile with advisory locking functions.
3473 @item QtPropertyBrowser: A framework that enables the user to edit a set of
3475 @item QtService: A helper for writing services such as Unix daemons.
3476 @item QtSingleApplication: A component that provides support for applications
3477 that can be only started once per user.
3478 @item QtSoap: A component that provides basic web service support with version
3479 1.1 of the SOAP protocol.
3481 (home-page "https://doc.qt.io/archives/qq/qq09-qt-solutions.html")
3482 (license (list license:bsd-3
3483 ;; QScriptParser and QScriptGrammar specifically allow
3484 ;; redistribution under GPL3 or LGPL2.1
3485 license:gpl3 license:lgpl2.1)))))
3495 (string-append "mirror://sourceforge/qwt/qwt/"
3496 version "/qwt-" version ".tar.bz2"))
3498 (base32 "0hf0mpca248xlqn7xnzkfj8drf19gdyg5syzklvq8pibxiixwxj0"))))
3499 (build-system gnu-build-system)
3501 (list qtbase-5 qtsvg-5 qttools-5))
3504 (modify-phases %standard-phases
3506 (lambda* (#:key outputs #:allow-other-keys)
3507 (let* ((out (assoc-ref outputs "out"))
3508 (docdir (string-append out "/share/doc/qwt"))
3509 (incdir (string-append out "/include/qwt"))
3510 (pluginsdir (string-append out "/lib/qt5/plugins/designer"))
3511 (featuresdir (string-append out "/lib/qt5/mkspecs/features")))
3512 (substitute* '("qwtconfig.pri")
3513 (("^(\\s*QWT_INSTALL_PREFIX)\\s*=.*" _ x)
3514 (format #f "~a = ~a\n" x out))
3515 (("^(QWT_INSTALL_DOCS)\\s*=.*" _ x)
3516 (format #f "~a = ~a\n" x docdir))
3517 (("^(QWT_INSTALL_HEADERS)\\s*=.*" _ x)
3518 (format #f "~a = ~a\n" x incdir))
3519 (("^(QWT_INSTALL_PLUGINS)\\s*=.*" _ x)
3520 (format #f "~a = ~a\n" x pluginsdir))
3521 (("^(QWT_INSTALL_FEATURES)\\s*=.*" _ x)
3522 (format #f "~a = ~a\n" x featuresdir)))
3523 (substitute* '("doc/doc.pro")
3524 ;; We'll install them in the 'install-man-pages' phase.
3525 (("^unix:doc\\.files.*") ""))
3527 (add-after 'install 'install-man-pages
3528 (lambda* (#:key outputs #:allow-other-keys)
3529 (let* ((out (assoc-ref outputs "out"))
3530 (man (string-append out "/share/man")))
3531 ;; Remove some incomplete manual pages.
3532 (for-each delete-file (find-files "doc/man/man3" "^_tmp.*"))
3534 (copy-recursively "doc/man" man)
3536 (home-page "http://qwt.sourceforge.net")
3537 (synopsis "Qt widgets for plots, scales, dials and other technical software
3540 "The Qwt library contains widgets and components which are primarily useful
3541 for technical and scientific purposes. It includes a 2-D plotting widget,
3542 different kinds of sliders, and much more.")
3545 ;; The Qwt license is LGPL2.1 with some exceptions.
3546 (license:non-copyleft "http://qwt.sourceforge.net/qwtlicense.html")
3547 ;; textengines/mathml/qwt_mml_document.{cpp,h} is dual LGPL2.1/GPL3 (either).
3548 license:lgpl2.1 license:gpl3))))
3550 (define-public qtwebkit
3553 (version "5.212.0-alpha4")
3557 (uri (string-append "https://github.com/annulen/webkit/releases/download/"
3558 "qtwebkit-" version "/qtwebkit-" version ".tar.xz"))
3561 "1rm9sjkabxna67dl7myx9d9vpdyfxfdhrk9w7b94srkkjbd2d8cw"))
3562 (patches (search-patches "qtwebkit-pbutils-include.patch"
3563 "qtwebkit-fix-building-with-bison-3.7.patch"
3564 "qtwebkit-fix-building-with-glib-2.68.patch"
3565 "qtwebkit-fix-building-with-icu-68.patch"
3566 "qtwebkit-fix-building-with-python-3.9.patch"))))
3567 (build-system cmake-build-system)
3579 ("gst-plugins-base" ,gst-plugins-base)
3580 ("libjpeg" ,libjpeg-turbo)
3582 ("libwebp" ,libwebp)
3584 ("fontconfig" ,fontconfig)
3585 ("libxrender" ,libxrender)
3586 ("qtbase" ,qtbase-5)
3587 ("qtdeclarative-5" ,qtdeclarative-5)
3588 ("qtlocation" ,qtlocation)
3589 ("qtmultimedia-5" ,qtmultimedia-5)
3590 ("qtsensors" ,qtsensors)
3591 ("qtwebchannel-5" ,qtwebchannel-5)
3592 ("libxml2" ,libxml2)
3593 ("libxslt" ,libxslt)
3595 ("libxcomposite" ,libxcomposite)))
3597 `(#:tests? #f ; no apparent tests; it might be necessary to set
3598 ; ENABLE_API_TESTS, see CMakeLists.txt
3600 ;; Parallel builds fail due to a race condition:
3601 ;; <https://bugs.gnu.org/34062>.
3602 #:parallel-build? #f
3604 #:configure-flags (list ;"-DENABLE_API_TESTS=TRUE"
3606 "-DUSE_LIBHYPHEN=OFF"
3607 "-DUSE_SYSTEM_MALLOC=ON"
3608 ;; XXX: relative dir installs to build dir?
3609 (string-append "-DECM_MKSPECS_INSTALL_DIR="
3610 %output "/lib/qt5/mkspecs/modules")
3611 ;; Sacrifice a little speed in order to link
3612 ;; libraries and test executables in a
3613 ;; reasonable amount of memory.
3614 "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,--no-keep-memory"
3615 "-DCMAKE_EXE_LINKER_FLAGS=-Wl,--no-keep-memory")))
3616 (home-page "https://www.webkit.org")
3617 (synopsis "Web browser engine and classes to render and interact with web
3619 (description "QtWebKit provides a Web browser engine that makes it easy to
3620 embed content from the World Wide Web into your Qt application. At the same
3621 time Web content can be enhanced with native controls.")
3622 ;; Building QtWebKit takes around 13 hours on an AArch64 machine. Give some
3623 ;; room for slower or busy hardware.
3624 (properties '((timeout . 64800))) ;18 hours
3626 ;; XXX: This consumes too much RAM to successfully build on AArch64 (e.g.,
3627 ;; SoftIron OverDrive with 8 GiB of RAM), so instead of wasting resources,
3628 ;; disable it on non-Intel platforms.
3629 (supported-systems '("x86_64-linux" "i686-linux"))
3631 (license license:lgpl2.1+)))
3633 (define-public dotherside
3641 (url "https://github.com/filcuc/DOtherSide")
3642 (commit (string-append "v" version))))
3643 (file-name (git-file-name name version))
3646 "09fz6v8rp28997f235yaifj8p4vvsyv45knc1iivgdvx7msgcd0m"))))
3647 (build-system cmake-build-system)
3651 (list qtbase-5 qtdeclarative-5))
3652 (home-page "https://filcuc.github.io/DOtherSide/index.html")
3653 (synopsis "C language library for creating bindings for the Qt QML language")
3655 "DOtherSide is a C language library for creating bindings for the
3656 QT QML language. The following features are implementable from
3659 @item Creating custom QObject
3660 @item Creating custom QAbstractListModels
3661 @item Creating custom properties, signals and slots
3662 @item Creating from QML QObject defined in the binded language
3663 @item Creating from Singleton QML QObject defined in the binded language
3665 (license license:lgpl3))) ;version 3 only (+ exception)
3667 ;; There have been no public releases yet.
3668 (define-public qtcolorwidgets
3669 (let ((commit "a95f72e935fe9e046061a1d1c3930cbfbcb533e0")
3672 (name "qtcolorwidgets")
3673 (version (git-version "0" revision commit))
3677 (url "https://gitlab.com/mattia.basaglia/Qt-Color-Widgets")
3679 (file-name (git-file-name name version))
3682 "0dkiwlqh2gwhlp78c1fmchj3shl4p9inspcl96ya5aa8mn6kydy8"))))
3683 (build-system cmake-build-system)
3684 (arguments `(#:tests? #f)) ; There are no tests
3689 (home-page "https://gitlab.com/mattia.basaglia/Qt-Color-Widgets")
3690 (synopsis "Color management widgets")
3691 (description "QtColorWidgets provides a Qt color dialog that is more
3692 user-friendly than the default @code{QColorDialog} and several other
3693 color-related widgets.")
3694 ;; Includes a license exception for combining with GPL2 code.
3695 (license license:lgpl3+))))
3697 (define-public qcustomplot
3699 (name "qcustomplot")
3704 (uri (string-append "https://www.qcustomplot.com/release/"
3705 version "fixed" "/QCustomPlot.tar.gz"))
3707 (base32 "1324kqyj1v1f8k8d7b15gc3apwz9qxx52p86hvchg33hjdlqhskx"))))
3709 `(("qcustomplot-sharedlib"
3712 (uri (string-append "https://www.qcustomplot.com/release/"
3713 version "fixed" "/QCustomPlot-sharedlib.tar.gz"))
3715 (base32 "0vp8lpxvd1nlp4liqrlvslpqrgfn0wpiwizzdsjbj22zzb8vxikc"))))))
3718 (build-system gnu-build-system)
3721 (modify-phases %standard-phases
3722 (add-after 'unpack 'unpack-extra-files
3723 (lambda* (#:key inputs #:allow-other-keys)
3724 (invoke "tar" "-xvf" (assoc-ref inputs "qcustomplot-sharedlib"))))
3726 (lambda* (#:key outputs #:allow-other-keys)
3727 (chdir "qcustomplot-sharedlib/sharedlib-compilation")
3728 (substitute* "sharedlib-compilation.pro"
3729 ;; Don't build debug library.
3730 (("debug_and_release")
3733 (string-append "DESTDIR="
3734 (assoc-ref outputs "out")
3736 (add-after 'install 'install-header
3737 (lambda* (#:key outputs #:allow-other-keys)
3738 (install-file "../../qcustomplot.h"
3739 (string-append (assoc-ref outputs "out")
3741 (home-page "https://www.qcustomplot.com/")
3742 (synopsis "Qt widget for plotting and data visualization")
3744 "QCustomPlot is a Qt C++ widget providing 2D plots, graphs and charts.")
3745 (license license:gpl3+)))
3747 (define-public python-shiboken-2
3749 (name "python-shiboken-2")
3753 (uri (string-append "https://download.qt.io/official_releases"
3754 "/QtForPython/pyside2/PySide2-" version
3755 "-src/pyside-setup-opensource-src-"
3759 "060ljj1nzyp4zfz2vasbv2i7gs5rfkkjwxxbisd0fdw01d5m01mk"))))
3760 (build-system cmake-build-system)
3762 (list clang-toolchain
3770 ;; FIXME: Building tests fails
3771 #:configure-flags '("-DBUILD_TESTS=off")
3773 (modify-phases %standard-phases
3774 (add-after 'unpack 'use-shiboken-dir-only
3775 (lambda _ (chdir "sources/shiboken2") #t))
3776 (add-before 'configure 'make-files-writable-and-update-timestamps
3778 ;; The build scripts need to modify some files in
3779 ;; the read-only source directory, and also attempts
3780 ;; to create Zip files which fails because the Zip
3781 ;; format does not support timestamps before 1980.
3782 (let ((circa-1980 (* 10 366 24 60 60)))
3783 (for-each (lambda (file)
3784 (make-file-writable file)
3785 (utime file circa-1980 circa-1980))
3788 (add-before 'configure 'set-build-env
3789 (lambda* (#:key inputs #:allow-other-keys)
3790 (let ((llvm (assoc-ref inputs "clang-toolchain")))
3791 (setenv "CLANG_INSTALL_DIR" llvm)
3793 (home-page "https://wiki.qt.io/Qt_for_Python")
3795 "Shiboken generates bindings for C++ libraries using CPython source code")
3797 "Shiboken generates bindings for C++ libraries using CPython source code")
3800 ;; The main code is GPL3 or LGPL3.
3801 ;; Examples are BSD-3.
3806 (define-public python-pyside-2
3808 (name "python-pyside-2")
3809 (version (package-version python-shiboken-2))
3810 (source (package-source python-shiboken-2))
3811 (build-system cmake-build-system)
3834 (list python-shiboken-2))
3836 `(("cmake" ,cmake-minimal)
3837 ("python" ,python-wrapper)
3838 ("qttools-5" ,qttools-5)
3842 ;; FIXME: Building tests fail.
3844 (list "-DBUILD_TESTS=FALSE"
3845 (string-append "-DPYTHON_EXECUTABLE="
3846 (assoc-ref %build-inputs "python")
3848 #:modules ((guix build cmake-build-system)
3852 (modify-phases %standard-phases
3853 (add-after 'unpack 'go-to-source-dir
3854 (lambda _ (chdir "sources/pyside2") #t))
3855 (add-after 'go-to-source-dir 'fix-qt-module-detection
3856 (lambda* (#:key inputs #:allow-other-keys)
3857 ;; Activate qt module support even if it not in the same
3858 ;; directory as qtbase.
3859 (substitute* "../cmake_helpers/helpers.cmake"
3860 (("\\(\"\\$\\{found_basepath\\}\" GREATER \"0\"\\)")
3862 ;; Add include directories for qt modules.
3863 (let ((dirs (map (lambda (name)
3864 (string-append (assoc-ref inputs name)
3883 (substitute* "cmake/Macros/PySideModules.cmake"
3884 (("\\$\\{PATH_SEP\\}\\$\\{core_includes\\}" all)
3885 (fold (lambda (dir paths)
3886 (string-append paths "${PATH_SEP}" dir))
3889 (setenv "CXXFLAGS" (fold (lambda (dir paths)
3890 (string-append paths " -I" dir))
3893 (add-before 'configure 'set-clang-dir
3894 (lambda* (#:key inputs #:allow-other-keys)
3895 (let ((clang (assoc-ref inputs "clang-toolchain")))
3896 (setenv "CLANG_INSTALL_DIR" clang)
3898 (home-page "https://wiki.qt.io/Qt_for_Python")
3900 "The Qt for Python product enables the use of Qt5 APIs in Python applications")
3902 "The Qt for Python product enables the use of Qt5 APIs in Python
3903 applications. It lets Python developers utilize the full potential of Qt,
3904 using the PySide2 module. The PySide2 module provides access to the
3905 individual Qt modules such as QtCore, QtGui,and so on. Qt for Python also
3906 comes with the Shiboken2 CPython binding code generator, which can be used to
3907 generate Python bindings for your C or C++ code.")
3911 ;; this file may be used under the terms of the GNU General
3912 ;; Public License version 2.0 or (at your option) the GNU
3913 ;; General Public license version 3 or any later version
3914 ;; approved by the KDE Free Qt Foundation.
3915 ;; Thus, it is currently v2 or v3, but no "+".
3919 (define-public python-pyside-2-tools
3921 (name "python-pyside-2-tools")
3922 (version (package-version python-shiboken-2))
3923 (source (package-source python-shiboken-2))
3924 (build-system cmake-build-system)
3926 (list python-pyside-2 python-shiboken-2 qtbase-5))
3928 `(("python" ,python-wrapper)))
3932 (list "-DBUILD_TESTS=off"
3933 (string-append "-DPYTHON_EXECUTABLE="
3934 (assoc-ref %build-inputs "python")
3936 #:phases (modify-phases %standard-phases
3937 (add-after 'unpack 'go-to-source-dir
3938 (lambda _ (chdir "sources/pyside2-tools") #t)))))
3939 (home-page "https://wiki.qt.io/Qt_for_Python")
3941 "Contains command line tools for PySide2")
3943 "Contains lupdate, rcc and uic tools for PySide2")
3944 (license license:gpl2)))
3946 (define-public libqglviewer
3948 (name "libqglviewer")
3953 (string-append "http://libqglviewer.com/src/libQGLViewer-"
3957 "023w7da1fyn2z69nbkp2rndiv886zahmc5cmira79zswxjfpklp2"))))
3958 (build-system gnu-build-system)
3960 '(#:tests? #f ; no check target
3962 (list (string-append "PREFIX="
3963 (assoc-ref %outputs "out")))
3965 (modify-phases %standard-phases
3967 (lambda* (#:key make-flags #:allow-other-keys)
3968 (apply invoke (cons "qmake" make-flags)))))))
3970 (list qtbase-5 qttools-5))
3973 (home-page "http://libqglviewer.com")
3974 (synopsis "Qt-based C++ library for the creation of OpenGL 3D viewers")
3976 "@code{libQGLViewer} is a C++ library based on Qt that eases the creation
3977 of OpenGL 3D viewers.
3979 It provides some of the typical 3D viewer functionalities, such as the
3980 possibility to move the camera using the mouse, which lacks in most of the
3981 other APIs. Other features include mouse manipulated frames, interpolated
3982 keyFrames, object selection, stereo display, screenshot saving and much more.
3983 It can be used by OpenGL beginners as well as to create complex applications,
3984 being fully customizable and easy to extend.")
3985 ;; According to LICENSE, either version 2 or version 3 of the GNU GPL may
3987 (license (list license:gpl2 license:gpl3))))
3989 (define-public qhexedit
3997 (url "https://github.com/Simsys/qhexedit2")
3998 (commit (string-append "v" version))))
3999 (file-name (git-file-name name version))
4001 (base32 "1j333kiwhbidphdx86yilkaivgl632spfh6fqx93bc80gk4is3xa"))))
4002 (build-system gnu-build-system)
4005 (modify-phases %standard-phases
4006 (add-after 'unpack 'fix-path
4007 (lambda* (#:key outputs #:allow-other-keys)
4008 (substitute* "src/qhexedit.pro"
4009 (("^unix:DESTDIR = /usr/lib")
4010 (string-append "unix:DESTDIR = "
4011 (assoc-ref outputs "out") "/lib")))))
4015 (invoke "qmake" "qhexedit.pro")))
4016 (add-after 'install 'install-headers
4017 (lambda* (#:key outputs #:allow-other-keys)
4018 (let* ((out (assoc-ref outputs "out"))
4019 (include-dir (string-append out "/include")))
4020 (mkdir-p include-dir)
4021 (for-each (lambda (file)
4022 (install-file file include-dir))
4023 (find-files "." "\\.h$"))))))))
4024 (inputs (list qtbase-5))
4025 (native-inputs (list qttools-5))
4026 (home-page "https://simsys.github.io")
4027 (synopsis "Binary editor widget for Qt")
4029 "@code{QHexEdit} is a hex editor widget for the Qt framework. It is a
4030 simple editor for binary data, just like @code{QPlainTextEdit} is for text
4032 (license license:lgpl2.1)))
4035 (let ((commit-ref "fb8f655632bb9c9c60e0ff9fa69a5ba22d3ff99d")
4039 (version (git-version "1.6.0" revision commit-ref))
4044 (url "https://github.com/coin3d/soqt")
4047 (file-name (git-file-name name version))
4049 (base32 "16vikb3fy8rmk10sg5g0gy2c343hi3x7zccsga90ssnkzpq6m032"))))
4050 (build-system cmake-build-system)
4051 (arguments '(#:tests? #f)) ; There are no tests
4053 (list pkg-config cmake))
4055 (list qtbase-5 coin3D-4))
4056 (home-page "https://github.com/coin3d/soqt")
4057 (synopsis "Qt GUI component toolkit library for Coin")
4058 (description "SoQt is a Qt GUI component toolkit library for Coin. It is
4059 also compatible with SGI and TGS Open Inventor, and the API is based on the API
4060 of the InventorXt GUI component toolkit.")
4061 (license license:bsd-3))))