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