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