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