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