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