gnu: Add comments to the bottom of a few more package modules.
[jackhill/guix/guix.git] / gnu / packages / qt.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
4 ;;; Copyright © 2015, 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, 2022 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>
27 ;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
28 ;;;
29 ;;; This file is part of GNU Guix.
30 ;;;
31 ;;; GNU Guix is free software; you can redistribute it and/or modify it
32 ;;; under the terms of the GNU General Public License as published by
33 ;;; the Free Software Foundation; either version 3 of the License, or (at
34 ;;; your option) any later version.
35 ;;;
36 ;;; GNU Guix is distributed in the hope that it will be useful, but
37 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
38 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39 ;;; GNU General Public License for more details.
40 ;;;
41 ;;; You should have received a copy of the GNU General Public License
42 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
43
44 (define-module (gnu packages qt)
45 #:use-module ((guix licenses) #:prefix license:)
46 #:use-module (guix packages)
47 #:use-module (guix download)
48 #:use-module (guix git-download)
49 #:use-module (guix build-system cmake)
50 #:use-module (guix build-system gnu)
51 #:use-module (guix build-system trivial)
52 #:use-module (guix build-system python)
53 #:use-module (guix build-system qt)
54 #:use-module (guix gexp)
55 #:use-module (guix packages)
56 #:use-module (guix deprecation)
57 #:use-module (guix utils)
58 #:use-module (gnu packages)
59 #:use-module (gnu packages bash)
60 #:use-module (gnu packages base)
61 #:use-module (gnu packages bison)
62 #:use-module (gnu packages cmake)
63 #:use-module (gnu packages compression)
64 #:use-module (gnu packages cups)
65 #:use-module (gnu packages curl)
66 #:use-module (gnu packages databases)
67 #:use-module (gnu packages documentation)
68 #:use-module (gnu packages enchant)
69 #:use-module (gnu packages fontutils)
70 #:use-module (gnu packages flex)
71 #:use-module (gnu packages freedesktop)
72 #:use-module (gnu packages gcc)
73 #:use-module (gnu packages ghostscript)
74 #:use-module (gnu packages gl)
75 #:use-module (gnu packages glib)
76 #:use-module (gnu packages gnome)
77 #:use-module (gnu packages gnupg)
78 #:use-module (gnu packages gperf)
79 #:use-module (gnu packages graphics)
80 #:use-module (gnu packages gstreamer)
81 #:use-module (gnu packages gtk)
82 #:use-module (gnu packages icu4c)
83 #:use-module (gnu packages image)
84 #:use-module (gnu packages kde-frameworks)
85 #:use-module (gnu packages libevent)
86 #:use-module (gnu packages linux)
87 #:use-module (gnu packages llvm)
88 #:use-module (gnu packages maths)
89 #:use-module (gnu packages markup)
90 #:use-module (gnu packages networking)
91 #:use-module (gnu packages ninja)
92 #:use-module (gnu packages node)
93 #:use-module (gnu packages nss)
94 #:use-module (gnu packages pciutils)
95 #:use-module (gnu packages pcre)
96 #:use-module (gnu packages perl)
97 #:use-module (gnu packages pkg-config)
98 #:use-module (gnu packages pulseaudio)
99 #:use-module (gnu packages protobuf)
100 #:use-module (gnu packages python)
101 #:use-module (gnu packages python-build)
102 #:use-module (gnu packages python-xyz)
103 #:use-module (gnu packages python-web)
104 #:use-module (gnu packages regex)
105 #:use-module (gnu packages ruby)
106 #:use-module (gnu packages sdl)
107 #:use-module (gnu packages serialization)
108 #:use-module (gnu packages sqlite)
109 #:use-module (gnu packages telephony)
110 #:use-module (gnu packages tls)
111 #:use-module (gnu packages valgrind)
112 #:use-module (gnu packages video)
113 #:use-module (gnu packages vulkan)
114 #:use-module (gnu packages xdisorg)
115 #:use-module (gnu packages xiph)
116 #:use-module (gnu packages xorg)
117 #:use-module (gnu packages xml)
118 #:use-module (srfi srfi-1))
119
120 (define-public qite
121 (let ((commit "75fb3b6bbd5c6a5a8fc35e08a6efbfb588ed546a")
122 (revision "74"))
123 (package
124 (name "qite")
125 (version (git-version "0" revision commit))
126 (source
127 (origin
128 (method git-fetch)
129 (uri
130 (git-reference
131 (url "https://github.com/Ri0n/qite")
132 (commit commit)))
133 (file-name (git-file-name name version))
134 (sha256
135 (base32 "0jmmgy9pvk9hwwph1nwy7hxhczy8drhl4ymhnjjn6yx7bckssvsq"))))
136 (build-system qt-build-system)
137 (arguments
138 `(#:tests? #f ; no target
139 #:phases
140 (modify-phases %standard-phases
141 (add-after 'unpack 'chdir
142 (lambda _
143 (chdir "libqite")
144 #t)))))
145 (inputs
146 (list qtbase-5 qtmultimedia-5))
147 (home-page "https://github.com/Ri0n/qite/")
148 (synopsis "Qt Interactive Text Elements")
149 (description "Qite manages interactive elements on QTextEdit.")
150 (license license:asl2.0))))
151
152 (define-public qt5ct
153 (package
154 (name "qt5ct")
155 (version "1.5")
156 (source
157 (origin
158 (method url-fetch)
159 (uri
160 (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
161 (sha256
162 (base32 "14742vs32m98nbfb5mad0i8ciff5f45gfcb5v03p4hh2dvhhqgfn"))))
163 (build-system qt-build-system)
164 (arguments
165 (list
166 #:tests? #f ; No target
167 #:phases
168 #~(modify-phases %standard-phases
169 (add-after 'unpack 'patch
170 (lambda _
171 (substitute* '("src/qt5ct-qtplugin/CMakeLists.txt"
172 "src/qt5ct-style/CMakeLists.txt")
173 (("\\$\\{PLUGINDIR\\}")
174 (string-append #$output "/lib/qt5/plugins"))))))))
175 (native-inputs
176 (list qttools-5))
177 (inputs
178 (list qtsvg-5))
179 (synopsis "Qt5 Configuration Tool")
180 (description "Qt5CT is a program that allows users to configure Qt5
181 settings (such as icons, themes, and fonts) in desktop environments or
182 window managers, that don't provide Qt integration by themselves.")
183 (home-page "https://qt5ct.sourceforge.io/")
184 (license license:bsd-2)))
185
186 (define-public materialdecoration
187 (let ((commit "6a5de23f2e5162fbee39d16f938473ff970a2ec0")
188 (revision "9"))
189 (package
190 (name "materialdecoration")
191 (version
192 (git-version "1.1.0" revision commit))
193 (source
194 (origin
195 (method git-fetch)
196 (uri
197 (git-reference
198 (url "https://github.com/lirios/materialdecoration.git")
199 (commit commit)))
200 (file-name
201 (git-file-name name version))
202 (sha256
203 (base32 "1zdrcb39fhhmn76w8anv1dnspz26pdl6izmj1mlm02aza4y8ffp4"))
204 (modules '((guix build utils)
205 (ice-9 ftw)
206 (srfi srfi-1)))
207 (snippet
208 `(begin
209 (delete-file-recursively "cmake/3rdparty")))))
210 (build-system qt-build-system)
211 (arguments
212 `(#:tests? #f ; No target
213 #:configure-flags
214 ,#~(list
215 (string-append "-DCMAKE_CXX_FLAGS=-I"
216 #$(this-package-input "qtbase")
217 "/include/qt5/QtXkbCommonSupport/"
218 #$(package-version qtbase-5)))))
219 (native-inputs
220 (list cmake-shared extra-cmake-modules pkg-config))
221 (inputs
222 `(("qtbase" ,qtbase-5)
223 ("qtwayland" ,qtwayland)
224 ("wayland" ,wayland)
225 ("xkbcommon" ,libxkbcommon)))
226 (synopsis "Material Decoration for Qt")
227 (description "MaterialDecoration is a client-side decoration for Qt
228 applications on Wayland.")
229 (home-page "https://github.com/lirios/materialdecoration")
230 (license license:lgpl3+))))
231
232 (define-public grantlee
233 (package
234 (name "grantlee")
235 (version "5.2.0")
236 (source
237 (origin
238 (method git-fetch)
239 (uri (git-reference
240 (url "https://github.com/steveire/grantlee")
241 (commit (string-append "v" version))))
242 (file-name (git-file-name name version))
243 (sha256
244 (base32 "02dyqxjyxiqxrlz5g7v9ly8f095vs3iha39l75q6s8axs36y01lq"))))
245 (native-inputs
246 ;; Optional: lcov and cccc, both are for code coverage
247 (list doxygen))
248 (inputs
249 (list qtbase-5 qtdeclarative-5 qtscript))
250 (build-system cmake-build-system)
251 (arguments
252 `(#:phases
253 (modify-phases %standard-phases
254 (add-before 'check 'check-setup
255 (lambda _
256 ;; make Qt render "offscreen", required for tests
257 (setenv "QT_QPA_PLATFORM" "offscreen")
258 #t)))))
259 (home-page "https://github.com/steveire/grantlee")
260 (synopsis "Libraries for text templating with Qt")
261 (description "Grantlee Templates can be used for theming and generation of
262 other text such as code. The syntax uses the syntax of the Django template
263 system, and the core design of Django is reused in Grantlee.")
264 (license license:lgpl2.1+)))
265
266 (define (qt-urls component version)
267 "Return a list of URLs for VERSION of the Qt5 COMPONENT."
268 ;; We can't use a mirror:// scheme because these URLs are not exact copies:
269 ;; the layout differs between them.
270 (list (string-append "https://download.qt.io/official_releases/qt/"
271 (version-major+minor version) "/" version
272 "/submodules/" component "-everywhere-src-"
273 version ".tar.xz")
274 (string-append "https://download.qt.io/archive/qt/"
275 (version-major+minor version) "/" version
276 "/submodules/" component "-everywhere-src-"
277 version ".tar.xz")
278 (let ((directory (string-append "qt5" (string-drop component 2))))
279 (string-append "http://sources.buildroot.net/" directory "/"
280 component "-everywhere-src-" version ".tar.xz"))
281 (string-append "https://distfiles.macports.org/qt5/"
282 component "-everywhere-src-" version ".tar.xz")))
283
284 (define-public qtbase-5
285 (package
286 (name "qtbase")
287 (version "5.15.2")
288 (source (origin
289 (method url-fetch)
290 (uri (qt-urls name version))
291 (sha256
292 (base32
293 "1y70libf2x52lpbqvhz10lpk7nyl1ajjwzjxly9pjdpfj4jsv7wh"))
294 ;; Use TZDIR to avoid depending on package "tzdata".
295 (patches (search-patches "qtbase-use-TZDIR.patch"
296 "qtbase-moc-ignore-gcc-macro.patch"
297 "qtbase-absolute-runpath.patch"))
298 (modules '((guix build utils)))
299 (snippet
300 ;; corelib uses bundled harfbuzz, md4, md5, sha3
301 '(begin
302 (with-directory-excursion "src/3rdparty"
303 (for-each delete-file-recursively
304 (list "double-conversion" "freetype" "harfbuzz-ng"
305 "libpng" "libjpeg" "pcre2" "sqlite" "xcb"
306 "zlib")))))))
307 (build-system gnu-build-system)
308 (outputs '("out" "debug"))
309 (propagated-inputs
310 (list mesa
311 ;; Use which the package, not the function
312 (@ (gnu packages base) which)))
313 (inputs
314 `(("alsa-lib" ,alsa-lib)
315 ("cups" ,cups)
316 ("dbus" ,dbus)
317 ("double-conversion" ,double-conversion)
318 ("eudev" ,eudev)
319 ("expat" ,expat)
320 ("fontconfig" ,fontconfig)
321 ("freetype" ,freetype)
322 ("glib" ,glib)
323 ("gtk+" ,gtk+) ;for GTK theme support
324 ("harfbuzz" ,harfbuzz)
325 ("icu4c" ,icu4c)
326 ("libinput" ,libinput-minimal)
327 ("libjpeg" ,libjpeg-turbo)
328 ("libmng" ,libmng)
329 ("libpng" ,libpng)
330 ("libx11" ,libx11)
331 ("libxcomposite" ,libxcomposite)
332 ("libxcursor" ,libxcursor)
333 ("libxfixes" ,libxfixes)
334 ("libxi" ,libxi)
335 ("libxinerama" ,libxinerama)
336 ("libxkbcommon" ,libxkbcommon)
337 ("libxml2" ,libxml2)
338 ("libxrandr" ,libxrandr)
339 ("libxrender" ,libxrender)
340 ("libxslt" ,libxslt)
341 ("libxtst" ,libxtst)
342 ("mtdev" ,mtdev)
343 ("mariadb-dev" ,mariadb "dev")
344 ("nss" ,nss)
345 ("openssl" ,openssl)
346 ("pcre2" ,pcre2)
347 ;; TODO: Switch to 'postgres' in the next rebuild cycle.
348 ("postgresql" ,postgresql-13)
349 ("pulseaudio" ,pulseaudio)
350 ("sqlite" ,sqlite)
351 ("unixodbc" ,unixodbc)
352 ("xcb-util" ,xcb-util)
353 ("xcb-util-image" ,xcb-util-image)
354 ("xcb-util-keysyms" ,xcb-util-keysyms)
355 ("xcb-util-renderutil" ,xcb-util-renderutil)
356 ("xcb-util-wm" ,xcb-util-wm)
357 ("xdg-utils" ,xdg-utils)
358 ("zlib" ,zlib)))
359 (native-inputs
360 (list bison
361 flex
362 gperf
363 perl
364 pkg-config
365 python
366 vulkan-headers
367 ruby))
368 (arguments
369 `(#:configure-flags
370 (let ((out (assoc-ref %outputs "out")))
371 (list "-verbose"
372 "-prefix" out
373 "-docdir" (string-append out "/share/doc/qt5")
374 "-headerdir" (string-append out "/include/qt5")
375 "-archdatadir" (string-append out "/lib/qt5")
376 "-datadir" (string-append out "/share/qt5")
377 "-examplesdir" (string-append
378 out "/share/doc/qt5/examples")
379 "-opensource"
380 "-confirm-license"
381
382 ;; Later stripped into the :debug output.
383 "-force-debug-info"
384
385 ;; These features require higher versions of Linux than the
386 ;; minimum version of the glibc. See
387 ;; src/corelib/global/minimum-linux_p.h. By disabling these
388 ;; features Qt5 applications can be used on the oldest
389 ;; kernels that the glibc supports, including the RHEL6
390 ;; (2.6.32) and RHEL7 (3.10) kernels.
391 "-no-feature-getentropy" ; requires Linux 3.17
392 "-no-feature-renameat2" ; requires Linux 3.16
393
394 ;; Do not build examples; if desired, these could go
395 ;; into a separate output, but for the time being, we
396 ;; prefer to save the space and build time.
397 "-no-compile-examples"
398 ;; Most "-system-..." are automatic, but some use
399 ;; the bundled copy by default.
400 "-system-sqlite"
401 "-system-harfbuzz"
402 "-system-pcre"
403 ;; explicitly link with openssl instead of dlopening it
404 "-openssl-linked"
405 ;; explicitly link with dbus instead of dlopening it
406 "-dbus-linked"
407 ;; don't use the precompiled headers
408 "-no-pch"
409 ;; drop special machine instructions that do not have
410 ;; runtime detection
411 ,@(if (string-prefix? "x86_64"
412 (or (%current-target-system)
413 (%current-system)))
414 '()
415 '("-no-sse2"))
416 "-no-mips_dsp"
417 "-no-mips_dspr2"))
418 #:phases
419 (modify-phases %standard-phases
420 (add-after 'configure 'patch-bin-sh
421 (lambda _
422 (substitute* '("config.status"
423 "configure"
424 "mkspecs/features/qt_functions.prf"
425 "qmake/library/qmakebuiltins.cpp")
426 (("/bin/sh") (which "sh")))))
427 (add-after 'configure 'patch-xdg-open
428 (lambda _
429 (substitute* '("src/platformsupport/services/genericunix/qgenericunixservices.cpp")
430 (("^.*const char \\*browsers.*$" all)
431 (string-append "*browser = QStringLiteral(\""
432 (which "xdg-open")
433 "\"); return true; \n" all)))))
434 (replace 'configure
435 ;; Overridden to not pass "--enable-fast-install", which makes the
436 ;; configure process fail.
437 (lambda* (#:key outputs configure-flags #:allow-other-keys)
438 (let ((out (assoc-ref outputs "out")))
439 (substitute* "configure"
440 (("/bin/pwd") (which "pwd")))
441 (substitute* "src/corelib/global/global.pri"
442 (("/bin/ls") (which "ls")))
443 ;; The configuration files for other Qt5 packages are searched
444 ;; through a call to "find_package" in Qt5Config.cmake, which
445 ;; disables the use of CMAKE_PREFIX_PATH via the parameter
446 ;; "NO_DEFAULT_PATH". Re-enable it so that the different
447 ;; components can be installed in different places.
448 (substitute* (find-files "." ".*\\.cmake")
449 (("NO_DEFAULT_PATH") ""))
450 (format #t "build directory: ~s~%" (getcwd))
451 (format #t "configure flags: ~s~%" configure-flags)
452 (apply invoke "./configure" configure-flags))))
453 (add-after 'install 'patch-mkspecs
454 (lambda* (#:key outputs #:allow-other-keys)
455 (let* ((out (assoc-ref outputs "out"))
456 (archdata (string-append out "/lib/qt5"))
457 (mkspecs (string-append archdata "/mkspecs"))
458 (qt_config.prf (string-append
459 mkspecs "/features/qt_config.prf")))
460 ;; For each Qt module, let `qmake' uses search paths in the
461 ;; module directory instead of all in QT_INSTALL_PREFIX.
462 (substitute* qt_config.prf
463 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
464 "$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt5))")
465 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
466 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
467 (("\\$\\$\\[QT_HOST_LIBS\\]")
468 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
469 (("\\$\\$\\[QT_INSTALL_BINS\\]")
470 "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))"))
471
472 ;; Searches Qt tools in the current PATH instead of QT_HOST_BINS.
473 (substitute* (string-append mkspecs "/features/qt_functions.prf")
474 (("cmd = \\$\\$\\[QT_HOST_BINS\\]/\\$\\$2")
475 "cmd = $$system(which $${2}.pl 2>/dev/null || which $${2})"))
476
477 ;; Resolve qmake spec files within qtbase by absolute paths.
478 (substitute*
479 (map (lambda (file)
480 (string-append mkspecs "/features/" file))
481 '("device_config.prf" "moc.prf" "qt_build_config.prf"
482 "qt_config.prf" "winrt/package_manifest.prf"))
483 (("\\$\\$\\[QT_HOST_DATA/get\\]") archdata)
484 (("\\$\\$\\[QT_HOST_DATA/src\\]") archdata)))))
485 (add-after 'patch-mkspecs 'patch-prl-files
486 (lambda* (#:key outputs #:allow-other-keys)
487 (let ((out (assoc-ref outputs "out")))
488 ;; Insert absolute references to the qtbase libraries because
489 ;; QT_INSTALL_LIBS does not always resolve correctly, depending
490 ;; on context. See <https://bugs.gnu.org/38405>
491 (substitute* (find-files (string-append out "/lib") "\\.prl$")
492 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
493 (string-append out "/lib"))))))
494 (add-after 'unpack 'patch-paths
495 ;; Use the absolute paths for dynamically loaded libs, otherwise
496 ;; the lib will be searched in LD_LIBRARY_PATH which typically is
497 ;; not set in guix.
498 (lambda* (#:key inputs #:allow-other-keys)
499 ;; libresolve
500 (let ((glibc (assoc-ref inputs ,(if (%current-target-system)
501 "cross-libc" "libc"))))
502 (substitute* '("src/network/kernel/qdnslookup_unix.cpp"
503 "src/network/kernel/qhostinfo_unix.cpp")
504 (("^\\s*(lib.setFileName\\(QLatin1String\\(\")(resolv\"\\)\\);)" _ a b)
505 (string-append a glibc "/lib/lib" b))))
506 ;; libGL
507 (substitute* "src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp"
508 (("^\\s*(QLibrary lib\\(QLatin1String\\(\")(GL\"\\)\\);)" _ a b)
509 (string-append a (assoc-ref inputs "mesa") "/lib/lib" b)))
510 ;; libXcursor
511 (substitute* "src/plugins/platforms/xcb/qxcbcursor.cpp"
512 (("^\\s*(QLibrary xcursorLib\\(QLatin1String\\(\")(Xcursor\"\\), 1\\);)" _ a b)
513 (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))
514 (("^\\s*(xcursorLib.setFileName\\(QLatin1String\\(\")(Xcursor\"\\)\\);)" _ a b)
515 (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))))))))
516 (native-search-paths
517 (list (search-path-specification
518 (variable "QMAKEPATH")
519 (files '("lib/qt5")))
520 (search-path-specification
521 (variable "QML2_IMPORT_PATH")
522 (files '("lib/qt5/qml")))
523 (search-path-specification
524 (variable "QT_PLUGIN_PATH")
525 (files '("lib/qt5/plugins")))
526 (search-path-specification
527 (variable "XDG_DATA_DIRS")
528 (files '("share")))
529 (search-path-specification
530 (variable "XDG_CONFIG_DIRS")
531 (files '("etc/xdg")))))
532 (home-page "https://www.qt.io/")
533 (synopsis "Cross-platform GUI library")
534 (description "Qt is a cross-platform application and UI framework for
535 developers using C++ or QML, a CSS & JavaScript like language.")
536 (license (list license:lgpl2.1 license:lgpl3))))
537
538 (define-public qtbase
539 (package/inherit qtbase-5
540 (name "qtbase")
541 (version "6.3.1")
542 (source (origin
543 (inherit (package-source qtbase-5))
544 (uri (qt-urls name version))
545 (sha256
546 (base32
547 "00sfya41ihqb0zwg6wf1kiy02iymj6mk584hhk2c4s94khfl4r0a"))
548 (modules '((guix build utils)))
549 (snippet
550 ;; corelib uses bundled harfbuzz, md4, md5, sha3
551 '(with-directory-excursion "src/3rdparty"
552 (for-each delete-file-recursively
553 ;; The bundled pcre2 copy is kept, as its headers
554 ;; are required by some internal bootstrap target
555 ;; used for the tools.
556 (list "double-conversion" "freetype" "harfbuzz-ng"
557 "libpng" "libjpeg" "sqlite" "xcb" "zlib"))))))
558 (build-system cmake-build-system)
559 (arguments
560 (substitute-keyword-arguments (package-arguments qtbase-5)
561 ((#:configure-flags _ ''())
562 `(let ((out (assoc-ref %outputs "out")))
563 (list "-GNinja" ;the build fails otherwise
564 "-DQT_BUILD_TESTS=ON"
565 (string-append "-DINSTALL_ARCHDATADIR=" out "/lib/qt6")
566 (string-append "-DINSTALL_DATADIR=" out "/share/qt6")
567 (string-append "-DINSTALL_DOCDIR=" out "/share/doc/qt6")
568 (string-append "-DINSTALL_MKSPECSDIR=" out "/lib/qt6/mkspecs")
569 (string-append "-DINSTALL_EXAMPLESDIR=" out
570 "/share/doc/qt6/examples")
571 (string-append "-DINSTALL_INCLUDEDIR=" out "/include/qt6")
572 ;; Link with DBus and OpenSSL so they don't get dlopen'ed.
573 "-DINPUT_dbus=linked"
574 "-DINPUT_openssl=linked"
575 ;; These features require higher versions of Linux than the
576 ;; minimum version of the glibc. See
577 ;; src/corelib/global/minimum-linux_p.h. By disabling these
578 ;; features Qt applications can be used on the oldest kernels
579 ;; that the glibc supports, including the RHEL6 (2.6.32) and
580 ;; RHEL7 (3.10) kernels.
581 "-DFEATURE_getentropy=OFF" ; requires Linux 3.17
582 "-DFEATURE_renameat2=OFF" ; requires Linux 3.16
583 ;; Most system libraries are used by default, except in some
584 ;; cases such as for those below.
585 "-DFEATURE_system_pcre2=ON"
586 "-DFEATURE_system_sqlite=ON"
587 "-DFEATURE_system_xcb_xinput=ON"
588 ;; Don't use the precompiled headers.
589 "-DBUILD_WITH_PCH=OFF"
590 ;; Drop special machine instructions that do not have runtime
591 ;; detection.
592 ,@(if (string-prefix? "x86_64"
593 (or (%current-target-system)
594 (%current-system)))
595 '() ;implicitly enabled
596 '("-DFEATURE_sse2=OFF"
597 "-DFEATURE_sse3=OFF"
598 "-DFEATURE_ssse3=OFF"
599 "-DFEATURE_sse4_1=OFF"
600 "-DFEATURE_sse4_2=OFF"))
601 "-DFEATURE_mips_dsp=OFF"
602 "-DFEATURE_mips_dspr2=OFF")))
603 ((#:phases phases)
604 #~(modify-phases #$phases
605 (add-after 'unpack 'honor-CMAKE_PREFIX_PATH
606 (lambda _
607 ;; The configuration files for other Qt packages are searched
608 ;; through a call to "find_package" in Qt5Config.cmake, which
609 ;; disables the use of CMAKE_PREFIX_PATH via the parameter
610 ;; "NO_DEFAULT_PATH". Re-enable it so that the different
611 ;; components can be installed in different places.
612 (substitute* (find-files "." "\\.cmake(\\.in)?$")
613 (("\\bNO_DEFAULT_PATH\\b") ""))
614 ;; Because Qt goes against the grain of CMake and set
615 ;; NO_DEFAULT_PATH, it needs to invent yet another variable
616 ;; to do what CMAKE_PREFIX_PATH could have done:
617 ;; QT_ADDITIONAL_PACKAGES_PREFIX_PATH. Since we patch out
618 ;; the NO_DEFAULT_PATH, we can set the default value of
619 ;; QT_ADDITIONAL_PACKAGES_PREFIX_PATH to that of
620 ;; CMAKE_PREFIX_PATH to ensure tools such as
621 ;; 'qmlimportscanner' from qtdeclarative work out of the
622 ;; box.
623 (substitute* "cmake/QtConfig.cmake.in"
624 (("(set\\(QT_ADDITIONAL_PACKAGES_PREFIX_PATH )\"\"" _ head)
625 (string-append head "\"$ENV{CMAKE_PREFIX_PATH}\"")))))
626 (delete 'patch-bin-sh)
627 (delete 'patch-xdg-open)
628 (add-after 'patch-paths 'patch-more-paths
629 (lambda* (#:key inputs #:allow-other-keys)
630 (substitute* (find-files "bin" "\\.in$")
631 (("/bin/pwd")
632 (search-input-file inputs "bin/pwd")))
633 (substitute* "src/gui/platform/unix/qgenericunixservices.cpp"
634 (("\"xdg-open\"")
635 (format #f "~s" (search-input-file inputs "bin/xdg-open"))))
636 (substitute* '("mkspecs/features/qt_functions.prf"
637 "qmake/library/qmakebuiltins.cpp")
638 (("/bin/sh")
639 (search-input-file inputs "bin/bash")))
640 (substitute* "src/corelib/CMakeLists.txt"
641 (("/bin/ls")
642 (search-input-file inputs "bin/ls")))))
643 (replace 'configure
644 (assoc-ref %standard-phases 'configure))
645 (replace 'build
646 (lambda* (#:key parallel-build? #:allow-other-keys)
647 (apply invoke "cmake" "--build" "."
648 (if parallel-build?
649 `("--parallel" ,(number->string (parallel-job-count)))
650 '()))))
651 (delete 'check) ;move after patch-prl-files
652 (add-after 'patch-prl-files 'check
653 (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
654 (when tests?
655 ;; The tests expect to find the modules provided by this
656 ;; package; extend the environment variables needed to do so.
657 (setenv "CMAKE_PREFIX_PATH"
658 (string-append #$output
659 ":" (getenv "CMAKE_PREFIX_PATH")))
660 (setenv "QMAKEPATH" (string-append #$output "/lib/qt6"))
661 (setenv "QML2_IMPORT_PATH"
662 (string-append #$output "/lib/qt6/qml"))
663 (setenv "QT_PLUGIN_PATH"
664 (string-append #$output "/lib/qt6/plugins"))
665 (setenv "QT_QPA_PLATFORM" "offscreen")
666 ;; Skip tests known to fail on GNU/Linux, in a CI context or
667 ;; due to bitness (see: https://code.qt.io/cgit/qt/qtbase.git
668 ;; /tree/src/testlib/qtestblacklist.cpp).
669 (setenv "QTEST_ENVIRONMENT" "linux ci 32bit")
670 (setenv "HOME" "/tmp") ;some tests require a writable HOME
671 (invoke
672 "xvfb-run" "ctest" "--output-on-failure"
673 "-j" (if parallel-tests?
674 (number->string (parallel-job-count))
675 "1")
676 "-E" ;disable problematic tests
677 (string-append
678 "("
679 (string-join
680 (list
681 ;; The 'tst_moc' test fails with "'fi.exists()' returned FALSE".
682 "tst_moc"
683 ;; The 'test_rcc' test fails on a comparison:
684 ;; <<<<<< actual
685 ;; 0x0,0x0,0x0,0x0,0x0,0x0,0x3,0xe8,
686 ;; ======
687 ;; 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
688 ;; >>>>>> expected
689 "tst_rcc"
690 ;; The 'tst_qtemporarydir' and 'tst_qtemporaryfile'
691 ;; tests depend on '/home' not being writable.
692 "tst_qtemporarydir"
693 "tst_qtemporaryfile"
694 ;; The 'tst_qdir' compares two directories which are
695 ;; unexpectedly different when inside the build
696 ;; container.
697 "tst_qdir"
698 ;; This checks the last modified time of '/', and fails
699 ;; because Epoch 0 is considered to be invalid.
700 "tst_qresourceengine"
701 ;; The 'tst_qfilesystemwatcher' installs a watcher on
702 ;; '/home', which doesn't exist in the build container.
703 "tst_qfilesystemwatcher"
704 ;; The 'mockplugins' test fail following error: "Unknown
705 ;; platform linux-g++", and the other plugin tests
706 ;; depend on it.
707 "mockplugins"
708 "test_plugin_flavor.*"
709 ;; The 'test_import_plugins' fails with "Could NOT find
710 ;; Qt6MockPlugins1".
711 "test_import_plugins"
712 ;; The 'tst_QTimeZone::systemZone' validates the
713 ;; currently set timezone and fails.
714 "tst_qtimezone"
715 ;; The 'tst_qdatetime' fails with:
716 ;; FAIL! : tst_QDateTime::offsetFromUtc() Compared values are not the same
717 ;; Actual (dt5.offsetFromUtc()): 0
718 ;; Expected (46800) : 46800
719 "tst_qdatetime"
720 ;; The 'tst_QSettings::fromFile' assumes the data
721 ;; location to be relative to the root directory and
722 ;; fails.
723 "tst_qsettings"
724 ;; The 'tst_qaddpreroutine',
725 ;; 'test_generating_cpp_exports' and
726 ;; 'test_static_resources' tests fail with: "Unknown
727 ;; platform linux-g++.
728 "tst_qaddpreroutine"
729 "test_generating_cpp_exports"
730 "test_static_resources"
731 ;; The 'tst_qfile' fails since there is no /home in the
732 ;; build container.
733 "tst_qfile"
734 ;; The 'tst_QGlyphRun::mixedScripts' test fails with:
735 ;; Actual (glyphRuns.size()): 1
736 ;; Expected (2) : 2
737 "tst_qglyphrun"
738 ;; The 'tst_qx11info' test fails with "Internal error:
739 ;; QPA plugin doesn't implement generatePeekerId",
740 ;; likely requires a real display.
741 "tst_qx11info"
742 ;; The 'tst_qgraphicswidget' test fails because "This
743 ;; plugin does not support propagateSizeHints".
744 "tst_qgraphicswidget"
745 ;; The 'tst_qdnslookup' test requires networking.
746 "tst_qdnslookup"
747 ;; The 'tst_qcompleter' and 'tst_QFiledialog::completer'
748 ;; attempt to complete paths they assume exist, such as
749 ;; "/home", "/etc" or "/root" and fail.
750 "tst_qcompleter"
751 "tst_qfiledialog") "|")
752 ")")))))
753 (replace 'install
754 (lambda _
755 (invoke "cmake" "--install" ".")))
756 (replace 'patch-mkspecs
757 (lambda* (#:key outputs #:allow-other-keys)
758 (let* ((archdata (search-input-directory outputs "lib/qt6"))
759 (mkspecs (search-input-directory outputs
760 "lib/qt6/mkspecs"))
761 (qt_config.prf
762 (search-input-file
763 outputs "lib/qt6/mkspecs/features/qt_config.prf"))
764 (qt_functions.prf
765 (search-input-file
766 outputs "lib/qt6/mkspecs/features/qt_functions.prf")))
767 ;; For each Qt module, let `qmake' uses search paths in the
768 ;; module directory instead of all in QT_INSTALL_PREFIX.
769 (substitute* qt_config.prf
770 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
771 "$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt6))")
772 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
773 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
774 (("\\$\\$\\[QT_HOST_LIBS\\]")
775 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
776 (("\\$\\$\\[QT_INSTALL_BINS\\]")
777 "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))"))
778
779 ;; Searches Qt tools in the current PATH instead of QT_HOST_BINS.
780 (substitute* qt_functions.prf
781 (("cmd = \\$\\$\\[QT_HOST_BINS\\]/\\$\\$2")
782 "cmd = $$system(which $${2}.pl 2>/dev/null || which $${2})"))
783
784 ;; Resolve qmake spec files within qtbase by absolute paths.
785 (substitute*
786 (map (lambda (file)
787 (search-input-file
788 outputs
789 (string-append "lib/qt6/mkspecs/features/" file)))
790 '("device_config.prf" "moc.prf" "qt_build_config.prf"
791 "qt_config.prf"))
792 (("\\$\\$\\[QT_HOST_DATA/get\\]") archdata)
793 (("\\$\\$\\[QT_HOST_DATA/src\\]") archdata)))))))))
794 (native-inputs
795 (modify-inputs (package-native-inputs qtbase-5)
796 (prepend ninja
797 wayland-protocols
798 xvfb-run)))
799 (inputs
800 (modify-inputs (package-inputs qtbase-5)
801 (prepend bash-minimal coreutils-minimal libxcb md4c)
802 (replace "postgresql" postgresql))) ;use latest postgresql
803 (native-search-paths
804 (list (search-path-specification
805 (variable "QMAKEPATH")
806 (files '("lib/qt6")))
807 (search-path-specification
808 (variable "QML2_IMPORT_PATH")
809 (files '("lib/qt6/qml")))
810 (search-path-specification
811 (variable "QT_PLUGIN_PATH")
812 (files '("lib/qt6/plugins")))
813 (search-path-specification
814 (variable "XDG_DATA_DIRS")
815 (files '("share")))
816 (search-path-specification
817 (variable "XDG_CONFIG_DIRS")
818 (files '("etc/xdg")))))))
819
820 (define-public qt5compat
821 (package
822 (name "qt5compat")
823 (version "6.3.1")
824 (source (origin
825 (method url-fetch)
826 (uri (qt-urls name version))
827 (sha256
828 (base32
829 "1zbcaswpl79ixcxzj85qzjq73962s4c7316pibwfrskqswmwcgm4"))))
830 (build-system cmake-build-system)
831 (arguments
832 (list
833 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
834 #:phases #~(modify-phases %standard-phases
835 (add-after 'install 'delete-installed-tests
836 (lambda _
837 (delete-file-recursively
838 (string-append #$output "/tests")))))))
839 (native-inputs (list perl))
840 (inputs (list icu4c libxkbcommon qtbase qtdeclarative qtshadertools))
841 (home-page (package-home-page qtbase))
842 (synopsis "Legacy Qt 5 APIs ported to Qt 6")
843 (description "The @code{qt5compat} package includes application
844 programming interfaces (APIs) from Qt 5 that were ported to Qt 6, to ease
845 migration. It provides for example the @code{GraphicalEffects} module that
846 came with the @{qtgraphicaleffects} Qt 5 package.")
847 (license (list license:gpl2+ license:lgpl3+)))) ;dual licensed
848
849 (define-public qtsvg-5
850 (package
851 (inherit qtbase-5)
852 (name "qtsvg")
853 (version "5.15.2")
854 (source (origin
855 (method url-fetch)
856 (uri (qt-urls name version))
857 (sha256
858 (base32
859 "0pjqrdmd1991x9h4rl8sf81pkd89hfd5h1a2gp3fjw96pk0w5hwb"))))
860 (propagated-inputs `())
861 (native-inputs (list perl))
862 (inputs
863 (list mesa qtbase-5 zlib))
864 (arguments
865 `(#:phases
866 (modify-phases %standard-phases
867 (add-before 'configure 'configure-qmake
868 (lambda* (#:key inputs outputs #:allow-other-keys)
869 (let* ((out (assoc-ref outputs "out"))
870 (qtbase (assoc-ref inputs "qtbase"))
871 (tmpdir (string-append (getenv "TMPDIR")))
872 (qmake (string-append tmpdir "/qmake"))
873 (qt.conf (string-append tmpdir "/qt.conf")))
874 ;; Use qmake with a customized qt.conf to override install
875 ;; paths to $out.
876 (symlink (which "qmake") qmake)
877 (setenv "PATH" (string-append tmpdir ":" (getenv "PATH")))
878 (with-output-to-file qt.conf
879 (lambda ()
880 (format #t "[Paths]
881 Prefix=~a
882 ArchData=lib/qt5
883 Data=share/qt5
884 Documentation=share/doc/qt5
885 Headers=include/qt5
886 Libraries=lib
887 LibraryExecutables=lib/qt5/libexec
888 Binaries=bin
889 Tests=tests
890 Plugins=lib/qt5/plugins
891 Imports=lib/qt5/imports
892 Qml2Imports=lib/qt5/qml
893 Translations=share/qt5/translations
894 Settings=etc/xdg
895 Examples=share/doc/qt5/examples
896 HostPrefix=~a
897 HostData=lib/qt5
898 HostBinaries=bin
899 HostLibraries=lib
900
901 [EffectiveSourcePaths]
902 HostPrefix=~a
903 HostData=lib/qt5
904 " out out qtbase)))
905 #t)))
906 (replace 'configure
907 (lambda* (#:key inputs outputs #:allow-other-keys)
908 ;; Valid QT_BUILD_PARTS variables are:
909 ;; libs tools tests examples demos docs translations
910 (invoke "qmake" "QT_BUILD_PARTS = libs tools tests")))
911 (add-before 'check 'set-display
912 (lambda _
913 ;; make Qt render "offscreen", required for tests
914 (setenv "QT_QPA_PLATFORM" "offscreen")
915 #t)))))
916 (synopsis "Qt module for displaying SVGs")
917 (description "The QtSvg module provides classes for displaying the
918 contents of SVG files.")))
919
920 (define-public qtsvg
921 (package
922 (name "qtsvg")
923 (version "6.3.1")
924 (source (origin
925 (method url-fetch)
926 (uri (qt-urls name version))
927 (sha256
928 (base32
929 "1xvxz2jfpr1al85rhwss7ji5vkxa812d0b888hry5f7pwqcg86bv"))))
930 (build-system cmake-build-system)
931 (arguments
932 (list
933 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
934 #:phases
935 #~(modify-phases %standard-phases
936 (add-before 'check 'set-display
937 (lambda _
938 ;; Make Qt render "offscreen", required for tests.
939 (setenv "QT_QPA_PLATFORM" "offscreen")))
940 (add-after 'install 'delete-installed-tests
941 (lambda _
942 (delete-file-recursively (string-append #$output "/tests")))))))
943 (native-inputs (list perl))
944 (inputs (list libxkbcommon mesa qtbase zlib))
945 (synopsis "Qt module for displaying SVGs")
946 (description "The QtSvg module provides classes for displaying the
947 contents of SVG files.")
948 (home-page (package-home-page qtbase))
949 (license (package-license qtbase))))
950
951 (define-public qtimageformats
952 (package (inherit qtsvg-5)
953 (name "qtimageformats")
954 (version "5.15.2")
955 (source (origin
956 (method url-fetch)
957 (uri (qt-urls name version))
958 (sha256
959 (base32
960 "1msk8a0z8rr16hkp2fnv668vf6wayiydqgc2mcklaa04rv3qb0mz"))
961 (modules '((guix build utils)))
962 (snippet
963 '(begin
964 (delete-file-recursively "src/3rdparty")
965 #t))))
966 (arguments
967 (substitute-keyword-arguments (package-arguments qtsvg-5)
968 ((#:phases phases)
969 `(modify-phases ,phases
970 (add-after 'unpack 'fix-build
971 (lambda _
972 (substitute* "src/plugins/imageformats/jp2/qjp2handler.cpp"
973 (("^#include <jasper/jasper.h>")
974 "#include <jasper/jasper.h>\n#include <QtCore/qmath.h>"))
975 #t))))))
976 (native-inputs `())
977 (inputs
978 (list jasper
979 libmng
980 libtiff
981 libwebp
982 mesa
983 qtbase-5
984 zlib))
985 (synopsis "Additional Image Format plugins for Qt")
986 (description "The QtImageFormats module contains plugins for adding
987 support for MNG, TGA, TIFF and WBMP image formats.")))
988
989 (define-public qtx11extras
990 (package (inherit qtsvg-5)
991 (name "qtx11extras")
992 (version "5.15.2")
993 (source (origin
994 (method url-fetch)
995 (uri (qt-urls name version))
996 (sha256
997 (base32
998 "0gkfzj195v9flwljnqpdz3a532618yn4h2577nlsai56x4p7053h"))))
999 (arguments
1000 (substitute-keyword-arguments (package-arguments qtsvg-5)
1001 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1002 (native-inputs (list perl))
1003 (inputs
1004 (list mesa qtbase-5))
1005 (synopsis "Qt Extras for X11")
1006 (description "The QtX11Extras module includes the library to access X11
1007 from within Qt 5.")))
1008
1009 (define-public qtxmlpatterns
1010 (package (inherit qtsvg-5)
1011 (name "qtxmlpatterns")
1012 (version "5.15.2")
1013 (source (origin
1014 (method url-fetch)
1015 (uri (qt-urls name version))
1016 (sha256
1017 (base32
1018 "1ypj5jpa31rlx8yfw3y9jia212lfnxvnqkvygs6ihjf3lxi23skn"))))
1019 (arguments
1020 (substitute-keyword-arguments (package-arguments qtsvg-5)
1021 ((#:tests? _ #f) #f) ; TODO: Enable the tests
1022 ((#:phases phases)
1023 `(modify-phases ,phases
1024 (add-after 'unpack 'disable-network-tests
1025 (lambda _ (substitute* "tests/auto/auto.pro"
1026 (("qxmlquery") "# qxmlquery")
1027 (("xmlpatterns ") "# xmlpatterns"))
1028 #t))))))
1029 (native-inputs (list perl qtdeclarative-5))
1030 (inputs (list qtbase-5))
1031 (synopsis "Qt XML patterns module")
1032 (description "The QtXmlPatterns module is a XQuery and XPath engine for
1033 XML and custom data models. It contains programs such as xmlpatterns and
1034 xmlpatternsvalidator.")))
1035
1036 (define-public qtdeclarative-5
1037 (package (inherit qtsvg-5)
1038 (name "qtdeclarative")
1039 (version "5.15.2")
1040 (source (origin
1041 (method url-fetch)
1042 (uri (qt-urls name version))
1043 (sha256
1044 (base32
1045 "0lancdn7y0lrlmyn5cbdm0izd5yprvd5n77nhkb7a3wl2sbx0066"))))
1046 (arguments
1047 (substitute-keyword-arguments (package-arguments qtsvg-5)
1048 ((#:tests? _ #f) #f) ;TODO: Enable the tests
1049 ((#:phases phases)
1050 `(modify-phases ,phases
1051 (add-after 'build 'fix-qt5core-install-prefix
1052 (lambda* (#:key outputs #:allow-other-keys)
1053 (let ((out (assoc-ref outputs "out")))
1054 ;; The Qt5Core install prefix is set to qtbase, but qmlcachegen
1055 ;; is provided by qtdeclarative-5.
1056 (substitute*
1057 "lib/cmake/Qt5QuickCompiler/Qt5QuickCompilerConfig.cmake"
1058 (("\\$\\{_qt5Core_install_prefix\\}") out)))
1059 #t))))))
1060 (native-inputs
1061 (list perl
1062 pkg-config
1063 python
1064 python-wrapper
1065 qtsvg-5
1066 vulkan-headers))
1067 (inputs
1068 (list mesa qtbase-5))
1069 (synopsis "Qt QML module (Quick 2)")
1070 (description "The Qt QML module provides a framework for developing
1071 applications and libraries with the QML language. It defines and implements the
1072 language and engine infrastructure, and provides an API to enable application
1073 developers to extend the QML language with custom types and integrate QML code
1074 with JavaScript and C++.")))
1075
1076 (define-public qtdeclarative
1077 (package
1078 (name "qtdeclarative")
1079 (version "6.3.1")
1080 ;; TODO: Package 'masm' and unbundle from sources.
1081 (source (origin
1082 (method url-fetch)
1083 (uri (qt-urls name version))
1084 (sha256
1085 (base32
1086 "1s268fha3650dn1lqxf8jfa07wxpw09f6p7rjyiwq3w24d0nkrq3"))))
1087 (build-system cmake-build-system)
1088 (arguments
1089 (list
1090 #:configure-flags #~(list "-GNinja" ;about twice as fast!
1091 "-DQT_BUILD_TESTS=ON")
1092 #:phases
1093 #~(modify-phases %standard-phases
1094 (add-after 'unpack 'honor-cmake-install-rpath
1095 ;; The build system goes out of its way to compute a runpath it
1096 ;; thinks makes more sense, and fails. Revert to the default
1097 ;; behavior, which is to honor CMAKE_INSTALL_RPATH.
1098 (lambda _
1099 (substitute* "src/qml/Qt6QmlMacros.cmake"
1100 (("set_target_properties.*PROPERTIES.*INSTALL_RPATH.*" all)
1101 (string-append "# " all)))))
1102 (add-after 'unpack 'patch-qlibraryinfo-paths
1103 (lambda _
1104 ;; The QLibraryInfo paths are hard-coded to point to the qtbase
1105 ;; installation, but all the tools used in the test suite come
1106 ;; from this package.
1107 (substitute* (find-files "tests" "\\.cpp$")
1108 (("QLibraryInfo::path\\(QLibraryInfo::BinariesPath)")
1109 (string-append "QStringLiteral(\"" #$output "/bin\")"))
1110 (("QLibraryInfo::path\\(QLibraryInfo::LibraryExecutablesPath)")
1111 (string-append "QStringLiteral(\"" #$output
1112 "/lib/qt6/libexec\")"))
1113 (("QLibraryInfo::path\\(QLibraryInfo::QmlImportsPath)")
1114 (string-append "QStringLiteral(\"" #$output
1115 "/lib/qt6/qml\")")))))
1116 (replace 'build
1117 (lambda* (#:key parallel-build? #:allow-other-keys)
1118 (apply invoke "cmake" "--build" "."
1119 (if parallel-build?
1120 `("--parallel" ,(number->string (parallel-job-count)))
1121 '()))))
1122 (delete 'check) ;move after the install phase
1123 (replace 'install
1124 (lambda _
1125 (invoke "cmake" "--install" ".")))
1126 (add-after 'install 'check
1127 (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
1128 (when tests?
1129 ;; The tests expect to find the modules provided by this
1130 ;; package; extend the environment variables needed to do so.
1131 ;(setenv "CMAKE_PREFIX_PATH" #$output)
1132 (setenv "QML2_IMPORT_PATH"
1133 (string-append #$output "/lib/qt6/qml"))
1134 (setenv "QT_PLUGIN_PATH"
1135 (string-append #$output "/lib/qt6/plugins:"
1136 (getenv "QT_PLUGIN_PATH")))
1137 (setenv "QT_QPA_PLATFORM" "offscreen")
1138 ;; Skip tests known to fail on GNU/Linux, in a CI context or
1139 ;; due to bitness (see: https://code.qt.io/cgit/qt/qtbase.git
1140 ;; /tree/src/testlib/qtestblacklist.cpp).
1141 (setenv "QTEST_ENVIRONMENT" "linux ci 32bit")
1142 (setenv "HOME" "/tmp") ;a few tests require a writable HOME
1143 (invoke
1144 "ctest" "--output-on-failure"
1145 "-j" (if parallel-tests?
1146 (number->string (parallel-job-count))
1147 "1")
1148 "-E" ;exclude some tests by regex
1149 (string-append
1150 "("
1151 (string-join
1152 (list
1153 ;; This test is marked as flaky upstream (see:
1154 ;; https://bugreports.qt.io/browse/QTBUG-101488).
1155 "tst_qquickfiledialogimpl"
1156 ;; These tests all fail because 'test_overlappingHandles'
1157 ;; (see: https://bugreports.qt.io/browse/QTBUG-95750).
1158 "tst_basic"
1159 "tst_fusion"
1160 "tst_imagine"
1161 "tst_material"
1162 "tst_universal"
1163 ;; Fails due to using the wrong lib/qt6/qml prefix:
1164 ;; "Warning: Failed to find the following builtins:
1165 ;; builtins.qmltypes, jsroot.qmltypes (so will use
1166 ;; qrc). Import paths used:
1167 ;; /gnu/store/...-qtbase-6.3.1/lib/qt6/qml"
1168 "tst_qmltc_qprocess"
1169 ;; These test fail when running qmlimportscanner; perhaps
1170 ;; an extra CMAKE_PREFIX_PATH location is missing to
1171 ;; correctly locate the imports.
1172 "empty_qmldir"
1173 "qtquickcompiler"
1174 "cmake_tooling_imports"
1175 ;; This test seems to hangs for a long time, possibly
1176 ;; waiting for a killed process, which becomes a zombie in
1177 ;; the build container (perhaps solved after
1178 ;; fixing/applying #30948).
1179 "tst_qqmlpreview") "|")
1180 ")")))))
1181 (add-after 'install 'delete-installed-tests
1182 (lambda _
1183 (delete-file-recursively (string-append #$output "/tests")))))))
1184 (native-inputs
1185 (list ninja
1186 perl
1187 pkg-config
1188 python
1189 qtshadertools
1190 vulkan-headers))
1191 (inputs
1192 (list libxkbcommon
1193 mesa
1194 qtbase))
1195 (home-page (package-home-page qtbase))
1196 (synopsis "Qt QML module (Quick 2)")
1197 (description "The Qt QML module provides a framework for developing
1198 applications and libraries with the QML language. It defines and implements
1199 the language and engine infrastructure, and provides an API to enable
1200 application developers to extend the QML language with custom types and
1201 integrate QML code with JavaScript and C++.")
1202 (license (package-license qtbase))))
1203
1204 (define-public qtconnectivity
1205 (package (inherit qtsvg-5)
1206 (name "qtconnectivity")
1207 (version "5.15.2")
1208 (source (origin
1209 (method url-fetch)
1210 (uri (qt-urls name version))
1211 (sha256
1212 (base32
1213 "185zci61ip1wpjrygcw2m6v55lvninc0b8y2p3jh6qgpf5w35003"))))
1214 (native-inputs
1215 (list perl pkg-config qtdeclarative-5))
1216 (inputs
1217 (list bluez qtbase-5))
1218 (synopsis "Qt Connectivity module")
1219 (description "The Qt Connectivity modules provides modules for interacting
1220 with Bluetooth and NFC.")))
1221
1222 (define-public qtwebsockets-5
1223 (package (inherit qtsvg-5)
1224 (name "qtwebsockets")
1225 (version "5.15.2")
1226 (source (origin
1227 (method url-fetch)
1228 (uri (qt-urls name version))
1229 (sha256
1230 (base32
1231 "0gr399fn5n8j3m9d3vv01vcbr1cb7pw043j04cnnxzrlvn2jvd50"))))
1232 (arguments
1233 (substitute-keyword-arguments (package-arguments qtsvg-5)
1234 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1235 (native-inputs
1236 (list perl qtdeclarative-5))
1237 (inputs (list qtbase-5))
1238 (synopsis "Qt Web Sockets module")
1239 (description "WebSocket is a web-based protocol designed to enable two-way
1240 communication between a client application and a remote host. The Qt
1241 WebSockets module provides C++ and QML interfaces that enable Qt applications
1242 to act as a server that can process WebSocket requests, or a client that can
1243 consume data received from the server, or both.")))
1244
1245 (define-public qtwebsockets
1246 (package
1247 (name "qtwebsockets")
1248 (version "6.3.1")
1249 (source (origin
1250 (method url-fetch)
1251 (uri (qt-urls name version))
1252 (sha256
1253 (base32
1254 "06hj0pkdzjicmbiinjp1dk1ziz8cb3fgcwy7a0dxxjvzr680v64z"))))
1255 (build-system cmake-build-system)
1256 (arguments
1257 (list
1258 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
1259 #:phases #~(modify-phases %standard-phases
1260 (delete 'check) ;move after install
1261 (add-after 'install 'prepare-for-tests
1262 (lambda _
1263 (setenv "QT_QPA_PLATFORM" "offscreen")
1264 (setenv "QML2_IMPORT_PATH"
1265 (string-append #$output "/lib/qt6/qml:"
1266 (getenv "QML2_IMPORT_PATH")))))
1267 (add-after 'prepare-for-tests 'check
1268 (assoc-ref %standard-phases 'check))
1269 (add-after 'check 'delete-installed-tests
1270 (lambda _
1271 (delete-file-recursively
1272 (string-append #$output "/tests")))))))
1273 (native-inputs (list perl))
1274 (inputs (list qtbase qtdeclarative))
1275 (synopsis "Qt Web Sockets module")
1276 (description "WebSocket is a web-based protocol designed to enable two-way
1277 communication between a client application and a remote host. The Qt
1278 WebSockets module provides C++ and QML interfaces that enable Qt applications
1279 to act as a server that can process WebSocket requests, or a client that can
1280 consume data received from the server, or both.")
1281 (home-page (package-home-page qtbase))
1282 (license (package-license qtbase))))
1283
1284 (define-public qtsensors
1285 (package (inherit qtsvg-5)
1286 (name "qtsensors")
1287 (version "5.15.2")
1288 (source (origin
1289 (method url-fetch)
1290 (uri (qt-urls name version))
1291 (sha256
1292 (base32
1293 "0fa81r7bn1mf9ynwsx524a55dx1q0jb4vda6j48ssb4lx7wi201z"))))
1294 (arguments
1295 (substitute-keyword-arguments (package-arguments qtsvg-5)
1296 ((#:parallel-tests? _ #f) #f) ; can lead to race condition
1297 ((#:phases phases)
1298 `(modify-phases ,phases
1299 (add-after 'unpack 'fix-tests
1300 (lambda _
1301 (substitute* "tests/auto/qsensorgestures_gestures/tst_sensorgestures_gestures.cpp"
1302 (("2000") "5000") ;lengthen test timeout
1303 (("QTest::newRow(\"twist\") << \"twist\"") "")) ;failing test
1304 #t))))))
1305 (native-inputs
1306 (list perl qtdeclarative-5))
1307 (inputs (list qtbase-5))
1308 (synopsis "Qt Sensors module")
1309 (description "The Qt Sensors API provides access to sensor hardware via QML
1310 and C++ interfaces. The Qt Sensors API also provides a motion gesture
1311 recognition API for devices.")))
1312
1313 (define-public qtmultimedia-5
1314 (package
1315 (inherit qtsvg-5)
1316 (name "qtmultimedia")
1317 (version "5.15.2")
1318 (source (origin
1319 (method url-fetch)
1320 (uri (qt-urls name version))
1321 (sha256
1322 (base32
1323 "1xbd6kc7i0iablqdkvfrajpi32cbq7j6ajbfyyyalcai1s0mhdqc"))
1324 (modules '((guix build utils)))
1325 (snippet
1326 '(begin
1327 (delete-file-recursively
1328 "examples/multimedia/spectrum/3rdparty")
1329 ;; We also prevent the spectrum example from being built.
1330 (substitute* "examples/multimedia/multimedia.pro"
1331 (("spectrum") "#"))
1332 #t))))
1333 (arguments
1334 (substitute-keyword-arguments (package-arguments qtsvg-5)
1335 ((#:phases phases)
1336 `(modify-phases ,phases
1337 (replace 'configure
1338 (lambda* (#:key outputs #:allow-other-keys)
1339 (let ((out (assoc-ref outputs "out")))
1340 (invoke "qmake" "QT_BUILD_PARTS = libs tools tests"
1341 (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out "/lib -Wl,-rpath,")
1342 (string-append "PREFIX=" out)))))))
1343 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1344 (native-inputs
1345 (list perl pkg-config python qtdeclarative-5))
1346 (inputs
1347 (list alsa-lib
1348 mesa
1349 pulseaudio
1350 qtbase-5
1351 ;; Gstreamer is needed for the mediaplayer plugin
1352 gstreamer
1353 gst-plugins-base))
1354 (synopsis "Qt Multimedia module")
1355 (description "The Qt Multimedia module provides set of APIs to play and
1356 record media, and manage a collection of media content. It also contains a
1357 set of plugins for interacting with pulseaudio and GStreamer.")))
1358
1359 (define-public qtshadertools
1360 (package
1361 (name "qtshadertools")
1362 (version "6.3.1")
1363 (source (origin
1364 (method url-fetch)
1365 (uri (qt-urls name version))
1366 ;; Note: the source bundles *patched* glslang and SPIRV-Cross
1367 ;; sources.
1368 (sha256
1369 (base32
1370 "0nj35s2z5n438q7nqf6bnj3slwz2am3169ck1ixwqa0mjrv73dsr"))))
1371 (build-system cmake-build-system)
1372 (arguments
1373 (list
1374 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
1375 #:phases #~(modify-phases %standard-phases
1376 (add-before 'check 'prepare-for-tests
1377 (lambda _
1378 (setenv "QT_QPA_PLATFORM" "offscreen"))))))
1379 (native-inputs (list perl))
1380 (inputs (list glslang libxkbcommon qtbase))
1381 (home-page (package-home-page qtbase))
1382 (synopsis "Shader pipeline API and and tools for Qt")
1383 (description "The @code{qtshadertools} module provides APIs and tools
1384 supporting shader pipeline functionality as offered in Qt Quick to operate on
1385 Vulkan, OpenGL and other main graphic APIs.")
1386 (license (package-license qtbase))))
1387
1388 (define-public qtmultimedia
1389 (package
1390 (name "qtmultimedia")
1391 (version "6.3.1")
1392 (source (origin
1393 (method url-fetch)
1394 (uri (qt-urls name version))
1395 (sha256
1396 (base32
1397 "0dkk3lmzi2fs13cnj8q1lpcs6gghj219826gkwnzyd6nmlm280vy"))
1398 (modules '((guix build utils)))
1399 (snippet
1400 '(begin
1401 (delete-file-recursively
1402 "examples/multimedia/spectrum/3rdparty")
1403 ;; We also prevent the spectrum example from being built.
1404 (substitute* "examples/multimedia/multimedia.pro"
1405 (("spectrum") "#"))))))
1406 (build-system cmake-build-system)
1407 (arguments
1408 (list
1409 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON"
1410 "-DQT_FEATURE_pulseaudio=ON")
1411 #:phases
1412 #~(modify-phases %standard-phases
1413 (add-after 'unpack 'disable-integration-tests
1414 (lambda _
1415 ;; XXX: The tst_qaudiodecoderbackend, tst_qaudiodevice,
1416 ;; tst_qaudiosource, tst_qmediaplayerbackend and
1417 ;; tst_qcamerabackend tests fail, presumably because they
1418 ;; require a functional pulseaudio daemon (which requires a dbus
1419 ;; session bus, which requires an X11 server, and then is still
1420 ;; unhappy).
1421 (substitute* "tests/auto/CMakeLists.txt"
1422 (("add_subdirectory\\(integration)") ""))))
1423 (add-before 'check 'prepare-for-tests
1424 (lambda _
1425 (setenv "QT_QPA_PLATFORM" "offscreen")))
1426 (add-after 'install 'delete-installed-tests
1427 (lambda _
1428 (delete-file-recursively (string-append #$output "/tests")))))))
1429 (native-inputs
1430 (list perl
1431 pkg-config
1432 qtshadertools
1433 vulkan-headers))
1434 (inputs
1435 (list alsa-lib
1436 glib
1437 gstreamer
1438 gst-plugins-base ;gstreamer-gl
1439 gst-plugins-good ;camera support, additional plugins
1440 gst-libav ;ffmpeg plugin
1441 libxkbcommon
1442 mesa
1443 qtbase
1444 qtdeclarative
1445 pulseaudio))
1446 (home-page (package-home-page qtbase))
1447 (synopsis "Qt Multimedia module")
1448 (description "The Qt Multimedia module provides set of APIs to play and
1449 record media, and manage a collection of media content. It also contains a
1450 set of plugins for interacting with pulseaudio and GStreamer.")
1451 (license (package-license qtbase))))
1452
1453 (define-public qtwayland
1454 (package (inherit qtsvg-5)
1455 (name "qtwayland")
1456 (version "5.15.2")
1457 (source (origin
1458 (method url-fetch)
1459 (uri (qt-urls name version))
1460 (patches (search-patches "qtwayland-gcc-11.patch"))
1461 (sha256
1462 (base32
1463 "1ddfx4nak16xx0zh1kl836zxvpbixmmjyplsmfmg65pqkwi34dqr"))))
1464 (arguments
1465 (substitute-keyword-arguments (package-arguments qtsvg-5)
1466 ((#:phases phases)
1467 `(modify-phases ,phases
1468 (add-after 'unpack 'disable-failing-tests
1469 (lambda _
1470 ;; FIXME: tst_seatv4::animatedCursor() fails for no good
1471 ;; reason and breaks these two tests.
1472 (substitute* "tests/auto/client/seatv4/tst_seatv4.cpp"
1473 (((string-append "QVERIFY\\(!cursorSurface\\(\\)->"
1474 "m_waitingFrameCallbacks\\.empty\\(\\)\\);"))
1475 "")
1476 (("QTRY_COMPARE\\(bufferSpy\\.count\\(\\), 1\\);")
1477 ""))
1478 #t))
1479 (add-before 'check 'set-test-environment
1480 (lambda _
1481 ;; Do not fail just because /etc/machine-id is missing.
1482 (setenv "DBUS_FATAL_WARNINGS" "0")
1483 #t))))))
1484 (native-inputs
1485 (list glib perl pkg-config qtdeclarative-5))
1486 (inputs
1487 (list fontconfig
1488 freetype
1489 libx11
1490 libxcomposite
1491 libxext
1492 libxkbcommon
1493 libxrender
1494 mesa
1495 mtdev
1496 qtbase-5
1497 vulkan-headers
1498 wayland))
1499 (synopsis "Qt Wayland module")
1500 (description "The Qt Wayland module provides the QtWayland client and
1501 compositor libraries.")))
1502
1503 (define-public qtserialport
1504 (package (inherit qtsvg-5)
1505 (name "qtserialport")
1506 (version "5.15.2")
1507 (source (origin
1508 (method url-fetch)
1509 (uri (qt-urls name version))
1510 (sha256
1511 (base32
1512 "17gp5qzg4wdg8qlxk2p3mh8x1vk33rf33wic3fy0cws193bmkiar"))))
1513 (native-inputs (list perl))
1514 (inputs
1515 (list qtbase-5 eudev))
1516 (arguments
1517 (substitute-keyword-arguments (package-arguments qtsvg-5)
1518 ((#:phases phases)
1519 `(modify-phases ,phases
1520 (add-after 'unpack 'patch-dlopen-paths
1521 (lambda* (#:key inputs #:allow-other-keys)
1522 (substitute* "src/serialport/qtudev_p.h"
1523 ;; Use the absolute paths for dynamically loaded libs,
1524 ;; otherwise the lib will be searched in LD_LIBRARY_PATH which
1525 ;; typically is not set in guix.
1526 (("^\\s*(udevLibrary->setFileNameAndVersion\\(QStringLiteral\\(\")(udev\"\\),\\s*[0-9]+\\);)" _ a b)
1527 (string-append a (assoc-ref inputs "eudev") "/lib/lib" b)))
1528 #t))))))
1529 (synopsis "Qt Serial Port module")
1530 (description "The Qt Serial Port module provides the library for
1531 interacting with serial ports from within Qt.")))
1532
1533 (define-public qtserialbus
1534 (package (inherit qtsvg-5)
1535 (name "qtserialbus")
1536 (version "5.15.2")
1537 (source (origin
1538 (method url-fetch)
1539 (uri (qt-urls name version))
1540 (sha256
1541 (base32
1542 "125x6756fjpldqy6wbw6cg7ngjh2016aiq92bchh719z1mf7xsxf"))))
1543 (arguments
1544 (substitute-keyword-arguments (package-arguments qtsvg-5)
1545 ((#:phases phases '%standard-phases)
1546 `(modify-phases ,phases
1547 (add-after 'unpack 'patch-libsocketcan-reference
1548 (lambda* (#:key inputs #:allow-other-keys)
1549 (let* ((libcansocket (assoc-ref inputs "libsocketcan"))
1550 (libcansocket.so (string-append libcansocket
1551 "/lib/libsocketcan.so")))
1552 (substitute* "src/plugins/canbus/socketcan/libsocketcan.cpp"
1553 (("QStringLiteral\\(\"socketcan\"\\)")
1554 (format #f "QStringLiteral(~s)" libcansocket.so)))
1555 #t)))))))
1556 (inputs
1557 (list libsocketcan qtbase-5 qtserialport))
1558 (synopsis "Qt Serial Bus module")
1559 (description "The Qt Serial Bus API provides classes and functions to
1560 access the various industrial serial buses and protocols, such as CAN, ModBus,
1561 and others.")))
1562
1563 (define-public qtwebchannel-5
1564 (package (inherit qtsvg-5)
1565 (name "qtwebchannel")
1566 (version "5.15.2")
1567 (source (origin
1568 (method url-fetch)
1569 (uri (qt-urls name version))
1570 (sha256
1571 (base32
1572 "1h9y634phvvk557mhmf9z4lmxr41rl8x9mqy2lzp31mk8ffffzqj"))))
1573 (native-inputs
1574 (list perl qtdeclarative-5 qtwebsockets-5))
1575 (inputs (list qtbase-5))
1576 (synopsis "Web communication library for Qt")
1577 (description "The Qt WebChannel module enables peer-to-peer communication
1578 between the host (QML/C++ application) and the client (HTML/JavaScript
1579 application). The transport mechanism is supported out of the box by the two
1580 popular web engines, Qt WebKit 2 and Qt WebEngine.")))
1581
1582 (define-public qtwebchannel
1583 (package
1584 (name "qtwebchannel")
1585 (version "6.3.1")
1586 (source (origin
1587 (method url-fetch)
1588 (uri (qt-urls name version))
1589 (sha256
1590 (base32
1591 "0s16zx3qn3byldvhmsnwijm8rmizk8vpqj7fnwhjg6c67z10m8ma"))))
1592 (build-system cmake-build-system)
1593 (arguments
1594 (list
1595 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
1596 #:phases #~(modify-phases %standard-phases
1597 (delete 'check) ;move after install
1598 (add-after 'install 'prepare-for-tests
1599 (lambda _
1600 (setenv "QT_QPA_PLATFORM" "offscreen")
1601 (setenv "QML2_IMPORT_PATH"
1602 (string-append #$output "/lib/qt6/qml:"
1603 (getenv "QML2_IMPORT_PATH")))))
1604 (add-after 'prepare-for-tests 'check
1605 (assoc-ref %standard-phases 'check))
1606 (add-after 'check 'delete-installed-tests
1607 (lambda _
1608 (delete-file-recursively
1609 (string-append #$output "/tests")))))))
1610 (native-inputs (list perl))
1611 (inputs (list qtbase qtdeclarative qtwebsockets))
1612 (home-page (package-home-page qtbase))
1613 (synopsis "Web communication library for Qt")
1614 (description "The Qt WebChannel module enables peer-to-peer communication
1615 between the host (QML/C++ application) and the client (HTML/JavaScript
1616 application).")
1617 (license (package-license qtbase))))
1618
1619 (define-public qtwebglplugin
1620 (package (inherit qtsvg-5)
1621 (name "qtwebglplugin")
1622 (version "5.15.2")
1623 (source (origin
1624 (method url-fetch)
1625 (uri (qt-urls name version))
1626 (sha256
1627 (base32
1628 "0ihlnhv8ldkqz82v3j7j22lrhk17b6ghra8sx85y2agd2ysq5rw1"))))
1629 (arguments
1630 (substitute-keyword-arguments (package-arguments qtsvg-5)
1631 ((#:phases phases)
1632 `(modify-phases ,phases
1633 (add-after 'unpack 'disable-network-tests
1634 (lambda _ (substitute* "tests/plugins/platforms/platforms.pro"
1635 (("webgl") "# webgl"))
1636 #t))))))
1637 (native-inputs '())
1638 (inputs
1639 (list mesa qtbase-5 qtdeclarative-5 qtwebsockets-5 zlib))
1640 (synopsis "QPA plugin for running an application via a browser using
1641 streamed WebGL commands")
1642 (description "Qt back end that uses WebGL for rendering. It allows Qt
1643 applications (with some limitations) to run in a web browser that supports
1644 WebGL. WebGL is a JavaScript API for rendering 2D and 3D graphics within any
1645 compatible web browser without the use of plug-ins. The API is similar to
1646 OpenGL ES 2.0 and can be used in HTML5 canvas elements")))
1647
1648 (define-public qtwebview
1649 (package (inherit qtsvg-5)
1650 (name "qtwebview")
1651 (version "5.15.2")
1652 (source (origin
1653 (method url-fetch)
1654 (uri (qt-urls name version))
1655 (sha256
1656 (base32
1657 "1rw1wibmbxlj6xc86qs3y8h42al1vczqiksyxzaylxs9gqb4d7xy"))))
1658 (native-inputs
1659 (list perl))
1660 (inputs
1661 (list qtbase-5 qtdeclarative-5))
1662 (synopsis "Display web content in a QML application")
1663 (description "Qt WebView provides a way to display web content in a QML
1664 application without necessarily including a full web browser stack by using
1665 native APIs where it makes sense.")))
1666
1667 (define-public qtlocation
1668 (package (inherit qtsvg-5)
1669 (name "qtlocation")
1670 (version "5.15.2")
1671 (source (origin
1672 (method url-fetch)
1673 (uri (string-append "https://download.qt.io/official_releases/qt/"
1674 (version-major+minor version) "/" version
1675 "/submodules/" name "-everywhere-src-"
1676 version ".tar.xz"))
1677 (sha256
1678 (base32
1679 "184jychnlfhplpwc5cdcsapwljgwvzk5qpf3val4kpq8w44wnkwq"))))
1680 (arguments
1681 (substitute-keyword-arguments (package-arguments qtsvg-5)
1682 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1683 (native-inputs
1684 (list perl qtdeclarative-5 qtquickcontrols-5 qtserialport))
1685 (inputs
1686 (list icu4c openssl qtbase-5 zlib))
1687 (synopsis "Qt Location and Positioning modules")
1688 (description "The Qt Location module provides an interface for location,
1689 positioning and geolocation plugins.")))
1690
1691 (define-public qtlottie
1692 (package
1693 (name "qtlottie")
1694 (version "6.3.1")
1695 (source (origin
1696 (method url-fetch)
1697 (uri (qt-urls name version))
1698 (sha256
1699 (base32
1700 "1x8wmc6gwmxk92zjcsrbhrbqbfvnk7302ggghld5wk8jk5lsf2vl"))))
1701 (build-system cmake-build-system)
1702 (arguments
1703 (list
1704 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
1705 #:phases
1706 #~(modify-phases %standard-phases
1707 (delete 'check) ;move after install
1708 (add-after 'install 'prepare-for-tests
1709 (lambda _
1710 (setenv "QT_QPA_PLATFORM" "offscreen")
1711 (setenv "QML2_IMPORT_PATH"
1712 (string-append #$output "/lib/qt6/qml:"
1713 (getenv "QML2_IMPORT_PATH"))))))))
1714 (native-inputs (list perl))
1715 (inputs (list libxkbcommon qtbase qtdeclarative))
1716 (home-page (package-home-page qtbase))
1717 (synopsis "QML API for rendering Bodymovin graphics and animations")
1718 (description "Qt Lottie Animation provides a QML API for rendering
1719 graphics and animations that are exported in JSON format by the Bodymovin
1720 plugin for Adobe After Effects.")
1721 (license (package-license qtbase))))
1722
1723 (define-public qttools-5
1724 (package (inherit qtsvg-5)
1725 (name "qttools")
1726 (version "5.15.2")
1727 (source (origin
1728 (method url-fetch)
1729 (uri (qt-urls name version))
1730 (sha256
1731 (base32
1732 "1k618f7v6jaj0ygy8d7jvgb8zjr47sn55kiskbdkkizp3z7d12f1"))))
1733 (arguments
1734 (substitute-keyword-arguments (package-arguments qtsvg-5)
1735 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1736 (native-inputs
1737 (list perl qtdeclarative-5 vulkan-headers))
1738 (inputs
1739 (list mesa qtbase-5))
1740 (synopsis "Qt Tools and Designer modules")
1741 (description "The Qt Tools module provides a set of applications to browse
1742 the documentation, translate applications, generate help files and other stuff
1743 that helps in Qt development.")))
1744
1745 (define-public qttools
1746 (package
1747 (name "qttools")
1748 (version "6.3.1")
1749 (source (origin
1750 (method url-fetch)
1751 (uri (qt-urls name version))
1752 (sha256
1753 (base32
1754 "1h96w4bzkbd80vr7lh6hnypdlmbzc1y52c2zrqzvkgm3587pa4n4"))))
1755 (build-system cmake-build-system)
1756 (arguments
1757 (list
1758 ;; The build system attempts to fetch online resources and fails when
1759 ;; building the test suite.
1760 #:configure-flags #~(list "-DQT_BUILD_TESTS=OFF")))
1761 (native-inputs (list perl qtdeclarative vulkan-headers))
1762 (inputs (list libxkbcommon mesa qtbase))
1763 (home-page (package-home-page qtbase))
1764 (synopsis "Qt Tools and Designer modules")
1765 (description "The Qt Tools module provides a set of applications to browse
1766 the documentation, translate applications, generate help files and other stuff
1767 that helps in Qt development.")
1768 ;; GPL 3 only with Qt GPL exception 1.0 (see:
1769 ;; LICENSES/Qt-GPL-exception-1.0.txt).
1770 (license (list license:gpl3))))
1771
1772 (define-public qtscript
1773 (package (inherit qtsvg-5)
1774 (name "qtscript")
1775 (version "5.15.2")
1776 (source (origin
1777 (method url-fetch)
1778 (uri (qt-urls name version))
1779 (sha256
1780 (base32
1781 "0gk74hk488k9ldacxbxcranr3arf8ifqg8kz9nm1rgdgd59p36d2"))
1782 (patches (search-patches "qtscript-disable-tests.patch"))))
1783 (native-inputs
1784 (list perl qttools-5))
1785 (inputs
1786 (list qtbase-5))
1787 (synopsis "Qt Script module")
1788 (description "Qt provides support for application scripting with ECMAScript.
1789 The following guides and references cover aspects of programming with
1790 ECMAScript and Qt.")))
1791
1792 (define-public qtquickcontrols-5
1793 (package (inherit qtsvg-5)
1794 (name "qtquickcontrols")
1795 (version "5.15.2")
1796 (source (origin
1797 (method url-fetch)
1798 (uri (qt-urls name version))
1799 (sha256
1800 (base32
1801 "1dczakl868mg0lnwpf082jjc5976ycn879li1vqlgw5ihirzp4y3"))))
1802 (arguments
1803 (substitute-keyword-arguments (package-arguments qtsvg-5)
1804 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1805 (inputs
1806 (list qtbase-5 qtdeclarative-5))
1807 (synopsis "Qt Quick Controls and other Quick modules")
1808 (description "The QtScript module provides classes for making Qt
1809 applications scriptable. This module provides a set of extra components that
1810 can be used to build complete interfaces in Qt Quick.")))
1811
1812 (define-public qtquickcontrols2-5
1813 (package (inherit qtsvg-5)
1814 (name "qtquickcontrols2")
1815 (version "5.15.2")
1816 (source (origin
1817 (method url-fetch)
1818 (uri (qt-urls name version))
1819 (sha256
1820 (base32
1821 "06c9vrwvbjmzapmfa25y34lgjkzg57xxbm92nr6wkv5qykjnq6v7"))))
1822 (arguments
1823 (substitute-keyword-arguments (package-arguments qtsvg-5)
1824 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1825 (inputs
1826 (list qtbase-5 qtdeclarative-5))
1827 (synopsis "Qt Quick Controls 2 and other Quick 2 modules")
1828 (description "The Qt Quick Controls 2 module contains the Qt Labs Platform
1829 module that provides platform integration: native dialogs, menus and menu bars,
1830 and tray icons. It falls back to Qt Widgets when a native implementation is
1831 not available.")))
1832
1833 (define-public qtquickcontrols2
1834 ;; qtquickcontrols2 still exist, but was merged into qtdeclarative.
1835 ;; Unfortunately that hasn't been well communicated at all (see:
1836 ;; https://bugreports.qt.io/browse/QTBUG-79454).
1837 (deprecated-package "qtquickcontrols2" qtdeclarative))
1838
1839 (define-public qtgraphicaleffects
1840 (package (inherit qtsvg-5)
1841 (name "qtgraphicaleffects")
1842 (version "5.15.2")
1843 (source (origin
1844 (method url-fetch)
1845 (uri (qt-urls name version))
1846 (sha256
1847 (base32
1848 "1r6zfc0qga2ax155js7c8y5rx6vgayf582s921j09mb797v6g3gc"))))
1849 (arguments
1850 (substitute-keyword-arguments (package-arguments qtsvg-5)
1851 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1852 (inputs
1853 (list qtbase-5 qtdeclarative-5))
1854 (synopsis "Qt Graphical Effects module")
1855 (description "The Qt Graphical Effects module provides a set of QML types
1856 for adding visually impressive and configurable effects to user interfaces.
1857 Effects are visual items that can be added to Qt Quick user interface as UI
1858 components. The API consists of over 20 effects provided as separate QML
1859 types. The effects cover functional areas such as blending, masking, blurring,
1860 coloring, and many more.")))
1861
1862 (define-public qtgamepad
1863 (package (inherit qtsvg-5)
1864 (name "qtgamepad")
1865 (version "5.15.2")
1866 (source (origin
1867 (method url-fetch)
1868 (uri (qt-urls name version))
1869 (sha256
1870 (base32
1871 "0p07bg93fdfn4gr2kv38qgnws5znhswajrxdfs8xc9l3i7vi2xn7"))))
1872 (native-inputs
1873 (list perl pkg-config))
1874 (inputs
1875 `(("fontconfig" ,fontconfig)
1876 ("freetype" ,freetype)
1877 ("libxrender" ,libxrender)
1878 ("sdl2" ,sdl2)
1879 ("qtbase" ,qtbase-5)
1880 ("qtdeclarative-5" ,qtdeclarative-5)))
1881 (synopsis "Qt Gamepad module")
1882 (description "The Qt Gamepad module is an add-on library that enables Qt
1883 applications to support the use of gamepad hardware and in some cases remote
1884 control equipment. The module provides both QML and C++ interfaces. The
1885 primary target audience are embedded devices with fullscreen user interfaces,
1886 and mobile applications targeting TV-like form factors.")))
1887
1888 (define-public qtscxml
1889 (package (inherit qtsvg-5)
1890 (name "qtscxml")
1891 (version "5.15.2")
1892 (source (origin
1893 (method url-fetch)
1894 (uri (qt-urls name version))
1895 (sha256
1896 (base32
1897 "1p5771b9hnpchfcdgy0zkhwg09a6xq88934aggp0rij1k85mkfb0"))
1898 (modules '((guix build utils)))
1899 (snippet
1900 '(begin
1901 (delete-file-recursively "tests/3rdparty")
1902 ;; the scion test refers to the bundled 3rd party test code.
1903 (substitute* "tests/auto/auto.pro"
1904 (("scion") "#"))
1905 #t))))
1906 (inputs
1907 (list qtbase-5 qtdeclarative-5))
1908 (synopsis "Qt SCXML module")
1909 (description "The Qt SCXML module provides functionality to create state
1910 machines from SCXML files. This includes both dynamically creating state
1911 machines (loading the SCXML file and instantiating states and transitions) and
1912 generating a C++ file that has a class implementing the state machine. It
1913 also contains functionality to support data models and executable content.")))
1914
1915 (define-public qtpositioning
1916 (package
1917 (name "qtpositioning")
1918 (version "6.3.1")
1919 (source (origin
1920 (method url-fetch)
1921 (uri (qt-urls name version))
1922 (sha256
1923 (base32
1924 "0v78wamvdw02kf9rq7m5v24q2g6jmgq4ch0fnfa014p1r978wy06"))))
1925 (build-system cmake-build-system)
1926 (arguments
1927 (list
1928 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
1929 #:phases #~(modify-phases %standard-phases
1930 (add-after 'install 'delete-installed-tests
1931 (lambda _
1932 (delete-file-recursively
1933 (string-append #$output "/tests")))))))
1934 (inputs (list perl qtbase))
1935 (home-page (package-home-page qtbase))
1936 (synopsis "QML and C++ positioning information API")
1937 (description "The Qt Positioning API provides positioning information via
1938 QML and C++ interfaces. The Qt Positioning API lets you to determine a
1939 position by using a variety of possible sources, including satellite, wifi, or
1940 text files. That information can then be used to, for example, determine a
1941 position on a map. In addition, you can use to the API to retrieve satellite
1942 information and perform area based monitoring.")
1943 (license (package-license qtbase))))
1944
1945 (define-public qtpurchasing
1946 (package (inherit qtsvg-5)
1947 (name "qtpurchasing")
1948 (version "5.15.2")
1949 (source (origin
1950 (method url-fetch)
1951 (uri (qt-urls name version))
1952 (sha256
1953 (base32
1954 "09rjx53519dfk4qj2gbn3vlxyriasyb747wpg1p11y7jkwqhs4l7"))))
1955 (inputs
1956 (list qtbase-5 qtdeclarative-5))
1957 (synopsis "Qt Purchasing module")
1958 (description "The Qt Purchasing module provides and in-app API for
1959 purchasing goods and services.")))
1960
1961 (define-public qtcharts
1962 (package (inherit qtsvg-5)
1963 (name "qtcharts")
1964 (version "5.15.2")
1965 (source (origin
1966 (method url-fetch)
1967 (uri (qt-urls name version))
1968 (sha256
1969 (base32
1970 "049x7z8zcp9jixmdv2fjscy2ggpd6za9hkdbb2bqp2mxjm0hwxg0"))))
1971 (arguments
1972 (substitute-keyword-arguments (package-arguments qtsvg-5)
1973 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1974 (inputs
1975 (list qtbase-5 qtdeclarative-5))
1976 (synopsis "Qt Charts module")
1977 (description "The Qt Charts module provides a set of easy to use chart
1978 components. It uses the Qt Graphics View Framework, therefore charts can be
1979 easily integrated to modern user interfaces. Qt Charts can be used as QWidgets,
1980 QGraphicsWidget, or QML types. Users can easily create impressive graphs by
1981 selecting one of the charts themes.")
1982 (license license:gpl3)))
1983
1984 (define-public qtdatavis3d
1985 (package (inherit qtsvg-5)
1986 (name "qtdatavis3d")
1987 (version "5.15.2")
1988 (source (origin
1989 (method url-fetch)
1990 (uri (qt-urls name version))
1991 (sha256
1992 (base32
1993 "1zdn3vm0nfy9ny7c783aabp3mhlnqhi9fw2rljn7ibbksmsnasi2"))))
1994 (arguments
1995 (substitute-keyword-arguments (package-arguments qtsvg-5)
1996 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1997 (inputs
1998 (list qtbase-5 qtdeclarative-5))
1999 (synopsis "Qt Data Visualization module")
2000 (description "The Qt Data Visualization module provides a way to visualize
2001 data in 3D as bar, scatter, and surface graphs. It is especially useful for
2002 visualizing depth maps and large quantities of rapidly changing data, such as
2003 data received from multiple sensors. The look and feel of graphs can be
2004 customized by using themes or by adding custom items and labels to them.")
2005 (license license:gpl3)))
2006
2007 (define-public qtnetworkauth-5
2008 (package (inherit qtsvg-5)
2009 (name "qtnetworkauth")
2010 (version "5.15.2")
2011 (source (origin
2012 (method url-fetch)
2013 (uri (qt-urls name version))
2014 (sha256
2015 (base32
2016 "11fdgacv4syr8bff2vdw7rb0dg1gcqpdf37hm3pn31d6z91frhpw"))))
2017 (arguments
2018 (substitute-keyword-arguments (package-arguments qtsvg-5)
2019 ((#:phases phases)
2020 `(modify-phases ,phases
2021 (add-after 'unpack 'remove-failing-test
2022 (lambda _
2023 ;; These tests can't find their test data.
2024 (substitute* "tests/auto/auto.pro"
2025 (("oauth1 ") "# oauth1 "))
2026 #t))))))
2027 (inputs
2028 (list qtbase-5))
2029 (synopsis "Qt Network Authorization module")
2030 (description "The Qt Network Authorization module provides an
2031 implementation of OAuth and OAuth2 authenticathon methods for Qt.")))
2032
2033 (define-public qtnetworkauth
2034 (package
2035 (name "qtnetworkauth")
2036 (version "6.3.1")
2037 (source (origin
2038 (method url-fetch)
2039 (uri (qt-urls name version))
2040 (sha256
2041 (base32
2042 "0apvsb2ip1m3kw8vi9spvf6f6q72ys8vr40rpyysi7shsjwm83yn"))))
2043 (build-system cmake-build-system)
2044 (arguments (list #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")))
2045 (native-inputs (list perl))
2046 (inputs (list qtbase))
2047 (home-page (package-home-page qtbase))
2048 (synopsis "Qt Network Authorization module")
2049 (description "The Qt Network Authorization module provides an
2050 implementation of OAuth and OAuth2 authenticathon methods for Qt.")
2051 (license (package-license qtbase))))
2052
2053 (define-public qtremoteobjects
2054 (package (inherit qtsvg-5)
2055 (name "qtremoteobjects")
2056 (version "5.15.2")
2057 (source (origin
2058 (method url-fetch)
2059 (uri (qt-urls name version))
2060 (sha256
2061 (base32
2062 "1hngbp0vkr35rpsrac7b9vx6f360v8v2g0fffzm590l8j2ybd0b7"))))
2063 (arguments
2064 (substitute-keyword-arguments (package-arguments qtsvg-5)
2065 ((#:phases phases)
2066 `(modify-phases ,phases
2067 (add-after 'unpack 'remove-failing-test
2068 (lambda _
2069 ;; This test can't find its imports.
2070 (substitute* "tests/auto/qml/qml.pro"
2071 (("integration") "# integration")
2072 (("usertypes") "# usertypes"))
2073 ;; disable failing tests: they need network
2074 (substitute* "tests/auto/auto.pro"
2075 (("integration_multiprocess proxy_multiprocess integration_external restart")
2076 "integration_multiprocess"))
2077 #t))))))
2078 (inputs
2079 (list qtbase-5 qtdeclarative-5))
2080 (synopsis "Qt Remote Objects module")
2081 (description "The Qt Remote Objects module is an @dfn{inter-process
2082 communication} (IPC) module developed for Qt. The idea is to extend existing
2083 Qt's functionalities to enable an easy exchange of information between
2084 processes or computers.")))
2085
2086 (define-public qtspeech
2087 (package (inherit qtsvg-5)
2088 (name "qtspeech")
2089 (version "5.15.2")
2090 (source (origin
2091 (method url-fetch)
2092 (uri (qt-urls name version))
2093 (sha256
2094 (base32
2095 "1xc3x3ghnhgchsg1kgj156yg69wn4rwjx8r28i1jd05hxjggn468"))))
2096
2097 (arguments
2098 (substitute-keyword-arguments (package-arguments qtsvg-5)
2099 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
2100 (inputs
2101 (list qtbase-5))
2102 (native-inputs
2103 (list perl qtdeclarative-5 qtmultimedia-5 qtxmlpatterns))
2104 (synopsis "Qt Speech module")
2105 (description "The Qt Speech module enables a Qt application to support
2106 accessibility features such as text-to-speech, which is useful for end-users
2107 who are visually challenged or cannot access the application for whatever
2108 reason. The most common use case where text-to-speech comes in handy is when
2109 the end-user is driving and cannot attend the incoming messages on the phone.
2110 In such a scenario, the messaging application can read out the incoming
2111 message.")))
2112
2113 (define-public qtspell
2114 (package
2115 (name "qtspell")
2116 (version "1.0.1")
2117 (source
2118 (origin
2119 (method git-fetch)
2120 (uri (git-reference
2121 (url "https://github.com/manisandro/qtspell")
2122 (commit version)))
2123 (file-name (git-file-name name version))
2124 (sha256
2125 (base32 "19ff6jzm699wrxrk57w3d4kl9qxgdipdikpwls9n4aqv4mw7g969"))))
2126 (build-system cmake-build-system)
2127 (arguments
2128 `(#:tests? #f)) ;no test
2129 (native-inputs
2130 (list pkg-config qttools-5))
2131 (inputs
2132 (list enchant qtbase-5))
2133 (home-page "https://github.com/manisandro/qtspell")
2134 (synopsis "Spell checking for Qt text widgets")
2135 (description
2136 "QtSpell adds spell-checking functionality to Qt's text widgets,
2137 using the Enchant spell-checking library.")
2138 ;; COPYING file specify GPL3, but source code files all refer to GPL2+.
2139 (license license:gpl2+)))
2140
2141 (define-public qtwebengine-5
2142 (package
2143 (inherit qtsvg-5)
2144 (name "qtwebengine")
2145 (version (package-version qtbase-5))
2146 (source
2147 (origin
2148 (method url-fetch)
2149 (uri (qt-urls name version))
2150 (sha256
2151 (base32
2152 "1q4idxdm81sx102xc12ixj0xpfx52d6vwvs3jpapnkyq8c7cmby8"))
2153 (modules '((ice-9 ftw)
2154 (ice-9 match)
2155 (srfi srfi-1)
2156 (srfi srfi-26)
2157 (guix build utils)))
2158 (snippet
2159 '(begin
2160 (let ((preserved-third-party-files
2161 '("base/third_party/double_conversion"
2162 "base/third_party/cityhash"
2163 "base/third_party/cityhash_v103"
2164 "base/third_party/dynamic_annotations"
2165 "base/third_party/icu"
2166 "base/third_party/libevent"
2167 "base/third_party/nspr"
2168 "base/third_party/superfasthash"
2169 "base/third_party/symbolize"
2170 "base/third_party/xdg_mime"
2171 "base/third_party/xdg_user_dirs"
2172 "net/third_party/mozilla_security_manager"
2173 "net/third_party/nss"
2174 "net/third_party/quiche"
2175 "net/third_party/uri_template"
2176 "third_party/abseil-cpp"
2177 "third_party/angle"
2178 "third_party/angle/src/common/third_party/base"
2179 "third_party/angle/src/common/third_party/smhasher"
2180 "third_party/angle/src/common/third_party/xxhash"
2181 "third_party/angle/src/third_party/compiler"
2182 "third_party/axe-core"
2183 "third_party/blink"
2184 "third_party/boringssl"
2185 "third_party/boringssl/src/third_party/fiat"
2186 "third_party/breakpad"
2187 "third_party/brotli"
2188 "third_party/ced"
2189 "third_party/cld_3"
2190 "third_party/closure_compiler"
2191 "third_party/crashpad"
2192 "third_party/crashpad/crashpad/third_party/lss"
2193 "third_party/crashpad/crashpad/third_party/zlib"
2194 "third_party/crc32c"
2195 "third_party/dav1d"
2196 "third_party/dawn"
2197 "third_party/devtools-frontend"
2198 "third_party/devtools-frontend/src/front_end/third_party/fabricjs"
2199 "third_party/devtools-frontend/src/front_end/third_party/lighthouse"
2200 "third_party/devtools-frontend/src/front_end/third_party/wasmparser"
2201 "third_party/devtools-frontend/src/third_party/axe-core"
2202 "third_party/emoji-segmenter"
2203 "third_party/ffmpeg"
2204 "third_party/googletest"
2205 "third_party/harfbuzz-ng/utils"
2206 "third_party/hunspell"
2207 "third_party/iccjpeg"
2208 "third_party/icu"
2209 "third_party/inspector_protocol"
2210 "third_party/jinja2"
2211 "third_party/jsoncpp"
2212 "third_party/jstemplate"
2213 "third_party/khronos"
2214 "third_party/leveldatabase"
2215 "third_party/libaddressinput"
2216 "third_party/libgifcodec"
2217 "third_party/libjingle_xmpp"
2218 "third_party/libjpeg_turbo"
2219 "third_party/libpng"
2220 "third_party/libsrtp"
2221 "third_party/libsync"
2222 "third_party/libudev"
2223 "third_party/libvpx"
2224 "third_party/libwebm"
2225 "third_party/libwebp"
2226 "third_party/libxml"
2227 "third_party/libxslt"
2228 "third_party/libyuv"
2229 "third_party/lss"
2230 "third_party/mako"
2231 "third_party/markupsafe"
2232 "third_party/mesa_headers"
2233 "third_party/metrics_proto"
2234 "third_party/modp_b64"
2235 "third_party/nasm"
2236 "third_party/one_euro_filter"
2237 "third_party/openh264/src/codec/api/svc"
2238 "third_party/opus"
2239 "third_party/ots"
2240 "third_party/pdfium"
2241 "third_party/pdfium/third_party/agg23"
2242 "third_party/pdfium/third_party/base"
2243 "third_party/pdfium/third_party/freetype"
2244 "third_party/pdfium/third_party/lcms"
2245 "third_party/pdfium/third_party/libopenjpeg20"
2246 "third_party/pdfium/third_party/skia_shared"
2247 "third_party/perfetto"
2248 "third_party/pffft"
2249 "third_party/ply"
2250 "third_party/polymer"
2251 "third_party/protobuf"
2252 "third_party/protobuf/third_party/six"
2253 "third_party/pyjson5"
2254 "third_party/re2"
2255 "third_party/rnnoise"
2256 "third_party/skia"
2257 "third_party/skia/include/third_party/skcms/skcms.h"
2258 "third_party/skia/include/third_party/vulkan"
2259 "third_party/skia/third_party/skcms"
2260 "third_party/skia/third_party/vulkanmemoryallocator"
2261 "third_party/smhasher"
2262 "third_party/snappy"
2263 "third_party/sqlite"
2264 "third_party/usb_ids"
2265 "third_party/usrsctp"
2266 "third_party/web-animations-js"
2267 "third_party/webrtc"
2268 "third_party/webrtc/common_audio/third_party/fft4g"
2269 "third_party/webrtc/common_audio/third_party/spl_sqrt_floor"
2270 "third_party/webrtc/modules/third_party/fft"
2271 "third_party/webrtc/modules/third_party/g711"
2272 "third_party/webrtc/modules/third_party/g722"
2273 "third_party/webrtc/rtc_base/third_party/base64"
2274 "third_party/webrtc/rtc_base/third_party/sigslot"
2275 "third_party/webrtc_overrides"
2276 "third_party/widevine/cdm/widevine_cdm_common.h"
2277 "third_party/widevine/cdm/widevine_cdm_version.h"
2278 "third_party/woff2"
2279 "third_party/yasm"
2280 "third_party/zlib"
2281 "url/third_party/mozilla"
2282 "v8/src/third_party/utf8-decoder"
2283 "v8/src/third_party/valgrind"
2284 "v8/src/third_party/siphash"
2285 "v8/third_party/v8/builtins"
2286 "v8/third_party/inspector_protocol"))
2287 (protected (make-regexp "\\.(gn|gyp)i?$")))
2288 (define preserved-club
2289 (map (lambda (member)
2290 (string-append "./" member))
2291 preserved-third-party-files))
2292 (define (empty? dir)
2293 (equal? (scandir dir) '("." "..")))
2294 (define (third-party? file)
2295 (string-contains file "third_party/"))
2296 (define (useless? file)
2297 (any (cute string-suffix? <> file)
2298 '(".zip" ".so" ".dll" ".exe" ".jar")))
2299 (define (parents child)
2300 ;; Return all parent directories of CHILD up to and including
2301 ;; the closest "third_party".
2302 (let* ((dirs (match (string-split child #\/)
2303 ((dirs ... last) dirs)))
2304 (closest (list-index (lambda (dir)
2305 (string=? "third_party" dir))
2306 (reverse dirs)))
2307 (delim (- (length dirs) closest)))
2308 (fold (lambda (dir prev)
2309 (cons (string-append (car prev) "/" dir)
2310 prev))
2311 (list (string-join (list-head dirs delim) "/"))
2312 (list-tail dirs delim))))
2313 (define (remove-loudly file)
2314 (format #t "deleting ~a...~%" file)
2315 (force-output)
2316 (delete-file file))
2317 (define (delete-unwanted-files child stat flag base level)
2318 (match flag
2319 ((or 'regular 'symlink 'stale-symlink)
2320 (when (third-party? child)
2321 (unless (or (member child preserved-club)
2322 (any (cute member <> preserved-club)
2323 (parents child))
2324 (regexp-exec protected child))
2325 (remove-loudly child)))
2326 (when (and (useless? child) (file-exists? child))
2327 (remove-loudly child))
2328 #t)
2329 ('directory-processed
2330 (when (empty? child)
2331 (rmdir child))
2332 #t)
2333 (_ #t)))
2334
2335 (with-directory-excursion "src/3rdparty"
2336 ;; TODO: Try removing "gn" too for future versions of qtwebengine-5.
2337 (delete-file-recursively "ninja")
2338
2339 (with-directory-excursion "chromium"
2340 ;; Delete bundled software and binaries that were not explicitly
2341 ;; preserved above.
2342 (nftw "." delete-unwanted-files 'depth 'physical)
2343
2344 ;; Assert that each preserved item is present to catch removals.
2345 (for-each (lambda (third-party)
2346 (unless (file-exists? third-party)
2347 (error (format #f "~s does not exist!~%" third-party))))
2348 preserved-club)
2349
2350 ;; Use relative header locations instead of hard coded ones.
2351 (substitute*
2352 "base/third_party/dynamic_annotations/dynamic_annotations.c"
2353 (("base/third_party/valgrind") "valgrind"))
2354 (substitute*
2355 "third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.h"
2356 (("third_party/curl") "curl"))
2357 (substitute*
2358 '("components/viz/common/gpu/vulkan_context_provider.h"
2359 "components/viz/common/resources/resource_format_utils_vulkan.h"
2360 "gpu/config/gpu_util.cc")
2361 (("third_party/vulkan/include/")
2362 ""))
2363
2364 ;; Replace Google Analytics bundle with an empty file and hope
2365 ;; no one notices.
2366 (mkdir-p "third_party/analytics")
2367 (call-with-output-file
2368 "third_party/analytics/google-analytics-bundle.js"
2369 (lambda (port)
2370 (const #t)))))
2371 ;; Do not enable support for loading the Widevine DRM plugin.
2372 (substitute* "src/buildtools/config/common.pri"
2373 (("enable_widevine=true")
2374 "enable_widevine=false")))))))
2375 (build-system gnu-build-system)
2376 (native-inputs
2377 (list bison
2378 flex
2379 gperf
2380 ninja
2381 perl
2382 pkg-config
2383 python2-six
2384 python-2
2385 ruby))
2386 (inputs
2387 (list alsa-lib
2388 atk
2389 cups-minimal
2390 curl
2391 dbus
2392 ffmpeg
2393 fontconfig
2394 harfbuzz
2395 icu4c
2396 jsoncpp
2397 lcms
2398 libcap
2399 libevent
2400 libgcrypt
2401 libjpeg-turbo
2402 libvpx
2403 libwebp
2404 libx11
2405 libxcb
2406 libxcomposite
2407 libxcursor
2408 libxi
2409 libxkbcommon
2410 ;; FIXME: libxml2 needs to built with icu support though it links to
2411 ;; libxml2 configure summary still states "Checking for compatible
2412 ;; system libxml2... no"
2413 libxml2
2414 openh264
2415 libxrandr
2416 libxrender
2417 libxslt
2418 libxtst
2419 mesa
2420 minizip
2421 nss
2422 opus
2423 pciutils
2424 protobuf
2425 pulseaudio
2426 qtbase-5
2427 qtdeclarative-5
2428 qtmultimedia-5
2429 qtwebchannel-5
2430 re2
2431 snappy
2432 eudev
2433 valgrind
2434 vulkan-headers
2435 xcb-util))
2436 (arguments
2437 (substitute-keyword-arguments (package-arguments qtsvg-5)
2438 ((#:modules modules '())
2439 `((guix build gnu-build-system)
2440 (guix build utils)
2441 (ice-9 textual-ports)))
2442 ((#:phases phases)
2443 `(modify-phases ,phases
2444 (add-before 'configure 'substitute-source
2445 (lambda* (#:key inputs outputs #:allow-other-keys)
2446 (let ((out (assoc-ref outputs "out")))
2447 (with-atomic-file-replacement
2448 "src/buildtools/config/linux.pri"
2449 (lambda (in out)
2450 (display (get-string-all in) out)
2451 (display "\ngn_args += use_system_openh264=true\n" out)))
2452 ;; Qtwebengine is not installed into the same prefix as
2453 ;; qtbase. Some qtbase QTLibraryInfo constants will not
2454 ;; work. Replace with the full path to the qtwebengine-5
2455 ;; translations and locales in the store.
2456 (substitute* "src/core/web_engine_library_info.cpp"
2457 (("QLibraryInfo::location\\(QLibraryInfo::TranslationsPath\\)")
2458 (string-append "QLatin1String(\"" out "/share/qt5/translations\")"))
2459 (("QLibraryInfo::location\\(QLibraryInfo::DataPath\\)")
2460 (string-append "QLatin1String(\"" out "/share/qt5\")")))
2461 ;; Substitute full dynamic library path for nss.
2462 (substitute* "src/3rdparty/chromium/crypto/nss_util.cc"
2463 (("libnssckbi.so")
2464 (search-input-file inputs "lib/nss/libnssckbi.so")))
2465 ;; Substitute full dynamic library path for udev.
2466 (substitute* "src/3rdparty/chromium/device/udev_linux/udev1_loader.cc"
2467 (("libudev.so.1")
2468 (search-input-file inputs "lib/libudev.so.1"))))))
2469 (add-before 'configure 'set-env
2470 (lambda _
2471 ;; Avoids potential race conditions.
2472 (setenv "PYTHONDONTWRITEBYTECODE" "1")
2473 (setenv "NINJAFLAGS"
2474 (string-append "-k1" ;less verbose build output
2475 ;; Respect the '--cores' option of 'guix build'.
2476 " -j" (number->string (parallel-job-count))))))
2477 (replace 'configure
2478 (lambda _
2479 ;; Valid QT_BUILD_PARTS variables are:
2480 ;; libs tools tests examples demos docs translations
2481 (invoke "qmake" "QT_BUILD_PARTS = libs tools" "--"
2482 "--webengine-printing-and-pdf=no"
2483 "--webengine-ffmpeg=system"
2484 ;; FIXME: Building qtwebengine-5 5.12.2 with
2485 ;; icu4c >= 68 fails.
2486 ;;"--webengine-icu=system"
2487 "--webengine-pepper-plugins=no"
2488 "-webengine-proprietary-codecs")))))
2489 ;; Tests are disabled due to "Could not find QtWebEngineProcess error"
2490 ;; It's possible this can be fixed by setting QTWEBENGINEPROCESS_PATH
2491 ;; before running tests.
2492 ((#:tests? _ #f) #f)))
2493 (native-search-paths
2494 (list (search-path-specification
2495 (file-type 'regular)
2496 (separator #f)
2497 (variable "QTWEBENGINEPROCESS_PATH")
2498 (files '("lib/qt5/libexec/QtWebEngineProcess")))))
2499 (home-page "https://wiki.qt.io/QtWebEngine")
2500 (synopsis "Qt WebEngine module")
2501 (description "The Qt5WebEngine module provides support for web applications
2502 using the Chromium browser project. The Chromium source code has Google services
2503 and binaries removed, and adds modular support for using system libraries.")
2504 (license license:lgpl2.1+)))
2505
2506 (define-public qtwebengine
2507 (package
2508 (name "qtwebengine")
2509 (version "6.3.1")
2510 (source
2511 (origin
2512 (method url-fetch)
2513 (uri (qt-urls name version))
2514 (sha256
2515 (base32
2516 "0ivfsqd5c0cxsnssj6z37901cf6a47w50zaqgjiysvcm3ar36ymd"))
2517 (modules '((ice-9 ftw)
2518 (ice-9 match)
2519 (srfi srfi-1)
2520 (srfi srfi-26)
2521 (guix build utils)))
2522 (snippet
2523 '(begin
2524 (let ((preserved-third-party-files
2525 '("base/third_party/double_conversion"
2526 "base/third_party/cityhash"
2527 "base/third_party/cityhash_v103"
2528 "base/third_party/dynamic_annotations"
2529 "base/third_party/icu"
2530 "base/third_party/libevent"
2531 "base/third_party/nspr"
2532 "base/third_party/superfasthash"
2533 "base/third_party/symbolize"
2534 "base/third_party/xdg_mime"
2535 "base/third_party/xdg_user_dirs"
2536 "net/third_party/mozilla_security_manager"
2537 "net/third_party/nss"
2538 "net/third_party/quiche"
2539 "net/third_party/uri_template"
2540 "third_party/abseil-cpp"
2541 "third_party/angle"
2542 "third_party/angle/src/common/third_party/base"
2543 "third_party/angle/src/common/third_party/smhasher"
2544 "third_party/angle/src/common/third_party/xxhash"
2545 "third_party/axe-core"
2546 "third_party/blink"
2547 "third_party/boringssl"
2548 "third_party/boringssl/src/third_party/fiat"
2549 "third_party/breakpad"
2550 "third_party/brotli"
2551 "third_party/ced"
2552 "third_party/cld_3"
2553 "third_party/closure_compiler"
2554 "third_party/crashpad"
2555 "third_party/crashpad/crashpad/third_party/lss"
2556 "third_party/crashpad/crashpad/third_party/zlib"
2557 "third_party/crc32c"
2558 "third_party/dav1d"
2559 "third_party/dawn"
2560 "third_party/devtools-frontend"
2561 "third_party/devtools-frontend/src/front_end/third_party/lighthouse"
2562 "third_party/devtools-frontend/src/front_end/third_party/wasmparser"
2563 "third_party/emoji-segmenter"
2564 "third_party/ffmpeg"
2565 "third_party/googletest"
2566 "third_party/harfbuzz-ng/utils"
2567 "third_party/hunspell"
2568 "third_party/iccjpeg"
2569 "third_party/icu"
2570 "third_party/inspector_protocol"
2571 "third_party/jinja2"
2572 "third_party/jsoncpp"
2573 "third_party/jstemplate"
2574 "third_party/khronos"
2575 "third_party/leveldatabase"
2576 "third_party/libaddressinput"
2577 "third_party/libgifcodec"
2578 "third_party/libjingle_xmpp"
2579 "third_party/libjpeg_turbo"
2580 "third_party/libpng"
2581 "third_party/libsrtp"
2582 "third_party/libsync"
2583 "third_party/libudev"
2584 "third_party/libvpx"
2585 "third_party/libwebm"
2586 "third_party/libwebp"
2587 "third_party/libxml"
2588 "third_party/libxslt"
2589 "third_party/libyuv"
2590 "third_party/lss"
2591 "third_party/mako"
2592 "third_party/markupsafe"
2593 "third_party/mesa_headers"
2594 "third_party/metrics_proto"
2595 "third_party/modp_b64"
2596 "third_party/nasm"
2597 "third_party/one_euro_filter"
2598 "third_party/openh264/src/codec/api/svc"
2599 "third_party/opus"
2600 "third_party/ots"
2601 "third_party/pdfium"
2602 "third_party/pdfium/third_party/agg23"
2603 "third_party/pdfium/third_party/base"
2604 "third_party/pdfium/third_party/freetype"
2605 "third_party/pdfium/third_party/lcms"
2606 "third_party/pdfium/third_party/libopenjpeg20"
2607 "third_party/pdfium/third_party/skia_shared"
2608 "third_party/perfetto"
2609 "third_party/pffft"
2610 "third_party/ply"
2611 "third_party/polymer"
2612 "third_party/protobuf"
2613 "third_party/protobuf/third_party/six"
2614 "third_party/pyjson5"
2615 "third_party/re2"
2616 "third_party/rnnoise"
2617 "third_party/skia"
2618 "third_party/skia/include/third_party/skcms/skcms.h"
2619 "third_party/skia/include/third_party/vulkan"
2620 "third_party/skia/third_party/skcms"
2621 "third_party/skia/third_party/vulkanmemoryallocator"
2622 "third_party/smhasher"
2623 "third_party/snappy"
2624 "third_party/sqlite"
2625 "third_party/usb_ids"
2626 "third_party/usrsctp"
2627 "third_party/web-animations-js"
2628 "third_party/webrtc"
2629 "third_party/webrtc/common_audio/third_party/ooura"
2630 "third_party/webrtc/common_audio/third_party/spl_sqrt_floor"
2631 "third_party/webrtc/modules/third_party/fft"
2632 "third_party/webrtc/modules/third_party/g711"
2633 "third_party/webrtc/modules/third_party/g722"
2634 "third_party/webrtc/rtc_base/third_party/base64"
2635 "third_party/webrtc/rtc_base/third_party/sigslot"
2636 "third_party/webrtc_overrides"
2637 "third_party/widevine/cdm/widevine_cdm_common.h"
2638 "third_party/widevine/cdm/widevine_cdm_version.h"
2639 "third_party/woff2"
2640 "third_party/zlib"
2641 "url/third_party/mozilla"
2642 "v8/src/third_party/utf8-decoder"
2643 "v8/src/third_party/valgrind"
2644 "v8/src/third_party/siphash"
2645 "v8/third_party/v8/builtins"
2646 "v8/third_party/inspector_protocol"))
2647 (protected (make-regexp "\\.(gn|gyp)i?$")))
2648 (define preserved-club
2649 (map (lambda (member)
2650 (string-append "./" member))
2651 preserved-third-party-files))
2652 (define (empty? dir)
2653 (equal? (scandir dir) '("." "..")))
2654 (define (third-party? file)
2655 (string-contains file "third_party/"))
2656 (define (useless? file)
2657 (any (cute string-suffix? <> file)
2658 '(".zip" ".so" ".dll" ".exe" ".jar")))
2659 (define (parents child)
2660 ;; Return all parent directories of CHILD up to and including
2661 ;; the closest "third_party".
2662 (let* ((dirs (match (string-split child #\/)
2663 ((dirs ... last) dirs)))
2664 (closest (list-index (lambda (dir)
2665 (string=? "third_party" dir))
2666 (reverse dirs)))
2667 (delim (- (length dirs) closest)))
2668 (fold (lambda (dir prev)
2669 (cons (string-append (car prev) "/" dir)
2670 prev))
2671 (list (string-join (list-head dirs delim) "/"))
2672 (list-tail dirs delim))))
2673 (define (remove-loudly file)
2674 (format #t "deleting ~a...~%" file)
2675 (force-output)
2676 (delete-file file))
2677 (define (delete-unwanted-files child stat flag base level)
2678 (match flag
2679 ((or 'regular 'symlink 'stale-symlink)
2680 (when (third-party? child)
2681 (unless (or (member child preserved-club)
2682 (any (cute member <> preserved-club)
2683 (parents child))
2684 (regexp-exec protected child))
2685 (remove-loudly child)))
2686 (when (and (useless? child) (file-exists? child))
2687 (remove-loudly child)))
2688 ('directory-processed
2689 (when (empty? child)
2690 (rmdir child)))
2691 (_ #t)))
2692
2693 (with-directory-excursion "src/3rdparty"
2694 (delete-file-recursively "ninja")
2695
2696 (with-directory-excursion "chromium"
2697 ;; Delete bundled software and binaries that were not
2698 ;; explicitly preserved above.
2699 (nftw "." delete-unwanted-files 'depth 'physical)
2700
2701 ;; Assert that each preserved item is present to catch
2702 ;; removals.
2703 (for-each (lambda (third-party)
2704 (unless (file-exists? third-party)
2705 (error (format #f "~s does not exist!~%"
2706 third-party))))
2707 preserved-club)
2708
2709 ;; Use relative header locations instead of hard coded ones.
2710 (substitute*
2711 "base/third_party/dynamic_annotations/dynamic_annotations.c"
2712 (("base/third_party/valgrind") "valgrind"))
2713 (substitute* "third_party/breakpad/breakpad/src/common/\
2714 linux/libcurl_wrapper.h"
2715 (("third_party/curl") "curl"))
2716 (substitute*
2717 '("components/viz/common/gpu/vulkan_context_provider.h"
2718 "gpu/config/gpu_util.cc")
2719 (("third_party/vulkan/include/")
2720 ""))
2721
2722 ;; Replace Google Analytics bundle with an empty file and
2723 ;; hope no one notices.
2724 (mkdir-p "third_party/analytics")
2725 (call-with-output-file
2726 "third_party/analytics/google-analytics-bundle.js"
2727 (lambda (port)
2728 (const #t)))))
2729 ;; Do not enable support for loading the Widevine DRM plugin.
2730 (substitute* "src/core/CMakeLists.txt"
2731 (("enable_widevine=true")
2732 "enable_widevine=false")))))))
2733 (build-system cmake-build-system)
2734 (arguments
2735 (list
2736 ;; XXX: The test suite is not built by default; leave it off to save
2737 ;; some build time and resources.
2738 #:tests? #f
2739 #:configure-flags
2740 ;; Use the CMake ninja generator, otherwise the build fails (see:
2741 ;; https://bugreports.qt.io/browse/QTBUG-96897).
2742 #~(list "-GNinja" ;
2743 ;; Manually add the NSS library prefix to the linker
2744 ;; search path, otherwise it fails to be linked (see:
2745 ;; https://bugreports.qt.io/browse/QTBUG-105053).
2746 (string-append "-DCMAKE_SHARED_LINKER_FLAGS=-L"
2747 (search-input-directory %build-inputs "lib/nss"))
2748
2749 ;; The PDF renderer plugin fails to build with errors such as
2750 ;; "src/3rdparty/chromium/components/pdf
2751 ;; /renderer/pdf_accessibility_tree.cc:1373:39:
2752 ;; error: use of undeclared identifier 'IDS_PDF_PAGE_INDEX'";
2753 ;; disable it.
2754 "-DQT_FEATURE_webengine_printing_and_pdf=OFF"
2755 "-DQT_FEATURE_webengine_pepper_plugins=OFF" ;widevine
2756 "-DQT_FEATURE_system_ffmpeg=ON"
2757 ;; Do not artificially limit codec support; video decoding is
2758 ;; done by ffmpeg.
2759 "-DQT_FEATURE_webengine_proprietary_codecs=ON"
2760 "-DQT_FEATURE_webengine_system_alsa=ON"
2761 "-DQT_FEATURE_webengine_system_icu=ON"
2762 "-DQT_FEATURE_webengine_system_libxml=ON"
2763 "-DQT_FEATURE_webengine_system_libpci=ON"
2764 "-DQT_FEATURE_webengine_system_libpng=ON"
2765 "-DQT_FEATURE_webengine_system_pulseaudio=ON"
2766 "-DQT_FEATURE_webengine_system_zlib=ON")
2767 #:phases
2768 #~(modify-phases %standard-phases
2769 (add-after 'unpack 'patch-paths
2770 (lambda* (#:key inputs #:allow-other-keys)
2771 ;; Qtwebengine is not installed into the same prefix as qtbase.
2772 ;; Some qtbase QTLibraryInfo constants will not work. Replace
2773 ;; with the full path to the qtwebengine translations and
2774 ;; locales in the store.
2775 (substitute* "src/core/web_engine_library_info.cpp"
2776 (("QLibraryInfo::path\\(QLibraryInfo::TranslationsPath)")
2777 (string-append "QLatin1String(\"" #$output
2778 "/share/qt6/translations\")"))
2779 (("QLibraryInfo::path\\(QLibraryInfo::DataPath)")
2780 (string-append "QLatin1String(\"" #$output
2781 "/share/qt6\")")))
2782 ;; Substitute full dynamic library path for nss.
2783 (substitute* "src/3rdparty/chromium/crypto/nss_util.cc"
2784 (("libnssckbi.so")
2785 (search-input-file inputs "lib/nss/libnssckbi.so")))
2786 ;; Substitute full dynamic library path for udev.
2787 (substitute* "src/3rdparty/chromium/device/udev_linux/udev1_loader.cc"
2788 (("libudev.so.1")
2789 (search-input-file inputs "lib/libudev.so.1")))
2790 ;; Patch the location of the X11 keywoard layouts, otherwise
2791 ;; webengine *crashes* at run time when the default directory,
2792 ;; '/usr/share/X11/xkb' is empty (see:
2793 ;; https://bugreports.qt.io/browse/QTBUG-105124).
2794 (substitute* "src/3rdparty/chromium/ui/events/ozone/layout/xkb\
2795 /xkb_keyboard_layout_engine.cc"
2796 (("/usr/share/X11/xkb")
2797 (search-input-directory inputs "share/X11/xkb")))))
2798 (add-before 'configure 'prepare-build-environment
2799 (lambda _
2800 ;; Avoids potential race conditions.
2801 (setenv "PYTHONDONTWRITEBYTECODE" "1")
2802 (setenv "NINJAFLAGS"
2803 (string-append
2804 "-k1" ;less verbose build output
2805 ;; Respect the '--cores' option of 'guix build'.
2806 " -j" (number->string (parallel-job-count))))
2807 ;; Use Clang/LDD to help tame the memory requirements and hasten
2808 ;; the build.
2809 (setenv "AR" "llvm-ar") (setenv "NM" "llvm-nm")
2810 (setenv "CC" "clang") (setenv "CXX" "clang++")))
2811 (replace 'build
2812 (lambda* (#:key parallel-build? #:allow-other-keys)
2813 (apply invoke "cmake" "--build" "."
2814 (if parallel-build?
2815 `("--parallel" ,(number->string (parallel-job-count)))
2816 '()))))
2817 (replace 'install
2818 (lambda _
2819 (invoke "cmake" "--install" "."))))))
2820 (native-inputs
2821 (modify-inputs (package-native-inputs qtwebengine-5)
2822 (delete "python2" "python2-six")
2823 (append clang-14
2824 lld-as-ld-wrapper
2825 node-lts
2826 python-wrapper
2827 python-html5lib)))
2828 (inputs
2829 (modify-inputs (package-inputs qtwebengine-5)
2830 (replace "qtbase" qtbase)
2831 (replace "qtdeclarative" qtdeclarative)
2832 (replace "qtmultimedia" qtmultimedia)
2833 (replace "qtwebchannel" qtwebchannel)
2834 (append libxkbfile xkeyboard-config)))
2835 (native-search-paths
2836 (list (search-path-specification
2837 (file-type 'regular)
2838 (separator #f)
2839 (variable "QTWEBENGINEPROCESS_PATH")
2840 (files '("lib/qt6/libexec/QtWebEngineProcess")))))
2841 (home-page "https://wiki.qt.io/QtWebEngine")
2842 (synopsis "Qt WebEngine module")
2843 (description "The Qt WebEngine module provides support for web
2844 applications using the Chromium browser project. The Chromium source code has
2845 Google services and binaries removed, and adds modular support for using
2846 system libraries.")
2847 (license license:lgpl2.1+)))
2848
2849 (define-public single-application-qt5
2850 ;; Change in function signature, nheko requires at least this commit
2851 (let ((commit "dc8042b5db58f36e06ba54f16f38b16c5eea9053"))
2852 (package
2853 (name "single-application-qt5")
2854 (version (string-append "3.2.0-" (string-take commit 7)))
2855 (source
2856 (origin
2857 (method git-fetch)
2858 (uri
2859 (git-reference
2860 (url "https://github.com/itay-grudev/SingleApplication")
2861 (commit commit)))
2862 (file-name (git-file-name name version))
2863 (sha256
2864 (base32
2865 "163aa2x2qb0h8w26si5ql833ilj427jjbdwlz1p2p8iaq6dh0vq1"))))
2866 (build-system cmake-build-system)
2867 (arguments
2868 `(#:tests? #f ; no check target
2869 ;; Projects can decide how to build this library. You might need to
2870 ;; override this flag (QApplication, QGuiApplication or
2871 ;; QCoreApplication).
2872 #:configure-flags '("-DQAPPLICATION_CLASS=QApplication")
2873 #:phases
2874 (modify-phases %standard-phases
2875 ;; No install target, install things manually
2876 (replace 'install
2877 (lambda* (#:key inputs outputs source #:allow-other-keys)
2878 (let* ((qt (assoc-ref inputs "qtbase"))
2879 (qt-version ,(version-major (package-version qtbase-5)))
2880 (out (assoc-ref outputs "out")))
2881 (install-file
2882 "libSingleApplication.a" (string-append out "/lib"))
2883 (for-each
2884 (lambda (file)
2885 (install-file
2886 (string-append source "/" file)
2887 (string-append out "/include")))
2888 '("SingleApplication"
2889 "singleapplication.h" "singleapplication_p.h"))
2890 #t))))))
2891 (inputs
2892 (list qtbase-5))
2893 (home-page "https://github.com/itay-grudev/SingleApplication")
2894 (synopsis "Replacement of QtSingleApplication for Qt5 and Qt6")
2895 (description
2896 "SingleApplication is a replacement of the QtSingleApplication for Qt5 and Qt6.
2897
2898 It keeps the Primary Instance of your Application and kills each subsequent
2899 instances. It can (if enabled) spawn secondary (non-related to the primary)
2900 instances and can send data to the primary instance from secondary
2901 instances.")
2902 (license license:expat))))
2903
2904 (define-public python-sip
2905 (package
2906 (name "python-sip")
2907 (version "5.5.0")
2908 (source
2909 (origin
2910 (method url-fetch)
2911 (uri (list (pypi-uri "sip" version)
2912 (string-append "https://www.riverbankcomputing.com/static/"
2913 "Downloads/sip/" version
2914 "/sip-" version ".tar.gz")))
2915 (sha256
2916 (base32
2917 "1idaivamp1jvbbai9yzv471c62xbqxhaawccvskaizihkd0lq0jx"))))
2918 (build-system python-build-system)
2919 (native-inputs
2920 (list python-wrapper))
2921 (propagated-inputs
2922 (list python-toml python-packaging))
2923 (home-page "https://www.riverbankcomputing.com/software/sip/intro")
2924 (synopsis "Python binding creator for C and C++ libraries")
2925 (description
2926 "SIP is a tool to create Python bindings for C and C++ libraries. It
2927 was originally developed to create PyQt, the Python bindings for the Qt
2928 toolkit, but can be used to create bindings for any C or C++ library.
2929
2930 SIP comprises a code generator and a Python module. The code generator
2931 processes a set of specification files and generates C or C++ code, which
2932 is then compiled to create the bindings extension module. The SIP Python
2933 module provides support functions to the automatically generated code.")
2934 ;; There is a choice between a python like license, gpl2 and gpl3.
2935 ;; For compatibility with pyqt, we need gpl3.
2936 (license license:gpl3)))
2937
2938 (define-public python-sip-4
2939 (package
2940 (inherit python-sip)
2941 (name "python-sip")
2942 (version "4.19.25")
2943 (source
2944 (origin
2945 (method url-fetch)
2946 (uri (list (pypi-uri "sip" version)
2947 (string-append "https://www.riverbankcomputing.com/static/"
2948 "Downloads/sip/" version
2949 "/sip-" version ".tar.gz")))
2950 (sha256
2951 (base32
2952 "04a23cgsnx150xq86w1z44b6vr2zyazysy9mqax0fy346zlr77dk"))))
2953 (build-system gnu-build-system)
2954 (native-inputs
2955 `(("python" ,python-wrapper)))
2956 (propagated-inputs `())
2957 (arguments
2958 `(#:tests? #f ; no check target
2959 #:imported-modules ((guix build python-build-system)
2960 ,@%gnu-build-system-modules)
2961 #:modules ((srfi srfi-1)
2962 ((guix build python-build-system) #:select (python-version))
2963 ,@%gnu-build-system-modules)
2964 #:phases
2965 (modify-phases %standard-phases
2966 (replace 'configure
2967 (lambda* (#:key inputs outputs #:allow-other-keys)
2968 (let* ((out (assoc-ref outputs "out"))
2969 (bin (string-append out "/bin"))
2970 (include (string-append out "/include"))
2971 (python (assoc-ref inputs "python"))
2972 (lib (string-append out "/lib/python"
2973 (python-version python)
2974 "/site-packages")))
2975 (invoke "python" "configure.py"
2976 "--bindir" bin
2977 "--destdir" lib
2978 "--incdir" include)))))))
2979 (license license:gpl3)))
2980
2981 (define-public python-pyqt
2982 (package
2983 (name "python-pyqt")
2984 (version "5.15.2")
2985 (source
2986 (origin
2987 (method url-fetch)
2988 ;; PyPI is the canonical distribution point of PyQt. Older
2989 ;; releases are available from the web site.
2990 (uri (list (pypi-uri "PyQt5" version)
2991 (string-append "https://www.riverbankcomputing.com/static/"
2992 "Downloads/PyQt5/" version "/PyQt5-"
2993 version ".tar.gz")))
2994 (file-name (string-append "PyQt5-" version ".tar.gz"))
2995 (sha256
2996 (base32
2997 "1z74295i69cha52llsqffzhb5zz7qnbjc64h8qg21l91jgf0harp"))
2998 (patches (search-patches "pyqt-configure.patch"))))
2999 (build-system gnu-build-system)
3000 (native-inputs
3001 (list qtbase-5)) ; for qmake
3002 (propagated-inputs
3003 (list python-sip python-pyqt5-sip))
3004 (inputs
3005 `(("python" ,python-wrapper)
3006 ("qtbase" ,qtbase-5)
3007 ("qtconnectivity" ,qtconnectivity)
3008 ("qtdeclarative-5" ,qtdeclarative-5)
3009 ("qtlocation" ,qtlocation)
3010 ("qtmultimedia-5" ,qtmultimedia-5)
3011 ("qtsensors" ,qtsensors)
3012 ("qtserialport" ,qtserialport)
3013 ("qtsvg-5" ,qtsvg-5)
3014 ("qttools-5" ,qttools-5)
3015 ("qtwebchannel-5" ,qtwebchannel-5)
3016 ("qtwebkit" ,qtwebkit)
3017 ("qtwebsockets-5" ,qtwebsockets-5)
3018 ("qtx11extras" ,qtx11extras)
3019 ("qtxmlpatterns" ,qtxmlpatterns)))
3020 (arguments
3021 `(#:modules ((srfi srfi-1)
3022 ((guix build python-build-system) #:select (python-version))
3023 ,@%gnu-build-system-modules)
3024 #:imported-modules ((guix build python-build-system)
3025 ,@%gnu-build-system-modules)
3026 #:phases
3027 (modify-phases %standard-phases
3028 ;; When building python-pyqtwebengine, <qprinter.h> can not be
3029 ;; included. Here we substitute the full path to the header in the
3030 ;; store.
3031 (add-before 'configure 'substitute-source
3032 (lambda* (#:key inputs #:allow-other-keys)
3033 (let* ((qtbase (assoc-ref inputs "qtbase"))
3034 (qtprinter.h (string-append "\"" qtbase "/include/qt5/QtPrintSupport/qprinter.h\"")))
3035 (substitute* "sip/QtPrintSupport/qprinter.sip"
3036 (("<qprinter.h>")
3037 qtprinter.h))
3038 #t)))
3039 (replace 'configure
3040 (lambda* (#:key inputs outputs #:allow-other-keys)
3041 (let* ((out (assoc-ref outputs "out"))
3042 (bin (string-append out "/bin"))
3043 (sip (string-append out "/share/sip"))
3044 (plugins (string-append out "/lib/qt5/plugins"))
3045 (designer (string-append plugins "/designer"))
3046 (qml (string-append plugins "/PyQt5"))
3047 (python (assoc-ref inputs "python"))
3048 (lib (string-append out "/lib/python"
3049 (python-version python)
3050 "/site-packages"))
3051 (stubs (string-append lib "/PyQt5")))
3052 (invoke "python" "configure.py"
3053 "--confirm-license"
3054 "--bindir" bin
3055 "--destdir" lib
3056 "--designer-plugindir" designer
3057 "--qml-plugindir" qml
3058 ; Where to install the PEP 484 Type Hints stub
3059 ; files. Without this the stubs are tried to be
3060 ; installed into the python package's
3061 ; site-package directory, which is read-only.
3062 "--stubsdir" stubs
3063 "--sipdir" sip)))))))
3064 (home-page "https://www.riverbankcomputing.com/software/pyqt/intro")
3065 (synopsis "Python bindings for Qt")
3066 (description
3067 "PyQt is a set of Python v2 and v3 bindings for the Qt application
3068 framework. The bindings are implemented as a set of Python modules and
3069 contain over 620 classes.")
3070 (license license:gpl3)))
3071
3072 (define-public python-pyqt5-sip
3073 (package
3074 (name "python-pyqt5-sip")
3075 (version "12.8.1")
3076 (source
3077 (origin
3078 (method url-fetch)
3079 (uri (pypi-uri "PyQt5_sip" version))
3080 (sha256
3081 (base32
3082 "1gg032ys4pccwkdzmdryadc9a4lq85nr05pag9swrsdykbdl9s9h"))))
3083 (build-system python-build-system)
3084 (arguments
3085 `(#:tests? #f)) ;; No test code.
3086 (home-page "https://www.riverbankcomputing.com/software/sip/")
3087 (synopsis "Sip module support for PyQt5")
3088 (description "Sip module support for PyQt5")
3089 (license license:lgpl2.1+)))
3090
3091 (define-public python-pyqtwebengine
3092 (package
3093 (name "python-pyqtwebengine")
3094 (version "5.15.2")
3095 (source
3096 (origin
3097 (method url-fetch)
3098 ;; The newest releases are only available on PyPI. Older ones
3099 ;; are mirrored at the upstream home page.
3100 (uri (list (pypi-uri "PyQtWebEngine" version)
3101 (string-append "https://www.riverbankcomputing.com/static"
3102 "/Downloads/PyQtWebEngine/" version
3103 "/PyQtWebEngine-" version ".tar.gz")))
3104 (sha256
3105 (base32
3106 "0d56ak71r14w4f9r96vaj34qcn2rbln3s6ildvvyc707fjkzwwjd"))))
3107 (build-system gnu-build-system)
3108 (native-inputs
3109 (list python python-sip
3110 ;; qtbase is required for qmake
3111 qtbase-5))
3112 (inputs
3113 `(("python" ,python-wrapper)
3114 ("python-sip" ,python-sip)
3115 ("python-pyqt" ,python-pyqt-without-qtwebkit)
3116 ("qtbase" ,qtbase-5)
3117 ("qtsvg-5" ,qtsvg-5)
3118 ("qtdeclarative-5" ,qtdeclarative-5)
3119 ("qtwebchannel-5" ,qtwebchannel-5)
3120 ("qtwebengine-5" ,qtwebengine-5)))
3121 (arguments
3122 `(#:modules ((srfi srfi-1)
3123 ((guix build python-build-system) #:select (python-version))
3124 ,@%gnu-build-system-modules)
3125 #:imported-modules ((guix build python-build-system)
3126 ,@%gnu-build-system-modules)
3127 #:phases
3128 (modify-phases %standard-phases
3129 (replace 'configure
3130 (lambda* (#:key inputs outputs #:allow-other-keys)
3131 (let* ((out (assoc-ref outputs "out"))
3132 (sipdir (string-append out "/share/sip"))
3133 (pyqt-sipdir (string-append
3134 (assoc-ref inputs "python-pyqt") "/share/sip"))
3135 (python (assoc-ref inputs "python"))
3136 (lib (string-append out "/lib/python"
3137 (python-version python)
3138 "/site-packages/PyQt5"))
3139 (stubs (string-append lib "/PyQt5")))
3140
3141 (mkdir-p sipdir)
3142 (invoke "python" "configure.py"
3143 "-w"
3144 "--no-dist-info"
3145 "--destdir" lib
3146 "--no-qsci-api"
3147 "--stubsdir" stubs
3148 "--sipdir" sipdir
3149 "--pyqt-sipdir" pyqt-sipdir))))
3150 ;; Because this has a different prefix than python-pyqt then we need
3151 ;; to make this a namespace of its own.
3152 (add-after 'install 'make-namespace
3153 (lambda* (#:key inputs outputs #:allow-other-keys)
3154 (let* ((__init__.py (string-append
3155 (assoc-ref outputs "out")
3156 "/lib/python"
3157 (python-version (assoc-ref inputs "python"))
3158 "/site-packages/PyQt5/__init__.py")))
3159 (with-output-to-file __init__.py
3160 (lambda _ (display "
3161 from pkgutil import extend_path
3162 __path__ = extend_path(__path__, __name__)
3163 ")))
3164 #t))))))
3165 (home-page "https://www.riverbankcomputing.com/software/pyqtwebengine/intro")
3166 (synopsis "Python bindings for QtWebEngine")
3167 (description
3168 "PyQtWebEngine is a set of Python bindings for The Qt Company's Qt
3169 WebEngine libraries. The bindings sit on top of PyQt5 and are implemented as a
3170 set of three modules. Prior to v5.12 these bindings were part of PyQt
3171 itself.")
3172 (license license:gpl3)))
3173
3174 ;; XXX: This is useful for removing qtwebkit from other packages' dependency
3175 ;; graphs, as well as for preventing python-pyqtwebengine from transitively
3176 ;; depending on qtwebkit.
3177 ;; Ultimately, it would be nicer to have a more modular set of python-pyqt-*
3178 ;; packages that could be used together.
3179 (define-public python-pyqt-without-qtwebkit
3180 (package/inherit python-pyqt
3181 (name "python-pyqt-without-qtwebkit")
3182 (inputs
3183 (alist-delete "qtwebkit" (package-inputs python-pyqt)))))
3184
3185 (define-public python-pyqt-builder
3186 (package
3187 (name "python-pyqt-builder")
3188 (version "1.9.0")
3189 (source
3190 (origin
3191 (method url-fetch)
3192 (uri (pypi-uri "PyQt-builder" version))
3193 (sha256
3194 (base32
3195 "0nh0054c54ji3sm6d268fccf0y5f613spswwgwqd3rnn816hnljl"))))
3196 (build-system python-build-system)
3197 (inputs
3198 (list python-sip))
3199 (home-page "https://www.riverbankcomputing.com/static/Docs/PyQt-builder/")
3200 (synopsis "PEP 517 compliant PyQt build system")
3201 (description "PyQt-builder is a tool for generating Python bindings for C++
3202 libraries that use the Qt application framework. The bindings are built on
3203 top of the PyQt bindings for Qt. PyQt-builder is used to build PyQt itself.")
3204 ;; Either version 2 or 3, but no other version. See the file
3205 ;; 'pyqtbuild/builder.py' in the source distribution for more information.
3206 (license (list license:gpl2 license:gpl3))))
3207
3208 (define-public python-qtpy
3209 (package
3210 (name "python-qtpy")
3211 (version "2.2.0")
3212 (source
3213 (origin
3214 (method url-fetch)
3215 (uri (pypi-uri "QtPy" version))
3216 (sha256
3217 (base32
3218 "051rj10lbv2ny48lz34zhclcbdxxdbk4di2mdk91m9143w91npyq"))))
3219 (build-system python-build-system)
3220 (propagated-inputs (list python-packaging))
3221 (arguments
3222 `(;; Not all supported bindings are packaged. Especially PyQt4.
3223 #:tests? #f))
3224 (home-page "https://github.com/spyder-ide/qtpy")
3225 (synopsis
3226 "Qt bindings (PyQt5, PyQt4 and PySide) and additional custom QWidgets")
3227 (description
3228 "Provides an abstraction layer on top of the various Qt bindings
3229 (PyQt5, PyQt4 and PySide) and additional custom QWidgets.")
3230 (license license:expat)))
3231
3232 (define-public qscintilla
3233 (package
3234 (name "qscintilla")
3235 (version "2.11.6")
3236 (source (origin
3237 (method url-fetch)
3238 (uri (string-append "https://www.riverbankcomputing.com/static"
3239 "/Downloads/QScintilla/" version
3240 "/QScintilla-" version ".tar.gz"))
3241 (sha256
3242 (base32
3243 "19r0vpqb4m9bqwxmjp9w6x0hgahkrg7zryk78hwgplj7vdbn0d77"))))
3244 (build-system gnu-build-system)
3245 (arguments
3246 `(#:phases
3247 (modify-phases %standard-phases
3248 (replace 'configure
3249 (lambda* (#:key outputs #:allow-other-keys)
3250 (let ((out (assoc-ref outputs "out")))
3251 (chdir "Qt4Qt5")
3252 (substitute* "qscintilla.pro"
3253 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
3254 (string-append out "/lib"))
3255 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
3256 (string-append out "/include"))
3257 (("\\$\\$\\[QT_INSTALL_TRANSLATIONS\\]")
3258 (string-append out "/translations"))
3259 (("\\$\\$\\[QT_INSTALL_DATA\\]")
3260 (string-append out "/lib/qt$${QT_MAJOR_VERSION}"))
3261 (("\\$\\$\\[QT_HOST_DATA\\]")
3262 (string-append out "/lib/qt$${QT_MAJOR_VERSION}")))
3263 (invoke "qmake")))))))
3264 (native-inputs (list qtbase-5))
3265 (home-page "https://www.riverbankcomputing.co.uk/software/qscintilla/intro")
3266 (synopsis "Qt port of the Scintilla C++ editor control")
3267 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
3268 editor control. QScintilla includes features especially useful when editing
3269 and debugging source code. These include support for syntax styling, error
3270 indicators, code completion and call tips.")
3271 (license license:gpl3+)))
3272
3273 (define-public python-qscintilla
3274 (package/inherit qscintilla
3275 (name "python-qscintilla")
3276 (arguments
3277 `(#:configure-flags
3278 (list "--pyqt=PyQt5"
3279 (string-append "--pyqt-sipdir="
3280 (assoc-ref %build-inputs "python-pyqt")
3281 "/share/sip")
3282 (string-append "--qsci-incdir="
3283 (assoc-ref %build-inputs "qscintilla")
3284 "/include")
3285 (string-append "--qsci-libdir="
3286 (assoc-ref %build-inputs "qscintilla")
3287 "/lib"))
3288 #:phases
3289 (modify-phases %standard-phases
3290 (replace 'configure
3291 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
3292 (let ((out (assoc-ref outputs "out"))
3293 (python (assoc-ref inputs "python")))
3294 (chdir "Python")
3295 (apply invoke "python3" "configure.py"
3296 configure-flags)
3297 ;; Install to the right directory
3298 (substitute* '("Makefile"
3299 "Qsci/Makefile")
3300 (("\\$\\(INSTALL_ROOT\\)/gnu/store/[^/]+") out)
3301 (((string-append python "/lib"))
3302 (string-append out "/lib")))
3303 ;; And fix the installed.txt file
3304 (substitute* "installed.txt"
3305 (("/gnu/store/[^/]+") out)))
3306 #t)))))
3307 (inputs
3308 `(("qscintilla" ,qscintilla)
3309 ("python" ,python)
3310 ("python-pyqt" ,python-pyqt)))
3311 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
3312 editor control. QScintilla includes features especially useful when editing
3313 and debugging source code. These include support for syntax styling, error
3314 indicators, code completion and call tips.
3315
3316 This package provides the Python bindings.")))
3317
3318 ;; PyQt only looks for modules in its own directory. It ignores environment
3319 ;; variables such as PYTHONPATH, so we need to build a union package to make
3320 ;; it work.
3321 (define-public python-pyqt+qscintilla
3322 (package/inherit python-pyqt
3323 (name "python-pyqt+qscintilla")
3324 (source #f)
3325 (build-system trivial-build-system)
3326 (arguments
3327 '(#:modules ((guix build union))
3328 #:builder (begin
3329 (use-modules (ice-9 match)
3330 (guix build union))
3331 (match %build-inputs
3332 (((names . directories) ...)
3333 (union-build (assoc-ref %outputs "out")
3334 directories)
3335 #t)))))
3336 (inputs
3337 `(("python-pyqt" ,python-pyqt)
3338 ("python-qscintilla" ,python-qscintilla)))
3339 (synopsis "Union of PyQt and the Qscintilla extension")
3340 (description
3341 "This package contains the union of PyQt and the Qscintilla extension.")))
3342
3343 (define-public qtkeychain
3344 (package
3345 (name "qtkeychain")
3346 (version "0.13.2")
3347 (source
3348 (origin
3349 (method git-fetch)
3350 (uri (git-reference
3351 (url "https://github.com/frankosterfeld/qtkeychain/")
3352 (commit (string-append "v" version))))
3353 (file-name (git-file-name name version))
3354 (sha256
3355 (base32
3356 "1zk6r2vc1q48qs7mw2h47bpgrfbb9r7lf9cwq4sb1a4nls87zznk"))))
3357 (build-system cmake-build-system)
3358 (native-inputs
3359 (list pkg-config qttools-5))
3360 (inputs
3361 (list libsecret qtbase-5))
3362 (arguments
3363 `(#:tests? #f ; No tests included
3364 #:phases
3365 (modify-phases %standard-phases
3366 (add-before 'configure 'set-qt-trans-dir
3367 (lambda _
3368 (substitute* "CMakeLists.txt"
3369 (("\\$\\{qt_translations_dir\\}")
3370 "${CMAKE_INSTALL_PREFIX}/share/qt5/translations")))))))
3371 (home-page "https://github.com/frankosterfeld/qtkeychain")
3372 (synopsis "Qt API to store passwords")
3373 (description
3374 "QtKeychain is a Qt library to store passwords and other secret data
3375 securely. It will not store any data unencrypted unless explicitly requested.")
3376 (license license:bsd-3)))
3377
3378 (define-public qtsolutions
3379 (let ((commit "9568abd142d581b67b86a5f63d823a34b0612702")
3380 (revision "53"))
3381 (package
3382 (name "qtsolutions")
3383 (version (git-version "0" revision commit))
3384 (source
3385 (origin
3386 (method git-fetch)
3387 (uri (git-reference
3388 (url "https://github.com/qtproject/qt-solutions")
3389 (commit commit)))
3390 (file-name (git-file-name name version))
3391 (sha256
3392 (base32 "17fnmassflm3vxi0krpr6fff368jy38cby31a48rban4nqqmgx7n"))
3393 (modules '((guix build utils)
3394 (ice-9 ftw)
3395 (srfi srfi-1)))
3396 (snippet
3397 ;; Unvendor QtLockFile from QtSingleApplication.
3398 '(begin
3399 (with-directory-excursion "qtsingleapplication/src"
3400 (for-each delete-file
3401 (find-files "." "qtlockedfile.*\\.(h|cpp)"))
3402 (substitute* "qtsingleapplication.pri"
3403 ;; Add include path of LockedFile.
3404 (("INCLUDEPATH \\+=")
3405 "INCLUDEPATH += ../../qtlockedfile/src")
3406 ;; Link library of LockedFile.
3407 (("LIBS \\+=")
3408 "LIBS += -lQtSolutions_LockedFile"))
3409 (substitute* '("qtlocalpeer.h" "qtlocalpeer.cpp")
3410 (("#include \"qtlockedfile.*\\.cpp\"") "")
3411 ;; Unwrap namespace added in the vendoring process.
3412 (("QtLP_Private::QtLockedFile")
3413 "QtLockedFile")))
3414 #t))))
3415 (build-system gnu-build-system)
3416 (arguments
3417 `(#:tests? #f ; No target
3418 #:imported-modules
3419 ((guix build copy-build-system)
3420 ,@%gnu-build-system-modules)
3421 #:modules
3422 (((guix build copy-build-system) #:prefix copy:)
3423 (guix build gnu-build-system)
3424 (guix build utils))
3425 #:phases
3426 (modify-phases %standard-phases
3427 (add-after 'unpack 'patch-source
3428 (lambda* (#:key outputs #:allow-other-keys)
3429 (substitute* (find-files "." "common.pri")
3430 ;; Remove unnecessary prefixes/suffixes in library names.
3431 (("qt5") "qt")
3432 (("-head") ""))
3433 ;; Disable building of examples.
3434 (substitute* (find-files "." "\\.pro$")
3435 (("SUBDIRS\\+=examples") ""))
3436 ;; Fix deprecated functions.
3437 (substitute* "qtsoap/src/qtsoap.cpp"
3438 (("toAscii") "toUtf8"))
3439 #t))
3440 (replace 'configure
3441 (lambda _
3442 (for-each (lambda (solution)
3443 (with-directory-excursion solution
3444 (invoke "./configure" "-library")
3445 (invoke "qmake")))
3446 '("qtlockedfile" "qtpropertybrowser" "qtservice"
3447 "qtsingleapplication" "qtsoap"))
3448 #t))
3449 (replace 'build
3450 (lambda _
3451 (for-each (lambda (solution)
3452 (with-directory-excursion solution
3453 (invoke "make")))
3454 '("qtlockedfile" "qtpropertybrowser" "qtservice"
3455 "qtsingleapplication" "qtsoap"))
3456 #t))
3457 (replace 'install
3458 (lambda args
3459 (for-each (lambda (solution)
3460 (with-directory-excursion solution
3461 (apply
3462 (assoc-ref copy:%standard-phases 'install)
3463 #:install-plan
3464 '(("src" "include" #:include-regexp ("\\.h$"))
3465 ("lib" "lib"))
3466 args)))
3467 '("qtlockedfile" "qtpropertybrowser" "qtservice"
3468 "qtsingleapplication" "qtsoap")))))))
3469 (inputs
3470 (list qtbase-5))
3471 (synopsis "Collection of Qt extensions")
3472 (description "QtSolutions is a set of components extending Qt.
3473 @itemize
3474 @item QtLockedFile: A class that extends QFile with advisory locking functions.
3475 @item QtPropertyBrowser: A framework that enables the user to edit a set of
3476 properties.
3477 @item QtService: A helper for writing services such as Unix daemons.
3478 @item QtSingleApplication: A component that provides support for applications
3479 that can be only started once per user.
3480 @item QtSoap: A component that provides basic web service support with version
3481 1.1 of the SOAP protocol.
3482 @end itemize\n")
3483 (home-page "https://doc.qt.io/archives/qq/qq09-qt-solutions.html")
3484 (license (list license:bsd-3
3485 ;; QScriptParser and QScriptGrammar specifically allow
3486 ;; redistribution under GPL3 or LGPL2.1
3487 license:gpl3 license:lgpl2.1)))))
3488
3489 (define-public qwt
3490 (package
3491 (name "qwt")
3492 (version "6.1.5")
3493 (source
3494 (origin
3495 (method url-fetch)
3496 (uri
3497 (string-append "mirror://sourceforge/qwt/qwt/"
3498 version "/qwt-" version ".tar.bz2"))
3499 (sha256
3500 (base32 "0hf0mpca248xlqn7xnzkfj8drf19gdyg5syzklvq8pibxiixwxj0"))))
3501 (build-system gnu-build-system)
3502 (inputs
3503 (list qtbase-5 qtsvg-5 qttools-5))
3504 (arguments
3505 `(#:phases
3506 (modify-phases %standard-phases
3507 (replace 'configure
3508 (lambda* (#:key outputs #:allow-other-keys)
3509 (let* ((out (assoc-ref outputs "out"))
3510 (docdir (string-append out "/share/doc/qwt"))
3511 (incdir (string-append out "/include/qwt"))
3512 (pluginsdir (string-append out "/lib/qt5/plugins/designer"))
3513 (featuresdir (string-append out "/lib/qt5/mkspecs/features")))
3514 (substitute* '("qwtconfig.pri")
3515 (("^(\\s*QWT_INSTALL_PREFIX)\\s*=.*" _ x)
3516 (format #f "~a = ~a\n" x out))
3517 (("^(QWT_INSTALL_DOCS)\\s*=.*" _ x)
3518 (format #f "~a = ~a\n" x docdir))
3519 (("^(QWT_INSTALL_HEADERS)\\s*=.*" _ x)
3520 (format #f "~a = ~a\n" x incdir))
3521 (("^(QWT_INSTALL_PLUGINS)\\s*=.*" _ x)
3522 (format #f "~a = ~a\n" x pluginsdir))
3523 (("^(QWT_INSTALL_FEATURES)\\s*=.*" _ x)
3524 (format #f "~a = ~a\n" x featuresdir)))
3525 (substitute* '("doc/doc.pro")
3526 ;; We'll install them in the 'install-man-pages' phase.
3527 (("^unix:doc\\.files.*") ""))
3528 (invoke "qmake"))))
3529 (add-after 'install 'install-man-pages
3530 (lambda* (#:key outputs #:allow-other-keys)
3531 (let* ((out (assoc-ref outputs "out"))
3532 (man (string-append out "/share/man")))
3533 ;; Remove some incomplete manual pages.
3534 (for-each delete-file (find-files "doc/man/man3" "^_tmp.*"))
3535 (mkdir-p man)
3536 (copy-recursively "doc/man" man)
3537 #t))))))
3538 (home-page "http://qwt.sourceforge.net")
3539 (synopsis "Qt widgets for plots, scales, dials and other technical software
3540 GUI components")
3541 (description
3542 "The Qwt library contains widgets and components which are primarily useful
3543 for technical and scientific purposes. It includes a 2-D plotting widget,
3544 different kinds of sliders, and much more.")
3545 (license
3546 (list
3547 ;; The Qwt license is LGPL2.1 with some exceptions.
3548 (license:non-copyleft "http://qwt.sourceforge.net/qwtlicense.html")
3549 ;; textengines/mathml/qwt_mml_document.{cpp,h} is dual LGPL2.1/GPL3 (either).
3550 license:lgpl2.1 license:gpl3))))
3551
3552 (define-public qtwebkit
3553 (package
3554 (name "qtwebkit")
3555 (version "5.212.0-alpha4")
3556 (source
3557 (origin
3558 (method url-fetch)
3559 (uri (string-append "https://github.com/annulen/webkit/releases/download/"
3560 "qtwebkit-" version "/qtwebkit-" version ".tar.xz"))
3561 (sha256
3562 (base32
3563 "1rm9sjkabxna67dl7myx9d9vpdyfxfdhrk9w7b94srkkjbd2d8cw"))
3564 (patches (search-patches "qtwebkit-pbutils-include.patch"
3565 "qtwebkit-fix-building-with-bison-3.7.patch"
3566 "qtwebkit-fix-building-with-glib-2.68.patch"
3567 "qtwebkit-fix-building-with-icu-68.patch"
3568 "qtwebkit-fix-building-with-python-3.9.patch"))))
3569 (build-system cmake-build-system)
3570 (native-inputs
3571 (list perl
3572 python
3573 ruby
3574 bison
3575 flex
3576 gperf
3577 pkg-config))
3578 (inputs
3579 `(("icu" ,icu4c)
3580 ("glib" ,glib)
3581 ("gst-plugins-base" ,gst-plugins-base)
3582 ("libjpeg" ,libjpeg-turbo)
3583 ("libpng" ,libpng)
3584 ("libwebp" ,libwebp)
3585 ("sqlite" ,sqlite)
3586 ("fontconfig" ,fontconfig)
3587 ("libxrender" ,libxrender)
3588 ("qtbase" ,qtbase-5)
3589 ("qtdeclarative-5" ,qtdeclarative-5)
3590 ("qtlocation" ,qtlocation)
3591 ("qtmultimedia-5" ,qtmultimedia-5)
3592 ("qtsensors" ,qtsensors)
3593 ("qtwebchannel-5" ,qtwebchannel-5)
3594 ("libxml2" ,libxml2)
3595 ("libxslt" ,libxslt)
3596 ("libx11" ,libx11)
3597 ("libxcomposite" ,libxcomposite)))
3598 (arguments
3599 `(#:tests? #f ; no apparent tests; it might be necessary to set
3600 ; ENABLE_API_TESTS, see CMakeLists.txt
3601
3602 ;; Parallel builds fail due to a race condition:
3603 ;; <https://bugs.gnu.org/34062>.
3604 #:parallel-build? #f
3605
3606 #:configure-flags (list ;"-DENABLE_API_TESTS=TRUE"
3607 "-DPORT=Qt"
3608 "-DUSE_LIBHYPHEN=OFF"
3609 "-DUSE_SYSTEM_MALLOC=ON"
3610 ;; XXX: relative dir installs to build dir?
3611 (string-append "-DECM_MKSPECS_INSTALL_DIR="
3612 %output "/lib/qt5/mkspecs/modules")
3613 ;; Sacrifice a little speed in order to link
3614 ;; libraries and test executables in a
3615 ;; reasonable amount of memory.
3616 "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,--no-keep-memory"
3617 "-DCMAKE_EXE_LINKER_FLAGS=-Wl,--no-keep-memory")))
3618 (home-page "https://www.webkit.org")
3619 (synopsis "Web browser engine and classes to render and interact with web
3620 content")
3621 (description "QtWebKit provides a Web browser engine that makes it easy to
3622 embed content from the World Wide Web into your Qt application. At the same
3623 time Web content can be enhanced with native controls.")
3624 ;; Building QtWebKit takes around 13 hours on an AArch64 machine. Give some
3625 ;; room for slower or busy hardware.
3626 (properties '((timeout . 64800))) ;18 hours
3627
3628 ;; XXX: This consumes too much RAM to successfully build on AArch64 (e.g.,
3629 ;; SoftIron OverDrive with 8 GiB of RAM), so instead of wasting resources,
3630 ;; disable it on non-Intel platforms.
3631 (supported-systems '("x86_64-linux" "i686-linux"))
3632
3633 (license license:lgpl2.1+)))
3634
3635 (define-public dotherside
3636 (package
3637 (name "dotherside")
3638 (version "0.9.0")
3639 (source
3640 (origin
3641 (method git-fetch)
3642 (uri (git-reference
3643 (url "https://github.com/filcuc/DOtherSide")
3644 (commit (string-append "v" version))))
3645 (file-name (git-file-name name version))
3646 (sha256
3647 (base32
3648 "13n2qb8q9jz4ihwlbs7y15lw90w9113gb1bgnb1dggpxkj64r953"))))
3649 (build-system cmake-build-system)
3650 (native-inputs
3651 (list qttools-5))
3652 (inputs
3653 ;; TODO: Support Qt 6 (requires qtdeclarative of Qt6).
3654 (list qtbase-5 qtdeclarative-5))
3655 (home-page "https://filcuc.github.io/DOtherSide/index.html")
3656 (synopsis "C language library for creating bindings for the Qt QML language")
3657 (description
3658 "DOtherSide is a C language library for creating bindings for the
3659 QT QML language. The following features are implementable from
3660 a binding language:
3661 @itemize
3662 @item Creating custom QObject
3663 @item Creating custom QAbstractListModels
3664 @item Creating custom properties, signals and slots
3665 @item Creating from QML QObject defined in the binded language
3666 @item Creating from Singleton QML QObject defined in the binded language
3667 @end itemize\n")
3668 (license license:lgpl3))) ;version 3 only (+ exception)
3669
3670 ;; There have been no public releases yet.
3671 (define-public qtcolorwidgets
3672 (let ((commit "a95f72e935fe9e046061a1d1c3930cbfbcb533e0")
3673 (revision "1"))
3674 (package
3675 (name "qtcolorwidgets")
3676 (version (git-version "0" revision commit))
3677 (source (origin
3678 (method git-fetch)
3679 (uri (git-reference
3680 (url "https://gitlab.com/mattia.basaglia/Qt-Color-Widgets")
3681 (commit commit)))
3682 (file-name (git-file-name name version))
3683 (sha256
3684 (base32
3685 "0dkiwlqh2gwhlp78c1fmchj3shl4p9inspcl96ya5aa8mn6kydy8"))))
3686 (build-system cmake-build-system)
3687 (arguments `(#:tests? #f)) ; There are no tests
3688 (native-inputs
3689 (list qttools-5))
3690 (inputs
3691 (list qtbase-5))
3692 (home-page "https://gitlab.com/mattia.basaglia/Qt-Color-Widgets")
3693 (synopsis "Color management widgets")
3694 (description "QtColorWidgets provides a Qt color dialog that is more
3695 user-friendly than the default @code{QColorDialog} and several other
3696 color-related widgets.")
3697 ;; Includes a license exception for combining with GPL2 code.
3698 (license license:lgpl3+))))
3699
3700 (define-public qcustomplot
3701 (package
3702 (name "qcustomplot")
3703 (version "2.1.0")
3704 (source
3705 (origin
3706 (method url-fetch)
3707 (uri (string-append "https://www.qcustomplot.com/release/"
3708 version "fixed" "/QCustomPlot.tar.gz"))
3709 (sha256
3710 (base32 "1324kqyj1v1f8k8d7b15gc3apwz9qxx52p86hvchg33hjdlqhskx"))))
3711 (native-inputs
3712 `(("qcustomplot-sharedlib"
3713 ,(origin
3714 (method url-fetch)
3715 (uri (string-append "https://www.qcustomplot.com/release/"
3716 version "fixed" "/QCustomPlot-sharedlib.tar.gz"))
3717 (sha256
3718 (base32 "0vp8lpxvd1nlp4liqrlvslpqrgfn0wpiwizzdsjbj22zzb8vxikc"))))))
3719 (inputs
3720 (list qtbase-5))
3721 (build-system gnu-build-system)
3722 (arguments
3723 `(#:phases
3724 (modify-phases %standard-phases
3725 (add-after 'unpack 'unpack-extra-files
3726 (lambda* (#:key inputs #:allow-other-keys)
3727 (invoke "tar" "-xvf" (assoc-ref inputs "qcustomplot-sharedlib"))))
3728 (replace 'configure
3729 (lambda* (#:key outputs #:allow-other-keys)
3730 (chdir "qcustomplot-sharedlib/sharedlib-compilation")
3731 (substitute* "sharedlib-compilation.pro"
3732 ;; Don't build debug library.
3733 (("debug_and_release")
3734 "release"))
3735 (invoke "qmake"
3736 (string-append "DESTDIR="
3737 (assoc-ref outputs "out")
3738 "/lib"))))
3739 (add-after 'install 'install-header
3740 (lambda* (#:key outputs #:allow-other-keys)
3741 (install-file "../../qcustomplot.h"
3742 (string-append (assoc-ref outputs "out")
3743 "/include")))))))
3744 (home-page "https://www.qcustomplot.com/")
3745 (synopsis "Qt widget for plotting and data visualization")
3746 (description
3747 "QCustomPlot is a Qt C++ widget providing 2D plots, graphs and charts.")
3748 (license license:gpl3+)))
3749
3750 ;; TODO: Split shiboken2 binding generator into a dedicated output.
3751 ;; This executable requires libxml2, libxslt, clang-toolchain at runtime.
3752 ;; The libshiboken library only requires Qt and Python at runtime.
3753 (define-public python-shiboken-2
3754 (package
3755 (name "python-shiboken-2")
3756 (version "5.15.2")
3757 (source (origin
3758 (method url-fetch)
3759 (uri (string-append "https://download.qt.io/official_releases"
3760 "/QtForPython/pyside2/PySide2-" version
3761 "-src/pyside-setup-opensource-src-"
3762 version ".tar.xz"))
3763 (sha256
3764 (base32
3765 "060ljj1nzyp4zfz2vasbv2i7gs5rfkkjwxxbisd0fdw01d5m01mk"))))
3766 (build-system cmake-build-system)
3767 (inputs
3768 (list clang-toolchain
3769 libxml2
3770 libxslt
3771 python-wrapper
3772 qtbase-5
3773 qtxmlpatterns))
3774 (arguments
3775 (list
3776 #:tests? #f
3777 ;; FIXME: Building tests fails
3778 #:configure-flags #~(list "-DBUILD_TESTS=off")
3779 #:phases
3780 #~(modify-phases %standard-phases
3781 (add-after 'unpack 'use-shiboken-dir-only
3782 (lambda _ (chdir "sources/shiboken2") #t))
3783 (add-before 'configure 'make-files-writable-and-update-timestamps
3784 (lambda _
3785 ;; The build scripts need to modify some files in
3786 ;; the read-only source directory, and also attempts
3787 ;; to create Zip files which fails because the Zip
3788 ;; format does not support timestamps before 1980.
3789 (let ((circa-1980 (* 10 366 24 60 60)))
3790 (for-each (lambda (file)
3791 (make-file-writable file)
3792 (utime file circa-1980 circa-1980))
3793 (find-files ".")))
3794 #t))
3795 (add-before 'configure 'set-build-env
3796 (lambda _
3797 (let ((llvm #$(this-package-input "clang-toolchain")))
3798 (setenv "CLANG_INSTALL_DIR" llvm)
3799 #t))))))
3800 (home-page "https://wiki.qt.io/Qt_for_Python")
3801 (synopsis
3802 "Shiboken generates bindings for C++ libraries using CPython source code")
3803 (description
3804 "Shiboken generates bindings for C++ libraries using CPython source code")
3805 (license
3806 (list
3807 ;; The main code is GPL3 or LGPL3.
3808 ;; Examples are BSD-3.
3809 license:gpl3
3810 license:lgpl3
3811 license:bsd-3))))
3812
3813 (define-public python-shiboken-6
3814 (package
3815 (inherit python-shiboken-2)
3816 (name "python-shiboken-6")
3817 (version "6.3.1")
3818 (source (origin
3819 (method url-fetch)
3820 (uri (string-append "https://download.qt.io/official_releases"
3821 "/QtForPython/pyside6/PySide6-" version
3822 "-src/pyside-setup-opensource-src-"
3823 version ".tar.xz"))
3824 (sha256
3825 (base32
3826 "0xwri69nnbhn6fajm7l045r0s0qv8nlq6qj8wcj87srli3b5xa75"))))
3827 (build-system cmake-build-system)
3828 (inputs
3829 (modify-inputs (package-inputs python-shiboken-2)
3830 (replace "qtbase" qtbase)
3831 (delete "qtxmlpatterns")))
3832 (arguments
3833 (substitute-keyword-arguments (package-arguments python-shiboken-2)
3834 ((#:phases p)
3835 #~(modify-phases #$p
3836 (replace 'use-shiboken-dir-only
3837 (lambda _ (chdir "sources/shiboken6") #t))))
3838 ((#:configure-flags flags)
3839 #~(cons*
3840 ;; The RUNPATH of shibokenmodule contains the entry in build
3841 ;; directory instead of install directory.
3842 "-DCMAKE_SKIP_RPATH=TRUE"
3843 (string-append "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath="
3844 #$output "/lib")
3845 #$flags))))))
3846
3847 (define-public python-pyside-2
3848 (package
3849 (name "python-pyside-2")
3850 (version (package-version python-shiboken-2))
3851 (source (package-source python-shiboken-2))
3852 (build-system cmake-build-system)
3853 (inputs
3854 (list qtbase-5
3855 qtdatavis3d
3856 qtdeclarative-5
3857 qtlocation
3858 qtmultimedia-5
3859 qtquickcontrols-5
3860 qtquickcontrols2-5
3861 qtscript
3862 qtscxml
3863 qtsensors
3864 qtspeech
3865 qtsvg-5
3866 qttools-5
3867 qtwebchannel-5
3868 qtwebengine-5
3869 qtwebsockets-5
3870 qtx11extras
3871 qtxmlpatterns))
3872 (propagated-inputs
3873 (list python-shiboken-2))
3874 (native-inputs
3875 (list python-wrapper))
3876 (arguments
3877 (list
3878 #:tests? #f
3879 ;; FIXME: Building tests fail.
3880 #:configure-flags
3881 #~(list "-DBUILD_TESTS=FALSE"
3882 (string-append "-DPYTHON_EXECUTABLE="
3883 (search-input-file %build-inputs
3884 "/bin/python")))
3885 #:modules '((guix build cmake-build-system)
3886 (guix build utils)
3887 (srfi srfi-1))
3888 #:phases
3889 #~(modify-phases %standard-phases
3890 (add-after 'unpack 'go-to-source-dir
3891 (lambda _ (chdir "sources/pyside2") #t))
3892 (add-after 'go-to-source-dir 'fix-qt-module-detection
3893 (lambda _
3894 ;; Activate qt module support even if it not in the same
3895 ;; directory as qtbase.
3896 (substitute* "../cmake_helpers/helpers.cmake"
3897 (("\\(\"\\$\\{found_basepath\\}\" GREATER \"0\"\\)")
3898 "true"))
3899 ;; Add include directories for qt modules.
3900 (let ((dirs (map (lambda (path)
3901 (string-append path "/include/qt5"))
3902 (list
3903 #$@(map (lambda (name)
3904 (this-package-input name))
3905 '("qtdatavis3d"
3906 "qtdeclarative"
3907 "qtlocation"
3908 "qtmultimedia"
3909 "qtquickcontrols"
3910 "qtquickcontrols2"
3911 "qtscript"
3912 "qtscxml"
3913 "qtsensors"
3914 "qtspeech"
3915 "qtsvg"
3916 "qttools"
3917 "qtwebchannel"
3918 "qtwebengine"
3919 "qtwebsockets"
3920 "qtx11extras"
3921 "qtxmlpatterns"))))))
3922 (substitute* "cmake/Macros/PySideModules.cmake"
3923 (("\\$\\{PATH_SEP\\}\\$\\{core_includes\\}" all)
3924 (fold (lambda (dir paths)
3925 (string-append paths "${PATH_SEP}" dir))
3926 all
3927 dirs)))
3928 (setenv "CXXFLAGS" (fold (lambda (dir paths)
3929 (string-append paths " -I" dir))
3930 ""
3931 dirs))))))))
3932 (home-page "https://wiki.qt.io/Qt_for_Python")
3933 (synopsis
3934 "The Qt for Python product enables the use of Qt5 APIs in Python applications")
3935 (description
3936 "The Qt for Python product enables the use of Qt5 APIs in Python
3937 applications. It lets Python developers utilize the full potential of Qt,
3938 using the PySide2 module. The PySide2 module provides access to the
3939 individual Qt modules such as QtCore, QtGui,and so on. Qt for Python also
3940 comes with the Shiboken2 CPython binding code generator, which can be used to
3941 generate Python bindings for your C or C++ code.")
3942 (license (list
3943 license:lgpl3
3944 ;;They state that:
3945 ;; this file may be used under the terms of the GNU General
3946 ;; Public License version 2.0 or (at your option) the GNU
3947 ;; General Public license version 3 or any later version
3948 ;; approved by the KDE Free Qt Foundation.
3949 ;; Thus, it is currently v2 or v3, but no "+".
3950 license:gpl3
3951 license:gpl2))))
3952
3953 (define-public python-pyside-6
3954 (package
3955 (inherit python-pyside-2)
3956 (name "python-pyside-6")
3957 (version (package-version python-shiboken-6))
3958 (source (package-source python-shiboken-6))
3959 ;; TODO: Add more Qt components if available.
3960 (inputs
3961 (list qtbase
3962 qtdeclarative
3963 qtmultimedia
3964 qtnetworkauth
3965 qtpositioning
3966 qtsvg
3967 qttools
3968 qtwebchannel
3969 qtwebengine
3970 qtwebsockets))
3971 (propagated-inputs
3972 (list python-shiboken-6))
3973 (native-inputs
3974 (list python-wrapper))
3975 (arguments
3976 (list
3977 #:tests? #f
3978 #:configure-flags
3979 #~(list "-DBUILD_TESTS=FALSE"
3980 (string-append "-DPYTHON_EXECUTABLE="
3981 (search-input-file %build-inputs
3982 "/bin/python")))
3983 #:phases
3984 #~(modify-phases %standard-phases
3985 (add-after 'unpack 'go-to-source-dir
3986 (lambda _ (chdir "sources/pyside6") #t))
3987 (add-after 'go-to-source-dir 'fix-qt-module-detection
3988 (lambda _
3989 (substitute* "cmake/PySideHelpers.cmake"
3990 (("\\(\"\\$\\{found_basepath\\}\" GREATER \"0\"\\)")
3991 "true"))
3992 (let ((dirs (map (lambda (path)
3993 (string-append path "/include/qt6"))
3994 (list
3995 #$@(map (lambda (name)
3996 (this-package-input name))
3997 '("qtdeclarative"
3998 "qtmultimedia"
3999 "qtnetworkauth"
4000 "qtpositioning"
4001 "qtsvg"
4002 "qttools"
4003 "qtwebchannel"
4004 "qtwebengine"
4005 "qtwebsockets"))))))
4006 (substitute* "cmake/Macros/PySideModules.cmake"
4007 (("set\\(shiboken_include_dir_list " all)
4008 (string-append all (string-join dirs ";") " ")))
4009 (setenv "CXXFLAGS"
4010 (string-join
4011 (map (lambda (dir)
4012 (string-append "-I" dir))
4013 dirs)
4014 " "))))))))
4015 (synopsis
4016 "The Qt for Python product enables the use of Qt6 APIs in Python applications")
4017 (description
4018 "The Qt for Python product enables the use of Qt6 APIs in Python
4019 applications. It lets Python developers utilize the full potential of Qt,
4020 using the PySide6 module. The PySide6 module provides access to the
4021 individual Qt modules such as QtCore, QtGui,and so on. Qt for Python also
4022 comes with the Shiboken6 CPython binding code generator, which can be used to
4023 generate Python bindings for your C or C++ code.")))
4024
4025 (define-public python-pyside-2-tools
4026 (package
4027 (name "python-pyside-2-tools")
4028 (version (package-version python-shiboken-2))
4029 (source (package-source python-shiboken-2))
4030 (build-system cmake-build-system)
4031 (inputs
4032 (list python-pyside-2 python-shiboken-2 qtbase-5))
4033 (native-inputs
4034 (list python-wrapper))
4035 (arguments
4036 (list
4037 #:tests? #f
4038 #:configure-flags
4039 #~(list "-DBUILD_TESTS=off"
4040 (string-append "-DPYTHON_EXECUTABLE="
4041 (search-input-file %build-inputs
4042 "/bin/python")))
4043 #:phases
4044 #~(modify-phases %standard-phases
4045 (add-after 'unpack 'go-to-source-dir
4046 (lambda _ (chdir "sources/pyside2-tools") #t)))))
4047 (home-page "https://wiki.qt.io/Qt_for_Python")
4048 (synopsis
4049 "Command line tools for PySide2")
4050 (description
4051 "Python-pyside-2-tools contains lupdate, rcc and uic tools for PySide2")
4052 (license license:gpl2)))
4053
4054 (define-public libqglviewer
4055 (package
4056 (name "libqglviewer")
4057 (version "2.7.2")
4058 (source (origin
4059 (method url-fetch)
4060 (uri
4061 (string-append "http://libqglviewer.com/src/libQGLViewer-"
4062 version ".tar.gz"))
4063 (sha256
4064 (base32
4065 "023w7da1fyn2z69nbkp2rndiv886zahmc5cmira79zswxjfpklp2"))))
4066 (build-system gnu-build-system)
4067 (arguments
4068 '(#:tests? #f ; no check target
4069 #:make-flags
4070 (list (string-append "PREFIX="
4071 (assoc-ref %outputs "out")))
4072 #:phases
4073 (modify-phases %standard-phases
4074 (replace 'configure
4075 (lambda* (#:key make-flags #:allow-other-keys)
4076 (apply invoke (cons "qmake" make-flags)))))))
4077 (native-inputs
4078 (list qtbase-5 qttools-5))
4079 (inputs
4080 (list glu))
4081 (home-page "http://libqglviewer.com")
4082 (synopsis "Qt-based C++ library for the creation of OpenGL 3D viewers")
4083 (description
4084 "@code{libQGLViewer} is a C++ library based on Qt that eases the creation
4085 of OpenGL 3D viewers.
4086
4087 It provides some of the typical 3D viewer functionalities, such as the
4088 possibility to move the camera using the mouse, which lacks in most of the
4089 other APIs. Other features include mouse manipulated frames, interpolated
4090 keyFrames, object selection, stereo display, screenshot saving and much more.
4091 It can be used by OpenGL beginners as well as to create complex applications,
4092 being fully customizable and easy to extend.")
4093 ;; According to LICENSE, either version 2 or version 3 of the GNU GPL may
4094 ;; be used.
4095 (license (list license:gpl2 license:gpl3))))
4096
4097 (define-public qhexedit
4098 (package
4099 (name "qhexedit")
4100 (version "0.8.9")
4101 (source
4102 (origin
4103 (method git-fetch)
4104 (uri (git-reference
4105 (url "https://github.com/Simsys/qhexedit2")
4106 (commit (string-append "v" version))))
4107 (file-name (git-file-name name version))
4108 (sha256
4109 (base32 "1j333kiwhbidphdx86yilkaivgl632spfh6fqx93bc80gk4is3xa"))))
4110 (build-system gnu-build-system)
4111 (arguments
4112 `(#:phases
4113 (modify-phases %standard-phases
4114 (add-after 'unpack 'fix-path
4115 (lambda* (#:key outputs #:allow-other-keys)
4116 (substitute* "src/qhexedit.pro"
4117 (("^unix:DESTDIR = /usr/lib")
4118 (string-append "unix:DESTDIR = "
4119 (assoc-ref outputs "out") "/lib")))))
4120 (replace 'configure
4121 (lambda _
4122 (chdir "src")
4123 (invoke "qmake" "qhexedit.pro")))
4124 (add-after 'install 'install-headers
4125 (lambda* (#:key outputs #:allow-other-keys)
4126 (let* ((out (assoc-ref outputs "out"))
4127 (include-dir (string-append out "/include")))
4128 (mkdir-p include-dir)
4129 (for-each (lambda (file)
4130 (install-file file include-dir))
4131 (find-files "." "\\.h$"))))))))
4132 (inputs (list qtbase-5))
4133 (native-inputs (list qttools-5))
4134 (home-page "https://simsys.github.io")
4135 (synopsis "Binary editor widget for Qt")
4136 (description
4137 "@code{QHexEdit} is a hex editor widget for the Qt framework. It is a
4138 simple editor for binary data, just like @code{QPlainTextEdit} is for text
4139 data.")
4140 (license license:lgpl2.1)))
4141
4142 (define-public soqt
4143 (let ((commit-ref "fb8f655632bb9c9c60e0ff9fa69a5ba22d3ff99d")
4144 (revision "1"))
4145 (package
4146 (name "soqt")
4147 (version (git-version "1.6.0" revision commit-ref))
4148 (source
4149 (origin
4150 (method git-fetch)
4151 (uri (git-reference
4152 (url "https://github.com/coin3d/soqt")
4153 (commit commit-ref)
4154 (recursive? #t)))
4155 (file-name (git-file-name name version))
4156 (sha256
4157 (base32 "16vikb3fy8rmk10sg5g0gy2c343hi3x7zccsga90ssnkzpq6m032"))))
4158 (build-system cmake-build-system)
4159 (arguments '(#:tests? #f)) ; There are no tests
4160 (native-inputs
4161 (list pkg-config cmake))
4162 (inputs
4163 (list qtbase-5 coin3D-4))
4164 (home-page "https://github.com/coin3d/soqt")
4165 (synopsis "Qt GUI component toolkit library for Coin")
4166 (description "SoQt is a Qt GUI component toolkit library for Coin. It is
4167 also compatible with SGI and TGS Open Inventor, and the API is based on the API
4168 of the InventorXt GUI component toolkit.")
4169 (license license:bsd-3))))
4170
4171 (define-public libdbusmenu-qt
4172 (package
4173 (name "libdbusmenu-qt")
4174 (version "0.9.3+16.04.20160218-0ubuntu1")
4175 (source
4176 (origin
4177 (method git-fetch)
4178 ;; Download from github rather than launchpad because launchpad trunk
4179 ;; tarball hash is not deterministic.
4180 (uri (git-reference
4181 (url "https://github.com/unity8-team/libdbusmenu-qt")
4182 (commit version)))
4183 (file-name (git-file-name name version))
4184 (sha256
4185 (base32 "0b7ii1cvmpcyl79gqal9c3va9m55h055s4hx7fpxkhhqs9463ggg"))))
4186 (build-system cmake-build-system)
4187 (arguments
4188 ;; XXX: Tests require a dbus session and some icons.
4189 '(#:tests? #f))
4190 (native-inputs
4191 (list doxygen))
4192 (inputs
4193 (list qtbase-5))
4194 (home-page "https://launchpad.net/libdbusmenu-qt")
4195 (synopsis "Qt implementation of the DBusMenu spec")
4196 (description "This library provides a Qt implementation of the DBusMenu
4197 protocol. The DBusMenu protocol makes it possible for applications to export
4198 and import their menus over DBus.")
4199 (license license:lgpl2.1+)))
4200
4201 (define-public kdsoap
4202 (package
4203 (name "kdsoap")
4204 (version "2.0.0")
4205 (source
4206 (origin
4207 (method url-fetch)
4208 (uri (string-append "https://github.com/KDAB/KDSoap/releases/download/"
4209 "kdsoap-" version "/kdsoap-" version ".tar.gz"))
4210 (sha256
4211 (base32
4212 "1vh4rzb09kks1ilay1y60q7gf64gwzdwsca60hmx1xx69w8672fi"))))
4213 (build-system qt-build-system)
4214 (inputs `(("qtbase" ,qtbase-5)))
4215 (arguments
4216 '(#:configure-flags '("-DKDSoap_TESTS=true")
4217 #:phases
4218 (modify-phases %standard-phases
4219 (replace 'check
4220 (lambda* (#:key tests? #:allow-other-keys)
4221 (when tests?
4222 (invoke "ctest" "-E" ;; These tests try connect to the internet.
4223 "(kdsoap-webcalls|kdsoap-webcalls_wsdl|kdsoap-test_calc)"))
4224 #t)))))
4225 (home-page "https://www.kdab.com/development-resources/qt-tools/kd-soap/")
4226 (synopsis "Qt SOAP component")
4227 (description "KD SOAP is a tool for creating client applications for web
4228 services using the XML based SOAP protocol and without the need for a dedicated
4229 web server.")
4230 (license (list license:gpl2 license:gpl3))))
4231
4232 ;;;
4233 ;;; Avoid adding new packages to the end of this file. To reduce the chances
4234 ;;; of a merge conflict, place them above by existing packages with similar
4235 ;;; functionality or similar names.
4236 ;;;