gnu: python-deepmerge: Use pyproject-build-system.
[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-5)
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-5
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 qtwayland
1500 (package
1501 (name "qtwayland")
1502 (version "6.3.1")
1503 (source
1504 (origin
1505 (method url-fetch)
1506 (uri (qt-urls name version))
1507 (sha256
1508 (base32 "1w60p1did7awdlzq5k8vnq2ncpskb07cpvz31cbv99bjs6igw53g"))))
1509 (build-system cmake-build-system)
1510 (arguments
1511 (list #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
1512 #:phases
1513 #~(modify-phases %standard-phases
1514 (add-after 'unpack 'disable-failing-tests
1515 (lambda _
1516 ;; FIXME: tst_seatv4::animatedCursor() fails here.
1517 ;; See also: <https://bugreports.qt.io/browse/QTBUG-78317>
1518 (substitute* "tests/auto/client/seatv4/tst_seatv4.cpp"
1519 (((string-append
1520 "QVERIFY\\(!cursorSurface\\(\\)->"
1521 "m_waitingFrameCallbacks\\.empty\\(\\)\\);")) "")
1522 (("QTRY_COMPARE\\(bufferSpy\\.count\\(\\), 1\\);") ""))))
1523 (add-before 'check 'set-test-environment
1524 (lambda _
1525 ;; Do not fail just because /etc/machine-id is missing.
1526 (setenv "DBUS_FATAL_WARNINGS" "0")
1527 ;; Make Qt render "offscreen", required for tests.
1528 (setenv "QT_QPA_PLATFORM" "offscreen"))))))
1529 (native-inputs (list glib perl pkg-config qtdeclarative))
1530 (inputs
1531 (list fontconfig
1532 freetype
1533 libx11
1534 libxcomposite
1535 libxext
1536 libxkbcommon
1537 libxrender
1538 mesa
1539 mtdev
1540 qtbase
1541 vulkan-headers
1542 wayland))
1543 (synopsis "Qt Wayland module")
1544 (description "The Qt Wayland module provides the QtWayland client and
1545 compositor libraries.")
1546 (home-page (package-home-page qtbase))
1547 (license (package-license qtbase))))
1548
1549 (define-public qtserialport
1550 (package (inherit qtsvg-5)
1551 (name "qtserialport")
1552 (version "5.15.5")
1553 (source (origin
1554 (method url-fetch)
1555 (uri (qt-urls name version))
1556 (sha256
1557 (base32
1558 "0xg2djwhrj5jqamawlp75g70nmwbp2ph2hh1pm45s36jkxm0k7al"))))
1559 (native-inputs (list perl))
1560 (inputs
1561 (list qtbase-5 eudev))
1562 (arguments
1563 (substitute-keyword-arguments (package-arguments qtsvg-5)
1564 ((#:phases phases)
1565 `(modify-phases ,phases
1566 (add-after 'unpack 'patch-dlopen-paths
1567 (lambda* (#:key inputs #:allow-other-keys)
1568 (substitute* "src/serialport/qtudev_p.h"
1569 ;; Use the absolute paths for dynamically loaded libs,
1570 ;; otherwise the lib will be searched in LD_LIBRARY_PATH which
1571 ;; typically is not set in guix.
1572 (("^\\s*(udevLibrary->setFileNameAndVersion\\(QStringLiteral\\(\")(udev\"\\),\\s*[0-9]+\\);)" _ a b)
1573 (string-append a (assoc-ref inputs "eudev") "/lib/lib" b)))))))))
1574 (synopsis "Qt Serial Port module")
1575 (description "The Qt Serial Port module provides the library for
1576 interacting with serial ports from within Qt.")))
1577
1578 (define-public qtserialbus
1579 (package (inherit qtsvg-5)
1580 (name "qtserialbus")
1581 (version "5.15.5")
1582 (source (origin
1583 (method url-fetch)
1584 (uri (qt-urls name version))
1585 (sha256
1586 (base32
1587 "180gm1jvqfn0h3251zafdd1wd3af00phwaa5qljsbrj6s6ywj79j"))))
1588 (arguments
1589 (substitute-keyword-arguments (package-arguments qtsvg-5)
1590 ((#:phases phases '%standard-phases)
1591 `(modify-phases ,phases
1592 (add-after 'unpack 'patch-libsocketcan-reference
1593 (lambda* (#:key inputs #:allow-other-keys)
1594 (let* ((libcansocket (assoc-ref inputs "libsocketcan"))
1595 (libcansocket.so (string-append libcansocket
1596 "/lib/libsocketcan.so")))
1597 (substitute* "src/plugins/canbus/socketcan/libsocketcan.cpp"
1598 (("QStringLiteral\\(\"socketcan\"\\)")
1599 (format #f "QStringLiteral(~s)" libcansocket.so))))))))))
1600 (inputs
1601 (list libsocketcan qtbase-5 qtserialport))
1602 (synopsis "Qt Serial Bus module")
1603 (description "The Qt Serial Bus API provides classes and functions to
1604 access the various industrial serial buses and protocols, such as CAN, ModBus,
1605 and others.")))
1606
1607 (define-public qtwebchannel-5
1608 (package (inherit qtsvg-5)
1609 (name "qtwebchannel")
1610 (version "5.15.5")
1611 (source (origin
1612 (method url-fetch)
1613 (uri (qt-urls name version))
1614 (sha256
1615 (base32
1616 "1w8mcpdqlphgg3a6yfq18liwlj2nkwrafv0n80h242x5l2mk3ljf"))))
1617 (native-inputs
1618 (list perl qtdeclarative-5 qtwebsockets-5))
1619 (inputs (list qtbase-5))
1620 (synopsis "Web communication library for Qt")
1621 (description "The Qt WebChannel module enables peer-to-peer communication
1622 between the host (QML/C++ application) and the client (HTML/JavaScript
1623 application). The transport mechanism is supported out of the box by the two
1624 popular web engines, Qt WebKit 2 and Qt WebEngine.")))
1625
1626 (define-public qtwebchannel
1627 (package
1628 (name "qtwebchannel")
1629 (version "6.3.1")
1630 (source (origin
1631 (method url-fetch)
1632 (uri (qt-urls name version))
1633 (sha256
1634 (base32
1635 "0s16zx3qn3byldvhmsnwijm8rmizk8vpqj7fnwhjg6c67z10m8ma"))))
1636 (build-system cmake-build-system)
1637 (arguments
1638 (list
1639 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
1640 #:phases #~(modify-phases %standard-phases
1641 (delete 'check) ;move after install
1642 (add-after 'install 'prepare-for-tests
1643 (lambda _
1644 (setenv "QT_QPA_PLATFORM" "offscreen")
1645 (setenv "QML2_IMPORT_PATH"
1646 (string-append #$output "/lib/qt6/qml:"
1647 (getenv "QML2_IMPORT_PATH")))))
1648 (add-after 'prepare-for-tests 'check
1649 (assoc-ref %standard-phases 'check))
1650 (add-after 'check 'delete-installed-tests
1651 (lambda _
1652 (delete-file-recursively
1653 (string-append #$output "/tests")))))))
1654 (native-inputs (list perl))
1655 (inputs (list qtbase qtdeclarative qtwebsockets))
1656 (home-page (package-home-page qtbase))
1657 (synopsis "Web communication library for Qt")
1658 (description "The Qt WebChannel module enables peer-to-peer communication
1659 between the host (QML/C++ application) and the client (HTML/JavaScript
1660 application).")
1661 (license (package-license qtbase))))
1662
1663 (define-public qtwebglplugin
1664 (package (inherit qtsvg-5)
1665 (name "qtwebglplugin")
1666 (version "5.15.5")
1667 (source (origin
1668 (method url-fetch)
1669 (uri (qt-urls name version))
1670 (sha256
1671 (base32
1672 "1m0p4ssykw07lbip2qyv6w34f8ng13bxb63j0w446f5w0492nn9f"))))
1673 (arguments
1674 (substitute-keyword-arguments (package-arguments qtsvg-5)
1675 ((#:phases phases)
1676 `(modify-phases ,phases
1677 (add-after 'unpack 'disable-network-tests
1678 (lambda _ (substitute* "tests/plugins/platforms/platforms.pro"
1679 (("webgl") "# webgl"))))))))
1680 (native-inputs '())
1681 (inputs
1682 (list mesa qtbase-5 qtdeclarative-5 qtwebsockets-5 zlib))
1683 (synopsis "QPA plugin for running an application via a browser using
1684 streamed WebGL commands")
1685 (description "Qt back end that uses WebGL for rendering. It allows Qt
1686 applications (with some limitations) to run in a web browser that supports
1687 WebGL. WebGL is a JavaScript API for rendering 2D and 3D graphics within any
1688 compatible web browser without the use of plug-ins. The API is similar to
1689 OpenGL ES 2.0 and can be used in HTML5 canvas elements")))
1690
1691 (define-public qtwebview
1692 (package (inherit qtsvg-5)
1693 (name "qtwebview")
1694 (version "5.15.5")
1695 (source (origin
1696 (method url-fetch)
1697 (uri (qt-urls name version))
1698 (sha256
1699 (base32
1700 "0arwaky3jy5ql3z4d8f7k7diidzb1kncdans7pn50hsa1bzacfal"))))
1701 (native-inputs
1702 (list perl))
1703 (inputs
1704 (list qtbase-5 qtdeclarative-5))
1705 (synopsis "Display web content in a QML application")
1706 (description "Qt WebView provides a way to display web content in a QML
1707 application without necessarily including a full web browser stack by using
1708 native APIs where it makes sense.")))
1709
1710 (define-public qtlocation
1711 (package (inherit qtsvg-5)
1712 (name "qtlocation")
1713 (version "5.15.5")
1714 (source (origin
1715 (method url-fetch)
1716 (uri (qt-urls name version))
1717 (sha256
1718 (base32
1719 "0mlhhhcxx3gpr9kh04c6fljxcj50c2j21r0wb9f7d7nk4flip7b2"))))
1720 (arguments
1721 (substitute-keyword-arguments (package-arguments qtsvg-5)
1722 ((#:tests? _ #f) #f) ; TODO: Enable the tests
1723 ((#:phases phases)
1724 `(modify-phases ,phases
1725 (add-before 'check 'pre-check
1726 (lambda _
1727 (setenv "HOME" "/tmp")))))))
1728 (native-inputs
1729 (list perl qtdeclarative-5 qtquickcontrols-5 qtserialport))
1730 (inputs
1731 (list icu4c openssl qtbase-5 zlib))
1732 (synopsis "Qt Location and Positioning modules")
1733 (description "The Qt Location module provides an interface for location,
1734 positioning and geolocation plugins.")))
1735
1736 (define-public qtlottie
1737 (package
1738 (name "qtlottie")
1739 (version "6.3.1")
1740 (source (origin
1741 (method url-fetch)
1742 (uri (qt-urls name version))
1743 (sha256
1744 (base32
1745 "1x8wmc6gwmxk92zjcsrbhrbqbfvnk7302ggghld5wk8jk5lsf2vl"))))
1746 (build-system cmake-build-system)
1747 (arguments
1748 (list
1749 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
1750 #:phases
1751 #~(modify-phases %standard-phases
1752 (delete 'check) ;move after install
1753 (add-after 'install 'prepare-for-tests
1754 (lambda _
1755 (setenv "QT_QPA_PLATFORM" "offscreen")
1756 (setenv "QML2_IMPORT_PATH"
1757 (string-append #$output "/lib/qt6/qml:"
1758 (getenv "QML2_IMPORT_PATH"))))))))
1759 (native-inputs (list perl))
1760 (inputs (list libxkbcommon qtbase qtdeclarative))
1761 (home-page (package-home-page qtbase))
1762 (synopsis "QML API for rendering Bodymovin graphics and animations")
1763 (description "Qt Lottie Animation provides a QML API for rendering
1764 graphics and animations that are exported in JSON format by the Bodymovin
1765 plugin for Adobe After Effects.")
1766 (license (package-license qtbase))))
1767
1768 (define-public qttools-5
1769 (package (inherit qtsvg-5)
1770 (name "qttools")
1771 (version "5.15.5")
1772 (source (origin
1773 (method url-fetch)
1774 (uri (qt-urls name version))
1775 (sha256
1776 (base32
1777 "0v7wkzq9i8w3qrw0z8al7lb6clr57lfisyb1fm9cnhi73fvph1vd"))))
1778 (arguments
1779 (substitute-keyword-arguments (package-arguments qtsvg-5)
1780 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1781 (native-inputs
1782 (list perl qtdeclarative-5 vulkan-headers))
1783 (inputs
1784 (list mesa qtbase-5))
1785 (synopsis "Qt Tools and Designer modules")
1786 (description "The Qt Tools module provides a set of applications to browse
1787 the documentation, translate applications, generate help files and other stuff
1788 that helps in Qt development.")))
1789
1790 (define-public qttools
1791 (package
1792 (name "qttools")
1793 (version "6.3.1")
1794 (source (origin
1795 (method url-fetch)
1796 (uri (qt-urls name version))
1797 (sha256
1798 (base32
1799 "1h96w4bzkbd80vr7lh6hnypdlmbzc1y52c2zrqzvkgm3587pa4n4"))))
1800 (build-system cmake-build-system)
1801 (arguments
1802 (list
1803 ;; The build system attempts to fetch online resources and fails when
1804 ;; building the test suite.
1805 #:configure-flags #~(list "-DQT_BUILD_TESTS=OFF")))
1806 (native-inputs (list perl qtdeclarative vulkan-headers))
1807 (inputs (list libxkbcommon mesa qtbase))
1808 (home-page (package-home-page qtbase))
1809 (synopsis "Qt Tools and Designer modules")
1810 (description "The Qt Tools module provides a set of applications to browse
1811 the documentation, translate applications, generate help files and other stuff
1812 that helps in Qt development.")
1813 ;; GPL 3 only with Qt GPL exception 1.0 (see:
1814 ;; LICENSES/Qt-GPL-exception-1.0.txt).
1815 (license (list license:gpl3))))
1816
1817 (define-public qtscript
1818 (package (inherit qtsvg-5)
1819 (name "qtscript")
1820 (version "5.15.5")
1821 (source (origin
1822 (method url-fetch)
1823 (uri (qt-urls name version))
1824 (sha256
1825 (base32
1826 "17yk0p8ci47xlfpllc17arlycng47wrnnskimskzz85bspabc8pm"))
1827 (patches (search-patches "qtscript-disable-tests.patch"))))
1828 (native-inputs
1829 (list perl qttools-5))
1830 (inputs
1831 (list qtbase-5))
1832 (synopsis "Qt Script module")
1833 (description "Qt provides support for application scripting with ECMAScript.
1834 The following guides and references cover aspects of programming with
1835 ECMAScript and Qt.")))
1836
1837 (define-public qtquickcontrols-5
1838 (package (inherit qtsvg-5)
1839 (name "qtquickcontrols")
1840 (version "5.15.5")
1841 (source (origin
1842 (method url-fetch)
1843 (uri (qt-urls name version))
1844 (sha256
1845 (base32
1846 "0mjw25wcgd2bvjz9rr4qjydb423c63615rcx1vws4jmydqdihssr"))))
1847 (arguments
1848 (substitute-keyword-arguments (package-arguments qtsvg-5)
1849 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1850 (inputs
1851 (list qtbase-5 qtdeclarative-5))
1852 (synopsis "Qt Quick Controls and other Quick modules")
1853 (description "The QtScript module provides classes for making Qt
1854 applications scriptable. This module provides a set of extra components that
1855 can be used to build complete interfaces in Qt Quick.")))
1856
1857 (define-public qtquickcontrols2-5
1858 (package (inherit qtsvg-5)
1859 (name "qtquickcontrols2")
1860 (version "5.15.5")
1861 (source (origin
1862 (method url-fetch)
1863 (uri (qt-urls name version))
1864 (sha256
1865 (base32
1866 "1cxg4ml07k1zcyi5m4lx06sz8f5l67isb5vhk7nakxm0wnn7p8y4"))))
1867 (arguments
1868 (substitute-keyword-arguments (package-arguments qtsvg-5)
1869 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1870 (inputs
1871 (list qtbase-5 qtdeclarative-5))
1872 (synopsis "Qt Quick Controls 2 and other Quick 2 modules")
1873 (description "The Qt Quick Controls 2 module contains the Qt Labs Platform
1874 module that provides platform integration: native dialogs, menus and menu bars,
1875 and tray icons. It falls back to Qt Widgets when a native implementation is
1876 not available.")))
1877
1878 (define-public qtquickcontrols2
1879 ;; qtquickcontrols2 still exist, but was merged into qtdeclarative.
1880 ;; Unfortunately that hasn't been well communicated at all (see:
1881 ;; https://bugreports.qt.io/browse/QTBUG-79454).
1882 (deprecated-package "qtquickcontrols2" qtdeclarative))
1883
1884 (define-public qtgraphicaleffects
1885 (package (inherit qtsvg-5)
1886 (name "qtgraphicaleffects")
1887 (version "5.15.5")
1888 (source (origin
1889 (method url-fetch)
1890 (uri (qt-urls name version))
1891 (sha256
1892 (base32
1893 "0xznn5zqp6xrqfgl54l8cig9asqf9m2hz0p3ga514rh8spmdazr3"))))
1894 (arguments
1895 (substitute-keyword-arguments (package-arguments qtsvg-5)
1896 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1897 (inputs
1898 (list qtbase-5 qtdeclarative-5))
1899 (synopsis "Qt Graphical Effects module")
1900 (description "The Qt Graphical Effects module provides a set of QML types
1901 for adding visually impressive and configurable effects to user interfaces.
1902 Effects are visual items that can be added to Qt Quick user interface as UI
1903 components. The API consists of over 20 effects provided as separate QML
1904 types. The effects cover functional areas such as blending, masking, blurring,
1905 coloring, and many more.")))
1906
1907 (define-public qtgamepad
1908 (package (inherit qtsvg-5)
1909 (name "qtgamepad")
1910 (version "5.15.5")
1911 (source (origin
1912 (method url-fetch)
1913 (uri (qt-urls name version))
1914 (sha256
1915 (base32
1916 "0wa4d8f025hlp4bmdzdy5wcahm9wjg6bkwig8dpw9nrsj3idz5b0"))))
1917 (native-inputs
1918 (list perl pkg-config))
1919 (inputs
1920 `(("fontconfig" ,fontconfig)
1921 ("freetype" ,freetype)
1922 ("libxrender" ,libxrender)
1923 ("sdl2" ,sdl2)
1924 ("qtbase" ,qtbase-5)
1925 ("qtdeclarative-5" ,qtdeclarative-5)))
1926 (synopsis "Qt Gamepad module")
1927 (description "The Qt Gamepad module is an add-on library that enables Qt
1928 applications to support the use of gamepad hardware and in some cases remote
1929 control equipment. The module provides both QML and C++ interfaces. The
1930 primary target audience are embedded devices with fullscreen user interfaces,
1931 and mobile applications targeting TV-like form factors.")))
1932
1933 (define-public qtscxml
1934 (package (inherit qtsvg-5)
1935 (name "qtscxml")
1936 (version "5.15.5")
1937 (source (origin
1938 (method url-fetch)
1939 (uri (qt-urls name version))
1940 (sha256
1941 (base32
1942 "0xf5mqsrw16h8xjglymgfc8qg2qa5bi4fgdl4j3dkhvvpr7vrphp"))
1943 (modules '((guix build utils)))
1944 (snippet
1945 '(begin
1946 (delete-file-recursively "tests/3rdparty")
1947 ;; the scion test refers to the bundled 3rd party test code.
1948 (substitute* "tests/auto/auto.pro"
1949 (("scion") "#"))))))
1950 (arguments
1951 (substitute-keyword-arguments (package-arguments qtsvg-5)
1952 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1953 (inputs
1954 (list qtbase-5 qtdeclarative-5))
1955 (synopsis "Qt SCXML module")
1956 (description "The Qt SCXML module provides functionality to create state
1957 machines from SCXML files. This includes both dynamically creating state
1958 machines (loading the SCXML file and instantiating states and transitions) and
1959 generating a C++ file that has a class implementing the state machine. It
1960 also contains functionality to support data models and executable content.")))
1961
1962 (define-public qtpositioning
1963 (package
1964 (name "qtpositioning")
1965 (version "6.3.1")
1966 (source (origin
1967 (method url-fetch)
1968 (uri (qt-urls name version))
1969 (sha256
1970 (base32
1971 "0v78wamvdw02kf9rq7m5v24q2g6jmgq4ch0fnfa014p1r978wy06"))))
1972 (build-system cmake-build-system)
1973 (arguments
1974 (list
1975 #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")
1976 #:phases #~(modify-phases %standard-phases
1977 (add-after 'install 'delete-installed-tests
1978 (lambda _
1979 (delete-file-recursively
1980 (string-append #$output "/tests")))))))
1981 (inputs (list perl qtbase))
1982 (home-page (package-home-page qtbase))
1983 (synopsis "QML and C++ positioning information API")
1984 (description "The Qt Positioning API provides positioning information via
1985 QML and C++ interfaces. The Qt Positioning API lets you to determine a
1986 position by using a variety of possible sources, including satellite, wifi, or
1987 text files. That information can then be used to, for example, determine a
1988 position on a map. In addition, you can use to the API to retrieve satellite
1989 information and perform area based monitoring.")
1990 (license (package-license qtbase))))
1991
1992 (define-public qtpurchasing
1993 (package (inherit qtsvg-5)
1994 (name "qtpurchasing")
1995 (version "5.15.5")
1996 (source (origin
1997 (method url-fetch)
1998 (uri (qt-urls name version))
1999 (sha256
2000 (base32
2001 "04z6mwzn73gg56hgs7gividinfgndx4kmcnp7w6h3wamrdlkfdx7"))))
2002 (inputs
2003 (list qtbase-5 qtdeclarative-5))
2004 (synopsis "Qt Purchasing module")
2005 (description "The Qt Purchasing module provides and in-app API for
2006 purchasing goods and services.")))
2007
2008 (define-public qtcharts
2009 (package (inherit qtsvg-5)
2010 (name "qtcharts")
2011 (version "5.15.5")
2012 (source (origin
2013 (method url-fetch)
2014 (uri (qt-urls name version))
2015 (sha256
2016 (base32
2017 "0y051i1837bfybkf8cm7cx8k5wjmbi47pxawaaz6wm0hd2z5b4qi"))))
2018 (arguments
2019 (substitute-keyword-arguments (package-arguments qtsvg-5)
2020 ((#:phases phases)
2021 `(modify-phases ,phases
2022 (add-after 'unpack 'remove-failing-test
2023 (lambda _
2024 (substitute* "tests/auto/auto.pro"
2025 (("qml") "# qml")
2026 (("qml-qtquicktest") "# qml-qtquicktest"))))))))
2027 (inputs
2028 (list qtbase-5 qtdeclarative-5))
2029 (synopsis "Qt Charts module")
2030 (description "The Qt Charts module provides a set of easy to use chart
2031 components. It uses the Qt Graphics View Framework, therefore charts can be
2032 easily integrated to modern user interfaces. Qt Charts can be used as QWidgets,
2033 QGraphicsWidget, or QML types. Users can easily create impressive graphs by
2034 selecting one of the charts themes.")
2035 (license license:gpl3)))
2036
2037 (define-public qtdatavis3d
2038 (package (inherit qtsvg-5)
2039 (name "qtdatavis3d")
2040 (version "5.15.5")
2041 (source (origin
2042 (method url-fetch)
2043 (uri (qt-urls name version))
2044 (sha256
2045 (base32
2046 "0sczwqlc36jdywf7bqxz0hm6mr7fn8p1fsnc33jliiqzn9yrg77x"))))
2047 (arguments
2048 (substitute-keyword-arguments (package-arguments qtsvg-5)
2049 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
2050 (inputs
2051 (list qtbase-5 qtdeclarative-5))
2052 (synopsis "Qt Data Visualization module")
2053 (description "The Qt Data Visualization module provides a way to visualize
2054 data in 3D as bar, scatter, and surface graphs. It is especially useful for
2055 visualizing depth maps and large quantities of rapidly changing data, such as
2056 data received from multiple sensors. The look and feel of graphs can be
2057 customized by using themes or by adding custom items and labels to them.")
2058 (license license:gpl3)))
2059
2060 (define-public qtnetworkauth-5
2061 (package (inherit qtsvg-5)
2062 (name "qtnetworkauth")
2063 (version "5.15.5")
2064 (source (origin
2065 (method url-fetch)
2066 (uri (qt-urls name version))
2067 (sha256
2068 (base32
2069 "0c7mz715rlpg0cqgs6s0aszmslyamkhnpamc1iij6i571sj5j2f1"))))
2070 (inputs
2071 (list qtbase-5))
2072 (synopsis "Qt Network Authorization module")
2073 (description "The Qt Network Authorization module provides an
2074 implementation of OAuth and OAuth2 authenticathon methods for Qt.")))
2075
2076 (define-public qtnetworkauth
2077 (package
2078 (name "qtnetworkauth")
2079 (version "6.3.1")
2080 (source (origin
2081 (method url-fetch)
2082 (uri (qt-urls name version))
2083 (sha256
2084 (base32
2085 "0apvsb2ip1m3kw8vi9spvf6f6q72ys8vr40rpyysi7shsjwm83yn"))))
2086 (build-system cmake-build-system)
2087 (arguments (list #:configure-flags #~(list "-DQT_BUILD_TESTS=ON")))
2088 (native-inputs (list perl))
2089 (inputs (list qtbase))
2090 (home-page (package-home-page qtbase))
2091 (synopsis "Qt Network Authorization module")
2092 (description "The Qt Network Authorization module provides an
2093 implementation of OAuth and OAuth2 authenticathon methods for Qt.")
2094 (license (package-license qtbase))))
2095
2096 (define-public qtremoteobjects
2097 (package (inherit qtsvg-5)
2098 (name "qtremoteobjects")
2099 (version "5.15.5")
2100 (source (origin
2101 (method url-fetch)
2102 (uri (qt-urls name version))
2103 (sha256
2104 (base32
2105 "1m0xcqlbxsfn0cd4ajin1h3i4l51dajmkw91v0r4a61xi14i0kks"))))
2106 (arguments
2107 (substitute-keyword-arguments (package-arguments qtsvg-5)
2108 ((#:phases phases)
2109 `(modify-phases ,phases
2110 (add-after 'unpack 'remove-failing-test
2111 (lambda _
2112 ;; This test can't find its imports.
2113 (substitute* "tests/auto/qml/qml.pro"
2114 (("integration") "# integration")
2115 (("usertypes") "# usertypes"))
2116 ;; disable failing tests: they need network
2117 (substitute* "tests/auto/auto.pro"
2118 (("integration_multiprocess proxy_multiprocess integration_external restart")
2119 "integration_multiprocess"))))))))
2120 (inputs
2121 (list qtbase-5 qtdeclarative-5))
2122 (synopsis "Qt Remote Objects module")
2123 (description "The Qt Remote Objects module is an @dfn{inter-process
2124 communication} (IPC) module developed for Qt. The idea is to extend existing
2125 Qt's functionalities to enable an easy exchange of information between
2126 processes or computers.")))
2127
2128 (define-public qtspeech
2129 (package (inherit qtsvg-5)
2130 (name "qtspeech")
2131 (version "5.15.5")
2132 (source (origin
2133 (method url-fetch)
2134 (uri (qt-urls name version))
2135 (sha256
2136 (base32
2137 "0xskp9dzjy5nqszygk8gwvjyiylgynx5sq3nk2vi3zwgfdh5jpm4"))))
2138 (arguments
2139 (substitute-keyword-arguments (package-arguments qtsvg-5)
2140 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
2141 (inputs
2142 (list qtbase-5))
2143 (native-inputs
2144 (list perl qtdeclarative-5 qtmultimedia-5 qtxmlpatterns))
2145 (synopsis "Qt Speech module")
2146 (description "The Qt Speech module enables a Qt application to support
2147 accessibility features such as text-to-speech, which is useful for end-users
2148 who are visually challenged or cannot access the application for whatever
2149 reason. The most common use case where text-to-speech comes in handy is when
2150 the end-user is driving and cannot attend the incoming messages on the phone.
2151 In such a scenario, the messaging application can read out the incoming
2152 message.")))
2153
2154 (define-public qtspell
2155 (package
2156 (name "qtspell")
2157 (version "1.0.1")
2158 (source
2159 (origin
2160 (method git-fetch)
2161 (uri (git-reference
2162 (url "https://github.com/manisandro/qtspell")
2163 (commit version)))
2164 (file-name (git-file-name name version))
2165 (sha256
2166 (base32 "19ff6jzm699wrxrk57w3d4kl9qxgdipdikpwls9n4aqv4mw7g969"))))
2167 (build-system cmake-build-system)
2168 (arguments
2169 `(#:tests? #f)) ;no test
2170 (native-inputs
2171 (list pkg-config qttools-5))
2172 (inputs
2173 (list enchant qtbase-5))
2174 (home-page "https://github.com/manisandro/qtspell")
2175 (synopsis "Spell checking for Qt text widgets")
2176 (description
2177 "QtSpell adds spell-checking functionality to Qt's text widgets,
2178 using the Enchant spell-checking library.")
2179 ;; COPYING file specify GPL3, but source code files all refer to GPL2+.
2180 (license license:gpl2+)))
2181
2182 (define-public qtwebengine-5
2183 (package
2184 (inherit qtsvg-5)
2185 (name "qtwebengine")
2186 (version "5.15.5")
2187 (source
2188 (origin
2189 (method url-fetch)
2190 (uri (qt-urls name version))
2191 (sha256
2192 (base32
2193 "0zahr9w6rqdxwh2whsgk3fhcszs7wa9j95lq4sqi8xzin2wcgl17"))
2194 (modules '((ice-9 ftw)
2195 (ice-9 match)
2196 (srfi srfi-1)
2197 (srfi srfi-26)
2198 (guix build utils)))
2199 (snippet
2200 '(begin
2201 (let ((preserved-third-party-files
2202 '("base/third_party/double_conversion"
2203 "base/third_party/cityhash"
2204 "base/third_party/cityhash_v103"
2205 "base/third_party/dynamic_annotations"
2206 "base/third_party/icu"
2207 "base/third_party/libevent"
2208 "base/third_party/nspr"
2209 "base/third_party/superfasthash"
2210 "base/third_party/symbolize"
2211 "base/third_party/xdg_mime"
2212 "base/third_party/xdg_user_dirs"
2213 "net/third_party/mozilla_security_manager"
2214 "net/third_party/nss"
2215 "net/third_party/quiche"
2216 "net/third_party/uri_template"
2217 "third_party/abseil-cpp"
2218 "third_party/angle"
2219 "third_party/angle/src/common/third_party/base"
2220 "third_party/angle/src/common/third_party/smhasher"
2221 "third_party/angle/src/common/third_party/xxhash"
2222 "third_party/angle/src/third_party/compiler"
2223 "third_party/axe-core"
2224 "third_party/blink"
2225 "third_party/boringssl"
2226 "third_party/boringssl/src/third_party/fiat"
2227 "third_party/breakpad"
2228 "third_party/brotli"
2229 "third_party/catapult/common/py_vulcanize/py_vulcanize"
2230 "third_party/catapult/common/py_vulcanize/third_party"
2231 "third_party/catapult/third_party/beautifulsoup4"
2232 "third_party/catapult/third_party/html5lib-python"
2233 "third_party/catapult/third_party/polymer/components"
2234 "third_party/catapult/tracing"
2235 "third_party/catapult/tracing/third_party"
2236 "third_party/ced"
2237 "third_party/cld_3"
2238 "third_party/closure_compiler"
2239 "third_party/crashpad"
2240 "third_party/crashpad/crashpad/third_party/lss"
2241 "third_party/crashpad/crashpad/third_party/zlib"
2242 "third_party/crc32c"
2243 "third_party/dav1d"
2244 "third_party/dawn"
2245 "third_party/devtools-frontend"
2246 "third_party/devtools-frontend/src/front_end/third_party"
2247 "third_party/devtools-frontend/src/third_party/typescript"
2248 "third_party/emoji-segmenter"
2249 "third_party/ffmpeg"
2250 "third_party/googletest"
2251 "third_party/harfbuzz-ng/utils"
2252 "third_party/hunspell"
2253 "third_party/iccjpeg"
2254 "third_party/icu"
2255 "third_party/inspector_protocol"
2256 "third_party/jinja2"
2257 "third_party/jsoncpp"
2258 "third_party/jstemplate"
2259 "third_party/khronos"
2260 "third_party/leveldatabase"
2261 "third_party/libaddressinput"
2262 "third_party/libavif"
2263 "third_party/libgifcodec"
2264 "third_party/libjingle_xmpp"
2265 "third_party/libjpeg_turbo"
2266 "third_party/libpng"
2267 "third_party/libsrtp"
2268 "third_party/libsync"
2269 "third_party/libudev"
2270 "third_party/libvpx"
2271 "third_party/libwebm"
2272 "third_party/libwebp"
2273 "third_party/libxml"
2274 "third_party/libxslt"
2275 "third_party/libyuv"
2276 "third_party/lottie"
2277 "third_party/lss"
2278 "third_party/mako"
2279 "third_party/markupsafe"
2280 "third_party/mesa_headers"
2281 "third_party/metrics_proto"
2282 "third_party/modp_b64"
2283 "third_party/nasm"
2284 "third_party/node"
2285 "third_party/one_euro_filter"
2286 "third_party/openh264/src/codec/api/svc"
2287 "third_party/opus"
2288 "third_party/ots"
2289 "third_party/pdfium"
2290 "third_party/pdfium/third_party/agg23"
2291 "third_party/pdfium/third_party/base"
2292 "third_party/pdfium/third_party/freetype"
2293 "third_party/pdfium/third_party/lcms"
2294 "third_party/pdfium/third_party/libopenjpeg20"
2295 "third_party/pdfium/third_party/skia_shared"
2296 "third_party/perfetto"
2297 "third_party/pffft"
2298 "third_party/ply"
2299 "third_party/polymer"
2300 "third_party/protobuf"
2301 "third_party/protobuf/third_party/six"
2302 "third_party/pyjson5"
2303 "third_party/re2"
2304 "third_party/rnnoise"
2305 "third_party/skia"
2306 "third_party/skia/include/third_party/skcms/skcms.h"
2307 "third_party/skia/include/third_party/vulkan"
2308 "third_party/skia/third_party/skcms"
2309 "third_party/smhasher"
2310 "third_party/snappy"
2311 "third_party/sqlite"
2312 "third_party/usb_ids"
2313 "third_party/usrsctp"
2314 "third_party/vulkan_memory_allocator"
2315 "third_party/web-animations-js"
2316 "third_party/webrtc"
2317 "third_party/webrtc/common_audio/third_party/ooura/fft_size_128"
2318 "third_party/webrtc/common_audio/third_party/ooura/fft_size_256"
2319 "third_party/webrtc/common_audio/third_party/spl_sqrt_floor"
2320 "third_party/webrtc/modules/third_party/fft"
2321 "third_party/webrtc/modules/third_party/g711"
2322 "third_party/webrtc/modules/third_party/g722"
2323 "third_party/webrtc/rtc_base/third_party/base64"
2324 "third_party/webrtc/rtc_base/third_party/sigslot"
2325 "third_party/webrtc_overrides"
2326 "third_party/widevine/cdm/widevine_cdm_common.h"
2327 "third_party/widevine/cdm/widevine_cdm_version.h"
2328 "third_party/woff2"
2329 "third_party/xcbproto"
2330 "third_party/zlib"
2331 "url/third_party/mozilla"
2332 "v8/src/third_party/utf8-decoder"
2333 "v8/src/third_party/valgrind"
2334 "v8/src/third_party/siphash"
2335 "v8/third_party/v8/builtins"
2336 "v8/third_party/inspector_protocol"))
2337 (protected (make-regexp "\\.(gn|gyp)i?$")))
2338 (define preserved-club
2339 (map (lambda (member)
2340 (string-append "./" member))
2341 preserved-third-party-files))
2342 (define (empty? dir)
2343 (equal? (scandir dir) '("." "..")))
2344 (define (third-party? file)
2345 (string-contains file "third_party/"))
2346 (define (useless? file)
2347 (any (cute string-suffix? <> file)
2348 '(".zip" ".so" ".dll" ".exe" ".jar")))
2349 (define (parents child)
2350 ;; Return all parent directories of CHILD up to and including
2351 ;; the closest "third_party".
2352 (let* ((dirs (match (string-split child #\/)
2353 ((dirs ... last) dirs)))
2354 (closest (list-index (lambda (dir)
2355 (string=? "third_party" dir))
2356 (reverse dirs)))
2357 (delim (- (length dirs) closest)))
2358 (fold (lambda (dir prev)
2359 (cons (string-append (car prev) "/" dir)
2360 prev))
2361 (list (string-join (list-head dirs delim) "/"))
2362 (list-tail dirs delim))))
2363 (define (remove-loudly file)
2364 (format #t "deleting ~a...~%" file)
2365 (force-output)
2366 (delete-file file))
2367 (define (delete-unwanted-files child stat flag base level)
2368 (match flag
2369 ((or 'regular 'symlink 'stale-symlink)
2370 (when (third-party? child)
2371 (unless (or (member child preserved-club)
2372 (any (cute member <> preserved-club)
2373 (parents child))
2374 (regexp-exec protected child))
2375 (remove-loudly child)))
2376 (when (and (useless? child) (file-exists? child))
2377 (remove-loudly child))
2378 #t)
2379 ('directory-processed
2380 (when (empty? child)
2381 (rmdir child))
2382 #t)
2383 (_ #t)))
2384
2385 (with-directory-excursion "src/3rdparty"
2386 ;; TODO: Try removing "gn" too for future versions of qtwebengine-5.
2387 (delete-file-recursively "ninja")
2388
2389 (with-directory-excursion "chromium"
2390 ;; Delete bundled software and binaries that were not explicitly
2391 ;; preserved above.
2392 (nftw "." delete-unwanted-files 'depth 'physical)
2393
2394 ;; Assert that each preserved item is present to catch removals.
2395 (for-each (lambda (third-party)
2396 (unless (file-exists? third-party)
2397 (error (format #f "~s does not exist!~%" third-party))))
2398 preserved-club)
2399
2400 ;; Use relative header locations instead of hard coded ones.
2401 (substitute*
2402 "base/third_party/dynamic_annotations/dynamic_annotations.c"
2403 (("base/third_party/valgrind") "valgrind"))
2404 (substitute*
2405 '("third_party/breakpad/breakpad/src/common/linux/http_upload.cc"
2406 "third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.h")
2407 (("third_party/curl") "curl"))
2408 (substitute*
2409 '("components/viz/common/gpu/vulkan_context_provider.h"
2410 "components/viz/common/resources/resource_format_utils.h"
2411 "gpu/config/gpu_info_collector_win.cc"
2412 "gpu/config/gpu_util.cc"
2413 "gpu/config/vulkan_info.h")
2414 (("third_party/vulkan_headers/include/")
2415 ""))
2416
2417 ;; Replace Google Analytics bundle with an empty file and hope
2418 ;; no one notices.
2419 (mkdir-p "third_party/analytics")
2420 (call-with-output-file
2421 "third_party/analytics/google-analytics-bundle.js"
2422 (lambda (port)
2423 (const #t)))))
2424 ;; Do not enable support for loading the Widevine DRM plugin.
2425 (substitute* "src/buildtools/config/common.pri"
2426 (("enable_widevine=true")
2427 "enable_widevine=false")))))))
2428 (build-system gnu-build-system)
2429 (native-inputs
2430 (list bison
2431 flex
2432 gperf
2433 ninja
2434 node
2435 perl
2436 pkg-config
2437 python2-six
2438 python-2
2439 ruby))
2440 (inputs
2441 (list alsa-lib
2442 atk
2443 cups-minimal
2444 curl
2445 dbus
2446 ffmpeg
2447 fontconfig
2448 harfbuzz
2449 icu4c
2450 jsoncpp
2451 lcms
2452 libcap
2453 libevent
2454 libgcrypt
2455 libjpeg-turbo
2456 libvpx
2457 libwebp
2458 libx11
2459 libxcb
2460 libxcomposite
2461 libxcursor
2462 libxkbfile
2463 libxi
2464 libxkbcommon
2465 ;; FIXME: libxml2 needs to built with icu support though it links to
2466 ;; libxml2 configure summary still states "Checking for compatible
2467 ;; system libxml2... no"
2468 libxml2
2469 openh264
2470 libxrandr
2471 libxrender
2472 libxslt
2473 libxtst
2474 mesa
2475 minizip
2476 nss
2477 opus
2478 pciutils
2479 protobuf
2480 pulseaudio
2481 qtbase-5
2482 qtdeclarative-5
2483 qtmultimedia-5
2484 qtwebchannel-5
2485 re2
2486 snappy
2487 eudev
2488 valgrind
2489 vulkan-headers
2490 xcb-util))
2491 (arguments
2492 (substitute-keyword-arguments (package-arguments qtsvg-5)
2493 ((#:modules modules '())
2494 `((guix build gnu-build-system)
2495 (guix build utils)
2496 (ice-9 textual-ports)))
2497 ((#:phases phases)
2498 `(modify-phases ,phases
2499 (add-before 'configure 'substitute-source
2500 (lambda* (#:key inputs outputs #:allow-other-keys)
2501 (let ((out (assoc-ref outputs "out")))
2502 (with-atomic-file-replacement
2503 "src/buildtools/config/linux.pri"
2504 (lambda (in out)
2505 (display (get-string-all in) out)
2506 (display "\ngn_args += use_system_openh264=true\n" out)))
2507 ;; Qtwebengine is not installed into the same prefix as
2508 ;; qtbase. Some qtbase QTLibraryInfo constants will not
2509 ;; work. Replace with the full path to the qtwebengine-5
2510 ;; translations and locales in the store.
2511 (substitute* "src/core/web_engine_library_info.cpp"
2512 (("QLibraryInfo::location\\(QLibraryInfo::TranslationsPath\\)")
2513 (string-append "QLatin1String(\"" out "/share/qt5/translations\")"))
2514 (("QLibraryInfo::location\\(QLibraryInfo::DataPath\\)")
2515 (string-append "QLatin1String(\"" out "/share/qt5\")")))
2516 ;; Substitute full dynamic library path for nss.
2517 (substitute* "src/3rdparty/chromium/crypto/nss_util.cc"
2518 (("libnssckbi.so")
2519 (search-input-file inputs "lib/nss/libnssckbi.so")))
2520 ;; Substitute full dynamic library path for udev.
2521 (substitute* "src/3rdparty/chromium/device/udev_linux/udev1_loader.cc"
2522 (("libudev.so.1")
2523 (search-input-file inputs "lib/libudev.so.1"))))))
2524 (add-before 'configure 'set-env
2525 (lambda _
2526 ;; Avoids potential race conditions.
2527 (setenv "PYTHONDONTWRITEBYTECODE" "1")
2528 (setenv "NINJAFLAGS"
2529 (string-append "-k1" ;less verbose build output
2530 ;; Respect the '--cores' option of 'guix build'.
2531 " -j" (number->string (parallel-job-count))))))
2532 (replace 'configure
2533 (lambda _
2534 ;; Valid QT_BUILD_PARTS variables are:
2535 ;; libs tools tests examples demos docs translations
2536 (invoke "qmake" "QT_BUILD_PARTS = libs tools" "--"
2537 "--webengine-printing-and-pdf=no"
2538 "--webengine-ffmpeg=system"
2539 ;; FIXME: Building qtwebengine-5 5.12.2 with
2540 ;; icu4c >= 68 fails.
2541 ;;"--webengine-icu=system"
2542 "--webengine-pepper-plugins=no"
2543 "-webengine-proprietary-codecs")))))
2544 ;; Tests are disabled due to "Could not find QtWebEngineProcess error"
2545 ;; It's possible this can be fixed by setting QTWEBENGINEPROCESS_PATH
2546 ;; before running tests.
2547 ((#:tests? _ #f) #f)))
2548 (native-search-paths
2549 (list (search-path-specification
2550 (file-type 'regular)
2551 (separator #f)
2552 (variable "QTWEBENGINEPROCESS_PATH")
2553 (files '("lib/qt5/libexec/QtWebEngineProcess")))))
2554 (home-page "https://wiki.qt.io/QtWebEngine")
2555 (synopsis "Qt WebEngine module")
2556 (description "The Qt5WebEngine module provides support for web applications
2557 using the Chromium browser project. The Chromium source code has Google services
2558 and binaries removed, and adds modular support for using system libraries.")
2559 (license license:lgpl2.1+)))
2560
2561 (define-public qtwebengine
2562 (package
2563 (name "qtwebengine")
2564 (version "6.3.1")
2565 (source
2566 (origin
2567 (method url-fetch)
2568 (uri (qt-urls name version))
2569 (sha256
2570 (base32
2571 "0ivfsqd5c0cxsnssj6z37901cf6a47w50zaqgjiysvcm3ar36ymd"))
2572 (modules '((ice-9 ftw)
2573 (ice-9 match)
2574 (srfi srfi-1)
2575 (srfi srfi-26)
2576 (guix build utils)))
2577 (snippet
2578 '(begin
2579 (let ((preserved-third-party-files
2580 '("base/third_party/double_conversion"
2581 "base/third_party/cityhash"
2582 "base/third_party/cityhash_v103"
2583 "base/third_party/dynamic_annotations"
2584 "base/third_party/icu"
2585 "base/third_party/libevent"
2586 "base/third_party/nspr"
2587 "base/third_party/superfasthash"
2588 "base/third_party/symbolize"
2589 "base/third_party/xdg_mime"
2590 "base/third_party/xdg_user_dirs"
2591 "net/third_party/mozilla_security_manager"
2592 "net/third_party/nss"
2593 "net/third_party/quiche"
2594 "net/third_party/uri_template"
2595 "third_party/abseil-cpp"
2596 "third_party/angle"
2597 "third_party/angle/src/common/third_party/base"
2598 "third_party/angle/src/common/third_party/smhasher"
2599 "third_party/angle/src/common/third_party/xxhash"
2600 "third_party/axe-core"
2601 "third_party/blink"
2602 "third_party/boringssl"
2603 "third_party/boringssl/src/third_party/fiat"
2604 "third_party/breakpad"
2605 "third_party/brotli"
2606 "third_party/ced"
2607 "third_party/cld_3"
2608 "third_party/closure_compiler"
2609 "third_party/crashpad"
2610 "third_party/crashpad/crashpad/third_party/lss"
2611 "third_party/crashpad/crashpad/third_party/zlib"
2612 "third_party/crc32c"
2613 "third_party/dav1d"
2614 "third_party/dawn"
2615 "third_party/devtools-frontend"
2616 "third_party/devtools-frontend/src/front_end/third_party/lighthouse"
2617 "third_party/devtools-frontend/src/front_end/third_party/wasmparser"
2618 "third_party/emoji-segmenter"
2619 "third_party/ffmpeg"
2620 "third_party/googletest"
2621 "third_party/harfbuzz-ng/utils"
2622 "third_party/hunspell"
2623 "third_party/iccjpeg"
2624 "third_party/icu"
2625 "third_party/inspector_protocol"
2626 "third_party/jinja2"
2627 "third_party/jsoncpp"
2628 "third_party/jstemplate"
2629 "third_party/khronos"
2630 "third_party/leveldatabase"
2631 "third_party/libaddressinput"
2632 "third_party/libgifcodec"
2633 "third_party/libjingle_xmpp"
2634 "third_party/libjpeg_turbo"
2635 "third_party/libpng"
2636 "third_party/libsrtp"
2637 "third_party/libsync"
2638 "third_party/libudev"
2639 "third_party/libvpx"
2640 "third_party/libwebm"
2641 "third_party/libwebp"
2642 "third_party/libxml"
2643 "third_party/libxslt"
2644 "third_party/libyuv"
2645 "third_party/lss"
2646 "third_party/mako"
2647 "third_party/markupsafe"
2648 "third_party/mesa_headers"
2649 "third_party/metrics_proto"
2650 "third_party/modp_b64"
2651 "third_party/nasm"
2652 "third_party/one_euro_filter"
2653 "third_party/openh264/src/codec/api/svc"
2654 "third_party/opus"
2655 "third_party/ots"
2656 "third_party/pdfium"
2657 "third_party/pdfium/third_party/agg23"
2658 "third_party/pdfium/third_party/base"
2659 "third_party/pdfium/third_party/freetype"
2660 "third_party/pdfium/third_party/lcms"
2661 "third_party/pdfium/third_party/libopenjpeg20"
2662 "third_party/pdfium/third_party/skia_shared"
2663 "third_party/perfetto"
2664 "third_party/pffft"
2665 "third_party/ply"
2666 "third_party/polymer"
2667 "third_party/protobuf"
2668 "third_party/protobuf/third_party/six"
2669 "third_party/pyjson5"
2670 "third_party/re2"
2671 "third_party/rnnoise"
2672 "third_party/skia"
2673 "third_party/skia/include/third_party/skcms/skcms.h"
2674 "third_party/skia/include/third_party/vulkan"
2675 "third_party/skia/third_party/skcms"
2676 "third_party/skia/third_party/vulkanmemoryallocator"
2677 "third_party/smhasher"
2678 "third_party/snappy"
2679 "third_party/sqlite"
2680 "third_party/usb_ids"
2681 "third_party/usrsctp"
2682 "third_party/web-animations-js"
2683 "third_party/webrtc"
2684 "third_party/webrtc/common_audio/third_party/ooura"
2685 "third_party/webrtc/common_audio/third_party/spl_sqrt_floor"
2686 "third_party/webrtc/modules/third_party/fft"
2687 "third_party/webrtc/modules/third_party/g711"
2688 "third_party/webrtc/modules/third_party/g722"
2689 "third_party/webrtc/rtc_base/third_party/base64"
2690 "third_party/webrtc/rtc_base/third_party/sigslot"
2691 "third_party/webrtc_overrides"
2692 "third_party/widevine/cdm/widevine_cdm_common.h"
2693 "third_party/widevine/cdm/widevine_cdm_version.h"
2694 "third_party/woff2"
2695 "third_party/zlib"
2696 "url/third_party/mozilla"
2697 "v8/src/third_party/utf8-decoder"
2698 "v8/src/third_party/valgrind"
2699 "v8/src/third_party/siphash"
2700 "v8/third_party/v8/builtins"
2701 "v8/third_party/inspector_protocol"))
2702 (protected (make-regexp "\\.(gn|gyp)i?$")))
2703 (define preserved-club
2704 (map (lambda (member)
2705 (string-append "./" member))
2706 preserved-third-party-files))
2707 (define (empty? dir)
2708 (equal? (scandir dir) '("." "..")))
2709 (define (third-party? file)
2710 (string-contains file "third_party/"))
2711 (define (useless? file)
2712 (any (cute string-suffix? <> file)
2713 '(".zip" ".so" ".dll" ".exe" ".jar")))
2714 (define (parents child)
2715 ;; Return all parent directories of CHILD up to and including
2716 ;; the closest "third_party".
2717 (let* ((dirs (match (string-split child #\/)
2718 ((dirs ... last) dirs)))
2719 (closest (list-index (lambda (dir)
2720 (string=? "third_party" dir))
2721 (reverse dirs)))
2722 (delim (- (length dirs) closest)))
2723 (fold (lambda (dir prev)
2724 (cons (string-append (car prev) "/" dir)
2725 prev))
2726 (list (string-join (list-head dirs delim) "/"))
2727 (list-tail dirs delim))))
2728 (define (remove-loudly file)
2729 (format #t "deleting ~a...~%" file)
2730 (force-output)
2731 (delete-file file))
2732 (define (delete-unwanted-files child stat flag base level)
2733 (match flag
2734 ((or 'regular 'symlink 'stale-symlink)
2735 (when (third-party? child)
2736 (unless (or (member child preserved-club)
2737 (any (cute member <> preserved-club)
2738 (parents child))
2739 (regexp-exec protected child))
2740 (remove-loudly child)))
2741 (when (and (useless? child) (file-exists? child))
2742 (remove-loudly child)))
2743 ('directory-processed
2744 (when (empty? child)
2745 (rmdir child)))
2746 (_ #t)))
2747
2748 (with-directory-excursion "src/3rdparty"
2749 (delete-file-recursively "ninja")
2750
2751 (with-directory-excursion "chromium"
2752 ;; Delete bundled software and binaries that were not
2753 ;; explicitly preserved above.
2754 (nftw "." delete-unwanted-files 'depth 'physical)
2755
2756 ;; Assert that each preserved item is present to catch
2757 ;; removals.
2758 (for-each (lambda (third-party)
2759 (unless (file-exists? third-party)
2760 (error (format #f "~s does not exist!~%"
2761 third-party))))
2762 preserved-club)
2763
2764 ;; Use relative header locations instead of hard coded ones.
2765 (substitute*
2766 "base/third_party/dynamic_annotations/dynamic_annotations.c"
2767 (("base/third_party/valgrind") "valgrind"))
2768 (substitute* "third_party/breakpad/breakpad/src/common/\
2769 linux/libcurl_wrapper.h"
2770 (("third_party/curl") "curl"))
2771 (substitute*
2772 '("components/viz/common/gpu/vulkan_context_provider.h"
2773 "gpu/config/gpu_util.cc")
2774 (("third_party/vulkan/include/")
2775 ""))
2776
2777 ;; Replace Google Analytics bundle with an empty file and
2778 ;; hope no one notices.
2779 (mkdir-p "third_party/analytics")
2780 (call-with-output-file
2781 "third_party/analytics/google-analytics-bundle.js"
2782 (lambda (port)
2783 (const #t)))))
2784 ;; Do not enable support for loading the Widevine DRM plugin.
2785 (substitute* "src/core/CMakeLists.txt"
2786 (("enable_widevine=true")
2787 "enable_widevine=false")))))))
2788 (build-system cmake-build-system)
2789 (arguments
2790 (list
2791 ;; XXX: The test suite is not built by default; leave it off to save
2792 ;; some build time and resources.
2793 #:tests? #f
2794 #:configure-flags
2795 ;; Use the CMake ninja generator, otherwise the build fails (see:
2796 ;; https://bugreports.qt.io/browse/QTBUG-96897).
2797 #~(list "-GNinja" ;
2798 ;; Manually add the NSS library prefix to the linker
2799 ;; search path, otherwise it fails to be linked (see:
2800 ;; https://bugreports.qt.io/browse/QTBUG-105053).
2801 (string-append "-DCMAKE_SHARED_LINKER_FLAGS=-L"
2802 (search-input-directory %build-inputs "lib/nss"))
2803
2804 ;; The PDF renderer plugin fails to build with errors such as
2805 ;; "src/3rdparty/chromium/components/pdf
2806 ;; /renderer/pdf_accessibility_tree.cc:1373:39:
2807 ;; error: use of undeclared identifier 'IDS_PDF_PAGE_INDEX'";
2808 ;; disable it.
2809 "-DQT_FEATURE_webengine_printing_and_pdf=OFF"
2810 "-DQT_FEATURE_webengine_pepper_plugins=OFF" ;widevine
2811 "-DQT_FEATURE_system_ffmpeg=ON"
2812 ;; Do not artificially limit codec support; video decoding is
2813 ;; done by ffmpeg.
2814 "-DQT_FEATURE_webengine_proprietary_codecs=ON"
2815 "-DQT_FEATURE_webengine_system_alsa=ON"
2816 "-DQT_FEATURE_webengine_system_icu=ON"
2817 "-DQT_FEATURE_webengine_system_libxml=ON"
2818 "-DQT_FEATURE_webengine_system_libpci=ON"
2819 "-DQT_FEATURE_webengine_system_libpng=ON"
2820 "-DQT_FEATURE_webengine_system_pulseaudio=ON"
2821 "-DQT_FEATURE_webengine_system_zlib=ON")
2822 #:phases
2823 #~(modify-phases %standard-phases
2824 (add-after 'unpack 'patch-paths
2825 (lambda* (#:key inputs #:allow-other-keys)
2826 ;; Qtwebengine is not installed into the same prefix as qtbase.
2827 ;; Some qtbase QTLibraryInfo constants will not work. Replace
2828 ;; with the full path to the qtwebengine translations and
2829 ;; locales in the store.
2830 (substitute* "src/core/web_engine_library_info.cpp"
2831 (("QLibraryInfo::path\\(QLibraryInfo::TranslationsPath)")
2832 (string-append "QLatin1String(\"" #$output
2833 "/share/qt6/translations\")"))
2834 (("QLibraryInfo::path\\(QLibraryInfo::DataPath)")
2835 (string-append "QLatin1String(\"" #$output
2836 "/share/qt6\")")))
2837 ;; Substitute full dynamic library path for nss.
2838 (substitute* "src/3rdparty/chromium/crypto/nss_util.cc"
2839 (("libnssckbi.so")
2840 (search-input-file inputs "lib/nss/libnssckbi.so")))
2841 ;; Substitute full dynamic library path for udev.
2842 (substitute* "src/3rdparty/chromium/device/udev_linux/udev1_loader.cc"
2843 (("libudev.so.1")
2844 (search-input-file inputs "lib/libudev.so.1")))
2845 ;; Patch the location of the X11 keywoard layouts, otherwise
2846 ;; webengine *crashes* at run time when the default directory,
2847 ;; '/usr/share/X11/xkb' is empty (see:
2848 ;; https://bugreports.qt.io/browse/QTBUG-105124).
2849 (substitute* "src/3rdparty/chromium/ui/events/ozone/layout/xkb\
2850 /xkb_keyboard_layout_engine.cc"
2851 (("/usr/share/X11/xkb")
2852 (search-input-directory inputs "share/X11/xkb")))))
2853 (add-before 'configure 'prepare-build-environment
2854 (lambda _
2855 ;; Avoids potential race conditions.
2856 (setenv "PYTHONDONTWRITEBYTECODE" "1")
2857 (setenv "NINJAFLAGS"
2858 (string-append
2859 "-k1" ;less verbose build output
2860 ;; Respect the '--cores' option of 'guix build'.
2861 " -j" (number->string (parallel-job-count))))
2862 ;; Use Clang/LDD to help tame the memory requirements and hasten
2863 ;; the build.
2864 (setenv "AR" "llvm-ar") (setenv "NM" "llvm-nm")
2865 (setenv "CC" "clang") (setenv "CXX" "clang++")))
2866 (replace 'build
2867 (lambda* (#:key parallel-build? #:allow-other-keys)
2868 (apply invoke "cmake" "--build" "."
2869 (if parallel-build?
2870 `("--parallel" ,(number->string (parallel-job-count)))
2871 '()))))
2872 (replace 'install
2873 (lambda _
2874 (invoke "cmake" "--install" "."))))))
2875 (native-inputs
2876 (modify-inputs (package-native-inputs qtwebengine-5)
2877 (delete "python2" "python2-six")
2878 (append clang-14
2879 lld-as-ld-wrapper
2880 node-lts
2881 python-wrapper
2882 python-html5lib)))
2883 (inputs
2884 (modify-inputs (package-inputs qtwebengine-5)
2885 (replace "qtbase" qtbase)
2886 (replace "qtdeclarative" qtdeclarative)
2887 (replace "qtmultimedia" qtmultimedia)
2888 (replace "qtwebchannel" qtwebchannel)
2889 (append libxkbfile xkeyboard-config)))
2890 (native-search-paths
2891 (list (search-path-specification
2892 (file-type 'regular)
2893 (separator #f)
2894 (variable "QTWEBENGINEPROCESS_PATH")
2895 (files '("lib/qt6/libexec/QtWebEngineProcess")))))
2896 (home-page "https://wiki.qt.io/QtWebEngine")
2897 (synopsis "Qt WebEngine module")
2898 (description "The Qt WebEngine module provides support for web
2899 applications using the Chromium browser project. The Chromium source code has
2900 Google services and binaries removed, and adds modular support for using
2901 system libraries.")
2902 (license license:lgpl2.1+)))
2903
2904 (define-public single-application-qt5
2905 ;; Change in function signature, nheko requires at least this commit
2906 (let ((commit "dc8042b5db58f36e06ba54f16f38b16c5eea9053"))
2907 (package
2908 (name "single-application-qt5")
2909 (version (string-append "3.2.0-" (string-take commit 7)))
2910 (source
2911 (origin
2912 (method git-fetch)
2913 (uri
2914 (git-reference
2915 (url "https://github.com/itay-grudev/SingleApplication")
2916 (commit commit)))
2917 (file-name (git-file-name name version))
2918 (sha256
2919 (base32
2920 "163aa2x2qb0h8w26si5ql833ilj427jjbdwlz1p2p8iaq6dh0vq1"))))
2921 (build-system cmake-build-system)
2922 (arguments
2923 `(#:tests? #f ; no check target
2924 ;; Projects can decide how to build this library. You might need to
2925 ;; override this flag (QApplication, QGuiApplication or
2926 ;; QCoreApplication).
2927 #:configure-flags '("-DQAPPLICATION_CLASS=QApplication")
2928 #:phases
2929 (modify-phases %standard-phases
2930 ;; No install target, install things manually
2931 (replace 'install
2932 (lambda* (#:key inputs outputs source #:allow-other-keys)
2933 (let* ((qt (assoc-ref inputs "qtbase"))
2934 (qt-version ,(version-major (package-version qtbase-5)))
2935 (out (assoc-ref outputs "out")))
2936 (install-file
2937 "libSingleApplication.a" (string-append out "/lib"))
2938 (for-each
2939 (lambda (file)
2940 (install-file
2941 (string-append source "/" file)
2942 (string-append out "/include")))
2943 '("SingleApplication"
2944 "singleapplication.h" "singleapplication_p.h"))
2945 #t))))))
2946 (inputs
2947 (list qtbase-5))
2948 (home-page "https://github.com/itay-grudev/SingleApplication")
2949 (synopsis "Replacement of QtSingleApplication for Qt5 and Qt6")
2950 (description
2951 "SingleApplication is a replacement of the QtSingleApplication for Qt5 and Qt6.
2952
2953 It keeps the Primary Instance of your Application and kills each subsequent
2954 instances. It can (if enabled) spawn secondary (non-related to the primary)
2955 instances and can send data to the primary instance from secondary
2956 instances.")
2957 (license license:expat))))
2958
2959 (define-public python-sip
2960 (package
2961 (name "python-sip")
2962 (version "5.5.0")
2963 (source
2964 (origin
2965 (method url-fetch)
2966 (uri (list (pypi-uri "sip" version)
2967 (string-append "https://www.riverbankcomputing.com/static/"
2968 "Downloads/sip/" version
2969 "/sip-" version ".tar.gz")))
2970 (sha256
2971 (base32
2972 "1idaivamp1jvbbai9yzv471c62xbqxhaawccvskaizihkd0lq0jx"))))
2973 (build-system python-build-system)
2974 (native-inputs
2975 (list python-wrapper))
2976 (propagated-inputs
2977 (list python-toml python-packaging))
2978 (home-page "https://www.riverbankcomputing.com/software/sip/intro")
2979 (synopsis "Python binding creator for C and C++ libraries")
2980 (description
2981 "SIP is a tool to create Python bindings for C and C++ libraries. It
2982 was originally developed to create PyQt, the Python bindings for the Qt
2983 toolkit, but can be used to create bindings for any C or C++ library.
2984
2985 SIP comprises a code generator and a Python module. The code generator
2986 processes a set of specification files and generates C or C++ code, which
2987 is then compiled to create the bindings extension module. The SIP Python
2988 module provides support functions to the automatically generated code.")
2989 ;; There is a choice between a python like license, gpl2 and gpl3.
2990 ;; For compatibility with pyqt, we need gpl3.
2991 (license license:gpl3)))
2992
2993 (define-public python-sip-4
2994 (package
2995 (inherit python-sip)
2996 (name "python-sip")
2997 (version "4.19.25")
2998 (source
2999 (origin
3000 (method url-fetch)
3001 (uri (list (pypi-uri "sip" version)
3002 (string-append "https://www.riverbankcomputing.com/static/"
3003 "Downloads/sip/" version
3004 "/sip-" version ".tar.gz")))
3005 (sha256
3006 (base32
3007 "04a23cgsnx150xq86w1z44b6vr2zyazysy9mqax0fy346zlr77dk"))))
3008 (build-system gnu-build-system)
3009 (native-inputs
3010 `(("python" ,python-wrapper)))
3011 (propagated-inputs `())
3012 (arguments
3013 `(#:tests? #f ; no check target
3014 #:imported-modules ((guix build python-build-system)
3015 ,@%gnu-build-system-modules)
3016 #:modules ((srfi srfi-1)
3017 ((guix build python-build-system) #:select (python-version))
3018 ,@%gnu-build-system-modules)
3019 #:phases
3020 (modify-phases %standard-phases
3021 (replace 'configure
3022 (lambda* (#:key inputs outputs #:allow-other-keys)
3023 (let* ((out (assoc-ref outputs "out"))
3024 (bin (string-append out "/bin"))
3025 (include (string-append out "/include"))
3026 (python (assoc-ref inputs "python"))
3027 (lib (string-append out "/lib/python"
3028 (python-version python)
3029 "/site-packages")))
3030 (invoke "python" "configure.py"
3031 "--bindir" bin
3032 "--destdir" lib
3033 "--incdir" include)))))))
3034 (license license:gpl3)))
3035
3036 (define-public python-pyqt
3037 (package
3038 (name "python-pyqt")
3039 (version "5.15.5")
3040 (source
3041 (origin
3042 (method url-fetch)
3043 ;; PyPI is the canonical distribution point of PyQt. Older
3044 ;; releases are available from the web site.
3045 (uri (list (pypi-uri "PyQt5" version)
3046 (string-append "https://www.riverbankcomputing.com/static/"
3047 "Downloads/PyQt5/" version "/PyQt5-"
3048 version ".tar.gz")))
3049 (file-name (string-append "PyQt5-" version ".tar.gz"))
3050 (sha256
3051 (base32
3052 "0aya963kkmbwfwmpd0p6k85y4g7wl5zarjqxxfgir403zalbf4dl"))
3053 (patches (search-patches "pyqt-configure.patch"))))
3054 (build-system gnu-build-system)
3055 (native-inputs
3056 (list qtbase-5)) ; for qmake
3057 (propagated-inputs
3058 (list python-sip python-pyqt5-sip))
3059 (inputs
3060 `(("python" ,python-wrapper)
3061 ("qtbase" ,qtbase-5)
3062 ("qtconnectivity" ,qtconnectivity)
3063 ("qtdeclarative-5" ,qtdeclarative-5)
3064 ("qtlocation" ,qtlocation)
3065 ("qtmultimedia-5" ,qtmultimedia-5)
3066 ("qtsensors" ,qtsensors)
3067 ("qtserialport" ,qtserialport)
3068 ("qtsvg-5" ,qtsvg-5)
3069 ("qttools-5" ,qttools-5)
3070 ("qtwebchannel-5" ,qtwebchannel-5)
3071 ("qtwebkit" ,qtwebkit)
3072 ("qtwebsockets-5" ,qtwebsockets-5)
3073 ("qtx11extras" ,qtx11extras)
3074 ("qtxmlpatterns" ,qtxmlpatterns)))
3075 (arguments
3076 `(#:modules ((srfi srfi-1)
3077 ((guix build python-build-system) #:select (python-version))
3078 ,@%gnu-build-system-modules)
3079 #:imported-modules ((guix build python-build-system)
3080 ,@%gnu-build-system-modules)
3081 #:phases
3082 (modify-phases %standard-phases
3083 ;; When building python-pyqtwebengine, <qprinter.h> can not be
3084 ;; included. Here we substitute the full path to the header in the
3085 ;; store.
3086 (add-before 'configure 'substitute-source
3087 (lambda* (#:key inputs #:allow-other-keys)
3088 (let* ((qtbase (assoc-ref inputs "qtbase"))
3089 (qtprinter.h (string-append "\"" qtbase "/include/qt5/QtPrintSupport/qprinter.h\"")))
3090 (substitute* "sip/QtPrintSupport/qprinter.sip"
3091 (("<qprinter.h>")
3092 qtprinter.h))
3093 #t)))
3094 (replace 'configure
3095 (lambda* (#:key inputs outputs #:allow-other-keys)
3096 (let* ((out (assoc-ref outputs "out"))
3097 (bin (string-append out "/bin"))
3098 (sip (string-append out "/share/sip"))
3099 (plugins (string-append out "/lib/qt5/plugins"))
3100 (designer (string-append plugins "/designer"))
3101 (qml (string-append plugins "/PyQt5"))
3102 (python (assoc-ref inputs "python"))
3103 (lib (string-append out "/lib/python"
3104 (python-version python)
3105 "/site-packages"))
3106 (stubs (string-append lib "/PyQt5")))
3107 (invoke "python" "configure.py"
3108 "--confirm-license"
3109 "--bindir" bin
3110 "--destdir" lib
3111 "--designer-plugindir" designer
3112 "--qml-plugindir" qml
3113 ; Where to install the PEP 484 Type Hints stub
3114 ; files. Without this the stubs are tried to be
3115 ; installed into the python package's
3116 ; site-package directory, which is read-only.
3117 "--stubsdir" stubs
3118 "--sipdir" sip)))))))
3119 (home-page "https://www.riverbankcomputing.com/software/pyqt/intro")
3120 (synopsis "Python bindings for Qt")
3121 (description
3122 "PyQt is a set of Python v2 and v3 bindings for the Qt application
3123 framework. The bindings are implemented as a set of Python modules and
3124 contain over 620 classes.")
3125 (license license:gpl3)))
3126
3127 (define-public python-pyqt5-sip
3128 (package
3129 (name "python-pyqt5-sip")
3130 (version "12.10.1")
3131 (source
3132 (origin
3133 (method url-fetch)
3134 (uri (pypi-uri "PyQt5_sip" version))
3135 (sha256
3136 (base32
3137 "09771b6fdn0rx34l5a0wzcd899yd57zxp5sw3bsqhd25biwhiq4p"))))
3138 (build-system python-build-system)
3139 (arguments
3140 `(#:tests? #f)) ;; No test code.
3141 (home-page "https://www.riverbankcomputing.com/software/sip/")
3142 (synopsis "Sip module support for PyQt5")
3143 (description "Sip module support for PyQt5")
3144 (license license:lgpl2.1+)))
3145
3146 (define-public python-pyqtwebengine
3147 (package
3148 (name "python-pyqtwebengine")
3149 (version "5.15.5")
3150 (source
3151 (origin
3152 (method url-fetch)
3153 ;; The newest releases are only available on PyPI. Older ones
3154 ;; are mirrored at the upstream home page.
3155 (uri (list (pypi-uri "PyQtWebEngine" version)
3156 (string-append "https://www.riverbankcomputing.com/static"
3157 "/Downloads/PyQtWebEngine/" version
3158 "/PyQtWebEngine-" version ".tar.gz")))
3159 (sha256
3160 (base32
3161 "0hdr0g0rzlhsnylhfk826pq1lw8p9dqcr8yma2wy9dgjrj6n0ixb"))))
3162 (build-system gnu-build-system)
3163 (native-inputs
3164 (list python python-sip
3165 ;; qtbase is required for qmake
3166 qtbase-5))
3167 (inputs
3168 `(("python" ,python-wrapper)
3169 ("python-sip" ,python-sip)
3170 ("python-pyqt" ,python-pyqt-without-qtwebkit)
3171 ("qtbase" ,qtbase-5)
3172 ("qtsvg-5" ,qtsvg-5)
3173 ("qtdeclarative-5" ,qtdeclarative-5)
3174 ("qtwebchannel-5" ,qtwebchannel-5)
3175 ("qtwebengine-5" ,qtwebengine-5)))
3176 (arguments
3177 `(#:modules ((srfi srfi-1)
3178 ((guix build python-build-system) #:select (python-version))
3179 ,@%gnu-build-system-modules)
3180 #:imported-modules ((guix build python-build-system)
3181 ,@%gnu-build-system-modules)
3182 #:phases
3183 (modify-phases %standard-phases
3184 (replace 'configure
3185 (lambda* (#:key inputs outputs #:allow-other-keys)
3186 (let* ((out (assoc-ref outputs "out"))
3187 (sipdir (string-append out "/share/sip"))
3188 (pyqt-sipdir (string-append
3189 (assoc-ref inputs "python-pyqt") "/share/sip"))
3190 (python (assoc-ref inputs "python"))
3191 (lib (string-append out "/lib/python"
3192 (python-version python)
3193 "/site-packages/PyQt5"))
3194 (stubs (string-append lib "/PyQt5")))
3195
3196 (mkdir-p sipdir)
3197 (invoke "python" "configure.py"
3198 "-w"
3199 "--no-dist-info"
3200 "--destdir" lib
3201 "--no-qsci-api"
3202 "--stubsdir" stubs
3203 "--sipdir" sipdir
3204 "--pyqt-sipdir" pyqt-sipdir))))
3205 ;; Because this has a different prefix than python-pyqt then we need
3206 ;; to make this a namespace of its own.
3207 (add-after 'install 'make-namespace
3208 (lambda* (#:key inputs outputs #:allow-other-keys)
3209 (let* ((__init__.py (string-append
3210 (assoc-ref outputs "out")
3211 "/lib/python"
3212 (python-version (assoc-ref inputs "python"))
3213 "/site-packages/PyQt5/__init__.py")))
3214 (with-output-to-file __init__.py
3215 (lambda _ (display "
3216 from pkgutil import extend_path
3217 __path__ = extend_path(__path__, __name__)
3218 ")))
3219 #t))))))
3220 (home-page "https://www.riverbankcomputing.com/software/pyqtwebengine/intro")
3221 (synopsis "Python bindings for QtWebEngine")
3222 (description
3223 "PyQtWebEngine is a set of Python bindings for The Qt Company's Qt
3224 WebEngine libraries. The bindings sit on top of PyQt5 and are implemented as a
3225 set of three modules. Prior to v5.12 these bindings were part of PyQt
3226 itself.")
3227 (license license:gpl3)))
3228
3229 ;; XXX: This is useful for removing qtwebkit from other packages' dependency
3230 ;; graphs, as well as for preventing python-pyqtwebengine from transitively
3231 ;; depending on qtwebkit.
3232 ;; Ultimately, it would be nicer to have a more modular set of python-pyqt-*
3233 ;; packages that could be used together.
3234 (define-public python-pyqt-without-qtwebkit
3235 (package/inherit python-pyqt
3236 (name "python-pyqt-without-qtwebkit")
3237 (inputs
3238 (alist-delete "qtwebkit" (package-inputs python-pyqt)))))
3239
3240 (define-public python-pyqt-builder
3241 (package
3242 (name "python-pyqt-builder")
3243 (version "1.9.0")
3244 (source
3245 (origin
3246 (method url-fetch)
3247 (uri (pypi-uri "PyQt-builder" version))
3248 (sha256
3249 (base32
3250 "0nh0054c54ji3sm6d268fccf0y5f613spswwgwqd3rnn816hnljl"))))
3251 (build-system python-build-system)
3252 (inputs
3253 (list python-sip))
3254 (home-page "https://www.riverbankcomputing.com/static/Docs/PyQt-builder/")
3255 (synopsis "PEP 517 compliant PyQt build system")
3256 (description "PyQt-builder is a tool for generating Python bindings for C++
3257 libraries that use the Qt application framework. The bindings are built on
3258 top of the PyQt bindings for Qt. PyQt-builder is used to build PyQt itself.")
3259 ;; Either version 2 or 3, but no other version. See the file
3260 ;; 'pyqtbuild/builder.py' in the source distribution for more information.
3261 (license (list license:gpl2 license:gpl3))))
3262
3263 (define-public python-qtpy
3264 (package
3265 (name "python-qtpy")
3266 (version "2.2.0")
3267 (source
3268 (origin
3269 (method url-fetch)
3270 (uri (pypi-uri "QtPy" version))
3271 (sha256
3272 (base32
3273 "051rj10lbv2ny48lz34zhclcbdxxdbk4di2mdk91m9143w91npyq"))))
3274 (build-system python-build-system)
3275 (propagated-inputs (list python-packaging))
3276 (arguments
3277 `(;; Not all supported bindings are packaged. Especially PyQt4.
3278 #:tests? #f))
3279 (home-page "https://github.com/spyder-ide/qtpy")
3280 (synopsis
3281 "Qt bindings (PyQt5, PyQt4 and PySide) and additional custom QWidgets")
3282 (description
3283 "Provides an abstraction layer on top of the various Qt bindings
3284 (PyQt5, PyQt4 and PySide) and additional custom QWidgets.")
3285 (license license:expat)))
3286
3287 (define-public python-qt.py
3288 (package
3289 (name "python-qt.py")
3290 (version "1.3.7")
3291 (source
3292 (origin
3293 (method url-fetch)
3294 (uri (pypi-uri "Qt.py" version))
3295 (sha256
3296 (base32 "07rvfwzjl378j75j2va0c6xylwx16icxa6dycsjgjc329pgpng40"))))
3297 (build-system python-build-system)
3298 (native-inputs (list python-pyqt))
3299 (home-page "https://github.com/mottosso/Qt.py")
3300 (synopsis "Abstraction layer for Python Qt bindings")
3301 (description
3302 "This package provides an abstraction layer on top of the various Qt
3303 bindings (PySide, PySide2, PyQt4 and PyQt5).")
3304 (license license:expat)))
3305
3306 (define-public qscintilla
3307 (package
3308 (name "qscintilla")
3309 (version "2.11.6")
3310 (source (origin
3311 (method url-fetch)
3312 (uri (string-append "https://www.riverbankcomputing.com/static"
3313 "/Downloads/QScintilla/" version
3314 "/QScintilla-" version ".tar.gz"))
3315 (sha256
3316 (base32
3317 "19r0vpqb4m9bqwxmjp9w6x0hgahkrg7zryk78hwgplj7vdbn0d77"))))
3318 (build-system gnu-build-system)
3319 (arguments
3320 `(#:phases
3321 (modify-phases %standard-phases
3322 (replace 'configure
3323 (lambda* (#:key outputs #:allow-other-keys)
3324 (let ((out (assoc-ref outputs "out")))
3325 (chdir "Qt4Qt5")
3326 (substitute* "qscintilla.pro"
3327 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
3328 (string-append out "/lib"))
3329 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
3330 (string-append out "/include"))
3331 (("\\$\\$\\[QT_INSTALL_TRANSLATIONS\\]")
3332 (string-append out "/translations"))
3333 (("\\$\\$\\[QT_INSTALL_DATA\\]")
3334 (string-append out "/lib/qt$${QT_MAJOR_VERSION}"))
3335 (("\\$\\$\\[QT_HOST_DATA\\]")
3336 (string-append out "/lib/qt$${QT_MAJOR_VERSION}")))
3337 (invoke "qmake")))))))
3338 (native-inputs (list qtbase-5))
3339 (home-page "https://www.riverbankcomputing.co.uk/software/qscintilla/intro")
3340 (synopsis "Qt port of the Scintilla C++ editor control")
3341 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
3342 editor control. QScintilla includes features especially useful when editing
3343 and debugging source code. These include support for syntax styling, error
3344 indicators, code completion and call tips.")
3345 (license license:gpl3+)))
3346
3347 (define-public python-qscintilla
3348 (package/inherit qscintilla
3349 (name "python-qscintilla")
3350 (arguments
3351 `(#:configure-flags
3352 (list "--pyqt=PyQt5"
3353 (string-append "--pyqt-sipdir="
3354 (assoc-ref %build-inputs "python-pyqt")
3355 "/share/sip")
3356 (string-append "--qsci-incdir="
3357 (assoc-ref %build-inputs "qscintilla")
3358 "/include")
3359 (string-append "--qsci-libdir="
3360 (assoc-ref %build-inputs "qscintilla")
3361 "/lib"))
3362 #:phases
3363 (modify-phases %standard-phases
3364 (replace 'configure
3365 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
3366 (let ((out (assoc-ref outputs "out"))
3367 (python (assoc-ref inputs "python")))
3368 (chdir "Python")
3369 (apply invoke "python3" "configure.py"
3370 configure-flags)
3371 ;; Install to the right directory
3372 (substitute* '("Makefile"
3373 "Qsci/Makefile")
3374 (("\\$\\(INSTALL_ROOT\\)/gnu/store/[^/]+") out)
3375 (((string-append python "/lib"))
3376 (string-append out "/lib")))
3377 ;; And fix the installed.txt file
3378 (substitute* "installed.txt"
3379 (("/gnu/store/[^/]+") out)))
3380 #t)))))
3381 (inputs
3382 `(("qscintilla" ,qscintilla)
3383 ("python" ,python)
3384 ("python-pyqt" ,python-pyqt)))
3385 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
3386 editor control. QScintilla includes features especially useful when editing
3387 and debugging source code. These include support for syntax styling, error
3388 indicators, code completion and call tips.
3389
3390 This package provides the Python bindings.")))
3391
3392 ;; PyQt only looks for modules in its own directory. It ignores environment
3393 ;; variables such as PYTHONPATH, so we need to build a union package to make
3394 ;; it work.
3395 (define-public python-pyqt+qscintilla
3396 (package/inherit python-pyqt
3397 (name "python-pyqt+qscintilla")
3398 (source #f)
3399 (build-system trivial-build-system)
3400 (arguments
3401 '(#:modules ((guix build union))
3402 #:builder (begin
3403 (use-modules (ice-9 match)
3404 (guix build union))
3405 (match %build-inputs
3406 (((names . directories) ...)
3407 (union-build (assoc-ref %outputs "out")
3408 directories)
3409 #t)))))
3410 (inputs
3411 `(("python-pyqt" ,python-pyqt)
3412 ("python-qscintilla" ,python-qscintilla)))
3413 (synopsis "Union of PyQt and the Qscintilla extension")
3414 (description
3415 "This package contains the union of PyQt and the Qscintilla extension.")))
3416
3417 (define-public qtkeychain
3418 (package
3419 (name "qtkeychain")
3420 (version "0.13.2")
3421 (source
3422 (origin
3423 (method git-fetch)
3424 (uri (git-reference
3425 (url "https://github.com/frankosterfeld/qtkeychain/")
3426 (commit (string-append "v" version))))
3427 (file-name (git-file-name name version))
3428 (sha256
3429 (base32
3430 "1zk6r2vc1q48qs7mw2h47bpgrfbb9r7lf9cwq4sb1a4nls87zznk"))))
3431 (build-system cmake-build-system)
3432 (native-inputs
3433 (list pkg-config qttools-5))
3434 (inputs
3435 (list libsecret qtbase-5))
3436 (arguments
3437 `(#:tests? #f ; No tests included
3438 #:phases
3439 (modify-phases %standard-phases
3440 (add-before 'configure 'set-qt-trans-dir
3441 (lambda _
3442 (substitute* "CMakeLists.txt"
3443 (("\\$\\{qt_translations_dir\\}")
3444 "${CMAKE_INSTALL_PREFIX}/share/qt5/translations")))))))
3445 (home-page "https://github.com/frankosterfeld/qtkeychain")
3446 (synopsis "Qt API to store passwords")
3447 (description
3448 "QtKeychain is a Qt library to store passwords and other secret data
3449 securely. It will not store any data unencrypted unless explicitly requested.")
3450 (license license:bsd-3)))
3451
3452 (define-public qtsolutions
3453 (let ((commit "9568abd142d581b67b86a5f63d823a34b0612702")
3454 (revision "53"))
3455 (package
3456 (name "qtsolutions")
3457 (version (git-version "0" revision commit))
3458 (source
3459 (origin
3460 (method git-fetch)
3461 (uri (git-reference
3462 (url "https://github.com/qtproject/qt-solutions")
3463 (commit commit)))
3464 (file-name (git-file-name name version))
3465 (sha256
3466 (base32 "17fnmassflm3vxi0krpr6fff368jy38cby31a48rban4nqqmgx7n"))
3467 (modules '((guix build utils)
3468 (ice-9 ftw)
3469 (srfi srfi-1)))
3470 (snippet
3471 ;; Unvendor QtLockFile from QtSingleApplication.
3472 '(begin
3473 (with-directory-excursion "qtsingleapplication/src"
3474 (for-each delete-file
3475 (find-files "." "qtlockedfile.*\\.(h|cpp)"))
3476 (substitute* "qtsingleapplication.pri"
3477 ;; Add include path of LockedFile.
3478 (("INCLUDEPATH \\+=")
3479 "INCLUDEPATH += ../../qtlockedfile/src")
3480 ;; Link library of LockedFile.
3481 (("LIBS \\+=")
3482 "LIBS += -lQtSolutions_LockedFile"))
3483 (substitute* '("qtlocalpeer.h" "qtlocalpeer.cpp")
3484 (("#include \"qtlockedfile.*\\.cpp\"") "")
3485 ;; Unwrap namespace added in the vendoring process.
3486 (("QtLP_Private::QtLockedFile")
3487 "QtLockedFile")))
3488 #t))))
3489 (build-system gnu-build-system)
3490 (arguments
3491 `(#:tests? #f ; No target
3492 #:imported-modules
3493 ((guix build copy-build-system)
3494 ,@%gnu-build-system-modules)
3495 #:modules
3496 (((guix build copy-build-system) #:prefix copy:)
3497 (guix build gnu-build-system)
3498 (guix build utils))
3499 #:phases
3500 (modify-phases %standard-phases
3501 (add-after 'unpack 'patch-source
3502 (lambda* (#:key outputs #:allow-other-keys)
3503 (substitute* (find-files "." "common.pri")
3504 ;; Remove unnecessary prefixes/suffixes in library names.
3505 (("qt5") "qt")
3506 (("-head") ""))
3507 ;; Disable building of examples.
3508 (substitute* (find-files "." "\\.pro$")
3509 (("SUBDIRS\\+=examples") ""))
3510 ;; Fix deprecated functions.
3511 (substitute* "qtsoap/src/qtsoap.cpp"
3512 (("toAscii") "toUtf8"))
3513 #t))
3514 (replace 'configure
3515 (lambda _
3516 (for-each (lambda (solution)
3517 (with-directory-excursion solution
3518 (invoke "./configure" "-library")
3519 (invoke "qmake")))
3520 '("qtlockedfile" "qtpropertybrowser" "qtservice"
3521 "qtsingleapplication" "qtsoap"))
3522 #t))
3523 (replace 'build
3524 (lambda _
3525 (for-each (lambda (solution)
3526 (with-directory-excursion solution
3527 (invoke "make")))
3528 '("qtlockedfile" "qtpropertybrowser" "qtservice"
3529 "qtsingleapplication" "qtsoap"))
3530 #t))
3531 (replace 'install
3532 (lambda args
3533 (for-each (lambda (solution)
3534 (with-directory-excursion solution
3535 (apply
3536 (assoc-ref copy:%standard-phases 'install)
3537 #:install-plan
3538 '(("src" "include" #:include-regexp ("\\.h$"))
3539 ("lib" "lib"))
3540 args)))
3541 '("qtlockedfile" "qtpropertybrowser" "qtservice"
3542 "qtsingleapplication" "qtsoap")))))))
3543 (inputs
3544 (list qtbase-5))
3545 (synopsis "Collection of Qt extensions")
3546 (description "QtSolutions is a set of components extending Qt.
3547 @itemize
3548 @item QtLockedFile: A class that extends QFile with advisory locking functions.
3549 @item QtPropertyBrowser: A framework that enables the user to edit a set of
3550 properties.
3551 @item QtService: A helper for writing services such as Unix daemons.
3552 @item QtSingleApplication: A component that provides support for applications
3553 that can be only started once per user.
3554 @item QtSoap: A component that provides basic web service support with version
3555 1.1 of the SOAP protocol.
3556 @end itemize\n")
3557 (home-page "https://doc.qt.io/archives/qq/qq09-qt-solutions.html")
3558 (license (list license:bsd-3
3559 ;; QScriptParser and QScriptGrammar specifically allow
3560 ;; redistribution under GPL3 or LGPL2.1
3561 license:gpl3 license:lgpl2.1)))))
3562
3563 (define-public qwt
3564 (package
3565 (name "qwt")
3566 (version "6.1.5")
3567 (source
3568 (origin
3569 (method url-fetch)
3570 (uri
3571 (string-append "mirror://sourceforge/qwt/qwt/"
3572 version "/qwt-" version ".tar.bz2"))
3573 (sha256
3574 (base32 "0hf0mpca248xlqn7xnzkfj8drf19gdyg5syzklvq8pibxiixwxj0"))))
3575 (build-system gnu-build-system)
3576 (inputs
3577 (list qtbase-5 qtsvg-5 qttools-5))
3578 (arguments
3579 `(#:phases
3580 (modify-phases %standard-phases
3581 (replace 'configure
3582 (lambda* (#:key outputs #:allow-other-keys)
3583 (let* ((out (assoc-ref outputs "out"))
3584 (docdir (string-append out "/share/doc/qwt"))
3585 (incdir (string-append out "/include/qwt"))
3586 (pluginsdir (string-append out "/lib/qt5/plugins/designer"))
3587 (featuresdir (string-append out "/lib/qt5/mkspecs/features")))
3588 (substitute* '("qwtconfig.pri")
3589 (("^(\\s*QWT_INSTALL_PREFIX)\\s*=.*" _ x)
3590 (format #f "~a = ~a\n" x out))
3591 (("^(QWT_INSTALL_DOCS)\\s*=.*" _ x)
3592 (format #f "~a = ~a\n" x docdir))
3593 (("^(QWT_INSTALL_HEADERS)\\s*=.*" _ x)
3594 (format #f "~a = ~a\n" x incdir))
3595 (("^(QWT_INSTALL_PLUGINS)\\s*=.*" _ x)
3596 (format #f "~a = ~a\n" x pluginsdir))
3597 (("^(QWT_INSTALL_FEATURES)\\s*=.*" _ x)
3598 (format #f "~a = ~a\n" x featuresdir)))
3599 (substitute* '("doc/doc.pro")
3600 ;; We'll install them in the 'install-man-pages' phase.
3601 (("^unix:doc\\.files.*") ""))
3602 (invoke "qmake"))))
3603 (add-after 'install 'install-man-pages
3604 (lambda* (#:key outputs #:allow-other-keys)
3605 (let* ((out (assoc-ref outputs "out"))
3606 (man (string-append out "/share/man")))
3607 ;; Remove some incomplete manual pages.
3608 (for-each delete-file (find-files "doc/man/man3" "^_tmp.*"))
3609 (mkdir-p man)
3610 (copy-recursively "doc/man" man)
3611 #t))))))
3612 (home-page "http://qwt.sourceforge.net")
3613 (synopsis "Qt widgets for plots, scales, dials and other technical software
3614 GUI components")
3615 (description
3616 "The Qwt library contains widgets and components which are primarily useful
3617 for technical and scientific purposes. It includes a 2-D plotting widget,
3618 different kinds of sliders, and much more.")
3619 (license
3620 (list
3621 ;; The Qwt license is LGPL2.1 with some exceptions.
3622 (license:non-copyleft "http://qwt.sourceforge.net/qwtlicense.html")
3623 ;; textengines/mathml/qwt_mml_document.{cpp,h} is dual LGPL2.1/GPL3 (either).
3624 license:lgpl2.1 license:gpl3))))
3625
3626 (define-public qtwebkit
3627 (package
3628 (name "qtwebkit")
3629 (version "5.212.0-alpha4")
3630 (source
3631 (origin
3632 (method url-fetch)
3633 (uri (string-append "https://github.com/annulen/webkit/releases/download/"
3634 "qtwebkit-" version "/qtwebkit-" version ".tar.xz"))
3635 (sha256
3636 (base32
3637 "1rm9sjkabxna67dl7myx9d9vpdyfxfdhrk9w7b94srkkjbd2d8cw"))
3638 (patches (search-patches "qtwebkit-pbutils-include.patch"
3639 "qtwebkit-fix-building-with-bison-3.7.patch"
3640 "qtwebkit-fix-building-with-glib-2.68.patch"
3641 "qtwebkit-fix-building-with-icu-68.patch"
3642 "qtwebkit-fix-building-with-python-3.9.patch"))))
3643 (build-system cmake-build-system)
3644 (native-inputs
3645 (list perl
3646 python
3647 ruby
3648 bison
3649 flex
3650 gperf
3651 pkg-config))
3652 (inputs
3653 `(("icu" ,icu4c)
3654 ("glib" ,glib)
3655 ("gst-plugins-base" ,gst-plugins-base)
3656 ("libjpeg" ,libjpeg-turbo)
3657 ("libpng" ,libpng)
3658 ("libwebp" ,libwebp)
3659 ("sqlite" ,sqlite)
3660 ("fontconfig" ,fontconfig)
3661 ("libxrender" ,libxrender)
3662 ("qtbase" ,qtbase-5)
3663 ("qtdeclarative-5" ,qtdeclarative-5)
3664 ("qtlocation" ,qtlocation)
3665 ("qtmultimedia-5" ,qtmultimedia-5)
3666 ("qtsensors" ,qtsensors)
3667 ("qtwebchannel-5" ,qtwebchannel-5)
3668 ("libxml2" ,libxml2)
3669 ("libxslt" ,libxslt)
3670 ("libx11" ,libx11)
3671 ("libxcomposite" ,libxcomposite)))
3672 (arguments
3673 `(#:tests? #f ; no apparent tests; it might be necessary to set
3674 ; ENABLE_API_TESTS, see CMakeLists.txt
3675
3676 ;; Parallel builds fail due to a race condition:
3677 ;; <https://bugs.gnu.org/34062>.
3678 #:parallel-build? #f
3679
3680 #:configure-flags (list ;"-DENABLE_API_TESTS=TRUE"
3681 "-DPORT=Qt"
3682 "-DUSE_LIBHYPHEN=OFF"
3683 "-DUSE_SYSTEM_MALLOC=ON"
3684 ;; XXX: relative dir installs to build dir?
3685 (string-append "-DECM_MKSPECS_INSTALL_DIR="
3686 %output "/lib/qt5/mkspecs/modules")
3687 ;; Sacrifice a little speed in order to link
3688 ;; libraries and test executables in a
3689 ;; reasonable amount of memory.
3690 "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,--no-keep-memory"
3691 "-DCMAKE_EXE_LINKER_FLAGS=-Wl,--no-keep-memory")))
3692 (home-page "https://www.webkit.org")
3693 (synopsis "Web browser engine and classes to render and interact with web
3694 content")
3695 (description "QtWebKit provides a Web browser engine that makes it easy to
3696 embed content from the World Wide Web into your Qt application. At the same
3697 time Web content can be enhanced with native controls.")
3698 ;; Building QtWebKit takes around 13 hours on an AArch64 machine. Give some
3699 ;; room for slower or busy hardware.
3700 (properties '((timeout . 64800))) ;18 hours
3701
3702 ;; XXX: This consumes too much RAM to successfully build on AArch64 (e.g.,
3703 ;; SoftIron OverDrive with 8 GiB of RAM), so instead of wasting resources,
3704 ;; disable it on non-Intel platforms.
3705 (supported-systems '("x86_64-linux" "i686-linux"))
3706
3707 (license license:lgpl2.1+)))
3708
3709 (define-public dotherside
3710 (package
3711 (name "dotherside")
3712 (version "0.9.0")
3713 (source
3714 (origin
3715 (method git-fetch)
3716 (uri (git-reference
3717 (url "https://github.com/filcuc/DOtherSide")
3718 (commit (string-append "v" version))))
3719 (file-name (git-file-name name version))
3720 (sha256
3721 (base32
3722 "13n2qb8q9jz4ihwlbs7y15lw90w9113gb1bgnb1dggpxkj64r953"))))
3723 (build-system cmake-build-system)
3724 (native-inputs
3725 (list qttools-5))
3726 (inputs
3727 ;; TODO: Support Qt 6 (requires qtdeclarative of Qt6).
3728 (list qtbase-5 qtdeclarative-5))
3729 (home-page "https://filcuc.github.io/DOtherSide/index.html")
3730 (synopsis "C language library for creating bindings for the Qt QML language")
3731 (description
3732 "DOtherSide is a C language library for creating bindings for the
3733 QT QML language. The following features are implementable from
3734 a binding language:
3735 @itemize
3736 @item Creating custom QObject
3737 @item Creating custom QAbstractListModels
3738 @item Creating custom properties, signals and slots
3739 @item Creating from QML QObject defined in the binded language
3740 @item Creating from Singleton QML QObject defined in the binded language
3741 @end itemize\n")
3742 (license license:lgpl3))) ;version 3 only (+ exception)
3743
3744 ;; There have been no public releases yet.
3745 (define-public qtcolorwidgets
3746 (let ((commit "a95f72e935fe9e046061a1d1c3930cbfbcb533e0")
3747 (revision "1"))
3748 (package
3749 (name "qtcolorwidgets")
3750 (version (git-version "0" revision commit))
3751 (source (origin
3752 (method git-fetch)
3753 (uri (git-reference
3754 (url "https://gitlab.com/mattia.basaglia/Qt-Color-Widgets")
3755 (commit commit)))
3756 (file-name (git-file-name name version))
3757 (sha256
3758 (base32
3759 "0dkiwlqh2gwhlp78c1fmchj3shl4p9inspcl96ya5aa8mn6kydy8"))))
3760 (build-system cmake-build-system)
3761 (arguments `(#:tests? #f)) ; There are no tests
3762 (native-inputs
3763 (list qttools-5))
3764 (inputs
3765 (list qtbase-5))
3766 (home-page "https://gitlab.com/mattia.basaglia/Qt-Color-Widgets")
3767 (synopsis "Color management widgets")
3768 (description "QtColorWidgets provides a Qt color dialog that is more
3769 user-friendly than the default @code{QColorDialog} and several other
3770 color-related widgets.")
3771 ;; Includes a license exception for combining with GPL2 code.
3772 (license license:lgpl3+))))
3773
3774 (define-public qcustomplot
3775 (package
3776 (name "qcustomplot")
3777 (version "2.1.0")
3778 (source
3779 (origin
3780 (method url-fetch)
3781 (uri (string-append "https://www.qcustomplot.com/release/"
3782 version "fixed" "/QCustomPlot.tar.gz"))
3783 (sha256
3784 (base32 "1324kqyj1v1f8k8d7b15gc3apwz9qxx52p86hvchg33hjdlqhskx"))))
3785 (native-inputs
3786 `(("qcustomplot-sharedlib"
3787 ,(origin
3788 (method url-fetch)
3789 (uri (string-append "https://www.qcustomplot.com/release/"
3790 version "fixed" "/QCustomPlot-sharedlib.tar.gz"))
3791 (sha256
3792 (base32 "0vp8lpxvd1nlp4liqrlvslpqrgfn0wpiwizzdsjbj22zzb8vxikc"))))))
3793 (inputs
3794 (list qtbase-5))
3795 (build-system gnu-build-system)
3796 (arguments
3797 `(#:phases
3798 (modify-phases %standard-phases
3799 (add-after 'unpack 'unpack-extra-files
3800 (lambda* (#:key inputs #:allow-other-keys)
3801 (invoke "tar" "-xvf" (assoc-ref inputs "qcustomplot-sharedlib"))))
3802 (replace 'configure
3803 (lambda* (#:key outputs #:allow-other-keys)
3804 (chdir "qcustomplot-sharedlib/sharedlib-compilation")
3805 (substitute* "sharedlib-compilation.pro"
3806 ;; Don't build debug library.
3807 (("debug_and_release")
3808 "release"))
3809 (invoke "qmake"
3810 (string-append "DESTDIR="
3811 (assoc-ref outputs "out")
3812 "/lib"))))
3813 (add-after 'install 'install-header
3814 (lambda* (#:key outputs #:allow-other-keys)
3815 (install-file "../../qcustomplot.h"
3816 (string-append (assoc-ref outputs "out")
3817 "/include")))))))
3818 (home-page "https://www.qcustomplot.com/")
3819 (synopsis "Qt widget for plotting and data visualization")
3820 (description
3821 "QCustomPlot is a Qt C++ widget providing 2D plots, graphs and charts.")
3822 (license license:gpl3+)))
3823
3824 ;; TODO: Split shiboken2 binding generator into a dedicated output.
3825 ;; This executable requires libxml2, libxslt, clang-toolchain at runtime.
3826 ;; The libshiboken library only requires Qt and Python at runtime.
3827 (define-public python-shiboken-2
3828 (package
3829 (name "python-shiboken-2")
3830 (version "5.15.5")
3831 (source (origin
3832 (method url-fetch)
3833 (uri (string-append "https://download.qt.io/official_releases"
3834 "/QtForPython/pyside2/PySide2-" version
3835 "-src/pyside-setup-opensource-src-"
3836 version ".tar.xz"))
3837 (sha256
3838 (base32
3839 "0cwvw6695215498rsbm2xzkwaxdr3w7zfvy4kc62c01k6pxs881r"))))
3840 (build-system cmake-build-system)
3841 (inputs
3842 (list clang-toolchain
3843 libxml2
3844 libxslt
3845 python-wrapper
3846 qtbase-5
3847 qtxmlpatterns))
3848 (arguments
3849 (list
3850 #:tests? #f
3851 ;; FIXME: Building tests fails
3852 #:configure-flags #~(list "-DBUILD_TESTS=off")
3853 #:phases
3854 #~(modify-phases %standard-phases
3855 (add-after 'unpack 'use-shiboken-dir-only
3856 (lambda _ (chdir "sources/shiboken2") #t))
3857 (add-before 'configure 'make-files-writable-and-update-timestamps
3858 (lambda _
3859 ;; The build scripts need to modify some files in
3860 ;; the read-only source directory, and also attempts
3861 ;; to create Zip files which fails because the Zip
3862 ;; format does not support timestamps before 1980.
3863 (let ((circa-1980 (* 10 366 24 60 60)))
3864 (for-each (lambda (file)
3865 (make-file-writable file)
3866 (utime file circa-1980 circa-1980))
3867 (find-files ".")))
3868 #t))
3869 (add-before 'configure 'set-build-env
3870 (lambda _
3871 (let ((llvm #$(this-package-input "clang-toolchain")))
3872 (setenv "CLANG_INSTALL_DIR" llvm)
3873 #t))))))
3874 (home-page "https://wiki.qt.io/Qt_for_Python")
3875 (synopsis
3876 "Shiboken generates bindings for C++ libraries using CPython source code")
3877 (description
3878 "Shiboken generates bindings for C++ libraries using CPython source code")
3879 (license
3880 (list
3881 ;; The main code is GPL3 or LGPL3.
3882 ;; Examples are BSD-3.
3883 license:gpl3
3884 license:lgpl3
3885 license:bsd-3))))
3886
3887 (define-public python-shiboken-6
3888 (package
3889 (inherit python-shiboken-2)
3890 (name "python-shiboken-6")
3891 (version "6.3.1")
3892 (source (origin
3893 (method url-fetch)
3894 (uri (string-append "https://download.qt.io/official_releases"
3895 "/QtForPython/pyside6/PySide6-" version
3896 "-src/pyside-setup-opensource-src-"
3897 version ".tar.xz"))
3898 (sha256
3899 (base32
3900 "0xwri69nnbhn6fajm7l045r0s0qv8nlq6qj8wcj87srli3b5xa75"))))
3901 (build-system cmake-build-system)
3902 (inputs
3903 (modify-inputs (package-inputs python-shiboken-2)
3904 (replace "qtbase" qtbase)
3905 (delete "qtxmlpatterns")))
3906 (arguments
3907 (substitute-keyword-arguments (package-arguments python-shiboken-2)
3908 ((#:phases p)
3909 #~(modify-phases #$p
3910 (replace 'use-shiboken-dir-only
3911 (lambda _ (chdir "sources/shiboken6") #t))))
3912 ((#:configure-flags flags)
3913 #~(cons*
3914 ;; The RUNPATH of shibokenmodule contains the entry in build
3915 ;; directory instead of install directory.
3916 "-DCMAKE_SKIP_RPATH=TRUE"
3917 (string-append "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath="
3918 #$output "/lib")
3919 #$flags))))))
3920
3921 (define-public python-pyside-2
3922 (package
3923 (name "python-pyside-2")
3924 (version (package-version python-shiboken-2))
3925 (source (package-source python-shiboken-2))
3926 (build-system cmake-build-system)
3927 (inputs
3928 (list qtbase-5
3929 qtdatavis3d
3930 qtdeclarative-5
3931 qtlocation
3932 qtmultimedia-5
3933 qtquickcontrols-5
3934 qtquickcontrols2-5
3935 qtscript
3936 qtscxml
3937 qtsensors
3938 qtspeech
3939 qtsvg-5
3940 qttools-5
3941 qtwebchannel-5
3942 qtwebengine-5
3943 qtwebsockets-5
3944 qtx11extras
3945 qtxmlpatterns))
3946 (propagated-inputs
3947 (list python-shiboken-2))
3948 (native-inputs
3949 (list python-wrapper))
3950 (arguments
3951 (list
3952 #:tests? #f
3953 ;; FIXME: Building tests fail.
3954 #:configure-flags
3955 #~(list "-DBUILD_TESTS=FALSE"
3956 (string-append "-DPYTHON_EXECUTABLE="
3957 (search-input-file %build-inputs
3958 "/bin/python")))
3959 #:modules '((guix build cmake-build-system)
3960 (guix build utils)
3961 (srfi srfi-1))
3962 #:phases
3963 #~(modify-phases %standard-phases
3964 (add-after 'unpack 'go-to-source-dir
3965 (lambda _ (chdir "sources/pyside2") #t))
3966 (add-after 'go-to-source-dir 'fix-qt-module-detection
3967 (lambda _
3968 ;; Activate qt module support even if it not in the same
3969 ;; directory as qtbase.
3970 (substitute* "../cmake_helpers/helpers.cmake"
3971 (("\\(\"\\$\\{found_basepath\\}\" GREATER \"0\"\\)")
3972 "true"))
3973 ;; Add include directories for qt modules.
3974 (let ((dirs (map (lambda (path)
3975 (string-append path "/include/qt5"))
3976 (list
3977 #$@(map (lambda (name)
3978 (this-package-input name))
3979 '("qtdatavis3d"
3980 "qtdeclarative"
3981 "qtlocation"
3982 "qtmultimedia"
3983 "qtquickcontrols"
3984 "qtquickcontrols2"
3985 "qtscript"
3986 "qtscxml"
3987 "qtsensors"
3988 "qtspeech"
3989 "qtsvg"
3990 "qttools"
3991 "qtwebchannel"
3992 "qtwebengine"
3993 "qtwebsockets"
3994 "qtx11extras"
3995 "qtxmlpatterns"))))))
3996 (substitute* "cmake/Macros/PySideModules.cmake"
3997 (("\\$\\{PATH_SEP\\}\\$\\{core_includes\\}" all)
3998 (fold (lambda (dir paths)
3999 (string-append paths "${PATH_SEP}" dir))
4000 all
4001 dirs)))
4002 (setenv "CXXFLAGS" (fold (lambda (dir paths)
4003 (string-append paths " -I" dir))
4004 ""
4005 dirs))))))))
4006 (home-page "https://wiki.qt.io/Qt_for_Python")
4007 (synopsis
4008 "The Qt for Python product enables the use of Qt5 APIs in Python applications")
4009 (description
4010 "The Qt for Python product enables the use of Qt5 APIs in Python
4011 applications. It lets Python developers utilize the full potential of Qt,
4012 using the PySide2 module. The PySide2 module provides access to the
4013 individual Qt modules such as QtCore, QtGui,and so on. Qt for Python also
4014 comes with the Shiboken2 CPython binding code generator, which can be used to
4015 generate Python bindings for your C or C++ code.")
4016 (license (list
4017 license:lgpl3
4018 ;;They state that:
4019 ;; this file may be used under the terms of the GNU General
4020 ;; Public License version 2.0 or (at your option) the GNU
4021 ;; General Public license version 3 or any later version
4022 ;; approved by the KDE Free Qt Foundation.
4023 ;; Thus, it is currently v2 or v3, but no "+".
4024 license:gpl3
4025 license:gpl2))))
4026
4027 (define-public python-pyside-6
4028 (package
4029 (inherit python-pyside-2)
4030 (name "python-pyside-6")
4031 (version (package-version python-shiboken-6))
4032 (source (package-source python-shiboken-6))
4033 ;; TODO: Add more Qt components if available.
4034 (inputs
4035 (list qtbase
4036 qtdeclarative
4037 qtmultimedia
4038 qtnetworkauth
4039 qtpositioning
4040 qtsvg
4041 qttools
4042 qtwebchannel
4043 qtwebengine
4044 qtwebsockets))
4045 (propagated-inputs
4046 (list python-shiboken-6))
4047 (native-inputs
4048 (list python-wrapper))
4049 (arguments
4050 (list
4051 #:tests? #f
4052 #:configure-flags
4053 #~(list "-DBUILD_TESTS=FALSE"
4054 (string-append "-DPYTHON_EXECUTABLE="
4055 (search-input-file %build-inputs
4056 "/bin/python")))
4057 #:phases
4058 #~(modify-phases %standard-phases
4059 (add-after 'unpack 'go-to-source-dir
4060 (lambda _ (chdir "sources/pyside6") #t))
4061 (add-after 'go-to-source-dir 'fix-qt-module-detection
4062 (lambda _
4063 (substitute* "cmake/PySideHelpers.cmake"
4064 (("\\(\"\\$\\{found_basepath\\}\" GREATER \"0\"\\)")
4065 "true"))
4066 (let ((dirs (map (lambda (path)
4067 (string-append path "/include/qt6"))
4068 (list
4069 #$@(map (lambda (name)
4070 (this-package-input name))
4071 '("qtdeclarative"
4072 "qtmultimedia"
4073 "qtnetworkauth"
4074 "qtpositioning"
4075 "qtsvg"
4076 "qttools"
4077 "qtwebchannel"
4078 "qtwebengine"
4079 "qtwebsockets"))))))
4080 (substitute* "cmake/Macros/PySideModules.cmake"
4081 (("set\\(shiboken_include_dir_list " all)
4082 (string-append all (string-join dirs ";") " ")))
4083 (setenv "CXXFLAGS"
4084 (string-join
4085 (map (lambda (dir)
4086 (string-append "-I" dir))
4087 dirs)
4088 " "))))))))
4089 (synopsis
4090 "The Qt for Python product enables the use of Qt6 APIs in Python applications")
4091 (description
4092 "The Qt for Python product enables the use of Qt6 APIs in Python
4093 applications. It lets Python developers utilize the full potential of Qt,
4094 using the PySide6 module. The PySide6 module provides access to the
4095 individual Qt modules such as QtCore, QtGui,and so on. Qt for Python also
4096 comes with the Shiboken6 CPython binding code generator, which can be used to
4097 generate Python bindings for your C or C++ code.")))
4098
4099 (define-public python-pyside-2-tools
4100 (package
4101 (name "python-pyside-2-tools")
4102 (version (package-version python-shiboken-2))
4103 (source (package-source python-shiboken-2))
4104 (build-system cmake-build-system)
4105 (inputs
4106 (list python-pyside-2 python-shiboken-2 qtbase-5))
4107 (native-inputs
4108 (list python-wrapper))
4109 (arguments
4110 (list
4111 #:tests? #f
4112 #:configure-flags
4113 #~(list "-DBUILD_TESTS=off"
4114 (string-append "-DPYTHON_EXECUTABLE="
4115 (search-input-file %build-inputs
4116 "/bin/python")))
4117 #:phases
4118 #~(modify-phases %standard-phases
4119 (add-after 'unpack 'go-to-source-dir
4120 (lambda _ (chdir "sources/pyside2-tools") #t)))))
4121 (home-page "https://wiki.qt.io/Qt_for_Python")
4122 (synopsis
4123 "Command line tools for PySide2")
4124 (description
4125 "Python-pyside-2-tools contains lupdate, rcc and uic tools for PySide2")
4126 (license license:gpl2)))
4127
4128 (define-public libqglviewer
4129 (package
4130 (name "libqglviewer")
4131 (version "2.7.2")
4132 (source (origin
4133 (method url-fetch)
4134 (uri
4135 (string-append "http://libqglviewer.com/src/libQGLViewer-"
4136 version ".tar.gz"))
4137 (sha256
4138 (base32
4139 "023w7da1fyn2z69nbkp2rndiv886zahmc5cmira79zswxjfpklp2"))))
4140 (build-system gnu-build-system)
4141 (arguments
4142 '(#:tests? #f ; no check target
4143 #:make-flags
4144 (list (string-append "PREFIX="
4145 (assoc-ref %outputs "out")))
4146 #:phases
4147 (modify-phases %standard-phases
4148 (replace 'configure
4149 (lambda* (#:key make-flags #:allow-other-keys)
4150 (apply invoke (cons "qmake" make-flags)))))))
4151 (native-inputs
4152 (list qtbase-5 qttools-5))
4153 (inputs
4154 (list glu))
4155 (home-page "http://libqglviewer.com")
4156 (synopsis "Qt-based C++ library for the creation of OpenGL 3D viewers")
4157 (description
4158 "@code{libQGLViewer} is a C++ library based on Qt that eases the creation
4159 of OpenGL 3D viewers.
4160
4161 It provides some of the typical 3D viewer functionalities, such as the
4162 possibility to move the camera using the mouse, which lacks in most of the
4163 other APIs. Other features include mouse manipulated frames, interpolated
4164 keyFrames, object selection, stereo display, screenshot saving and much more.
4165 It can be used by OpenGL beginners as well as to create complex applications,
4166 being fully customizable and easy to extend.")
4167 ;; According to LICENSE, either version 2 or version 3 of the GNU GPL may
4168 ;; be used.
4169 (license (list license:gpl2 license:gpl3))))
4170
4171 (define-public qhexedit
4172 (package
4173 (name "qhexedit")
4174 (version "0.8.9")
4175 (source
4176 (origin
4177 (method git-fetch)
4178 (uri (git-reference
4179 (url "https://github.com/Simsys/qhexedit2")
4180 (commit (string-append "v" version))))
4181 (file-name (git-file-name name version))
4182 (sha256
4183 (base32 "1j333kiwhbidphdx86yilkaivgl632spfh6fqx93bc80gk4is3xa"))))
4184 (build-system gnu-build-system)
4185 (arguments
4186 `(#:phases
4187 (modify-phases %standard-phases
4188 (add-after 'unpack 'fix-path
4189 (lambda* (#:key outputs #:allow-other-keys)
4190 (substitute* "src/qhexedit.pro"
4191 (("^unix:DESTDIR = /usr/lib")
4192 (string-append "unix:DESTDIR = "
4193 (assoc-ref outputs "out") "/lib")))))
4194 (replace 'configure
4195 (lambda _
4196 (chdir "src")
4197 (invoke "qmake" "qhexedit.pro")))
4198 (add-after 'install 'install-headers
4199 (lambda* (#:key outputs #:allow-other-keys)
4200 (let* ((out (assoc-ref outputs "out"))
4201 (include-dir (string-append out "/include")))
4202 (mkdir-p include-dir)
4203 (for-each (lambda (file)
4204 (install-file file include-dir))
4205 (find-files "." "\\.h$"))))))))
4206 (inputs (list qtbase-5))
4207 (native-inputs (list qttools-5))
4208 (home-page "https://simsys.github.io")
4209 (synopsis "Binary editor widget for Qt")
4210 (description
4211 "@code{QHexEdit} is a hex editor widget for the Qt framework. It is a
4212 simple editor for binary data, just like @code{QPlainTextEdit} is for text
4213 data.")
4214 (license license:lgpl2.1)))
4215
4216 (define-public soqt
4217 (let ((commit-ref "fb8f655632bb9c9c60e0ff9fa69a5ba22d3ff99d")
4218 (revision "1"))
4219 (package
4220 (name "soqt")
4221 (version (git-version "1.6.0" revision commit-ref))
4222 (source
4223 (origin
4224 (method git-fetch)
4225 (uri (git-reference
4226 (url "https://github.com/coin3d/soqt")
4227 (commit commit-ref)
4228 (recursive? #t)))
4229 (file-name (git-file-name name version))
4230 (sha256
4231 (base32 "16vikb3fy8rmk10sg5g0gy2c343hi3x7zccsga90ssnkzpq6m032"))))
4232 (build-system cmake-build-system)
4233 (arguments '(#:tests? #f)) ; There are no tests
4234 (native-inputs
4235 (list pkg-config cmake))
4236 (inputs
4237 (list qtbase-5 coin3D-4))
4238 (home-page "https://github.com/coin3d/soqt")
4239 (synopsis "Qt GUI component toolkit library for Coin")
4240 (description "SoQt is a Qt GUI component toolkit library for Coin. It is
4241 also compatible with SGI and TGS Open Inventor, and the API is based on the API
4242 of the InventorXt GUI component toolkit.")
4243 (license license:bsd-3))))
4244
4245 (define-public libdbusmenu-qt
4246 (package
4247 (name "libdbusmenu-qt")
4248 (version "0.9.3+16.04.20160218-0ubuntu1")
4249 (source
4250 (origin
4251 (method git-fetch)
4252 ;; Download from github rather than launchpad because launchpad trunk
4253 ;; tarball hash is not deterministic.
4254 (uri (git-reference
4255 (url "https://github.com/unity8-team/libdbusmenu-qt")
4256 (commit version)))
4257 (file-name (git-file-name name version))
4258 (sha256
4259 (base32 "0b7ii1cvmpcyl79gqal9c3va9m55h055s4hx7fpxkhhqs9463ggg"))))
4260 (build-system cmake-build-system)
4261 (arguments
4262 ;; XXX: Tests require a dbus session and some icons.
4263 '(#:tests? #f))
4264 (native-inputs
4265 (list doxygen))
4266 (inputs
4267 (list qtbase-5))
4268 (home-page "https://launchpad.net/libdbusmenu-qt")
4269 (synopsis "Qt implementation of the DBusMenu spec")
4270 (description "This library provides a Qt implementation of the DBusMenu
4271 protocol. The DBusMenu protocol makes it possible for applications to export
4272 and import their menus over DBus.")
4273 (license license:lgpl2.1+)))
4274
4275 (define-public kdsoap
4276 (package
4277 (name "kdsoap")
4278 (version "2.0.0")
4279 (source
4280 (origin
4281 (method url-fetch)
4282 (uri (string-append "https://github.com/KDAB/KDSoap/releases/download/"
4283 "kdsoap-" version "/kdsoap-" version ".tar.gz"))
4284 (sha256
4285 (base32
4286 "1vh4rzb09kks1ilay1y60q7gf64gwzdwsca60hmx1xx69w8672fi"))))
4287 (build-system qt-build-system)
4288 (inputs `(("qtbase" ,qtbase-5)))
4289 (arguments
4290 '(#:configure-flags '("-DKDSoap_TESTS=true")
4291 #:phases
4292 (modify-phases %standard-phases
4293 (replace 'check
4294 (lambda* (#:key tests? #:allow-other-keys)
4295 (when tests?
4296 (invoke "ctest" "-E" ;; These tests try connect to the internet.
4297 "(kdsoap-webcalls|kdsoap-webcalls_wsdl|kdsoap-test_calc)"))
4298 #t)))))
4299 (home-page "https://www.kdab.com/development-resources/qt-tools/kd-soap/")
4300 (synopsis "Qt SOAP component")
4301 (description "KD SOAP is a tool for creating client applications for web
4302 services using the XML based SOAP protocol and without the need for a dedicated
4303 web server.")
4304 (license (list license:gpl2 license:gpl3))))
4305
4306 ;;;
4307 ;;; Avoid adding new packages to the end of this file. To reduce the chances
4308 ;;; of a merge conflict, place them above by existing packages with similar
4309 ;;; functionality or similar names.
4310 ;;;