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