gnu: python-pyqtwebengine: Update to 5.15.5.
[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 Maxim Cournoyer <maxim.cournoyer@gmail.com>
23 ;;; Copyright © 2021 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 base)
59 #:use-module (gnu packages bison)
60 #:use-module (gnu packages cmake)
61 #:use-module (gnu packages compression)
62 #:use-module (gnu packages cups)
63 #:use-module (gnu packages curl)
64 #:use-module (gnu packages databases)
65 #:use-module (gnu packages documentation)
66 #:use-module (gnu packages enchant)
67 #:use-module (gnu packages fontutils)
68 #:use-module (gnu packages flex)
69 #:use-module (gnu packages freedesktop)
70 #:use-module (gnu packages gcc)
71 #:use-module (gnu packages ghostscript)
72 #:use-module (gnu packages gl)
73 #:use-module (gnu packages glib)
74 #:use-module (gnu packages gnome)
75 #:use-module (gnu packages gnupg)
76 #:use-module (gnu packages gperf)
77 #:use-module (gnu packages graphics)
78 #:use-module (gnu packages gstreamer)
79 #:use-module (gnu packages gtk)
80 #:use-module (gnu packages icu4c)
81 #:use-module (gnu packages image)
82 #:use-module (gnu packages kde-frameworks)
83 #:use-module (gnu packages libevent)
84 #:use-module (gnu packages linux)
85 #:use-module (gnu packages llvm)
86 #:use-module (gnu packages maths)
87 #:use-module (gnu packages networking)
88 #:use-module (gnu packages ninja)
89 #:use-module (gnu packages node)
90 #:use-module (gnu packages nss)
91 #:use-module (gnu packages pciutils)
92 #:use-module (gnu packages pcre)
93 #:use-module (gnu packages perl)
94 #:use-module (gnu packages pkg-config)
95 #:use-module (gnu packages pulseaudio)
96 #:use-module (gnu packages protobuf)
97 #:use-module (gnu packages python)
98 #:use-module (gnu packages python-build)
99 #:use-module (gnu packages python-xyz)
100 #:use-module (gnu packages regex)
101 #:use-module (gnu packages ruby)
102 #:use-module (gnu packages sdl)
103 #:use-module (gnu packages serialization)
104 #:use-module (gnu packages sqlite)
105 #:use-module (gnu packages telephony)
106 #:use-module (gnu packages tls)
107 #:use-module (gnu packages valgrind)
108 #:use-module (gnu packages video)
109 #:use-module (gnu packages vulkan)
110 #:use-module (gnu packages xdisorg)
111 #:use-module (gnu packages xiph)
112 #:use-module (gnu packages xorg)
113 #:use-module (gnu packages xml)
114 #:use-module (srfi srfi-1))
115
116 (define-public qite
117 (let ((commit "75fb3b6bbd5c6a5a8fc35e08a6efbfb588ed546a")
118 (revision "74"))
119 (package
120 (name "qite")
121 (version (git-version "0" revision commit))
122 (source
123 (origin
124 (method git-fetch)
125 (uri
126 (git-reference
127 (url "https://github.com/Ri0n/qite")
128 (commit commit)))
129 (file-name (git-file-name name version))
130 (sha256
131 (base32 "0jmmgy9pvk9hwwph1nwy7hxhczy8drhl4ymhnjjn6yx7bckssvsq"))))
132 (build-system qt-build-system)
133 (arguments
134 `(#:tests? #f ; no target
135 #:phases
136 (modify-phases %standard-phases
137 (add-after 'unpack 'chdir
138 (lambda _
139 (chdir "libqite")
140 #t)))))
141 (inputs
142 (list qtbase-5 qtmultimedia))
143 (home-page "https://github.com/Ri0n/qite/")
144 (synopsis "Qt Interactive Text Elements")
145 (description "Qite manages interactive elements on QTextEdit.")
146 (license license:asl2.0))))
147
148 (define-public qt5ct
149 (package
150 (name "qt5ct")
151 (version "1.5")
152 (source
153 (origin
154 (method url-fetch)
155 (uri
156 (string-append "mirror://sourceforge/qt5ct/qt5ct-" version ".tar.bz2"))
157 (sha256
158 (base32 "14742vs32m98nbfb5mad0i8ciff5f45gfcb5v03p4hh2dvhhqgfn"))))
159 (build-system gnu-build-system)
160 (arguments
161 `(#:tests? #f ; No target
162 #:imported-modules
163 (,@%qt-build-system-modules)
164 #:modules
165 ((guix build gnu-build-system)
166 ((guix build qt-build-system)
167 #:prefix qt:)
168 (guix build utils))
169 #:phases
170 (modify-phases %standard-phases
171 (add-after 'unpack 'patch
172 (lambda* (#:key inputs #:allow-other-keys)
173 (substitute* "qt5ct.pro"
174 (("\\$\\$\\[QT_INSTALL_BINS\\]/lrelease")
175 (search-input-file inputs "/bin/lrelease")))))
176 (replace 'configure
177 (lambda* (#:key outputs #:allow-other-keys)
178 (let* ((out (assoc-ref outputs "out")))
179 (invoke "qmake"
180 (string-append "PREFIX=" out)
181 (string-append "BINDIR=" out "/bin")
182 (string-append "DATADIR=" out "/share")
183 (string-append "PLUGINDIR=" out "/lib/qt5/plugins")))))
184 (add-after 'install 'qt-wrap
185 (assoc-ref qt:%standard-phases 'qt-wrap)))))
186 (native-inputs
187 (list qttools))
188 (inputs
189 (list qtbase-5 qtsvg))
190 (synopsis "Qt5 Configuration Tool")
191 (description "Qt5CT is a program that allows users to configure Qt5
192 settings (such as icons, themes, and fonts) in desktop environments or
193 window managers, that don't provide Qt integration by themselves.")
194 (home-page "https://qt5ct.sourceforge.io/")
195 (license license:bsd-2)))
196
197 (define-public materialdecoration
198 (let ((commit "6a5de23f2e5162fbee39d16f938473ff970a2ec0")
199 (revision "9"))
200 (package
201 (name "materialdecoration")
202 (version
203 (git-version "1.1.0" revision commit))
204 (source
205 (origin
206 (method git-fetch)
207 (uri
208 (git-reference
209 (url "https://github.com/lirios/materialdecoration.git")
210 (commit commit)))
211 (file-name
212 (git-file-name name version))
213 (sha256
214 (base32 "1zdrcb39fhhmn76w8anv1dnspz26pdl6izmj1mlm02aza4y8ffp4"))
215 (modules '((guix build utils)
216 (ice-9 ftw)
217 (srfi srfi-1)))
218 (snippet
219 `(begin
220 (delete-file-recursively "cmake/3rdparty")))))
221 (build-system qt-build-system)
222 (arguments
223 `(#:tests? #f ; No target
224 #:configure-flags
225 ,#~(list
226 (string-append "-DCMAKE_CXX_FLAGS=-I"
227 #$(this-package-input "qtbase")
228 "/include/qt5/QtXkbCommonSupport/"
229 #$(package-version qtbase-5)))))
230 (native-inputs
231 (list cmake-shared extra-cmake-modules pkg-config))
232 (inputs
233 `(("qtbase" ,qtbase-5)
234 ("qtwayland" ,qtwayland)
235 ("wayland" ,wayland)
236 ("xkbcommon" ,libxkbcommon)))
237 (synopsis "Material Decoration for Qt")
238 (description "MaterialDecoration is a client-side decoration for Qt
239 applications on Wayland.")
240 (home-page "https://github.com/lirios/materialdecoration")
241 (license license:lgpl3+))))
242
243 (define-public grantlee
244 (package
245 (name "grantlee")
246 (version "5.2.0")
247 (source
248 (origin
249 (method git-fetch)
250 (uri (git-reference
251 (url "https://github.com/steveire/grantlee")
252 (commit (string-append "v" version))))
253 (file-name (git-file-name name version))
254 (sha256
255 (base32 "02dyqxjyxiqxrlz5g7v9ly8f095vs3iha39l75q6s8axs36y01lq"))))
256 (native-inputs
257 ;; Optional: lcov and cccc, both are for code coverage
258 (list doxygen))
259 (inputs
260 (list qtbase-5 qtdeclarative qtscript))
261 (build-system cmake-build-system)
262 (arguments
263 `(#:phases
264 (modify-phases %standard-phases
265 (add-before 'check 'check-setup
266 (lambda _
267 ;; make Qt render "offscreen", required for tests
268 (setenv "QT_QPA_PLATFORM" "offscreen")
269 #t)))))
270 (home-page "https://github.com/steveire/grantlee")
271 (synopsis "Libraries for text templating with Qt")
272 (description "Grantlee Templates can be used for theming and generation of
273 other text such as code. The syntax uses the syntax of the Django template
274 system, and the core design of Django is reused in Grantlee.")
275 (license license:lgpl2.1+)))
276
277 (define (qt5-urls component version)
278 "Return a list of URLs for VERSION of the Qt5 COMPONENT."
279 ;; We can't use a mirror:// scheme because these URLs are not exact copies:
280 ;; the layout differs between them.
281 (list (string-append "https://download.qt.io/official_releases/qt/"
282 (version-major+minor version) "/" version
283 "/submodules/" component "-everywhere-opensource-src-"
284 version ".tar.xz")
285 (string-append "https://download.qt.io/official_releases/qt/"
286 (version-major+minor version) "/" version
287 "/submodules/" component "-everywhere-src-"
288 version ".tar.xz")
289 (string-append "https://download.qt.io/archive/qt/"
290 (version-major+minor version) "/" version
291 "/submodules/" component "-everywhere-opensource-src-"
292 version ".tar.xz")
293 (let ((directory (string-append "qt5" (string-drop component 2))))
294 (string-append "http://sources.buildroot.net/" directory "/"
295 component "-everywhere-opensource-src-" version ".tar.xz"))
296 (string-append "https://distfiles.macports.org/qt5/"
297 component "-everywhere-opensource-src-" version ".tar.xz")))
298
299 (define-public qtbase-5
300 (package
301 (name "qtbase")
302 (version "5.15.5")
303 (source (origin
304 (method url-fetch)
305 (uri (qt5-urls name version))
306 (sha256
307 (base32
308 "1p2fa94m1y8qzhdfi2d7dck93qh1lgsinibwl1wy92bwmacwfhhc"))
309 ;; Use TZDIR to avoid depending on package "tzdata".
310 (patches (search-patches "qtbase-use-TZDIR.patch"
311 "qtbase-moc-ignore-gcc-macro.patch"
312 "qtbase-absolute-runpath.patch"))
313 (modules '((guix build utils)))
314 (snippet
315 ;; corelib uses bundled harfbuzz, md4, md5, sha3
316 '(begin
317 (with-directory-excursion "src/3rdparty"
318 (for-each delete-file-recursively
319 (list "double-conversion" "freetype" "harfbuzz-ng"
320 "libpng" "libjpeg" "pcre2" "sqlite" "xcb"
321 "zlib")))))))
322 (build-system gnu-build-system)
323 (outputs '("out" "debug"))
324 (propagated-inputs
325 (list mesa
326 ;; Use which the package, not the function
327 (@ (gnu packages base) which)))
328 (inputs
329 `(("alsa-lib" ,alsa-lib)
330 ("cups" ,cups)
331 ("dbus" ,dbus)
332 ("double-conversion" ,double-conversion)
333 ("eudev" ,eudev)
334 ("expat" ,expat)
335 ("fontconfig" ,fontconfig)
336 ("freetype" ,freetype)
337 ("glib" ,glib)
338 ("gtk+" ,gtk+) ;for GTK theme support
339 ("harfbuzz" ,harfbuzz)
340 ("icu4c" ,icu4c)
341 ("libinput" ,libinput-minimal)
342 ("libjpeg" ,libjpeg-turbo)
343 ("libmng" ,libmng)
344 ("libpng" ,libpng)
345 ("libx11" ,libx11)
346 ("libxcomposite" ,libxcomposite)
347 ("libxcursor" ,libxcursor)
348 ("libxfixes" ,libxfixes)
349 ("libxi" ,libxi)
350 ("libxinerama" ,libxinerama)
351 ("libxkbcommon" ,libxkbcommon)
352 ("libxml2" ,libxml2)
353 ("libxrandr" ,libxrandr)
354 ("libxrender" ,libxrender)
355 ("libxslt" ,libxslt)
356 ("libxtst" ,libxtst)
357 ("mtdev" ,mtdev)
358 ("mariadb-dev" ,mariadb "dev")
359 ("nss" ,nss)
360 ("openssl" ,openssl)
361 ("pcre2" ,pcre2)
362 ("postgresql" ,postgresql)
363 ("pulseaudio" ,pulseaudio)
364 ("sqlite" ,sqlite)
365 ("unixodbc" ,unixodbc)
366 ("xcb-util" ,xcb-util)
367 ("xcb-util-image" ,xcb-util-image)
368 ("xcb-util-keysyms" ,xcb-util-keysyms)
369 ("xcb-util-renderutil" ,xcb-util-renderutil)
370 ("xcb-util-wm" ,xcb-util-wm)
371 ("xdg-utils" ,xdg-utils)
372 ("zlib" ,zlib)))
373 (native-inputs
374 (list bison
375 flex
376 gperf
377 perl
378 pkg-config
379 python
380 vulkan-headers
381 ruby))
382 (arguments
383 `(#:configure-flags
384 (let ((out (assoc-ref %outputs "out")))
385 (list "-verbose"
386 "-prefix" out
387 "-docdir" (string-append out "/share/doc/qt5")
388 "-headerdir" (string-append out "/include/qt5")
389 "-archdatadir" (string-append out "/lib/qt5")
390 "-datadir" (string-append out "/share/qt5")
391 "-examplesdir" (string-append
392 out "/share/doc/qt5/examples")
393 "-opensource"
394 "-confirm-license"
395
396 ;; Later stripped into the :debug output.
397 "-force-debug-info"
398
399 ;; These features require higher versions of Linux than the
400 ;; minimum version of the glibc. See
401 ;; src/corelib/global/minimum-linux_p.h. By disabling these
402 ;; features Qt5 applications can be used on the oldest
403 ;; kernels that the glibc supports, including the RHEL6
404 ;; (2.6.32) and RHEL7 (3.10) kernels.
405 "-no-feature-getentropy" ; requires Linux 3.17
406 "-no-feature-renameat2" ; requires Linux 3.16
407
408 ;; Do not build examples; if desired, these could go
409 ;; into a separate output, but for the time being, we
410 ;; prefer to save the space and build time.
411 "-no-compile-examples"
412 ;; Most "-system-..." are automatic, but some use
413 ;; the bundled copy by default.
414 "-system-sqlite"
415 "-system-harfbuzz"
416 "-system-pcre"
417 ;; explicitly link with openssl instead of dlopening it
418 "-openssl-linked"
419 ;; explicitly link with dbus instead of dlopening it
420 "-dbus-linked"
421 ;; don't use the precompiled headers
422 "-no-pch"
423 ;; drop special machine instructions that do not have
424 ;; runtime detection
425 ,@(if (string-prefix? "x86_64"
426 (or (%current-target-system)
427 (%current-system)))
428 '()
429 '("-no-sse2"))
430 "-no-mips_dsp"
431 "-no-mips_dspr2"))
432 #:phases
433 (modify-phases %standard-phases
434 (add-after 'configure 'patch-bin-sh
435 (lambda _
436 (substitute* '("config.status"
437 "configure"
438 "mkspecs/features/qt_functions.prf"
439 "qmake/library/qmakebuiltins.cpp")
440 (("/bin/sh") (which "sh")))))
441 (add-after 'configure 'patch-xdg-open
442 (lambda _
443 (substitute* '("src/platformsupport/services/genericunix/qgenericunixservices.cpp")
444 (("^.*const char \\*browsers.*$" all)
445 (string-append "*browser = QStringLiteral(\""
446 (which "xdg-open")
447 "\"); return true; \n" all)))))
448 (replace 'configure
449 ;; Overridden to not pass "--enable-fast-install", which makes the
450 ;; configure process fail.
451 (lambda* (#:key outputs configure-flags #:allow-other-keys)
452 (let ((out (assoc-ref outputs "out")))
453 (substitute* "configure"
454 (("/bin/pwd") (which "pwd")))
455 (substitute* "src/corelib/global/global.pri"
456 (("/bin/ls") (which "ls")))
457 ;; The configuration files for other Qt5 packages are searched
458 ;; through a call to "find_package" in Qt5Config.cmake, which
459 ;; disables the use of CMAKE_PREFIX_PATH via the parameter
460 ;; "NO_DEFAULT_PATH". Re-enable it so that the different
461 ;; components can be installed in different places.
462 (substitute* (find-files "." ".*\\.cmake")
463 (("NO_DEFAULT_PATH") ""))
464 (format #t "build directory: ~s~%" (getcwd))
465 (format #t "configure flags: ~s~%" configure-flags)
466 (apply invoke "./configure" configure-flags))))
467 (add-after 'install 'patch-mkspecs
468 (lambda* (#:key outputs #:allow-other-keys)
469 (let* ((out (assoc-ref outputs "out"))
470 (archdata (string-append out "/lib/qt5"))
471 (mkspecs (string-append archdata "/mkspecs"))
472 (qt_config.prf (string-append
473 mkspecs "/features/qt_config.prf")))
474 ;; For each Qt module, let `qmake' uses search paths in the
475 ;; module directory instead of all in QT_INSTALL_PREFIX.
476 (substitute* qt_config.prf
477 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
478 "$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt5))")
479 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
480 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
481 (("\\$\\$\\[QT_HOST_LIBS\\]")
482 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
483 (("\\$\\$\\[QT_INSTALL_BINS\\]")
484 "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))"))
485
486 ;; Searches Qt tools in the current PATH instead of QT_HOST_BINS.
487 (substitute* (string-append mkspecs "/features/qt_functions.prf")
488 (("cmd = \\$\\$\\[QT_HOST_BINS\\]/\\$\\$2")
489 "cmd = $$system(which $${2}.pl 2>/dev/null || which $${2})"))
490
491 ;; Resolve qmake spec files within qtbase by absolute paths.
492 (substitute*
493 (map (lambda (file)
494 (string-append mkspecs "/features/" file))
495 '("device_config.prf" "moc.prf" "qt_build_config.prf"
496 "qt_config.prf" "winrt/package_manifest.prf"))
497 (("\\$\\$\\[QT_HOST_DATA/get\\]") archdata)
498 (("\\$\\$\\[QT_HOST_DATA/src\\]") archdata)))))
499 (add-after 'patch-mkspecs 'patch-prl-files
500 (lambda* (#:key outputs #:allow-other-keys)
501 (let ((out (assoc-ref outputs "out")))
502 ;; Insert absolute references to the qtbase libraries because
503 ;; QT_INSTALL_LIBS does not always resolve correctly, depending
504 ;; on context. See <https://bugs.gnu.org/38405>
505 (substitute* (find-files (string-append out "/lib") "\\.prl$")
506 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
507 (string-append out "/lib"))))))
508 (add-after 'unpack 'patch-paths
509 ;; Use the absolute paths for dynamically loaded libs, otherwise
510 ;; the lib will be searched in LD_LIBRARY_PATH which typically is
511 ;; not set in guix.
512 (lambda* (#:key inputs #:allow-other-keys)
513 ;; libresolve
514 (let ((glibc (assoc-ref inputs ,(if (%current-target-system)
515 "cross-libc" "libc"))))
516 (substitute* '("src/network/kernel/qdnslookup_unix.cpp"
517 "src/network/kernel/qhostinfo_unix.cpp")
518 (("^\\s*(lib.setFileName\\(QLatin1String\\(\")(resolv\"\\)\\);)" _ a b)
519 (string-append a glibc "/lib/lib" b))))
520 ;; libGL
521 (substitute* "src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp"
522 (("^\\s*(QLibrary lib\\(QLatin1String\\(\")(GL\"\\)\\);)" _ a b)
523 (string-append a (assoc-ref inputs "mesa") "/lib/lib" b)))
524 ;; libXcursor
525 (substitute* "src/plugins/platforms/xcb/qxcbcursor.cpp"
526 (("^\\s*(QLibrary xcursorLib\\(QLatin1String\\(\")(Xcursor\"\\), 1\\);)" _ a b)
527 (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))
528 (("^\\s*(xcursorLib.setFileName\\(QLatin1String\\(\")(Xcursor\"\\)\\);)" _ a b)
529 (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))))))))
530 (native-search-paths
531 (list (search-path-specification
532 (variable "QMAKEPATH")
533 (files '("lib/qt5")))
534 (search-path-specification
535 (variable "QML2_IMPORT_PATH")
536 (files '("lib/qt5/qml")))
537 (search-path-specification
538 (variable "QT_PLUGIN_PATH")
539 (files '("lib/qt5/plugins")))
540 (search-path-specification
541 (variable "XDG_DATA_DIRS")
542 (files '("share")))
543 (search-path-specification
544 (variable "XDG_CONFIG_DIRS")
545 (files '("etc/xdg")))))
546 (home-page "https://www.qt.io/")
547 (synopsis "Cross-platform GUI library")
548 (description "Qt is a cross-platform application and UI framework for
549 developers using C++ or QML, a CSS & JavaScript like language.")
550 (license (list license:lgpl2.1 license:lgpl3))))
551
552 (define-public qtbase
553 (package/inherit qtbase-5
554 (name "qtbase")
555 (version "6.1.1")
556 (source (origin
557 (inherit (package-source qtbase-5))
558 (uri (qt5-urls name version))
559 (sha256
560 (base32
561 "1wizrfiw6h8bk99brbdpdli40vsk6yqchs66f1r083hp0ygsma11"))
562 (modules '((guix build utils)))
563 (snippet
564 ;; corelib uses bundled harfbuzz, md4, md5, sha3
565 '(with-directory-excursion "src/3rdparty"
566 (for-each delete-file-recursively
567 ;; The bundled pcre2 copy is kept, as its headers
568 ;; are required by some internal bootstrap target
569 ;; used for the tools.
570 (list "double-conversion" "freetype" "harfbuzz-ng"
571 "libpng" "libjpeg" "sqlite" "xcb" "zlib"))))))
572 (build-system cmake-build-system)
573 (arguments
574 (substitute-keyword-arguments (package-arguments qtbase-5)
575 ;; XXX: There are many test failures, because the test suite
576 ;; requires a real X server (a virtual one such as Xvfb is not
577 ;; enough) or a functional network. It's also quite expensive to
578 ;; build and run.
579 ((#:tests? _ #f) #f)
580 ;; ((#:cmake _)
581 ;; cmake) ;requires a CMake >= 3.18.4
582 ((#:configure-flags _ ''())
583 `(let ((out (assoc-ref %outputs "out")))
584 (list "-GNinja" ;the build fails otherwise
585 (string-append "-DINSTALL_ARCHDATADIR=" out "/lib/qt6")
586 (string-append "-DINSTALL_DATADIR=" out "/share/qt6")
587 (string-append "-DINSTALL_DOCDIR=" out "/share/doc/qt6")
588 (string-append "-DINSTALL_MKSPECSDIR=" out "/lib/qt6/mkspecs")
589 (string-append "-DINSTALL_EXAMPLESDIR=" out
590 "/share/doc/qt6/examples")
591 (string-append "-DINSTALL_INCLUDEDIR=" out "/include/qt6")
592 ;; Link with DBus and OpenSSL so they don't get dlopen'ed.
593 "-DINPUT_dbus=linked"
594 "-DINPUT_openssl=linked"
595 ;; These features require higher versions of Linux than the
596 ;; minimum version of the glibc. See
597 ;; src/corelib/global/minimum-linux_p.h. By disabling these
598 ;; features Qt applications can be used on the oldest kernels
599 ;; that the glibc supports, including the RHEL6 (2.6.32) and
600 ;; RHEL7 (3.10) kernels.
601 "-DFEATURE_getentropy=OFF" ; requires Linux 3.17
602 "-DFEATURE_renameat2=OFF" ; requires Linux 3.16
603 ;; Most system libraries are used by default, except in some
604 ;; cases such as for those below.
605 "-DFEATURE_system_pcre2=ON"
606 "-DFEATURE_system_sqlite=ON"
607 ;; Don't use the precompiled headers.
608 "-DBUILD_WITH_PCH=OFF"
609 ;; Drop special machine instructions that do not have runtime
610 ;; detection.
611 ,@(if (string-prefix? "x86_64"
612 (or (%current-target-system)
613 (%current-system)))
614 '() ;implicitly enabled
615 '("-DFEATURE_sse2=OFF"
616 "-DFEATURE_sse3=OFF"
617 "-DFEATURE_ssse3=OFF"
618 "-DFEATURE_sse4_1=OFF"
619 "-DFEATURE_sse4_2=OFF"))
620 "-DFEATURE_mips_dsp=OFF"
621 "-DFEATURE_mips_dspr2=OFF")))
622 ((#:phases phases)
623 `(modify-phases ,phases
624 (delete 'patch-bin-sh)
625 (delete 'patch-xdg-open)
626 (add-after 'patch-paths 'patch-more-paths
627 (lambda _
628 (substitute* "src/gui/platform/unix/qgenericunixservices.cpp"
629 (("\"xdg-open\"")
630 (format #f "~s" (which "xdg-open"))))
631 (substitute* '("mkspecs/features/qt_functions.prf"
632 "qmake/library/qmakebuiltins.cpp")
633 (("/bin/sh")
634 (which "sh")))))
635 (replace 'configure
636 (assoc-ref %standard-phases 'configure))
637 (replace 'build
638 (lambda* (#:key parallel-build? #:allow-other-keys)
639 (apply invoke "cmake" "--build" "."
640 (if parallel-build?
641 `("--parallel" ,(number->string (parallel-job-count)))
642 '()))))
643 (replace 'install
644 (lambda _
645 (invoke "cmake" "--install" ".")))
646 (replace 'patch-mkspecs
647 (lambda* (#:key outputs #:allow-other-keys)
648 (let* ((out (assoc-ref outputs "out"))
649 (archdata (string-append out "/lib/qt6"))
650 (mkspecs (string-append archdata "/mkspecs"))
651 (qt_config.prf (string-append
652 mkspecs "/features/qt_config.prf")))
653 ;; For each Qt module, let `qmake' uses search paths in the
654 ;; module directory instead of all in QT_INSTALL_PREFIX.
655 (substitute* qt_config.prf
656 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
657 "$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt6))")
658 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
659 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
660 (("\\$\\$\\[QT_HOST_LIBS\\]")
661 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
662 (("\\$\\$\\[QT_INSTALL_BINS\\]")
663 "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))"))
664
665 ;; Searches Qt tools in the current PATH instead of QT_HOST_BINS.
666 (substitute* (string-append mkspecs "/features/qt_functions.prf")
667 (("cmd = \\$\\$\\[QT_HOST_BINS\\]/\\$\\$2")
668 "cmd = $$system(which $${2}.pl 2>/dev/null || which $${2})"))
669
670 ;; Resolve qmake spec files within qtbase by absolute paths.
671 (substitute*
672 (map (lambda (file)
673 (string-append mkspecs "/features/" file))
674 '("device_config.prf" "moc.prf" "qt_build_config.prf"
675 "qt_config.prf"))
676 (("\\$\\$\\[QT_HOST_DATA/get\\]") archdata)
677 (("\\$\\$\\[QT_HOST_DATA/src\\]") archdata)))))))))
678 (native-inputs
679 `(("gtk+" ,gtk+) ;for GTK theme support
680 ("ninja" ,ninja)
681 ("wayland-protocols" ,wayland-protocols)
682 ("xorg-server" ,xorg-server-for-tests)
683 ,@(package-native-inputs qtbase-5)))
684 (native-search-paths
685 (list (search-path-specification
686 (variable "QMAKEPATH")
687 (files '("lib/qt6")))
688 (search-path-specification
689 (variable "QML2_IMPORT_PATH")
690 (files '("lib/qt6/qml")))
691 (search-path-specification
692 (variable "QT_PLUGIN_PATH")
693 (files '("lib/qt6/plugins")))
694 (search-path-specification
695 (variable "XDG_DATA_DIRS")
696 (files '("share")))
697 (search-path-specification
698 (variable "XDG_CONFIG_DIRS")
699 (files '("etc/xdg")))))))
700
701 (define-public qtsvg
702 (package (inherit qtbase-5)
703 (name "qtsvg")
704 (version "5.15.5")
705 (source (origin
706 (method url-fetch)
707 (uri (qt5-urls name version))
708 (sha256
709 (base32
710 "0cdhmhxngv4y7kl5vbcii4l4anbz0hj7dvhlddy1agyl19j9xky4"))))
711 (propagated-inputs `())
712 (native-inputs (list perl))
713 (inputs
714 (list mesa qtbase-5 zlib))
715 (arguments
716 `(#:phases
717 (modify-phases %standard-phases
718 (add-before 'configure 'configure-qmake
719 (lambda* (#:key inputs outputs #:allow-other-keys)
720 (let* ((out (assoc-ref outputs "out"))
721 (qtbase (assoc-ref inputs "qtbase"))
722 (tmpdir (string-append (getenv "TMPDIR")))
723 (qmake (string-append tmpdir "/qmake"))
724 (qt.conf (string-append tmpdir "/qt.conf")))
725 ;; Use qmake with a customized qt.conf to override install
726 ;; paths to $out.
727 (symlink (which "qmake") qmake)
728 (setenv "PATH" (string-append tmpdir ":" (getenv "PATH")))
729 (with-output-to-file qt.conf
730 (lambda ()
731 (format #t "[Paths]
732 Prefix=~a
733 ArchData=lib/qt5
734 Data=share/qt5
735 Documentation=share/doc/qt5
736 Headers=include/qt5
737 Libraries=lib
738 LibraryExecutables=lib/qt5/libexec
739 Binaries=bin
740 Tests=tests
741 Plugins=lib/qt5/plugins
742 Imports=lib/qt5/imports
743 Qml2Imports=lib/qt5/qml
744 Translations=share/qt5/translations
745 Settings=etc/xdg
746 Examples=share/doc/qt5/examples
747 HostPrefix=~a
748 HostData=lib/qt5
749 HostBinaries=bin
750 HostLibraries=lib
751
752 [EffectiveSourcePaths]
753 HostPrefix=~a
754 HostData=lib/qt5
755 " out out qtbase))))))
756 (replace 'configure
757 (lambda* (#:key inputs outputs #:allow-other-keys)
758 ;; Valid QT_BUILD_PARTS variables are:
759 ;; libs tools tests examples demos docs translations
760 (invoke "qmake" "QT_BUILD_PARTS = libs tools tests")))
761 (add-before 'check 'set-display
762 (lambda _
763 ;; make Qt render "offscreen", required for tests
764 (setenv "QT_QPA_PLATFORM" "offscreen"))))))
765 (synopsis "Qt module for displaying SVGs")
766 (description "The QtSvg module provides classes for displaying the
767 contents of SVG files.")))
768
769 (define-public qtimageformats
770 (package (inherit qtsvg)
771 (name "qtimageformats")
772 (version "5.15.5")
773 (source (origin
774 (method url-fetch)
775 (uri (qt5-urls name version))
776 (sha256
777 (base32
778 "1xjb2z2h1ajw7z9cwq8djpdvjwalpnmirwcwrlbjqv5r4ghmi82a"))
779 (modules '((guix build utils)))
780 (snippet
781 '(begin
782 (delete-file-recursively "src/3rdparty")))))
783 (native-inputs `())
784 (inputs
785 (list jasper
786 libmng
787 libtiff
788 libwebp
789 mesa
790 qtbase-5
791 zlib))
792 (synopsis "Additional Image Format plugins for Qt")
793 (description "The QtImageFormats module contains plugins for adding
794 support for MNG, TGA, TIFF and WBMP image formats.")))
795
796 (define-public qtx11extras
797 (package (inherit qtsvg)
798 (name "qtx11extras")
799 (version "5.15.5")
800 (source (origin
801 (method url-fetch)
802 (uri (qt5-urls name version))
803 (sha256
804 (base32
805 "0wxsrnnkkn68myy211rfz98brs7j3qmx3hmy097vh5avgsmw11bn"))))
806 (arguments
807 (substitute-keyword-arguments (package-arguments qtsvg)
808 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
809 (native-inputs (list perl))
810 (inputs
811 (list mesa qtbase-5))
812 (synopsis "Qt Extras for X11")
813 (description "The QtX11Extras module includes the library to access X11
814 from within Qt 5.")))
815
816 (define-public qtxmlpatterns
817 (package (inherit qtsvg)
818 (name "qtxmlpatterns")
819 (version "5.15.5")
820 (source (origin
821 (method url-fetch)
822 (uri (qt5-urls name version))
823 (sha256
824 (base32
825 "065vj1gk5i4cg0f9spksyb9ps4px0vssx262y77aakvw408vfmq5"))))
826 (arguments
827 (substitute-keyword-arguments (package-arguments qtsvg)
828 ((#:phases phases)
829 `(modify-phases ,phases
830 (add-after 'unpack 'disable-network-tests
831 (lambda _ (substitute* "tests/auto/auto.pro"
832 (("qxmlquery") "# qxmlquery")
833 (("xmlpatterns ") "# xmlpatterns"))))
834 (add-after 'unpack 'skip-qquickxmllistmodel-test
835 (lambda _ (substitute* "tests/auto/auto.pro"
836 ((".*qquickxmllistmodel.*") ""))))))))
837 (native-inputs (list perl qtdeclarative))
838 (inputs (list qtbase-5))
839 (synopsis "Qt XML patterns module")
840 (description "The QtXmlPatterns module is a XQuery and XPath engine for
841 XML and custom data models. It contains programs such as xmlpatterns and
842 xmlpatternsvalidator.")))
843
844 (define-public qtdeclarative
845 (package (inherit qtsvg)
846 (name "qtdeclarative")
847 (version "5.15.5")
848 (source (origin
849 (method url-fetch)
850 (uri (qt5-urls name version))
851 (sha256
852 (base32
853 "0ji5131g7h2mrgxw1wxc5mcvmsn3fbw64j28gzpa25gv3vcnkhaw"))))
854 (arguments
855 (substitute-keyword-arguments (package-arguments qtsvg)
856 ((#:tests? _ #f) #f) ;TODO: Enable the tests
857 ((#:phases phases)
858 `(modify-phases ,phases
859 (add-after 'build 'fix-qt5core-install-prefix
860 (lambda* (#:key outputs #:allow-other-keys)
861 (let ((out (assoc-ref outputs "out")))
862 ;; The Qt5Core install prefix is set to qtbase, but qmlcachegen
863 ;; is provided by qtdeclarative.
864 (substitute*
865 "lib/cmake/Qt5QuickCompiler/Qt5QuickCompilerConfig.cmake"
866 (("\\$\\{_qt5Core_install_prefix\\}") out)))))))))
867 (native-inputs
868 (list perl
869 pkg-config
870 python
871 python-wrapper
872 qtsvg
873 vulkan-headers))
874 (inputs
875 (list mesa qtbase-5))
876 (synopsis "Qt QML module (Quick 2)")
877 (description "The Qt QML module provides a framework for developing
878 applications and libraries with the QML language. It defines and implements the
879 language and engine infrastructure, and provides an API to enable application
880 developers to extend the QML language with custom types and integrate QML code
881 with JavaScript and C++.")))
882
883 (define-public qtconnectivity
884 (package (inherit qtsvg)
885 (name "qtconnectivity")
886 (version "5.15.5")
887 (source (origin
888 (method url-fetch)
889 (uri (qt5-urls name version))
890 (sha256
891 (base32
892 "0b2dnxw1rjbp1srhgns148cwl99f50mx29588dal3avv0f73s597"))))
893 (native-inputs
894 (list perl pkg-config qtdeclarative))
895 (inputs
896 (list bluez qtbase-5))
897 (synopsis "Qt Connectivity module")
898 (description "The Qt Connectivity modules provides modules for interacting
899 with Bluetooth and NFC.")))
900
901 (define-public qtwebsockets
902 (package (inherit qtsvg)
903 (name "qtwebsockets")
904 (version "5.15.5")
905 (source (origin
906 (method url-fetch)
907 (uri (qt5-urls name version))
908 (sha256
909 (base32
910 "0f120rfqnmlffjhrm5jbpipk1qsbzp1a2v3q8gz94hz6n9dqpav6"))))
911 (arguments
912 (substitute-keyword-arguments (package-arguments qtsvg)
913 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
914 (native-inputs
915 (list perl qtdeclarative))
916 (inputs (list qtbase-5))
917 (synopsis "Qt Web Sockets module")
918 (description "WebSocket is a web-based protocol designed to enable two-way
919 communication between a client application and a remote host. The Qt
920 WebSockets module provides C++ and QML interfaces that enable Qt applications
921 to act as a server that can process WebSocket requests, or a client that can
922 consume data received from the server, or both.")))
923
924 (define-public qtsensors
925 (package (inherit qtsvg)
926 (name "qtsensors")
927 (version "5.15.5")
928 (source (origin
929 (method url-fetch)
930 (uri (qt5-urls name version))
931 (sha256
932 (base32
933 "0zlhm4js02niibb23rw87wf4ik0gy4ai08fwprnwy7zf4rm1ss3d"))))
934 (arguments
935 (substitute-keyword-arguments (package-arguments qtsvg)
936 ((#:parallel-tests? _ #f) #f) ; can lead to race condition
937 ((#:phases phases)
938 `(modify-phases ,phases
939 (add-after 'unpack 'fix-tests
940 (lambda _
941 (substitute* "tests/auto/qsensorgestures_gestures/tst_sensorgestures_gestures.cpp"
942 (("2000") "5000") ;lengthen test timeout
943 (("QTest::newRow(\"twist\") << \"twist\"") "")))))))) ;failing test
944 (native-inputs
945 (list perl qtdeclarative))
946 (inputs (list qtbase-5))
947 (synopsis "Qt Sensors module")
948 (description "The Qt Sensors API provides access to sensor hardware via QML
949 and C++ interfaces. The Qt Sensors API also provides a motion gesture
950 recognition API for devices.")))
951
952 (define-public qtmultimedia
953 (package (inherit qtsvg)
954 (name "qtmultimedia")
955 (version "5.15.5")
956 (source (origin
957 (method url-fetch)
958 (uri (qt5-urls name version))
959 (sha256
960 (base32
961 "0q76iy1frcgm85mid17lh4p6gnn04n19n6zklgpv4w3md1ng97xw"))
962 (modules '((guix build utils)))
963 (snippet
964 '(begin
965 (delete-file-recursively
966 "examples/multimedia/spectrum/3rdparty")
967 ;; We also prevent the spectrum example from being built.
968 (substitute* "examples/multimedia/multimedia.pro"
969 (("spectrum") "#"))))))
970 (arguments
971 (substitute-keyword-arguments (package-arguments qtsvg)
972 ((#:phases phases)
973 `(modify-phases ,phases
974 (replace 'configure
975 (lambda* (#:key outputs #:allow-other-keys)
976 (let ((out (assoc-ref outputs "out")))
977 (invoke "qmake" "QT_BUILD_PARTS = libs tools tests"
978 (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out "/lib -Wl,-rpath,")
979 (string-append "PREFIX=" out)))))))
980 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
981 (native-inputs
982 (list perl pkg-config python qtdeclarative))
983 (inputs
984 (list alsa-lib
985 mesa
986 pulseaudio
987 qtbase-5
988 ;; Gstreamer is needed for the mediaplayer plugin
989 gstreamer
990 gst-plugins-base))
991 (synopsis "Qt Multimedia module")
992 (description "The Qt Multimedia module provides set of APIs to play and
993 record media, and manage a collection of media content. It also contains a
994 set of plugins for interacting with pulseaudio and GStreamer.")))
995
996 (define-public qtwayland
997 (package (inherit qtsvg)
998 (name "qtwayland")
999 (version "5.15.5")
1000 (source (origin
1001 (method url-fetch)
1002 (uri (qt5-urls name version))
1003 (sha256
1004 (base32
1005 "0yy8qf9kn15iqsxi2r7jbcsc0vsdyfz7bbxmfn4i9qmz1yvg0jgr"))))
1006 (arguments
1007 (substitute-keyword-arguments (package-arguments qtsvg)
1008 ((#:phases phases)
1009 `(modify-phases ,phases
1010 (add-after 'unpack 'disable-failing-tests
1011 (lambda _
1012 ;; FIXME: tst_seatv4::animatedCursor() fails for no good
1013 ;; reason and breaks these two tests.
1014 (substitute* "tests/auto/client/seatv4/tst_seatv4.cpp"
1015 (((string-append "QVERIFY\\(!cursorSurface\\(\\)->"
1016 "m_waitingFrameCallbacks\\.empty\\(\\)\\);"))
1017 "")
1018 (("QTRY_COMPARE\\(bufferSpy\\.count\\(\\), 1\\);")
1019 ""))))
1020 (add-before 'check 'set-test-environment
1021 (lambda _
1022 ;; Do not fail just because /etc/machine-id is missing.
1023 (setenv "DBUS_FATAL_WARNINGS" "0")))))))
1024 (native-inputs
1025 (list glib perl pkg-config qtdeclarative))
1026 (inputs
1027 `(("fontconfig" ,fontconfig)
1028 ("freetype" ,freetype)
1029 ("libx11" ,libx11)
1030 ("libxcomposite" ,libxcomposite)
1031 ("libxext" ,libxext)
1032 ("libxkbcommon" ,libxkbcommon)
1033 ("libxrender" ,libxrender)
1034 ("mesa" ,mesa)
1035 ("mtdev" ,mtdev)
1036 ("qtbase" ,qtbase-5)
1037 ("vulkan-headers" ,vulkan-headers)
1038 ("wayland" ,wayland)))
1039 (synopsis "Qt Wayland module")
1040 (description "The Qt Wayland module provides the QtWayland client and
1041 compositor libraries.")))
1042
1043 (define-public qtserialport
1044 (package (inherit qtsvg)
1045 (name "qtserialport")
1046 (version "5.15.5")
1047 (source (origin
1048 (method url-fetch)
1049 (uri (qt5-urls name version))
1050 (sha256
1051 (base32
1052 "0xg2djwhrj5jqamawlp75g70nmwbp2ph2hh1pm45s36jkxm0k7al"))))
1053 (native-inputs (list perl))
1054 (inputs
1055 (list qtbase-5 eudev))
1056 (arguments
1057 (substitute-keyword-arguments (package-arguments qtsvg)
1058 ((#:phases phases)
1059 `(modify-phases ,phases
1060 (add-after 'unpack 'patch-dlopen-paths
1061 (lambda* (#:key inputs #:allow-other-keys)
1062 (substitute* "src/serialport/qtudev_p.h"
1063 ;; Use the absolute paths for dynamically loaded libs,
1064 ;; otherwise the lib will be searched in LD_LIBRARY_PATH which
1065 ;; typically is not set in guix.
1066 (("^\\s*(udevLibrary->setFileNameAndVersion\\(QStringLiteral\\(\")(udev\"\\),\\s*[0-9]+\\);)" _ a b)
1067 (string-append a (assoc-ref inputs "eudev") "/lib/lib" b)))))))))
1068 (synopsis "Qt Serial Port module")
1069 (description "The Qt Serial Port module provides the library for
1070 interacting with serial ports from within Qt.")))
1071
1072 (define-public qtserialbus
1073 (package (inherit qtsvg)
1074 (name "qtserialbus")
1075 (version "5.15.5")
1076 (source (origin
1077 (method url-fetch)
1078 (uri (qt5-urls name version))
1079 (sha256
1080 (base32
1081 "180gm1jvqfn0h3251zafdd1wd3af00phwaa5qljsbrj6s6ywj79j"))))
1082 (arguments
1083 (substitute-keyword-arguments (package-arguments qtsvg)
1084 ((#:phases phases '%standard-phases)
1085 `(modify-phases ,phases
1086 (add-after 'unpack 'patch-libsocketcan-reference
1087 (lambda* (#:key inputs #:allow-other-keys)
1088 (let* ((libcansocket (assoc-ref inputs "libsocketcan"))
1089 (libcansocket.so (string-append libcansocket
1090 "/lib/libsocketcan.so")))
1091 (substitute* "src/plugins/canbus/socketcan/libsocketcan.cpp"
1092 (("QStringLiteral\\(\"socketcan\"\\)")
1093 (format #f "QStringLiteral(~s)" libcansocket.so))))))))))
1094 (inputs
1095 (list libsocketcan qtbase-5 qtserialport))
1096 (synopsis "Qt Serial Bus module")
1097 (description "The Qt Serial Bus API provides classes and functions to
1098 access the various industrial serial buses and protocols, such as CAN, ModBus,
1099 and others.")))
1100
1101 (define-public qtwebchannel
1102 (package (inherit qtsvg)
1103 (name "qtwebchannel")
1104 (version "5.15.5")
1105 (source (origin
1106 (method url-fetch)
1107 (uri (qt5-urls name version))
1108 (sha256
1109 (base32
1110 "1w8mcpdqlphgg3a6yfq18liwlj2nkwrafv0n80h242x5l2mk3ljf"))))
1111 (native-inputs
1112 (list perl qtdeclarative qtwebsockets))
1113 (inputs (list qtbase-5))
1114 (synopsis "Web communication library for Qt")
1115 (description "The Qt WebChannel module enables peer-to-peer communication
1116 between the host (QML/C++ application) and the client (HTML/JavaScript
1117 application). The transport mechanism is supported out of the box by the two
1118 popular web engines, Qt WebKit 2 and Qt WebEngine.")))
1119
1120 (define-public qtwebglplugin
1121 (package (inherit qtsvg)
1122 (name "qtwebglplugin")
1123 (version "5.15.5")
1124 (source (origin
1125 (method url-fetch)
1126 (uri (qt5-urls name version))
1127 (sha256
1128 (base32
1129 "1m0p4ssykw07lbip2qyv6w34f8ng13bxb63j0w446f5w0492nn9f"))))
1130 (arguments
1131 (substitute-keyword-arguments (package-arguments qtsvg)
1132 ((#:phases phases)
1133 `(modify-phases ,phases
1134 (add-after 'unpack 'disable-network-tests
1135 (lambda _ (substitute* "tests/plugins/platforms/platforms.pro"
1136 (("webgl") "# webgl"))))))))
1137 (native-inputs '())
1138 (inputs
1139 (list mesa qtbase-5 qtdeclarative qtwebsockets zlib))
1140 (synopsis "QPA plugin for running an application via a browser using
1141 streamed WebGL commands")
1142 (description "Qt back end that uses WebGL for rendering. It allows Qt
1143 applications (with some limitations) to run in a web browser that supports
1144 WebGL. WebGL is a JavaScript API for rendering 2D and 3D graphics within any
1145 compatible web browser without the use of plug-ins. The API is similar to
1146 OpenGL ES 2.0 and can be used in HTML5 canvas elements")))
1147
1148 (define-public qtwebview
1149 (package (inherit qtsvg)
1150 (name "qtwebview")
1151 (version "5.15.5")
1152 (source (origin
1153 (method url-fetch)
1154 (uri (qt5-urls name version))
1155 (sha256
1156 (base32
1157 "0arwaky3jy5ql3z4d8f7k7diidzb1kncdans7pn50hsa1bzacfal"))))
1158 (native-inputs
1159 (list perl))
1160 (inputs
1161 (list qtbase-5 qtdeclarative))
1162 (synopsis "Display web content in a QML application")
1163 (description "Qt WebView provides a way to display web content in a QML
1164 application without necessarily including a full web browser stack by using
1165 native APIs where it makes sense.")))
1166
1167 (define-public qtlocation
1168 (package (inherit qtsvg)
1169 (name "qtlocation")
1170 (version "5.15.5")
1171 (source (origin
1172 (method url-fetch)
1173 (uri (qt5-urls name version))
1174 (sha256
1175 (base32
1176 "0mlhhhcxx3gpr9kh04c6fljxcj50c2j21r0wb9f7d7nk4flip7b2"))))
1177 (arguments
1178 (substitute-keyword-arguments (package-arguments qtsvg)
1179 ((#:tests? _ #f) #f) ; TODO: Enable the tests
1180 ((#:phases phases)
1181 `(modify-phases ,phases
1182 (add-before 'check 'pre-check
1183 (lambda _
1184 (setenv "HOME" "/tmp")))))))
1185 (native-inputs
1186 (list perl qtdeclarative qtquickcontrols qtserialport))
1187 (inputs
1188 (list icu4c openssl qtbase-5 zlib))
1189 (synopsis "Qt Location and Positioning modules")
1190 (description "The Qt Location module provides an interface for location,
1191 positioning and geolocation plugins.")))
1192
1193 (define-public qttools
1194 (package (inherit qtsvg)
1195 (name "qttools")
1196 (version "5.15.5")
1197 (source (origin
1198 (method url-fetch)
1199 (uri (qt5-urls name version))
1200 (sha256
1201 (base32
1202 "0v7wkzq9i8w3qrw0z8al7lb6clr57lfisyb1fm9cnhi73fvph1vd"))))
1203 (arguments
1204 (substitute-keyword-arguments (package-arguments qtsvg)
1205 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1206 (native-inputs
1207 (list perl qtdeclarative vulkan-headers))
1208 (inputs
1209 (list mesa qtbase-5))
1210 (synopsis "Qt Tools and Designer modules")
1211 (description "The Qt Tools module provides a set of applications to browse
1212 the documentation, translate applications, generate help files and other stuff
1213 that helps in Qt development.")))
1214
1215 (define-public qtscript
1216 (package (inherit qtsvg)
1217 (name "qtscript")
1218 (version "5.15.5")
1219 (source (origin
1220 (method url-fetch)
1221 (uri (qt5-urls name version))
1222 (sha256
1223 (base32
1224 "17yk0p8ci47xlfpllc17arlycng47wrnnskimskzz85bspabc8pm"))
1225 (patches (search-patches "qtscript-disable-tests.patch"))))
1226 (native-inputs
1227 (list perl qttools))
1228 (inputs
1229 (list qtbase-5))
1230 (synopsis "Qt Script module")
1231 (description "Qt provides support for application scripting with ECMAScript.
1232 The following guides and references cover aspects of programming with
1233 ECMAScript and Qt.")))
1234
1235 (define-public qtquickcontrols
1236 (package (inherit qtsvg)
1237 (name "qtquickcontrols")
1238 (version "5.15.5")
1239 (source (origin
1240 (method url-fetch)
1241 (uri (qt5-urls name version))
1242 (sha256
1243 (base32
1244 "0mjw25wcgd2bvjz9rr4qjydb423c63615rcx1vws4jmydqdihssr"))))
1245 (arguments
1246 (substitute-keyword-arguments (package-arguments qtsvg)
1247 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1248 (inputs
1249 (list qtbase-5 qtdeclarative))
1250 (synopsis "Qt Quick Controls and other Quick modules")
1251 (description "The QtScript module provides classes for making Qt
1252 applications scriptable. This module provides a set of extra components that
1253 can be used to build complete interfaces in Qt Quick.")))
1254
1255 (define-public qtquickcontrols2
1256 (package (inherit qtsvg)
1257 (name "qtquickcontrols2")
1258 (version "5.15.5")
1259 (source (origin
1260 (method url-fetch)
1261 (uri (qt5-urls name version))
1262 (sha256
1263 (base32
1264 "1cxg4ml07k1zcyi5m4lx06sz8f5l67isb5vhk7nakxm0wnn7p8y4"))))
1265 (arguments
1266 (substitute-keyword-arguments (package-arguments qtsvg)
1267 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1268 (inputs
1269 (list qtbase-5 qtdeclarative))
1270 (synopsis "Qt Quick Controls 2 and other Quick 2 modules")
1271 (description "The Qt Quick Controls 2 module contains the Qt Labs Platform
1272 module that provides platform integration: native dialogs, menus and menu bars,
1273 and tray icons. It falls back to Qt Widgets when a native implementation is
1274 not available.")))
1275
1276 (define-public qtgraphicaleffects
1277 (package (inherit qtsvg)
1278 (name "qtgraphicaleffects")
1279 (version "5.15.5")
1280 (source (origin
1281 (method url-fetch)
1282 (uri (qt5-urls name version))
1283 (sha256
1284 (base32
1285 "0xznn5zqp6xrqfgl54l8cig9asqf9m2hz0p3ga514rh8spmdazr3"))))
1286 (arguments
1287 (substitute-keyword-arguments (package-arguments qtsvg)
1288 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1289 (inputs
1290 (list qtbase-5 qtdeclarative))
1291 (synopsis "Qt Graphical Effects module")
1292 (description "The Qt Graphical Effects module provides a set of QML types
1293 for adding visually impressive and configurable effects to user interfaces.
1294 Effects are visual items that can be added to Qt Quick user interface as UI
1295 components. The API consists of over 20 effects provided as separate QML
1296 types. The effects cover functional areas such as blending, masking, blurring,
1297 coloring, and many more.")))
1298
1299 (define-public qtgamepad
1300 (package (inherit qtsvg)
1301 (name "qtgamepad")
1302 (version "5.15.5")
1303 (source (origin
1304 (method url-fetch)
1305 (uri (qt5-urls name version))
1306 (sha256
1307 (base32
1308 "0wa4d8f025hlp4bmdzdy5wcahm9wjg6bkwig8dpw9nrsj3idz5b0"))))
1309 (native-inputs
1310 (list perl pkg-config))
1311 (inputs
1312 `(("fontconfig" ,fontconfig)
1313 ("freetype" ,freetype)
1314 ("libxrender" ,libxrender)
1315 ("sdl2" ,sdl2)
1316 ("qtbase" ,qtbase-5)
1317 ("qtdeclarative" ,qtdeclarative)))
1318 (synopsis "Qt Gamepad module")
1319 (description "The Qt Gamepad module is an add-on library that enables Qt
1320 applications to support the use of gamepad hardware and in some cases remote
1321 control equipment. The module provides both QML and C++ interfaces. The
1322 primary target audience are embedded devices with fullscreen user interfaces,
1323 and mobile applications targeting TV-like form factors.")))
1324
1325 (define-public qtscxml
1326 (package (inherit qtsvg)
1327 (name "qtscxml")
1328 (version "5.15.5")
1329 (source (origin
1330 (method url-fetch)
1331 (uri (qt5-urls name version))
1332 (sha256
1333 (base32
1334 "0xf5mqsrw16h8xjglymgfc8qg2qa5bi4fgdl4j3dkhvvpr7vrphp"))
1335 (modules '((guix build utils)))
1336 (snippet
1337 '(begin
1338 (delete-file-recursively "tests/3rdparty")
1339 ;; the scion test refers to the bundled 3rd party test code.
1340 (substitute* "tests/auto/auto.pro"
1341 (("scion") "#"))))))
1342 (arguments
1343 (substitute-keyword-arguments (package-arguments qtsvg)
1344 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1345 (inputs
1346 (list qtbase-5 qtdeclarative))
1347 (synopsis "Qt SCXML module")
1348 (description "The Qt SCXML module provides functionality to create state
1349 machines from SCXML files. This includes both dynamically creating state
1350 machines (loading the SCXML file and instantiating states and transitions) and
1351 generating a C++ file that has a class implementing the state machine. It
1352 also contains functionality to support data models and executable content.")))
1353
1354 (define-public qtpurchasing
1355 (package (inherit qtsvg)
1356 (name "qtpurchasing")
1357 (version "5.15.5")
1358 (source (origin
1359 (method url-fetch)
1360 (uri (qt5-urls name version))
1361 (sha256
1362 (base32
1363 "04z6mwzn73gg56hgs7gividinfgndx4kmcnp7w6h3wamrdlkfdx7"))))
1364 (inputs
1365 (list qtbase-5 qtdeclarative))
1366 (synopsis "Qt Purchasing module")
1367 (description "The Qt Purchasing module provides and in-app API for
1368 purchasing goods and services.")))
1369
1370 (define-public qtcharts
1371 (package (inherit qtsvg)
1372 (name "qtcharts")
1373 (version "5.15.5")
1374 (source (origin
1375 (method url-fetch)
1376 (uri (qt5-urls name version))
1377 (sha256
1378 (base32
1379 "0y051i1837bfybkf8cm7cx8k5wjmbi47pxawaaz6wm0hd2z5b4qi"))))
1380 (arguments
1381 (substitute-keyword-arguments (package-arguments qtsvg)
1382 ((#:phases phases)
1383 `(modify-phases ,phases
1384 (add-after 'unpack 'remove-failing-test
1385 (lambda _
1386 (substitute* "tests/auto/auto.pro"
1387 (("qml") "# qml")
1388 (("qml-qtquicktest") "# qml-qtquicktest"))))))))
1389 (inputs
1390 (list qtbase-5 qtdeclarative))
1391 (synopsis "Qt Charts module")
1392 (description "The Qt Charts module provides a set of easy to use chart
1393 components. It uses the Qt Graphics View Framework, therefore charts can be
1394 easily integrated to modern user interfaces. Qt Charts can be used as QWidgets,
1395 QGraphicsWidget, or QML types. Users can easily create impressive graphs by
1396 selecting one of the charts themes.")
1397 (license license:gpl3)))
1398
1399 (define-public qtdatavis3d
1400 (package (inherit qtsvg)
1401 (name "qtdatavis3d")
1402 (version "5.15.5")
1403 (source (origin
1404 (method url-fetch)
1405 (uri (qt5-urls name version))
1406 (sha256
1407 (base32
1408 "0sczwqlc36jdywf7bqxz0hm6mr7fn8p1fsnc33jliiqzn9yrg77x"))))
1409 (arguments
1410 (substitute-keyword-arguments (package-arguments qtsvg)
1411 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1412 (inputs
1413 (list qtbase-5 qtdeclarative))
1414 (synopsis "Qt Data Visualization module")
1415 (description "The Qt Data Visualization module provides a way to visualize
1416 data in 3D as bar, scatter, and surface graphs. It is especially useful for
1417 visualizing depth maps and large quantities of rapidly changing data, such as
1418 data received from multiple sensors. The look and feel of graphs can be
1419 customized by using themes or by adding custom items and labels to them.")
1420 (license license:gpl3)))
1421
1422 (define-public qtnetworkauth
1423 (package (inherit qtsvg)
1424 (name "qtnetworkauth")
1425 (version "5.15.5")
1426 (source (origin
1427 (method url-fetch)
1428 (uri (qt5-urls name version))
1429 (sha256
1430 (base32
1431 "0c7mz715rlpg0cqgs6s0aszmslyamkhnpamc1iij6i571sj5j2f1"))))
1432 (inputs
1433 (list qtbase-5))
1434 (synopsis "Qt Network Authorization module")
1435 (description "The Qt Network Authorization module provides an
1436 implementation of OAuth and OAuth2 authenticathon methods for Qt.")))
1437
1438 (define-public qtremoteobjects
1439 (package (inherit qtsvg)
1440 (name "qtremoteobjects")
1441 (version "5.15.5")
1442 (source (origin
1443 (method url-fetch)
1444 (uri (qt5-urls name version))
1445 (sha256
1446 (base32
1447 "1m0xcqlbxsfn0cd4ajin1h3i4l51dajmkw91v0r4a61xi14i0kks"))))
1448 (arguments
1449 (substitute-keyword-arguments (package-arguments qtsvg)
1450 ((#:phases phases)
1451 `(modify-phases ,phases
1452 (add-after 'unpack 'remove-failing-test
1453 (lambda _
1454 ;; This test can't find its imports.
1455 (substitute* "tests/auto/qml/qml.pro"
1456 (("integration") "# integration")
1457 (("usertypes") "# usertypes"))
1458 ;; disable failing tests: they need network
1459 (substitute* "tests/auto/auto.pro"
1460 (("integration_multiprocess proxy_multiprocess integration_external restart")
1461 "integration_multiprocess"))))))))
1462 (inputs
1463 (list qtbase-5 qtdeclarative))
1464 (synopsis "Qt Remote Objects module")
1465 (description "The Qt Remote Objects module is an @dfn{inter-process
1466 communication} (IPC) module developed for Qt. The idea is to extend existing
1467 Qt's functionalities to enable an easy exchange of information between
1468 processes or computers.")))
1469
1470 (define-public qtspeech
1471 (package (inherit qtsvg)
1472 (name "qtspeech")
1473 (version "5.15.5")
1474 (source (origin
1475 (method url-fetch)
1476 (uri (qt5-urls name version))
1477 (sha256
1478 (base32
1479 "0xskp9dzjy5nqszygk8gwvjyiylgynx5sq3nk2vi3zwgfdh5jpm4"))))
1480 (arguments
1481 (substitute-keyword-arguments (package-arguments qtsvg)
1482 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1483 (inputs
1484 (list qtbase-5))
1485 (native-inputs
1486 (list perl qtdeclarative qtmultimedia qtxmlpatterns))
1487 (synopsis "Qt Speech module")
1488 (description "The Qt Speech module enables a Qt application to support
1489 accessibility features such as text-to-speech, which is useful for end-users
1490 who are visually challenged or cannot access the application for whatever
1491 reason. The most common use case where text-to-speech comes in handy is when
1492 the end-user is driving and cannot attend the incoming messages on the phone.
1493 In such a scenario, the messaging application can read out the incoming
1494 message.")))
1495
1496 (define-public qtspell
1497 (package
1498 (name "qtspell")
1499 (version "1.0.1")
1500 (source
1501 (origin
1502 (method git-fetch)
1503 (uri (git-reference
1504 (url "https://github.com/manisandro/qtspell")
1505 (commit version)))
1506 (file-name (git-file-name name version))
1507 (sha256
1508 (base32 "19ff6jzm699wrxrk57w3d4kl9qxgdipdikpwls9n4aqv4mw7g969"))))
1509 (build-system cmake-build-system)
1510 (arguments
1511 `(#:tests? #f)) ;no test
1512 (native-inputs
1513 (list pkg-config qttools))
1514 (inputs
1515 (list enchant qtbase-5))
1516 (home-page "https://github.com/manisandro/qtspell")
1517 (synopsis "Spell checking for Qt text widgets")
1518 (description
1519 "QtSpell adds spell-checking functionality to Qt's text widgets,
1520 using the Enchant spell-checking library.")
1521 ;; COPYING file specify GPL3, but source code files all refer to GPL2+.
1522 (license license:gpl2+)))
1523
1524 (define-public qtwebengine
1525 (package
1526 (inherit qtsvg)
1527 (name "qtwebengine")
1528 (version "5.15.5")
1529 (source
1530 (origin
1531 (method url-fetch)
1532 (uri (qt5-urls name version))
1533 (sha256
1534 (base32
1535 "0zahr9w6rqdxwh2whsgk3fhcszs7wa9j95lq4sqi8xzin2wcgl17"))
1536 (modules '((ice-9 ftw)
1537 (ice-9 match)
1538 (srfi srfi-1)
1539 (srfi srfi-26)
1540 (guix build utils)))
1541 (snippet
1542 '(begin
1543 (let ((preserved-third-party-files
1544 '("base/third_party/double_conversion"
1545 "base/third_party/cityhash"
1546 "base/third_party/cityhash_v103"
1547 "base/third_party/dynamic_annotations"
1548 "base/third_party/icu"
1549 "base/third_party/libevent"
1550 "base/third_party/nspr"
1551 "base/third_party/superfasthash"
1552 "base/third_party/symbolize"
1553 "base/third_party/xdg_mime"
1554 "base/third_party/xdg_user_dirs"
1555 "net/third_party/mozilla_security_manager"
1556 "net/third_party/nss"
1557 "net/third_party/quiche"
1558 "net/third_party/uri_template"
1559 "third_party/abseil-cpp"
1560 "third_party/angle"
1561 "third_party/angle/src/common/third_party/base"
1562 "third_party/angle/src/common/third_party/smhasher"
1563 "third_party/angle/src/common/third_party/xxhash"
1564 "third_party/angle/src/third_party/compiler"
1565 "third_party/axe-core"
1566 "third_party/blink"
1567 "third_party/boringssl"
1568 "third_party/boringssl/src/third_party/fiat"
1569 "third_party/breakpad"
1570 "third_party/brotli"
1571 "third_party/catapult/common/py_vulcanize/py_vulcanize"
1572 "third_party/catapult/common/py_vulcanize/third_party"
1573 "third_party/catapult/third_party/beautifulsoup4"
1574 "third_party/catapult/third_party/html5lib-python"
1575 "third_party/catapult/third_party/polymer/components"
1576 "third_party/catapult/tracing"
1577 "third_party/catapult/tracing/third_party"
1578 "third_party/ced"
1579 "third_party/cld_3"
1580 "third_party/closure_compiler"
1581 "third_party/crashpad"
1582 "third_party/crashpad/crashpad/third_party/lss"
1583 "third_party/crashpad/crashpad/third_party/zlib"
1584 "third_party/crc32c"
1585 "third_party/dav1d"
1586 "third_party/dawn"
1587 "third_party/devtools-frontend"
1588 "third_party/devtools-frontend/src/front_end/third_party"
1589 "third_party/devtools-frontend/src/third_party/typescript"
1590 "third_party/emoji-segmenter"
1591 "third_party/ffmpeg"
1592 "third_party/googletest"
1593 "third_party/harfbuzz-ng/utils"
1594 "third_party/hunspell"
1595 "third_party/iccjpeg"
1596 "third_party/icu"
1597 "third_party/inspector_protocol"
1598 "third_party/jinja2"
1599 "third_party/jsoncpp"
1600 "third_party/jstemplate"
1601 "third_party/khronos"
1602 "third_party/leveldatabase"
1603 "third_party/libaddressinput"
1604 "third_party/libavif"
1605 "third_party/libgifcodec"
1606 "third_party/libjingle_xmpp"
1607 "third_party/libjpeg_turbo"
1608 "third_party/libpng"
1609 "third_party/libsrtp"
1610 "third_party/libsync"
1611 "third_party/libudev"
1612 "third_party/libvpx"
1613 "third_party/libwebm"
1614 "third_party/libwebp"
1615 "third_party/libxml"
1616 "third_party/libxslt"
1617 "third_party/libyuv"
1618 "third_party/lottie"
1619 "third_party/lss"
1620 "third_party/mako"
1621 "third_party/markupsafe"
1622 "third_party/mesa_headers"
1623 "third_party/metrics_proto"
1624 "third_party/modp_b64"
1625 "third_party/nasm"
1626 "third_party/node"
1627 "third_party/one_euro_filter"
1628 "third_party/openh264/src/codec/api/svc"
1629 "third_party/opus"
1630 "third_party/ots"
1631 "third_party/pdfium"
1632 "third_party/pdfium/third_party/agg23"
1633 "third_party/pdfium/third_party/base"
1634 "third_party/pdfium/third_party/freetype"
1635 "third_party/pdfium/third_party/lcms"
1636 "third_party/pdfium/third_party/libopenjpeg20"
1637 "third_party/pdfium/third_party/skia_shared"
1638 "third_party/perfetto"
1639 "third_party/pffft"
1640 "third_party/ply"
1641 "third_party/polymer"
1642 "third_party/protobuf"
1643 "third_party/protobuf/third_party/six"
1644 "third_party/pyjson5"
1645 "third_party/re2"
1646 "third_party/rnnoise"
1647 "third_party/skia"
1648 "third_party/skia/include/third_party/skcms/skcms.h"
1649 "third_party/skia/include/third_party/vulkan"
1650 "third_party/skia/third_party/skcms"
1651 "third_party/smhasher"
1652 "third_party/snappy"
1653 "third_party/sqlite"
1654 "third_party/usb_ids"
1655 "third_party/usrsctp"
1656 "third_party/vulkan_memory_allocator"
1657 "third_party/web-animations-js"
1658 "third_party/webrtc"
1659 "third_party/webrtc/common_audio/third_party/ooura/fft_size_128"
1660 "third_party/webrtc/common_audio/third_party/ooura/fft_size_256"
1661 "third_party/webrtc/common_audio/third_party/spl_sqrt_floor"
1662 "third_party/webrtc/modules/third_party/fft"
1663 "third_party/webrtc/modules/third_party/g711"
1664 "third_party/webrtc/modules/third_party/g722"
1665 "third_party/webrtc/rtc_base/third_party/base64"
1666 "third_party/webrtc/rtc_base/third_party/sigslot"
1667 "third_party/webrtc_overrides"
1668 "third_party/widevine/cdm/widevine_cdm_common.h"
1669 "third_party/widevine/cdm/widevine_cdm_version.h"
1670 "third_party/woff2"
1671 "third_party/xcbproto"
1672 "third_party/zlib"
1673 "url/third_party/mozilla"
1674 "v8/src/third_party/utf8-decoder"
1675 "v8/src/third_party/valgrind"
1676 "v8/src/third_party/siphash"
1677 "v8/third_party/v8/builtins"
1678 "v8/third_party/inspector_protocol"))
1679 (protected (make-regexp "\\.(gn|gyp)i?$")))
1680 (define preserved-club
1681 (map (lambda (member)
1682 (string-append "./" member))
1683 preserved-third-party-files))
1684 (define (empty? dir)
1685 (equal? (scandir dir) '("." "..")))
1686 (define (third-party? file)
1687 (string-contains file "third_party/"))
1688 (define (useless? file)
1689 (any (cute string-suffix? <> file)
1690 '(".zip" ".so" ".dll" ".exe" ".jar")))
1691 (define (parents child)
1692 ;; Return all parent directories of CHILD up to and including
1693 ;; the closest "third_party".
1694 (let* ((dirs (match (string-split child #\/)
1695 ((dirs ... last) dirs)))
1696 (closest (list-index (lambda (dir)
1697 (string=? "third_party" dir))
1698 (reverse dirs)))
1699 (delim (- (length dirs) closest)))
1700 (fold (lambda (dir prev)
1701 (cons (string-append (car prev) "/" dir)
1702 prev))
1703 (list (string-join (list-head dirs delim) "/"))
1704 (list-tail dirs delim))))
1705 (define (remove-loudly file)
1706 (format #t "deleting ~a...~%" file)
1707 (force-output)
1708 (delete-file file))
1709 (define (delete-unwanted-files child stat flag base level)
1710 (match flag
1711 ((or 'regular 'symlink 'stale-symlink)
1712 (when (third-party? child)
1713 (unless (or (member child preserved-club)
1714 (any (cute member <> preserved-club)
1715 (parents child))
1716 (regexp-exec protected child))
1717 (remove-loudly child)))
1718 (when (and (useless? child) (file-exists? child))
1719 (remove-loudly child))
1720 #t)
1721 ('directory-processed
1722 (when (empty? child)
1723 (rmdir child))
1724 #t)
1725 (_ #t)))
1726
1727 (with-directory-excursion "src/3rdparty"
1728 ;; TODO: Try removing "gn" too for future versions of qtwebengine.
1729 (delete-file-recursively "ninja")
1730
1731 (with-directory-excursion "chromium"
1732 ;; Delete bundled software and binaries that were not explicitly
1733 ;; preserved above.
1734 (nftw "." delete-unwanted-files 'depth 'physical)
1735
1736 ;; Assert that each preserved item is present to catch removals.
1737 (for-each (lambda (third-party)
1738 (unless (file-exists? third-party)
1739 (error (format #f "~s does not exist!~%" third-party))))
1740 preserved-club)
1741
1742 ;; Use relative header locations instead of hard coded ones.
1743 (substitute*
1744 "base/third_party/dynamic_annotations/dynamic_annotations.c"
1745 (("base/third_party/valgrind") "valgrind"))
1746 (substitute*
1747 '("third_party/breakpad/breakpad/src/common/linux/http_upload.cc"
1748 "third_party/breakpad/breakpad/src/common/linux/libcurl_wrapper.h")
1749 (("third_party/curl") "curl"))
1750 (substitute*
1751 '("components/viz/common/gpu/vulkan_context_provider.h"
1752 "components/viz/common/resources/resource_format_utils.h"
1753 "gpu/config/gpu_info_collector_win.cc"
1754 "gpu/config/gpu_util.cc"
1755 "gpu/config/vulkan_info.h")
1756 (("third_party/vulkan_headers/include/")
1757 ""))
1758
1759 ;; Replace Google Analytics bundle with an empty file and hope
1760 ;; no one notices.
1761 (mkdir-p "third_party/analytics")
1762 (call-with-output-file
1763 "third_party/analytics/google-analytics-bundle.js"
1764 (lambda (port)
1765 (const #t)))))
1766 ;; Do not enable support for loading the Widevine DRM plugin.
1767 (substitute* "src/buildtools/config/common.pri"
1768 (("enable_widevine=true")
1769 "enable_widevine=false")))))))
1770 (build-system gnu-build-system)
1771 (native-inputs
1772 (list bison
1773 flex
1774 gperf
1775 ninja
1776 node
1777 perl
1778 pkg-config
1779 python2-six
1780 python-2
1781 ruby))
1782 (inputs
1783 (list alsa-lib
1784 atk
1785 cups-minimal
1786 curl
1787 dbus
1788 ffmpeg
1789 fontconfig
1790 harfbuzz
1791 icu4c
1792 jsoncpp
1793 lcms
1794 libcap
1795 libevent
1796 libgcrypt
1797 libjpeg-turbo
1798 libvpx
1799 libwebp
1800 libx11
1801 libxcb
1802 libxcomposite
1803 libxcursor
1804 libxkbfile
1805 libxi
1806 libxkbcommon
1807 ;; FIXME: libxml2 needs to built with icu support though it links to
1808 ;; libxml2 configure summary still states "Checking for compatible
1809 ;; system libxml2... no"
1810 libxml2
1811 openh264
1812 libxrandr
1813 libxrender
1814 libxslt
1815 libxtst
1816 mesa
1817 minizip
1818 nss
1819 opus
1820 pciutils
1821 protobuf
1822 pulseaudio
1823 qtbase-5
1824 qtdeclarative
1825 qtmultimedia
1826 qtwebchannel
1827 re2
1828 snappy
1829 eudev
1830 valgrind
1831 vulkan-headers
1832 xcb-util))
1833 (arguments
1834 (substitute-keyword-arguments (package-arguments qtsvg)
1835 ((#:modules modules '())
1836 `((guix build gnu-build-system)
1837 (guix build utils)
1838 (ice-9 textual-ports)))
1839 ((#:phases phases)
1840 `(modify-phases ,phases
1841 (add-before 'configure 'substitute-source
1842 (lambda* (#:key inputs outputs #:allow-other-keys)
1843 (let ((out (assoc-ref outputs "out")))
1844 (with-atomic-file-replacement
1845 "src/buildtools/config/linux.pri"
1846 (lambda (in out)
1847 (display (get-string-all in) out)
1848 (display "\ngn_args += use_system_openh264=true\n" out)))
1849 ;; Qtwebengine is not installed into the same prefix as
1850 ;; qtbase. Some qtbase QTLibraryInfo constants will not
1851 ;; work. Replace with the full path to the qtwebengine
1852 ;; translations and locales in the store.
1853 (substitute* "src/core/web_engine_library_info.cpp"
1854 (("QLibraryInfo::location\\(QLibraryInfo::TranslationsPath\\)")
1855 (string-append "QLatin1String(\"" out "/share/qt5/translations\")"))
1856 (("QLibraryInfo::location\\(QLibraryInfo::DataPath\\)")
1857 (string-append "QLatin1String(\"" out "/share/qt5\")")))
1858 ;; Substitute full dynamic library path for nss.
1859 (substitute* "src/3rdparty/chromium/crypto/nss_util.cc"
1860 (("libnssckbi.so")
1861 (search-input-file inputs "lib/nss/libnssckbi.so")))
1862 ;; Substitute full dynamic library path for udev.
1863 (substitute* "src/3rdparty/chromium/device/udev_linux/udev1_loader.cc"
1864 (("libudev.so.1")
1865 (search-input-file inputs "lib/libudev.so.1"))))))
1866 (add-before 'configure 'set-env
1867 (lambda _
1868 ;; Avoids potential race conditions.
1869 (setenv "PYTHONDONTWRITEBYTECODE" "1")
1870 (setenv "NINJAFLAGS"
1871 (string-append "-k1" ;less verbose build output
1872 ;; Respect the '--cores' option of 'guix build'.
1873 " -j" (number->string (parallel-job-count))))))
1874 (replace 'configure
1875 (lambda _
1876 ;; Valid QT_BUILD_PARTS variables are:
1877 ;; libs tools tests examples demos docs translations
1878 (invoke "qmake" "QT_BUILD_PARTS = libs tools" "--"
1879 "--webengine-printing-and-pdf=no"
1880 "--webengine-ffmpeg=system"
1881 ;; FIXME: Building qtwebengine 5.12.2 with
1882 ;; icu4c >= 68 fails.
1883 ;;"--webengine-icu=system"
1884 "--webengine-pepper-plugins=no"
1885 "-webengine-proprietary-codecs")))))
1886 ;; Tests are disabled due to "Could not find QtWebEngineProcess error"
1887 ;; It's possible this can be fixed by setting QTWEBENGINEPROCESS_PATH
1888 ;; before running tests.
1889 ((#:tests? _ #f) #f)))
1890 (native-search-paths
1891 (list (search-path-specification
1892 (file-type 'regular)
1893 (separator #f)
1894 (variable "QTWEBENGINEPROCESS_PATH")
1895 (files '("lib/qt5/libexec/QtWebEngineProcess")))))
1896 (home-page "https://wiki.qt.io/QtWebEngine")
1897 (synopsis "Qt WebEngine module")
1898 (description "The Qt5WebEngine module provides support for web applications
1899 using the Chromium browser project. The Chromium source code has Google services
1900 and binaries removed, and adds modular support for using system libraries.")
1901 (license license:lgpl2.1+)))
1902
1903 (define-public single-application-qt5
1904 ;; Change in function signature, nheko requires at least this commit
1905 (let ((commit "dc8042b5db58f36e06ba54f16f38b16c5eea9053"))
1906 (package
1907 (name "single-application-qt5")
1908 (version (string-append "3.2.0-" (string-take commit 7)))
1909 (source
1910 (origin
1911 (method git-fetch)
1912 (uri
1913 (git-reference
1914 (url "https://github.com/itay-grudev/SingleApplication")
1915 (commit commit)))
1916 (file-name (git-file-name name version))
1917 (sha256
1918 (base32
1919 "163aa2x2qb0h8w26si5ql833ilj427jjbdwlz1p2p8iaq6dh0vq1"))))
1920 (build-system cmake-build-system)
1921 (arguments
1922 `(#:tests? #f ; no check target
1923 ;; Projects can decide how to build this library. You might need to
1924 ;; override this flag (QApplication, QGuiApplication or
1925 ;; QCoreApplication).
1926 #:configure-flags '("-DQAPPLICATION_CLASS=QApplication")
1927 #:phases
1928 (modify-phases %standard-phases
1929 ;; No install target, install things manually
1930 (replace 'install
1931 (lambda* (#:key inputs outputs source #:allow-other-keys)
1932 (let* ((qt (assoc-ref inputs "qtbase"))
1933 (qt-version ,(version-major (package-version qtbase-5)))
1934 (out (assoc-ref outputs "out")))
1935 (install-file
1936 "libSingleApplication.a" (string-append out "/lib"))
1937 (for-each
1938 (lambda (file)
1939 (install-file
1940 (string-append source "/" file)
1941 (string-append out "/include")))
1942 '("SingleApplication"
1943 "singleapplication.h" "singleapplication_p.h"))
1944 #t))))))
1945 (inputs
1946 (list qtbase-5))
1947 (home-page "https://github.com/itay-grudev/SingleApplication")
1948 (synopsis "Replacement of QtSingleApplication for Qt5 and Qt6")
1949 (description
1950 "SingleApplication is a replacement of the QtSingleApplication for Qt5 and Qt6.
1951
1952 It keeps the Primary Instance of your Application and kills each subsequent
1953 instances. It can (if enabled) spawn secondary (non-related to the primary)
1954 instances and can send data to the primary instance from secondary
1955 instances.")
1956 (license license:expat))))
1957
1958 (define-public python-sip
1959 (package
1960 (name "python-sip")
1961 (version "5.5.0")
1962 (source
1963 (origin
1964 (method url-fetch)
1965 (uri (list (pypi-uri "sip" version)
1966 (string-append "https://www.riverbankcomputing.com/static/"
1967 "Downloads/sip/" version
1968 "/sip-" version ".tar.gz")))
1969 (sha256
1970 (base32
1971 "1idaivamp1jvbbai9yzv471c62xbqxhaawccvskaizihkd0lq0jx"))))
1972 (build-system python-build-system)
1973 (native-inputs
1974 (list python-wrapper))
1975 (propagated-inputs
1976 (list python-toml python-packaging))
1977 (home-page "https://www.riverbankcomputing.com/software/sip/intro")
1978 (synopsis "Python binding creator for C and C++ libraries")
1979 (description
1980 "SIP is a tool to create Python bindings for C and C++ libraries. It
1981 was originally developed to create PyQt, the Python bindings for the Qt
1982 toolkit, but can be used to create bindings for any C or C++ library.
1983
1984 SIP comprises a code generator and a Python module. The code generator
1985 processes a set of specification files and generates C or C++ code, which
1986 is then compiled to create the bindings extension module. The SIP Python
1987 module provides support functions to the automatically generated code.")
1988 ;; There is a choice between a python like license, gpl2 and gpl3.
1989 ;; For compatibility with pyqt, we need gpl3.
1990 (license license:gpl3)))
1991
1992 (define-public python-sip-4
1993 (package
1994 (inherit python-sip)
1995 (name "python-sip")
1996 (version "4.19.25")
1997 (source
1998 (origin
1999 (method url-fetch)
2000 (uri (list (pypi-uri "sip" version)
2001 (string-append "https://www.riverbankcomputing.com/static/"
2002 "Downloads/sip/" version
2003 "/sip-" version ".tar.gz")))
2004 (sha256
2005 (base32
2006 "04a23cgsnx150xq86w1z44b6vr2zyazysy9mqax0fy346zlr77dk"))))
2007 (build-system gnu-build-system)
2008 (native-inputs
2009 `(("python" ,python-wrapper)))
2010 (propagated-inputs `())
2011 (arguments
2012 `(#:tests? #f ; no check target
2013 #:imported-modules ((guix build python-build-system)
2014 ,@%gnu-build-system-modules)
2015 #:modules ((srfi srfi-1)
2016 ((guix build python-build-system) #:select (python-version))
2017 ,@%gnu-build-system-modules)
2018 #:phases
2019 (modify-phases %standard-phases
2020 (replace 'configure
2021 (lambda* (#:key inputs outputs #:allow-other-keys)
2022 (let* ((out (assoc-ref outputs "out"))
2023 (bin (string-append out "/bin"))
2024 (include (string-append out "/include"))
2025 (python (assoc-ref inputs "python"))
2026 (lib (string-append out "/lib/python"
2027 (python-version python)
2028 "/site-packages")))
2029 (invoke "python" "configure.py"
2030 "--bindir" bin
2031 "--destdir" lib
2032 "--incdir" include)))))))
2033 (license license:gpl3)))
2034
2035 (define-public python-pyqt
2036 (package
2037 (name "python-pyqt")
2038 (version "5.15.5")
2039 (source
2040 (origin
2041 (method url-fetch)
2042 ;; PyPI is the canonical distribution point of PyQt. Older
2043 ;; releases are available from the web site.
2044 (uri (list (pypi-uri "PyQt5" version)
2045 (string-append "https://www.riverbankcomputing.com/static/"
2046 "Downloads/PyQt5/" version "/PyQt5-"
2047 version ".tar.gz")))
2048 (file-name (string-append "PyQt5-" version ".tar.gz"))
2049 (sha256
2050 (base32
2051 "0aya963kkmbwfwmpd0p6k85y4g7wl5zarjqxxfgir403zalbf4dl"))
2052 (patches (search-patches "pyqt-configure.patch"))))
2053 (build-system gnu-build-system)
2054 (native-inputs
2055 (list qtbase-5)) ; for qmake
2056 (propagated-inputs
2057 (list python-sip python-pyqt5-sip))
2058 (inputs
2059 `(("python" ,python-wrapper)
2060 ("qtbase" ,qtbase-5)
2061 ("qtconnectivity" ,qtconnectivity)
2062 ("qtdeclarative" ,qtdeclarative)
2063 ("qtlocation" ,qtlocation)
2064 ("qtmultimedia" ,qtmultimedia)
2065 ("qtsensors" ,qtsensors)
2066 ("qtserialport" ,qtserialport)
2067 ("qtsvg" ,qtsvg)
2068 ("qttools" ,qttools)
2069 ("qtwebchannel" ,qtwebchannel)
2070 ("qtwebkit" ,qtwebkit)
2071 ("qtwebsockets" ,qtwebsockets)
2072 ("qtx11extras" ,qtx11extras)
2073 ("qtxmlpatterns" ,qtxmlpatterns)))
2074 (arguments
2075 `(#:modules ((srfi srfi-1)
2076 ((guix build python-build-system) #:select (python-version))
2077 ,@%gnu-build-system-modules)
2078 #:imported-modules ((guix build python-build-system)
2079 ,@%gnu-build-system-modules)
2080 #:phases
2081 (modify-phases %standard-phases
2082 ;; When building python-pyqtwebengine, <qprinter.h> can not be
2083 ;; included. Here we substitute the full path to the header in the
2084 ;; store.
2085 (add-before 'configure 'substitute-source
2086 (lambda* (#:key inputs #:allow-other-keys)
2087 (let* ((qtbase (assoc-ref inputs "qtbase"))
2088 (qtprinter.h (string-append "\"" qtbase "/include/qt5/QtPrintSupport/qprinter.h\"")))
2089 (substitute* "sip/QtPrintSupport/qprinter.sip"
2090 (("<qprinter.h>")
2091 qtprinter.h))
2092 #t)))
2093 (replace 'configure
2094 (lambda* (#:key inputs outputs #:allow-other-keys)
2095 (let* ((out (assoc-ref outputs "out"))
2096 (bin (string-append out "/bin"))
2097 (sip (string-append out "/share/sip"))
2098 (plugins (string-append out "/lib/qt5/plugins"))
2099 (designer (string-append plugins "/designer"))
2100 (qml (string-append plugins "/PyQt5"))
2101 (python (assoc-ref inputs "python"))
2102 (lib (string-append out "/lib/python"
2103 (python-version python)
2104 "/site-packages"))
2105 (stubs (string-append lib "/PyQt5")))
2106 (invoke "python" "configure.py"
2107 "--confirm-license"
2108 "--bindir" bin
2109 "--destdir" lib
2110 "--designer-plugindir" designer
2111 "--qml-plugindir" qml
2112 ; Where to install the PEP 484 Type Hints stub
2113 ; files. Without this the stubs are tried to be
2114 ; installed into the python package's
2115 ; site-package directory, which is read-only.
2116 "--stubsdir" stubs
2117 "--sipdir" sip)))))))
2118 (home-page "https://www.riverbankcomputing.com/software/pyqt/intro")
2119 (synopsis "Python bindings for Qt")
2120 (description
2121 "PyQt is a set of Python v2 and v3 bindings for the Qt application
2122 framework. The bindings are implemented as a set of Python modules and
2123 contain over 620 classes.")
2124 (license license:gpl3)))
2125
2126 (define-public python-pyqt5-sip
2127 (package
2128 (name "python-pyqt5-sip")
2129 (version "12.10.1")
2130 (source
2131 (origin
2132 (method url-fetch)
2133 (uri (pypi-uri "PyQt5_sip" version))
2134 (sha256
2135 (base32
2136 "09771b6fdn0rx34l5a0wzcd899yd57zxp5sw3bsqhd25biwhiq4p"))))
2137 (build-system python-build-system)
2138 (arguments
2139 `(#:tests? #f)) ;; No test code.
2140 (home-page "https://www.riverbankcomputing.com/software/sip/")
2141 (synopsis "Sip module support for PyQt5")
2142 (description "Sip module support for PyQt5")
2143 (license license:lgpl2.1+)))
2144
2145 (define-public python-pyqtwebengine
2146 (package
2147 (name "python-pyqtwebengine")
2148 (version "5.15.5")
2149 (source
2150 (origin
2151 (method url-fetch)
2152 ;; The newest releases are only available on PyPI. Older ones
2153 ;; are mirrored at the upstream home page.
2154 (uri (list (pypi-uri "PyQtWebEngine" version)
2155 (string-append "https://www.riverbankcomputing.com/static"
2156 "/Downloads/PyQtWebEngine/" version
2157 "/PyQtWebEngine-" version ".tar.gz")))
2158 (sha256
2159 (base32
2160 "0hdr0g0rzlhsnylhfk826pq1lw8p9dqcr8yma2wy9dgjrj6n0ixb"))))
2161 (build-system gnu-build-system)
2162 (native-inputs
2163 (list python python-sip
2164 ;; qtbase is required for qmake
2165 qtbase-5))
2166 (inputs
2167 `(("python" ,python-wrapper)
2168 ("python-sip" ,python-sip)
2169 ("python-pyqt" ,python-pyqt-without-qtwebkit)
2170 ("qtbase" ,qtbase-5)
2171 ("qtsvg" ,qtsvg)
2172 ("qtdeclarative" ,qtdeclarative)
2173 ("qtwebchannel" ,qtwebchannel)
2174 ("qtwebengine" ,qtwebengine)))
2175 (arguments
2176 `(#:modules ((srfi srfi-1)
2177 ((guix build python-build-system) #:select (python-version))
2178 ,@%gnu-build-system-modules)
2179 #:imported-modules ((guix build python-build-system)
2180 ,@%gnu-build-system-modules)
2181 #:phases
2182 (modify-phases %standard-phases
2183 (replace 'configure
2184 (lambda* (#:key inputs outputs #:allow-other-keys)
2185 (let* ((out (assoc-ref outputs "out"))
2186 (sipdir (string-append out "/share/sip"))
2187 (pyqt-sipdir (string-append
2188 (assoc-ref inputs "python-pyqt") "/share/sip"))
2189 (python (assoc-ref inputs "python"))
2190 (lib (string-append out "/lib/python"
2191 (python-version python)
2192 "/site-packages/PyQt5"))
2193 (stubs (string-append lib "/PyQt5")))
2194
2195 (mkdir-p sipdir)
2196 (invoke "python" "configure.py"
2197 "-w"
2198 "--no-dist-info"
2199 "--destdir" lib
2200 "--no-qsci-api"
2201 "--stubsdir" stubs
2202 "--sipdir" sipdir
2203 "--pyqt-sipdir" pyqt-sipdir))))
2204 ;; Because this has a different prefix than python-pyqt then we need
2205 ;; to make this a namespace of its own.
2206 (add-after 'install 'make-namespace
2207 (lambda* (#:key inputs outputs #:allow-other-keys)
2208 (let* ((__init__.py (string-append
2209 (assoc-ref outputs "out")
2210 "/lib/python"
2211 (python-version (assoc-ref inputs "python"))
2212 "/site-packages/PyQt5/__init__.py")))
2213 (with-output-to-file __init__.py
2214 (lambda _ (display "
2215 from pkgutil import extend_path
2216 __path__ = extend_path(__path__, __name__)
2217 ")))
2218 #t))))))
2219 (home-page "https://www.riverbankcomputing.com/software/pyqtwebengine/intro")
2220 (synopsis "Python bindings for QtWebEngine")
2221 (description
2222 "PyQtWebEngine is a set of Python bindings for The Qt Company's Qt
2223 WebEngine libraries. The bindings sit on top of PyQt5 and are implemented as a
2224 set of three modules. Prior to v5.12 these bindings were part of PyQt
2225 itself.")
2226 (license license:gpl3)))
2227
2228 ;; XXX: This is useful for removing qtwebkit from other packages' dependency
2229 ;; graphs, as well as for preventing python-pyqtwebengine from transitively
2230 ;; depending on qtwebkit.
2231 ;; Ultimately, it would be nicer to have a more modular set of python-pyqt-*
2232 ;; packages that could be used together.
2233 (define-public python-pyqt-without-qtwebkit
2234 (package/inherit python-pyqt
2235 (name "python-pyqt-without-qtwebkit")
2236 (inputs
2237 (alist-delete "qtwebkit" (package-inputs python-pyqt)))))
2238
2239 (define-public python-pyqt-builder
2240 (package
2241 (name "python-pyqt-builder")
2242 (version "1.9.0")
2243 (source
2244 (origin
2245 (method url-fetch)
2246 (uri (pypi-uri "PyQt-builder" version))
2247 (sha256
2248 (base32
2249 "0nh0054c54ji3sm6d268fccf0y5f613spswwgwqd3rnn816hnljl"))))
2250 (build-system python-build-system)
2251 (inputs
2252 (list python-sip))
2253 (home-page "https://www.riverbankcomputing.com/static/Docs/PyQt-builder/")
2254 (synopsis "PEP 517 compliant PyQt build system")
2255 (description "PyQt-builder is a tool for generating Python bindings for C++
2256 libraries that use the Qt application framework. The bindings are built on
2257 top of the PyQt bindings for Qt. PyQt-builder is used to build PyQt itself.")
2258 ;; Either version 2 or 3, but no other version. See the file
2259 ;; 'pyqtbuild/builder.py' in the source distribution for more information.
2260 (license (list license:gpl2 license:gpl3))))
2261
2262 (define-public python-qtpy
2263 (package
2264 (name "python-qtpy")
2265 (version "2.0.1")
2266 (source
2267 (origin
2268 (method url-fetch)
2269 (uri (pypi-uri "QtPy" version))
2270 (sha256
2271 (base32
2272 "13zbhnl2rm30xafwrzfwdb4mjp7gk4s9h2xagbf83pnjzczhgzdd"))))
2273 (build-system python-build-system)
2274 (propagated-inputs (list python-packaging))
2275 (arguments
2276 `(;; Not all supported bindings are packaged. Especially PyQt4.
2277 #:tests? #f))
2278 (home-page "https://github.com/spyder-ide/qtpy")
2279 (synopsis
2280 "Qt bindings (PyQt5, PyQt4 and PySide) and additional custom QWidgets")
2281 (description
2282 "Provides an abstraction layer on top of the various Qt bindings
2283 (PyQt5, PyQt4 and PySide) and additional custom QWidgets.")
2284 (license license:expat)))
2285
2286 (define-public qscintilla
2287 (package
2288 (name "qscintilla")
2289 (version "2.11.6")
2290 (source (origin
2291 (method url-fetch)
2292 (uri (string-append "https://www.riverbankcomputing.com/static"
2293 "/Downloads/QScintilla/" version
2294 "/QScintilla-" version ".tar.gz"))
2295 (sha256
2296 (base32
2297 "19r0vpqb4m9bqwxmjp9w6x0hgahkrg7zryk78hwgplj7vdbn0d77"))))
2298 (build-system gnu-build-system)
2299 (arguments
2300 `(#:phases
2301 (modify-phases %standard-phases
2302 (replace 'configure
2303 (lambda* (#:key outputs #:allow-other-keys)
2304 (let ((out (assoc-ref outputs "out")))
2305 (chdir "Qt4Qt5")
2306 (substitute* "qscintilla.pro"
2307 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
2308 (string-append out "/lib"))
2309 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
2310 (string-append out "/include"))
2311 (("\\$\\$\\[QT_INSTALL_TRANSLATIONS\\]")
2312 (string-append out "/translations"))
2313 (("\\$\\$\\[QT_INSTALL_DATA\\]")
2314 (string-append out "/lib/qt$${QT_MAJOR_VERSION}"))
2315 (("\\$\\$\\[QT_HOST_DATA\\]")
2316 (string-append out "/lib/qt$${QT_MAJOR_VERSION}")))
2317 (invoke "qmake")))))))
2318 (native-inputs (list qtbase-5))
2319 (home-page "https://www.riverbankcomputing.co.uk/software/qscintilla/intro")
2320 (synopsis "Qt port of the Scintilla C++ editor control")
2321 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
2322 editor control. QScintilla includes features especially useful when editing
2323 and debugging source code. These include support for syntax styling, error
2324 indicators, code completion and call tips.")
2325 (license license:gpl3+)))
2326
2327 (define-public python-qscintilla
2328 (package/inherit qscintilla
2329 (name "python-qscintilla")
2330 (arguments
2331 `(#:configure-flags
2332 (list "--pyqt=PyQt5"
2333 (string-append "--pyqt-sipdir="
2334 (assoc-ref %build-inputs "python-pyqt")
2335 "/share/sip")
2336 (string-append "--qsci-incdir="
2337 (assoc-ref %build-inputs "qscintilla")
2338 "/include")
2339 (string-append "--qsci-libdir="
2340 (assoc-ref %build-inputs "qscintilla")
2341 "/lib"))
2342 #:phases
2343 (modify-phases %standard-phases
2344 (replace 'configure
2345 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
2346 (let ((out (assoc-ref outputs "out"))
2347 (python (assoc-ref inputs "python")))
2348 (chdir "Python")
2349 (apply invoke "python3" "configure.py"
2350 configure-flags)
2351 ;; Install to the right directory
2352 (substitute* '("Makefile"
2353 "Qsci/Makefile")
2354 (("\\$\\(INSTALL_ROOT\\)/gnu/store/[^/]+") out)
2355 (((string-append python "/lib"))
2356 (string-append out "/lib")))
2357 ;; And fix the installed.txt file
2358 (substitute* "installed.txt"
2359 (("/gnu/store/[^/]+") out)))
2360 #t)))))
2361 (inputs
2362 `(("qscintilla" ,qscintilla)
2363 ("python" ,python)
2364 ("python-pyqt" ,python-pyqt)))
2365 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
2366 editor control. QScintilla includes features especially useful when editing
2367 and debugging source code. These include support for syntax styling, error
2368 indicators, code completion and call tips.
2369
2370 This package provides the Python bindings.")))
2371
2372 ;; PyQt only looks for modules in its own directory. It ignores environment
2373 ;; variables such as PYTHONPATH, so we need to build a union package to make
2374 ;; it work.
2375 (define-public python-pyqt+qscintilla
2376 (package/inherit python-pyqt
2377 (name "python-pyqt+qscintilla")
2378 (source #f)
2379 (build-system trivial-build-system)
2380 (arguments
2381 '(#:modules ((guix build union))
2382 #:builder (begin
2383 (use-modules (ice-9 match)
2384 (guix build union))
2385 (match %build-inputs
2386 (((names . directories) ...)
2387 (union-build (assoc-ref %outputs "out")
2388 directories)
2389 #t)))))
2390 (inputs
2391 `(("python-pyqt" ,python-pyqt)
2392 ("python-qscintilla" ,python-qscintilla)))
2393 (synopsis "Union of PyQt and the Qscintilla extension")
2394 (description
2395 "This package contains the union of PyQt and the Qscintilla extension.")))
2396
2397 (define-public qtkeychain
2398 (package
2399 (name "qtkeychain")
2400 (version "0.13.2")
2401 (source
2402 (origin
2403 (method git-fetch)
2404 (uri (git-reference
2405 (url "https://github.com/frankosterfeld/qtkeychain/")
2406 (commit (string-append "v" version))))
2407 (file-name (git-file-name name version))
2408 (sha256
2409 (base32
2410 "1zk6r2vc1q48qs7mw2h47bpgrfbb9r7lf9cwq4sb1a4nls87zznk"))))
2411 (build-system cmake-build-system)
2412 (native-inputs
2413 (list pkg-config qttools))
2414 (inputs
2415 (list libsecret qtbase-5))
2416 (arguments
2417 `(#:tests? #f ; No tests included
2418 #:phases
2419 (modify-phases %standard-phases
2420 (add-before 'configure 'set-qt-trans-dir
2421 (lambda _
2422 (substitute* "CMakeLists.txt"
2423 (("\\$\\{qt_translations_dir\\}")
2424 "${CMAKE_INSTALL_PREFIX}/share/qt5/translations")))))))
2425 (home-page "https://github.com/frankosterfeld/qtkeychain")
2426 (synopsis "Qt API to store passwords")
2427 (description
2428 "QtKeychain is a Qt library to store passwords and other secret data
2429 securely. It will not store any data unencrypted unless explicitly requested.")
2430 (license license:bsd-3)))
2431
2432 (define-public qtsolutions
2433 (let ((commit "9568abd142d581b67b86a5f63d823a34b0612702")
2434 (revision "53"))
2435 (package
2436 (name "qtsolutions")
2437 (version (git-version "0" revision commit))
2438 (source
2439 (origin
2440 (method git-fetch)
2441 (uri (git-reference
2442 (url "https://github.com/qtproject/qt-solutions")
2443 (commit commit)))
2444 (file-name (git-file-name name version))
2445 (sha256
2446 (base32 "17fnmassflm3vxi0krpr6fff368jy38cby31a48rban4nqqmgx7n"))
2447 (modules '((guix build utils)
2448 (ice-9 ftw)
2449 (srfi srfi-1)))
2450 (snippet
2451 ;; Unvendor QtLockFile from QtSingleApplication.
2452 '(begin
2453 (with-directory-excursion "qtsingleapplication/src"
2454 (for-each delete-file
2455 (find-files "." "qtlockedfile.*\\.(h|cpp)"))
2456 (substitute* "qtsingleapplication.pri"
2457 ;; Add include path of LockedFile.
2458 (("INCLUDEPATH \\+=")
2459 "INCLUDEPATH += ../../qtlockedfile/src")
2460 ;; Link library of LockedFile.
2461 (("LIBS \\+=")
2462 "LIBS += -lQtSolutions_LockedFile"))
2463 (substitute* '("qtlocalpeer.h" "qtlocalpeer.cpp")
2464 (("#include \"qtlockedfile.*\\.cpp\"") "")
2465 ;; Unwrap namespace added in the vendoring process.
2466 (("QtLP_Private::QtLockedFile")
2467 "QtLockedFile")))
2468 #t))))
2469 (build-system gnu-build-system)
2470 (arguments
2471 `(#:tests? #f ; No target
2472 #:imported-modules
2473 ((guix build copy-build-system)
2474 ,@%gnu-build-system-modules)
2475 #:modules
2476 (((guix build copy-build-system) #:prefix copy:)
2477 (guix build gnu-build-system)
2478 (guix build utils))
2479 #:phases
2480 (modify-phases %standard-phases
2481 (add-after 'unpack 'patch-source
2482 (lambda* (#:key outputs #:allow-other-keys)
2483 (substitute* (find-files "." "common.pri")
2484 ;; Remove unnecessary prefixes/suffixes in library names.
2485 (("qt5") "qt")
2486 (("-head") ""))
2487 ;; Disable building of examples.
2488 (substitute* (find-files "." "\\.pro$")
2489 (("SUBDIRS\\+=examples") ""))
2490 ;; Fix deprecated functions.
2491 (substitute* "qtsoap/src/qtsoap.cpp"
2492 (("toAscii") "toUtf8"))
2493 #t))
2494 (replace 'configure
2495 (lambda _
2496 (for-each (lambda (solution)
2497 (with-directory-excursion solution
2498 (invoke "./configure" "-library")
2499 (invoke "qmake")))
2500 '("qtlockedfile" "qtpropertybrowser" "qtservice"
2501 "qtsingleapplication" "qtsoap"))
2502 #t))
2503 (replace 'build
2504 (lambda _
2505 (for-each (lambda (solution)
2506 (with-directory-excursion solution
2507 (invoke "make")))
2508 '("qtlockedfile" "qtpropertybrowser" "qtservice"
2509 "qtsingleapplication" "qtsoap"))
2510 #t))
2511 (replace 'install
2512 (lambda args
2513 (for-each (lambda (solution)
2514 (with-directory-excursion solution
2515 (apply
2516 (assoc-ref copy:%standard-phases 'install)
2517 #:install-plan
2518 '(("src" "include" #:include-regexp ("\\.h$"))
2519 ("lib" "lib"))
2520 args)))
2521 '("qtlockedfile" "qtpropertybrowser" "qtservice"
2522 "qtsingleapplication" "qtsoap")))))))
2523 (inputs
2524 (list qtbase-5))
2525 (synopsis "Collection of Qt extensions")
2526 (description "QtSolutions is a set of components extending Qt.
2527 @itemize
2528 @item QtLockedFile: A class that extends QFile with advisory locking functions.
2529 @item QtPropertyBrowser: A framework that enables the user to edit a set of
2530 properties.
2531 @item QtService: A helper for writing services such as Unix daemons.
2532 @item QtSingleApplication: A component that provides support for applications
2533 that can be only started once per user.
2534 @item QtSoap: A component that provides basic web service support with version
2535 1.1 of the SOAP protocol.
2536 @end itemize\n")
2537 (home-page "https://doc.qt.io/archives/qq/qq09-qt-solutions.html")
2538 (license (list license:bsd-3
2539 ;; QScriptParser and QScriptGrammar specifically allow
2540 ;; redistribution under GPL3 or LGPL2.1
2541 license:gpl3 license:lgpl2.1)))))
2542
2543 (define-public qwt
2544 (package
2545 (name "qwt")
2546 (version "6.1.5")
2547 (source
2548 (origin
2549 (method url-fetch)
2550 (uri
2551 (string-append "mirror://sourceforge/qwt/qwt/"
2552 version "/qwt-" version ".tar.bz2"))
2553 (sha256
2554 (base32 "0hf0mpca248xlqn7xnzkfj8drf19gdyg5syzklvq8pibxiixwxj0"))))
2555 (build-system gnu-build-system)
2556 (inputs
2557 (list qtbase-5 qtsvg qttools))
2558 (arguments
2559 `(#:phases
2560 (modify-phases %standard-phases
2561 (replace 'configure
2562 (lambda* (#:key outputs #:allow-other-keys)
2563 (let* ((out (assoc-ref outputs "out"))
2564 (docdir (string-append out "/share/doc/qwt"))
2565 (incdir (string-append out "/include/qwt"))
2566 (pluginsdir (string-append out "/lib/qt5/plugins/designer"))
2567 (featuresdir (string-append out "/lib/qt5/mkspecs/features")))
2568 (substitute* '("qwtconfig.pri")
2569 (("^(\\s*QWT_INSTALL_PREFIX)\\s*=.*" _ x)
2570 (format #f "~a = ~a\n" x out))
2571 (("^(QWT_INSTALL_DOCS)\\s*=.*" _ x)
2572 (format #f "~a = ~a\n" x docdir))
2573 (("^(QWT_INSTALL_HEADERS)\\s*=.*" _ x)
2574 (format #f "~a = ~a\n" x incdir))
2575 (("^(QWT_INSTALL_PLUGINS)\\s*=.*" _ x)
2576 (format #f "~a = ~a\n" x pluginsdir))
2577 (("^(QWT_INSTALL_FEATURES)\\s*=.*" _ x)
2578 (format #f "~a = ~a\n" x featuresdir)))
2579 (substitute* '("doc/doc.pro")
2580 ;; We'll install them in the 'install-man-pages' phase.
2581 (("^unix:doc\\.files.*") ""))
2582 (invoke "qmake"))))
2583 (add-after 'install 'install-man-pages
2584 (lambda* (#:key outputs #:allow-other-keys)
2585 (let* ((out (assoc-ref outputs "out"))
2586 (man (string-append out "/share/man")))
2587 ;; Remove some incomplete manual pages.
2588 (for-each delete-file (find-files "doc/man/man3" "^_tmp.*"))
2589 (mkdir-p man)
2590 (copy-recursively "doc/man" man)
2591 #t))))))
2592 (home-page "http://qwt.sourceforge.net")
2593 (synopsis "Qt widgets for plots, scales, dials and other technical software
2594 GUI components")
2595 (description
2596 "The Qwt library contains widgets and components which are primarily useful
2597 for technical and scientific purposes. It includes a 2-D plotting widget,
2598 different kinds of sliders, and much more.")
2599 (license
2600 (list
2601 ;; The Qwt license is LGPL2.1 with some exceptions.
2602 (license:non-copyleft "http://qwt.sourceforge.net/qwtlicense.html")
2603 ;; textengines/mathml/qwt_mml_document.{cpp,h} is dual LGPL2.1/GPL3 (either).
2604 license:lgpl2.1 license:gpl3))))
2605
2606 (define-public qtwebkit
2607 (package
2608 (name "qtwebkit")
2609 (version "5.212.0-alpha4")
2610 (source
2611 (origin
2612 (method url-fetch)
2613 (uri (string-append "https://github.com/annulen/webkit/releases/download/"
2614 "qtwebkit-" version "/qtwebkit-" version ".tar.xz"))
2615 (sha256
2616 (base32
2617 "1rm9sjkabxna67dl7myx9d9vpdyfxfdhrk9w7b94srkkjbd2d8cw"))
2618 (patches (search-patches "qtwebkit-pbutils-include.patch"
2619 "qtwebkit-fix-building-with-bison-3.7.patch"
2620 "qtwebkit-fix-building-with-glib-2.68.patch"
2621 "qtwebkit-fix-building-with-icu-68.patch"
2622 "qtwebkit-fix-building-with-python-3.9.patch"))))
2623 (build-system cmake-build-system)
2624 (native-inputs
2625 (list perl
2626 python
2627 ruby
2628 bison
2629 flex
2630 gperf
2631 pkg-config))
2632 (inputs
2633 `(("icu" ,icu4c)
2634 ("glib" ,glib)
2635 ("gst-plugins-base" ,gst-plugins-base)
2636 ("libjpeg" ,libjpeg-turbo)
2637 ("libpng" ,libpng)
2638 ("libwebp" ,libwebp)
2639 ("sqlite" ,sqlite)
2640 ("fontconfig" ,fontconfig)
2641 ("libxrender" ,libxrender)
2642 ("qtbase" ,qtbase-5)
2643 ("qtdeclarative" ,qtdeclarative)
2644 ("qtlocation" ,qtlocation)
2645 ("qtmultimedia" ,qtmultimedia)
2646 ("qtsensors" ,qtsensors)
2647 ("qtwebchannel" ,qtwebchannel)
2648 ("libxml2" ,libxml2)
2649 ("libxslt" ,libxslt)
2650 ("libx11" ,libx11)
2651 ("libxcomposite" ,libxcomposite)))
2652 (arguments
2653 `(#:tests? #f ; no apparent tests; it might be necessary to set
2654 ; ENABLE_API_TESTS, see CMakeLists.txt
2655
2656 ;; Parallel builds fail due to a race condition:
2657 ;; <https://bugs.gnu.org/34062>.
2658 #:parallel-build? #f
2659
2660 #:configure-flags (list ;"-DENABLE_API_TESTS=TRUE"
2661 "-DPORT=Qt"
2662 "-DUSE_LIBHYPHEN=OFF"
2663 "-DUSE_SYSTEM_MALLOC=ON"
2664 ;; XXX: relative dir installs to build dir?
2665 (string-append "-DECM_MKSPECS_INSTALL_DIR="
2666 %output "/lib/qt5/mkspecs/modules")
2667 ;; Sacrifice a little speed in order to link
2668 ;; libraries and test executables in a
2669 ;; reasonable amount of memory.
2670 "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,--no-keep-memory"
2671 "-DCMAKE_EXE_LINKER_FLAGS=-Wl,--no-keep-memory")))
2672 (home-page "https://www.webkit.org")
2673 (synopsis "Web browser engine and classes to render and interact with web
2674 content")
2675 (description "QtWebKit provides a Web browser engine that makes it easy to
2676 embed content from the World Wide Web into your Qt application. At the same
2677 time Web content can be enhanced with native controls.")
2678 ;; Building QtWebKit takes around 13 hours on an AArch64 machine. Give some
2679 ;; room for slower or busy hardware.
2680 (properties '((timeout . 64800))) ;18 hours
2681
2682 ;; XXX: This consumes too much RAM to successfully build on AArch64 (e.g.,
2683 ;; SoftIron OverDrive with 8 GiB of RAM), so instead of wasting resources,
2684 ;; disable it on non-Intel platforms.
2685 (supported-systems '("x86_64-linux" "i686-linux"))
2686
2687 (license license:lgpl2.1+)))
2688
2689 (define-public dotherside
2690 (package
2691 (name "dotherside")
2692 (version "0.6.4")
2693 (source
2694 (origin
2695 (method git-fetch)
2696 (uri (git-reference
2697 (url "https://github.com/filcuc/DOtherSide")
2698 (commit (string-append "v" version))))
2699 (file-name (git-file-name name version))
2700 (sha256
2701 (base32
2702 "09fz6v8rp28997f235yaifj8p4vvsyv45knc1iivgdvx7msgcd0m"))))
2703 (build-system cmake-build-system)
2704 (native-inputs
2705 (list qttools))
2706 (inputs
2707 (list qtbase-5 qtdeclarative))
2708 (home-page "https://filcuc.github.io/DOtherSide/index.html")
2709 (synopsis "C language library for creating bindings for the Qt QML language")
2710 (description
2711 "DOtherSide is a C language library for creating bindings for the
2712 QT QML language. The following features are implementable from
2713 a binding language:
2714 @itemize
2715 @item Creating custom QObject
2716 @item Creating custom QAbstractListModels
2717 @item Creating custom properties, signals and slots
2718 @item Creating from QML QObject defined in the binded language
2719 @item Creating from Singleton QML QObject defined in the binded language
2720 @end itemize\n")
2721 (license license:lgpl3))) ;version 3 only (+ exception)
2722
2723 ;; There have been no public releases yet.
2724 (define-public qtcolorwidgets
2725 (let ((commit "a95f72e935fe9e046061a1d1c3930cbfbcb533e0")
2726 (revision "1"))
2727 (package
2728 (name "qtcolorwidgets")
2729 (version (git-version "0" revision commit))
2730 (source (origin
2731 (method git-fetch)
2732 (uri (git-reference
2733 (url "https://gitlab.com/mattia.basaglia/Qt-Color-Widgets")
2734 (commit commit)))
2735 (file-name (git-file-name name version))
2736 (sha256
2737 (base32
2738 "0dkiwlqh2gwhlp78c1fmchj3shl4p9inspcl96ya5aa8mn6kydy8"))))
2739 (build-system cmake-build-system)
2740 (arguments `(#:tests? #f)) ; There are no tests
2741 (native-inputs
2742 (list qttools))
2743 (inputs
2744 (list qtbase-5))
2745 (home-page "https://gitlab.com/mattia.basaglia/Qt-Color-Widgets")
2746 (synopsis "Color management widgets")
2747 (description "QtColorWidgets provides a Qt color dialog that is more
2748 user-friendly than the default @code{QColorDialog} and several other
2749 color-related widgets.")
2750 ;; Includes a license exception for combining with GPL2 code.
2751 (license license:lgpl3+))))
2752
2753 (define-public qcustomplot
2754 (package
2755 (name "qcustomplot")
2756 (version "2.1.0")
2757 (source
2758 (origin
2759 (method url-fetch)
2760 (uri (string-append "https://www.qcustomplot.com/release/"
2761 version "fixed" "/QCustomPlot.tar.gz"))
2762 (sha256
2763 (base32 "1324kqyj1v1f8k8d7b15gc3apwz9qxx52p86hvchg33hjdlqhskx"))))
2764 (native-inputs
2765 `(("qcustomplot-sharedlib"
2766 ,(origin
2767 (method url-fetch)
2768 (uri (string-append "https://www.qcustomplot.com/release/"
2769 version "fixed" "/QCustomPlot-sharedlib.tar.gz"))
2770 (sha256
2771 (base32 "0vp8lpxvd1nlp4liqrlvslpqrgfn0wpiwizzdsjbj22zzb8vxikc"))))))
2772 (inputs
2773 (list qtbase-5))
2774 (build-system gnu-build-system)
2775 (arguments
2776 `(#:phases
2777 (modify-phases %standard-phases
2778 (add-after 'unpack 'unpack-extra-files
2779 (lambda* (#:key inputs #:allow-other-keys)
2780 (invoke "tar" "-xvf" (assoc-ref inputs "qcustomplot-sharedlib"))))
2781 (replace 'configure
2782 (lambda* (#:key outputs #:allow-other-keys)
2783 (chdir "qcustomplot-sharedlib/sharedlib-compilation")
2784 (substitute* "sharedlib-compilation.pro"
2785 ;; Don't build debug library.
2786 (("debug_and_release")
2787 "release"))
2788 (invoke "qmake"
2789 (string-append "DESTDIR="
2790 (assoc-ref outputs "out")
2791 "/lib"))))
2792 (add-after 'install 'install-header
2793 (lambda* (#:key outputs #:allow-other-keys)
2794 (install-file "../../qcustomplot.h"
2795 (string-append (assoc-ref outputs "out")
2796 "/include")))))))
2797 (home-page "https://www.qcustomplot.com/")
2798 (synopsis "Qt widget for plotting and data visualization")
2799 (description
2800 "QCustomPlot is a Qt C++ widget providing 2D plots, graphs and charts.")
2801 (license license:gpl3+)))
2802
2803 (define-public python-shiboken-2
2804 (package
2805 (name "python-shiboken-2")
2806 (version "5.15.4")
2807 (source (origin
2808 (method url-fetch)
2809 (uri (string-append "https://download.qt.io/official_releases"
2810 "/QtForPython/pyside2/PySide2-" version
2811 "-src/pyside-setup-opensource-src-"
2812 version ".tar.xz"))
2813 (sha256
2814 (base32
2815 "02s52hxdsg925zrflxrsk3l7l9wd6c306ds10rfyy4a1xw6yss1w"))))
2816 (build-system cmake-build-system)
2817 (inputs
2818 (list clang-toolchain
2819 libxml2
2820 libxslt
2821 python-wrapper
2822 qtbase-5
2823 qtxmlpatterns))
2824 (arguments
2825 `(#:tests? #f
2826 ;; FIXME: Building tests fails
2827 #:configure-flags '("-DBUILD_TESTS=off")
2828 #:phases
2829 (modify-phases %standard-phases
2830 (add-after 'unpack 'use-shiboken-dir-only
2831 (lambda _ (chdir "sources/shiboken2") #t))
2832 (add-before 'configure 'make-files-writable-and-update-timestamps
2833 (lambda _
2834 ;; The build scripts need to modify some files in
2835 ;; the read-only source directory, and also attempts
2836 ;; to create Zip files which fails because the Zip
2837 ;; format does not support timestamps before 1980.
2838 (let ((circa-1980 (* 10 366 24 60 60)))
2839 (for-each (lambda (file)
2840 (make-file-writable file)
2841 (utime file circa-1980 circa-1980))
2842 (find-files ".")))
2843 #t))
2844 (add-before 'configure 'set-build-env
2845 (lambda* (#:key inputs #:allow-other-keys)
2846 (let ((llvm (assoc-ref inputs "clang-toolchain")))
2847 (setenv "CLANG_INSTALL_DIR" llvm)
2848 #t))))))
2849 (home-page "https://wiki.qt.io/Qt_for_Python")
2850 (synopsis
2851 "Shiboken generates bindings for C++ libraries using CPython source code")
2852 (description
2853 "Shiboken generates bindings for C++ libraries using CPython source code")
2854 (license
2855 (list
2856 ;; The main code is GPL3 or LGPL3.
2857 ;; Examples are BSD-3.
2858 license:gpl3
2859 license:lgpl3
2860 license:bsd-3))))
2861
2862 (define-public python-pyside-2
2863 (package
2864 (name "python-pyside-2")
2865 (version (package-version python-shiboken-2))
2866 (source (package-source python-shiboken-2))
2867 (build-system cmake-build-system)
2868 (inputs
2869 (list libxml2
2870 libxslt
2871 clang-toolchain
2872 qtbase-5
2873 qtdatavis3d
2874 qtdeclarative
2875 qtlocation
2876 qtmultimedia
2877 qtquickcontrols
2878 qtquickcontrols2
2879 qtscript
2880 qtscxml
2881 qtsensors
2882 qtspeech
2883 qtsvg
2884 qtwebchannel
2885 qtwebengine
2886 qtwebsockets
2887 qtx11extras
2888 qtxmlpatterns))
2889 (propagated-inputs
2890 (list python-shiboken-2))
2891 (native-inputs
2892 `(("cmake" ,cmake-minimal)
2893 ("python" ,python-wrapper)
2894 ("qttools" ,qttools)
2895 ("which" ,which)))
2896 (arguments
2897 `(#:tests? #f
2898 ;; FIXME: Building tests fail.
2899 #:configure-flags
2900 (list "-DBUILD_TESTS=FALSE"
2901 (string-append "-DPYTHON_EXECUTABLE="
2902 (assoc-ref %build-inputs "python")
2903 "/bin/python"))
2904 #:modules ((guix build cmake-build-system)
2905 (guix build utils)
2906 (srfi srfi-1))
2907 #:phases
2908 (modify-phases %standard-phases
2909 (add-after 'unpack 'go-to-source-dir
2910 (lambda _ (chdir "sources/pyside2") #t))
2911 (add-after 'go-to-source-dir 'fix-qt-module-detection
2912 (lambda* (#:key inputs #:allow-other-keys)
2913 ;; Activate qt module support even if it not in the same
2914 ;; directory as qtbase.
2915 (substitute* "../cmake_helpers/helpers.cmake"
2916 (("\\(\"\\$\\{found_basepath\\}\" GREATER \"0\"\\)")
2917 "true"))
2918 ;; Add include directories for qt modules.
2919 (let ((dirs (map (lambda (name)
2920 (string-append (assoc-ref inputs name)
2921 "/include/qt5"))
2922 '("qtdatavis3d"
2923 "qtdeclarative"
2924 "qtlocation"
2925 "qtmultimedia"
2926 "qtquickcontrols"
2927 "qtquickcontrols2"
2928 "qtscript"
2929 "qtscxml"
2930 "qtsensors"
2931 "qtspeech"
2932 "qtsvg"
2933 "qttools"
2934 "qtwebchannel"
2935 "qtwebengine"
2936 "qtwebsockets"
2937 "qtx11extras"
2938 "qtxmlpatterns"))))
2939 (substitute* "cmake/Macros/PySideModules.cmake"
2940 (("\\$\\{PATH_SEP\\}\\$\\{core_includes\\}" all)
2941 (fold (lambda (dir paths)
2942 (string-append paths "${PATH_SEP}" dir))
2943 all
2944 dirs)))
2945 (setenv "CXXFLAGS" (fold (lambda (dir paths)
2946 (string-append paths " -I" dir))
2947 ""
2948 dirs)))))
2949 (add-before 'configure 'set-clang-dir
2950 (lambda* (#:key inputs #:allow-other-keys)
2951 (let ((clang (assoc-ref inputs "clang-toolchain")))
2952 (setenv "CLANG_INSTALL_DIR" clang)
2953 #t))))))
2954 (home-page "https://wiki.qt.io/Qt_for_Python")
2955 (synopsis
2956 "The Qt for Python product enables the use of Qt5 APIs in Python applications")
2957 (description
2958 "The Qt for Python product enables the use of Qt5 APIs in Python
2959 applications. It lets Python developers utilize the full potential of Qt,
2960 using the PySide2 module. The PySide2 module provides access to the
2961 individual Qt modules such as QtCore, QtGui,and so on. Qt for Python also
2962 comes with the Shiboken2 CPython binding code generator, which can be used to
2963 generate Python bindings for your C or C++ code.")
2964 (license (list
2965 license:lgpl3
2966 ;;They state that:
2967 ;; this file may be used under the terms of the GNU General
2968 ;; Public License version 2.0 or (at your option) the GNU
2969 ;; General Public license version 3 or any later version
2970 ;; approved by the KDE Free Qt Foundation.
2971 ;; Thus, it is currently v2 or v3, but no "+".
2972 license:gpl3
2973 license:gpl2))))
2974
2975 (define-public python-pyside-2-tools
2976 (package
2977 (name "python-pyside-2-tools")
2978 (version (package-version python-shiboken-2))
2979 (source (package-source python-shiboken-2))
2980 (build-system cmake-build-system)
2981 (inputs
2982 (list python-pyside-2 python-shiboken-2 qtbase-5))
2983 (native-inputs
2984 `(("python" ,python-wrapper)))
2985 (arguments
2986 `(#:tests? #f
2987 #:configure-flags
2988 (list "-DBUILD_TESTS=off"
2989 (string-append "-DPYTHON_EXECUTABLE="
2990 (assoc-ref %build-inputs "python")
2991 "/bin/python"))
2992 #:phases (modify-phases %standard-phases
2993 (add-after 'unpack 'go-to-source-dir
2994 (lambda _ (chdir "sources/pyside2-tools") #t)))))
2995 (home-page "https://wiki.qt.io/Qt_for_Python")
2996 (synopsis
2997 "Contains command line tools for PySide2")
2998 (description
2999 "Contains lupdate, rcc and uic tools for PySide2")
3000 (license license:gpl2)))
3001
3002 (define-public libqglviewer
3003 (package
3004 (name "libqglviewer")
3005 (version "2.7.2")
3006 (source (origin
3007 (method url-fetch)
3008 (uri
3009 (string-append "http://libqglviewer.com/src/libQGLViewer-"
3010 version ".tar.gz"))
3011 (sha256
3012 (base32
3013 "023w7da1fyn2z69nbkp2rndiv886zahmc5cmira79zswxjfpklp2"))))
3014 (build-system gnu-build-system)
3015 (arguments
3016 '(#:tests? #f ; no check target
3017 #:make-flags
3018 (list (string-append "PREFIX="
3019 (assoc-ref %outputs "out")))
3020 #:phases
3021 (modify-phases %standard-phases
3022 (replace 'configure
3023 (lambda* (#:key make-flags #:allow-other-keys)
3024 (apply invoke (cons "qmake" make-flags)))))))
3025 (native-inputs
3026 (list qtbase-5 qttools))
3027 (inputs
3028 (list glu))
3029 (home-page "http://libqglviewer.com")
3030 (synopsis "Qt-based C++ library for the creation of OpenGL 3D viewers")
3031 (description
3032 "@code{libQGLViewer} is a C++ library based on Qt that eases the creation
3033 of OpenGL 3D viewers.
3034
3035 It provides some of the typical 3D viewer functionalities, such as the
3036 possibility to move the camera using the mouse, which lacks in most of the
3037 other APIs. Other features include mouse manipulated frames, interpolated
3038 keyFrames, object selection, stereo display, screenshot saving and much more.
3039 It can be used by OpenGL beginners as well as to create complex applications,
3040 being fully customizable and easy to extend.")
3041 ;; According to LICENSE, either version 2 or version 3 of the GNU GPL may
3042 ;; be used.
3043 (license (list license:gpl2 license:gpl3))))
3044
3045 (define-public qhexedit
3046 (package
3047 (name "qhexedit")
3048 (version "0.8.9")
3049 (source
3050 (origin
3051 (method git-fetch)
3052 (uri (git-reference
3053 (url "https://github.com/Simsys/qhexedit2")
3054 (commit (string-append "v" version))))
3055 (file-name (git-file-name name version))
3056 (sha256
3057 (base32 "1j333kiwhbidphdx86yilkaivgl632spfh6fqx93bc80gk4is3xa"))))
3058 (build-system gnu-build-system)
3059 (arguments
3060 `(#:phases
3061 (modify-phases %standard-phases
3062 (add-after 'unpack 'fix-path
3063 (lambda* (#:key outputs #:allow-other-keys)
3064 (substitute* "src/qhexedit.pro"
3065 (("^unix:DESTDIR = /usr/lib")
3066 (string-append "unix:DESTDIR = "
3067 (assoc-ref outputs "out") "/lib")))))
3068 (replace 'configure
3069 (lambda _
3070 (chdir "src")
3071 (invoke "qmake" "qhexedit.pro")))
3072 (add-after 'install 'install-headers
3073 (lambda* (#:key outputs #:allow-other-keys)
3074 (let* ((out (assoc-ref outputs "out"))
3075 (include-dir (string-append out "/include")))
3076 (mkdir-p include-dir)
3077 (for-each (lambda (file)
3078 (install-file file include-dir))
3079 (find-files "." "\\.h$"))))))))
3080 (inputs (list qtbase-5))
3081 (native-inputs (list qttools))
3082 (home-page "https://simsys.github.io")
3083 (synopsis "Binary editor widget for Qt")
3084 (description
3085 "@code{QHexEdit} is a hex editor widget for the Qt framework. It is a
3086 simple editor for binary data, just like @code{QPlainTextEdit} is for text
3087 data.")
3088 (license license:lgpl2.1)))
3089
3090 (define-public soqt
3091 (let ((commit-ref "fb8f655632bb9c9c60e0ff9fa69a5ba22d3ff99d")
3092 (revision "1"))
3093 (package
3094 (name "soqt")
3095 (version (git-version "1.6.0" revision commit-ref))
3096 (source
3097 (origin
3098 (method git-fetch)
3099 (uri (git-reference
3100 (url "https://github.com/coin3d/soqt")
3101 (commit commit-ref)
3102 (recursive? #t)))
3103 (file-name (git-file-name name version))
3104 (sha256
3105 (base32 "16vikb3fy8rmk10sg5g0gy2c343hi3x7zccsga90ssnkzpq6m032"))))
3106 (build-system cmake-build-system)
3107 (arguments '(#:tests? #f)) ; There are no tests
3108 (native-inputs
3109 (list pkg-config cmake))
3110 (inputs
3111 (list qtbase-5 coin3D-4))
3112 (home-page "https://github.com/coin3d/soqt")
3113 (synopsis "Qt GUI component toolkit library for Coin")
3114 (description "SoQt is a Qt GUI component toolkit library for Coin. It is
3115 also compatible with SGI and TGS Open Inventor, and the API is based on the API
3116 of the InventorXt GUI component toolkit.")
3117 (license license:bsd-3))))