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