gnu: Add libwhich.
[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 'fix-build-with-newer-re2
1814 (lambda _
1815 ;; Adjust for API change in re2, taken from
1816 ;; https://chromium-review.googlesource.com/c/chromium/src/+/2145261
1817 (substitute* "src/3rdparty/chromium/components/autofill/core\
1818 /browser/address_rewriter.cc"
1819 (("options\\.set_utf8\\(true\\)")
1820 "options.set_encoding(RE2::Options::EncodingUTF8)"))
1821 #t))
1822 (add-after 'unpack 'patch-ninja-version-check
1823 (lambda _
1824 ;; The build system assumes the system Ninja is too old because
1825 ;; it only checks for versions 1.7 through 1.9. We have 1.10.
1826 (substitute* "configure.pri"
1827 (("1\\.\\[7-9\\]\\.\\*")
1828 "1.([7-9]|1[0-9]).*"))
1829 #t))
1830 (add-before 'configure 'substitute-source
1831 (lambda* (#:key inputs outputs #:allow-other-keys)
1832 (let ((out (assoc-ref outputs "out"))
1833 (nss (assoc-ref inputs "nss"))
1834 (udev (assoc-ref inputs "udev")))
1835 ;; Qtwebengine is not installed into the same prefix as
1836 ;; qtbase. Some qtbase QTLibraryInfo constants will not
1837 ;; work. Replace with the full path to the qtwebengine
1838 ;; translations and locales in the store.
1839 (substitute* "src/core/web_engine_library_info.cpp"
1840 (("QLibraryInfo::location\\(QLibraryInfo::TranslationsPath\\)")
1841 (string-append "QLatin1String(\"" out "/share/qt5/translations\")"))
1842 (("QLibraryInfo::location\\(QLibraryInfo::DataPath\\)")
1843 (string-append "QLatin1String(\"" out "/share/qt5\")")))
1844 ;; Substitute full dynamic library path for nss.
1845 (substitute* "src/3rdparty/chromium/crypto/nss_util.cc"
1846 (("libnssckbi.so")
1847 (string-append nss "/lib/nss/libnssckbi.so")))
1848 ;; Substitute full dynamic library path for udev.
1849 (substitute* "src/3rdparty/chromium/device/udev_linux/udev1_loader.cc"
1850 (("libudev.so.1")
1851 (string-append udev "/lib/libudev.so.1")))
1852 #t)))
1853 (add-before 'configure 'set-env
1854 (lambda _
1855 ;; Avoids potential race conditions.
1856 (setenv "PYTHONDONTWRITEBYTECODE" "1")
1857 (setenv "NINJAFLAGS"
1858 (string-append "-k1" ;less verbose build output
1859 ;; Respect the '--cores' option of 'guix build'.
1860 " -j" (number->string (parallel-job-count))))
1861 #t))
1862 (replace 'configure
1863 (lambda _
1864 ;; Valid QT_BUILD_PARTS variables are:
1865 ;; libs tools tests examples demos docs translations
1866 (invoke "qmake" "QT_BUILD_PARTS = libs tools" "--"
1867 "--webengine-printing-and-pdf=no"
1868 "--webengine-ffmpeg=system"
1869 "--webengine-icu=system"
1870 "--webengine-pepper-plugins=no")))))
1871 ;; Tests are disabled due to "Could not find QtWebEngineProcess error"
1872 ;; It's possible this can be fixed by setting QTWEBENGINEPROCESS_PATH
1873 ;; before running tests.
1874 ((#:tests? _ #f) #f)))
1875 (native-search-paths
1876 (list (search-path-specification
1877 (file-type 'regular)
1878 (separator #f)
1879 (variable "QTWEBENGINEPROCESS_PATH")
1880 (files '("lib/qt5/libexec/QtWebEngineProcess")))))
1881 (home-page "https://wiki.qt.io/QtWebEngine")
1882 (synopsis "Qt WebEngine module")
1883 (description "The Qt5WebEngine module provides support for web applications
1884 using the Chromium browser project. The Chromium source code has Google services
1885 and binaries removed, and adds modular support for using system libraries.")
1886 (license license:lgpl2.1+)))
1887
1888 (define-public python-sip
1889 (package
1890 (name "python-sip")
1891 (version "4.19.18")
1892 (source
1893 (origin
1894 (method url-fetch)
1895 (uri (string-append "https://www.riverbankcomputing.com/static/"
1896 "Downloads/sip/" version "/sip-" version ".tar.gz"))
1897 (sha256
1898 (base32
1899 "07kyd56xgbb40ljb022rq82shgxprlbl0z27mpf1b6zd00w8dgf0"))))
1900 (build-system gnu-build-system)
1901 (native-inputs
1902 `(("python" ,python-wrapper)))
1903 (arguments
1904 `(#:tests? #f ; no check target
1905 #:modules ((srfi srfi-1)
1906 ,@%gnu-build-system-modules)
1907 #:phases
1908 (modify-phases %standard-phases
1909 (replace 'configure
1910 (lambda* (#:key inputs outputs #:allow-other-keys)
1911 (let* ((out (assoc-ref outputs "out"))
1912 (bin (string-append out "/bin"))
1913 (include (string-append out "/include"))
1914 (python (assoc-ref inputs "python"))
1915 (python-version
1916 (last (string-split python #\-)))
1917 (python-major+minor
1918 (string-join
1919 (take (string-split python-version #\.) 2)
1920 "."))
1921 (lib (string-append out "/lib/python"
1922 python-major+minor
1923 "/site-packages")))
1924 (invoke "python" "configure.py"
1925 "--bindir" bin
1926 "--destdir" lib
1927 "--incdir" include)))))))
1928 (home-page "https://www.riverbankcomputing.com/software/sip/intro")
1929 (synopsis "Python binding creator for C and C++ libraries")
1930 (description
1931 "SIP is a tool to create Python bindings for C and C++ libraries. It
1932 was originally developed to create PyQt, the Python bindings for the Qt
1933 toolkit, but can be used to create bindings for any C or C++ library.
1934
1935 SIP comprises a code generator and a Python module. The code generator
1936 processes a set of specification files and generates C or C++ code, which
1937 is then compiled to create the bindings extension module. The SIP Python
1938 module provides support functions to the automatically generated code.")
1939 ;; There is a choice between a python like license, gpl2 and gpl3.
1940 ;; For compatibility with pyqt, we need gpl3.
1941 (license license:gpl3)))
1942
1943 (define-public python2-sip
1944 (package (inherit python-sip)
1945 (name "python2-sip")
1946 (native-inputs
1947 `(("python" ,python-2)))))
1948
1949 (define-public python-pyqt
1950 (package
1951 (name "python-pyqt")
1952 (version "5.12.3")
1953 (source
1954 (origin
1955 (method url-fetch)
1956 (uri (string-append "https://www.riverbankcomputing.com/static/"
1957 "Downloads/PyQt5/" version "/PyQt5_gpl-"
1958 version ".tar.gz"))
1959 (sha256
1960 (base32
1961 "041155bdzp57jy747p5d59740c55yy3241cy1x2lgcdsvqvzmc0d"))
1962 (patches (search-patches "pyqt-configure.patch"
1963 "pyqt-unbundled-qt.patch"
1964 "pyqt-public-sip.patch"))))
1965 (build-system gnu-build-system)
1966 (native-inputs
1967 `(("qtbase" ,qtbase))) ; for qmake
1968 (propagated-inputs
1969 `(("python-sip" ,python-sip)))
1970 (inputs
1971 `(("python" ,python-wrapper)
1972 ("qtbase" ,qtbase)
1973 ("qtconnectivity" ,qtconnectivity)
1974 ("qtdeclarative" ,qtdeclarative)
1975 ("qtlocation" ,qtlocation)
1976 ("qtmultimedia" ,qtmultimedia)
1977 ("qtsensors" ,qtsensors)
1978 ("qtserialport" ,qtserialport)
1979 ("qtsvg" ,qtsvg)
1980 ("qttools" ,qttools)
1981 ("qtwebchannel" ,qtwebchannel)
1982 ("qtwebkit" ,qtwebkit)
1983 ("qtwebsockets" ,qtwebsockets)
1984 ("qtx11extras" ,qtx11extras)
1985 ("qtxmlpatterns" ,qtxmlpatterns)))
1986 (arguments
1987 `(#:modules ((srfi srfi-1)
1988 ,@%gnu-build-system-modules)
1989 #:phases
1990 (modify-phases %standard-phases
1991 ;; When building python-pyqtwebengine, <qprinter.h> can not be
1992 ;; included. Here we substitute the full path to the header in the
1993 ;; store.
1994 (add-before 'configure 'substitute-source
1995 (lambda* (#:key inputs #:allow-other-keys)
1996 (let* ((qtbase (assoc-ref inputs "qtbase"))
1997 (qtprinter.h (string-append "\"" qtbase "/include/qt5/QtPrintSupport/qprinter.h\"")))
1998 (substitute* "sip/QtPrintSupport/qprinter.sip"
1999 (("<qprinter.h>")
2000 qtprinter.h))
2001 #t)))
2002 (replace 'configure
2003 (lambda* (#:key inputs outputs #:allow-other-keys)
2004 (let* ((out (assoc-ref outputs "out"))
2005 (bin (string-append out "/bin"))
2006 (sip (string-append out "/share/sip"))
2007 (plugins (string-append out "/lib/qt5/plugins"))
2008 (designer (string-append plugins "/designer"))
2009 (qml (string-append plugins "/PyQt5"))
2010 (python (assoc-ref inputs "python"))
2011 (python-version
2012 (last (string-split python #\-)))
2013 (python-major+minor
2014 (string-join
2015 (take (string-split python-version #\.) 2)
2016 "."))
2017 (lib (string-append out "/lib/python"
2018 python-major+minor
2019 "/site-packages"))
2020 (stubs (string-append lib "/PyQt5")))
2021 (invoke "python" "configure.py"
2022 "--confirm-license"
2023 "--bindir" bin
2024 "--destdir" lib
2025 "--designer-plugindir" designer
2026 "--qml-plugindir" qml
2027 ; Where to install the PEP 484 Type Hints stub
2028 ; files. Without this the stubs are tried to be
2029 ; installed into the python package's
2030 ; site-package directory, which is read-only.
2031 "--stubsdir" stubs
2032 "--sipdir" sip)))))))
2033 (home-page "https://www.riverbankcomputing.com/software/pyqt/intro")
2034 (synopsis "Python bindings for Qt")
2035 (description
2036 "PyQt is a set of Python v2 and v3 bindings for the Qt application
2037 framework. The bindings are implemented as a set of Python modules and
2038 contain over 620 classes.")
2039 (license license:gpl3)))
2040
2041 (define-public python-pyqtwebengine
2042 (package
2043 (name "python-pyqtwebengine")
2044 (version "5.12.1")
2045 (source
2046 (origin
2047 (method url-fetch)
2048 (uri (string-append
2049 "https://www.riverbankcomputing.com/static/Downloads/PyQtWebEngine/"
2050 version "/PyQtWebEngine_gpl-" version ".tar.gz"))
2051 (sha256
2052 (base32
2053 "0wylkd7fh2g27y3710rpxmj9wx0wpi3z7qbv6khiddm15rkh81w6"))))
2054 (build-system gnu-build-system)
2055 (native-inputs
2056 `(("python" ,python)
2057 ("python-sip" ,python-sip)
2058 ;; qtbase is required for qmake
2059 ("qtbase" ,qtbase)))
2060 (inputs
2061 `(("python" ,python-wrapper)
2062 ("python-sip" ,python-sip)
2063 ("python-pyqt" ,python-pyqt)
2064 ("qtbase" ,qtbase)
2065 ("qtsvg" ,qtsvg)
2066 ("qtdeclarative" ,qtdeclarative)
2067 ("qtwebchannel" ,qtwebchannel)
2068 ("python-pyqt" ,python-pyqt)
2069 ("qtwebengine" ,qtwebengine)))
2070 (arguments
2071 `(#:modules ((srfi srfi-1)
2072 ((guix build python-build-system) #:select (python-version))
2073 ,@%gnu-build-system-modules)
2074 #:imported-modules ((guix build python-build-system)
2075 ,@%gnu-build-system-modules)
2076 #:phases
2077 (modify-phases %standard-phases
2078 (replace 'configure
2079 (lambda* (#:key inputs outputs #:allow-other-keys)
2080 (let* ((out (assoc-ref outputs "out"))
2081 (sipdir (string-append out "/share/sip"))
2082 (pyqt-sipdir (string-append
2083 (assoc-ref inputs "python-pyqt") "/share/sip"))
2084 (python (assoc-ref inputs "python"))
2085 (lib (string-append out "/lib/python"
2086 (python-version python)
2087 "/site-packages/PyQt5"))
2088 (stubs (string-append lib "/PyQt5")))
2089
2090 (mkdir-p sipdir)
2091 (invoke "python" "configure.py"
2092 "-w"
2093 "--no-dist-info"
2094 "--destdir" lib
2095 "--no-qsci-api"
2096 "--stubsdir" stubs
2097 "--sipdir" sipdir
2098 "--pyqt-sipdir" pyqt-sipdir))))
2099 ;; Because this has a different prefix than python-pyqt then we need
2100 ;; to make this a namespace of it's own
2101 (add-after 'install 'make-namespace
2102 (lambda* (#:key inputs outputs #:allow-other-keys)
2103 (let* ((__init__.py (string-append
2104 (assoc-ref outputs "out")
2105 "/lib/python"
2106 (python-version (assoc-ref inputs "python"))
2107 "/site-packages/PyQt5/__init__.py")))
2108 (with-output-to-file __init__.py
2109 (lambda _ (display "
2110 from pkgutil import extend_path
2111 __path__ = extend_path(__path__, __name__)
2112 ")))
2113 #t))))))
2114 (home-page "https://www.riverbankcomputing.com/software/pyqtwebengine/intro")
2115 (synopsis "Python bindings for QtWebEngine")
2116 (description
2117 "PyQtWebEngine is a set of Python bindings for The Qt Company's Qt
2118 WebEngine libraries. The bindings sit on top of PyQt5 and are implemented as a
2119 set of three modules. Prior to v5.12 these bindings were part of PyQt
2120 itself.")
2121 (license license:gpl3)))
2122
2123 ;; XXX: This is useful because qtwebkit does not build reliably at this time.
2124 ;; Ultimately, it would be nicer to have a more modular set of python-pyqt-*
2125 ;; packages that could be used together.
2126 (define-public python-pyqt-without-qtwebkit
2127 (package (inherit python-pyqt)
2128 (name "python-pyqt-without-qtwebkit")
2129 (inputs
2130 (alist-delete "qtwebkit" (package-inputs python-pyqt)))))
2131
2132 (define-public python2-pyqt
2133 (package (inherit python-pyqt)
2134 (name "python2-pyqt")
2135 (native-inputs
2136 `(("python-sip" ,python2-sip)
2137 ("qtbase" ,qtbase)))
2138 (inputs
2139 `(("python" ,python-2)
2140 ("python2-enum34" ,python2-enum34)
2141 ,@(alist-delete "python" (package-inputs python-pyqt))))))
2142
2143 (define-public python2-pyqt-4
2144 (package (inherit python-pyqt)
2145 (name "python2-pyqt")
2146 (version "4.12")
2147 (source
2148 (origin
2149 (method url-fetch)
2150 (uri
2151 (string-append "mirror://sourceforge/pyqt/PyQt4/"
2152 "PyQt-" version "/PyQt4_gpl_x11-"
2153 version ".tar.gz"))
2154 (sha256
2155 (base32
2156 "1nw8r88a5g2d550yvklawlvns8gd5slw53yy688kxnsa65aln79w"))))
2157 (native-inputs
2158 `(("python-sip" ,python2-sip)
2159 ("qt" ,qt-4)))
2160 (inputs `(("python" ,python-2)))
2161 (arguments
2162 `(#:tests? #f ; no check target
2163 #:modules ((srfi srfi-1)
2164 ,@%gnu-build-system-modules)
2165 #:phases
2166 (modify-phases %standard-phases
2167 (replace 'configure
2168 (lambda* (#:key inputs outputs #:allow-other-keys)
2169 (let* ((out (assoc-ref outputs "out"))
2170 (bin (string-append out "/bin"))
2171 (sip (string-append out "/share/sip"))
2172 (python (assoc-ref inputs "python"))
2173 (python-version
2174 (last (string-split python #\-)))
2175 (python-major+minor
2176 (string-join
2177 (take (string-split python-version #\.) 2)
2178 "."))
2179 (lib (string-append out "/lib/python"
2180 python-major+minor
2181 "/site-packages")))
2182 (invoke "python" "configure.py"
2183 "--confirm-license"
2184 "--bindir" bin
2185 "--destdir" lib
2186 "--sipdir" sip)))))))
2187 (license (list license:gpl2 license:gpl3)))) ; choice of either license
2188
2189 (define-public qscintilla
2190 (package
2191 (name "qscintilla")
2192 (version "2.10.8")
2193 (source (origin
2194 (method url-fetch)
2195 (uri (string-append "mirror://sourceforge/pyqt/QScintilla2/"
2196 "QScintilla-" version "/QScintilla_gpl-"
2197 version ".tar.gz"))
2198 (sha256
2199 (base32
2200 "1swjr786w04r514pry9pn32ivza4il1cg35s60qy39cwc175pka6"))))
2201 (build-system gnu-build-system)
2202 (arguments
2203 `(#:phases
2204 (modify-phases %standard-phases
2205 (replace 'configure
2206 (lambda* (#:key outputs #:allow-other-keys)
2207 (let ((out (assoc-ref outputs "out")))
2208 (chdir "Qt4Qt5")
2209 (substitute* "qscintilla.pro"
2210 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
2211 (string-append out "/lib"))
2212 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
2213 (string-append out "/include"))
2214 (("\\$\\$\\[QT_INSTALL_TRANSLATIONS\\]")
2215 (string-append out "/translations"))
2216 (("\\$\\$\\[QT_INSTALL_DATA\\]")
2217 (string-append out "/lib/qt$${QT_MAJOR_VERSION}"))
2218 (("\\$\\$\\[QT_HOST_DATA\\]")
2219 (string-append out "/lib/qt$${QT_MAJOR_VERSION}")))
2220 (invoke "qmake")))))))
2221 (native-inputs `(("qtbase" ,qtbase)))
2222 (home-page "https://www.riverbankcomputing.co.uk/software/qscintilla/intro")
2223 (synopsis "Qt port of the Scintilla C++ editor control")
2224 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
2225 editor control. QScintilla includes features especially useful when editing
2226 and debugging source code. These include support for syntax styling, error
2227 indicators, code completion and call tips.")
2228 (license license:gpl3+)))
2229
2230 (define-public python-qscintilla
2231 (package (inherit qscintilla)
2232 (name "python-qscintilla")
2233 (arguments
2234 `(#:configure-flags
2235 (list "--pyqt=PyQt5"
2236 (string-append "--pyqt-sipdir="
2237 (assoc-ref %build-inputs "python-pyqt")
2238 "/share/sip")
2239 (string-append "--qsci-incdir="
2240 (assoc-ref %build-inputs "qscintilla")
2241 "/include")
2242 (string-append "--qsci-libdir="
2243 (assoc-ref %build-inputs "qscintilla")
2244 "/lib"))
2245 #:phases
2246 (modify-phases %standard-phases
2247 (replace 'configure
2248 (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
2249 (let ((out (assoc-ref outputs "out"))
2250 (python (assoc-ref inputs "python")))
2251 (chdir "Python")
2252 (apply invoke "python3" "configure.py"
2253 configure-flags)
2254 ;; Install to the right directory
2255 (substitute* '("Makefile"
2256 "Qsci/Makefile")
2257 (("\\$\\(INSTALL_ROOT\\)/gnu/store/[^/]+") out)
2258 (((string-append python "/lib"))
2259 (string-append out "/lib")))
2260 ;; And fix the installed.txt file
2261 (substitute* "installed.txt"
2262 (("/gnu/store/[^/]+") out)))
2263 #t)))))
2264 (inputs
2265 `(("qscintilla" ,qscintilla)
2266 ("python" ,python)
2267 ("python-pyqt" ,python-pyqt)))
2268 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
2269 editor control. QScintilla includes features especially useful when editing
2270 and debugging source code. These include support for syntax styling, error
2271 indicators, code completion and call tips.
2272
2273 This package provides the Python bindings.")))
2274
2275 ;; PyQt only looks for modules in its own directory. It ignores environment
2276 ;; variables such as PYTHONPATH, so we need to build a union package to make
2277 ;; it work.
2278 (define-public python-pyqt+qscintilla
2279 (package (inherit python-pyqt)
2280 (name "python-pyqt+qscintilla")
2281 (source #f)
2282 (build-system trivial-build-system)
2283 (arguments
2284 '(#:modules ((guix build union))
2285 #:builder (begin
2286 (use-modules (ice-9 match)
2287 (guix build union))
2288 (match %build-inputs
2289 (((names . directories) ...)
2290 (union-build (assoc-ref %outputs "out")
2291 directories)
2292 #t)))))
2293 (inputs
2294 `(("python-pyqt" ,python-pyqt)
2295 ("python-qscintilla" ,python-qscintilla)))
2296 (synopsis "Union of PyQt and the Qscintilla extension")
2297 (description
2298 "This package contains the union of PyQt and the Qscintilla extension.")))
2299
2300 (define-public qtkeychain
2301 (package
2302 (name "qtkeychain")
2303 (version "0.9.1")
2304 (source
2305 (origin
2306 (method git-fetch)
2307 (uri (git-reference
2308 (url "https://github.com/frankosterfeld/qtkeychain/")
2309 (commit (string-append "v" version))))
2310 (file-name (git-file-name name version))
2311 (sha256
2312 (base32
2313 "0h4wgngn2yl35hapbjs24amkjfbzsvnna4ixfhn87snjnq5lmjbc"))))
2314 (build-system cmake-build-system)
2315 (native-inputs
2316 `(("pkg-config" ,pkg-config)
2317 ("qttools" ,qttools)))
2318 (inputs
2319 `(("qtbase" ,qtbase)))
2320 (arguments
2321 `(#:tests? #f ; No tests included
2322 #:phases
2323 (modify-phases %standard-phases
2324 (add-before 'configure 'set-qt-trans-dir
2325 (lambda _
2326 (substitute* "CMakeLists.txt"
2327 (("\\$\\{qt_translations_dir\\}")
2328 "${CMAKE_INSTALL_PREFIX}/share/qt5/translations"))
2329 #t)))))
2330 (home-page "https://github.com/frankosterfeld/qtkeychain")
2331 (synopsis "Qt API to store passwords")
2332 (description
2333 "QtKeychain is a Qt library to store passwords and other secret data
2334 securely. It will not store any data unencrypted unless explicitly requested.")
2335 (license license:bsd-3)))
2336
2337 (define-public qwt
2338 (package
2339 (name "qwt")
2340 (version "6.1.4")
2341 (source
2342 (origin
2343 (method url-fetch)
2344 (uri
2345 (string-append "mirror://sourceforge/qwt/qwt/"
2346 version "/qwt-" version ".tar.bz2"))
2347 (sha256
2348 (base32 "1navkcnmn0qz8kzsyqmk32d929zl72l0b580w1ica7z5559j2a8m"))))
2349 (build-system gnu-build-system)
2350 (inputs
2351 `(("qtbase" ,qtbase)
2352 ("qtsvg" ,qtsvg)
2353 ("qttools" ,qttools)))
2354 (arguments
2355 `(#:phases
2356 (modify-phases %standard-phases
2357 (replace 'configure
2358 (lambda* (#:key outputs #:allow-other-keys)
2359 (let* ((out (assoc-ref outputs "out"))
2360 (docdir (string-append out "/share/doc/qwt"))
2361 (incdir (string-append out "/include/qwt"))
2362 (pluginsdir (string-append out "/lib/qt5/plugins/designer"))
2363 (featuresdir (string-append out "/lib/qt5/mkspecs/features")))
2364 (substitute* '("qwtconfig.pri")
2365 (("^(\\s*QWT_INSTALL_PREFIX)\\s*=.*" _ x)
2366 (format #f "~a = ~a\n" x out))
2367 (("^(QWT_INSTALL_DOCS)\\s*=.*" _ x)
2368 (format #f "~a = ~a\n" x docdir))
2369 (("^(QWT_INSTALL_HEADERS)\\s*=.*" _ x)
2370 (format #f "~a = ~a\n" x incdir))
2371 (("^(QWT_INSTALL_PLUGINS)\\s*=.*" _ x)
2372 (format #f "~a = ~a\n" x pluginsdir))
2373 (("^(QWT_INSTALL_FEATURES)\\s*=.*" _ x)
2374 (format #f "~a = ~a\n" x featuresdir)))
2375 (substitute* '("doc/doc.pro")
2376 ;; We'll install them in the 'install-man-pages' phase.
2377 (("^unix:doc\\.files.*") ""))
2378 (invoke "qmake"))))
2379 (add-after 'install 'install-man-pages
2380 (lambda* (#:key outputs #:allow-other-keys)
2381 (let* ((out (assoc-ref outputs "out"))
2382 (man (string-append out "/share/man")))
2383 ;; Remove some incomplete manual pages.
2384 (for-each delete-file (find-files "doc/man/man3" "^_tmp.*"))
2385 (mkdir-p man)
2386 (copy-recursively "doc/man" man)
2387 #t))))))
2388 (home-page "http://qwt.sourceforge.net")
2389 (synopsis "Qt widgets for plots, scales, dials and other technical software
2390 GUI components")
2391 (description
2392 "The Qwt library contains widgets and components which are primarily useful
2393 for technical and scientific purposes. It includes a 2-D plotting widget,
2394 different kinds of sliders, and much more.")
2395 (license
2396 (list
2397 ;; The Qwt license is LGPL2.1 with some exceptions.
2398 (license:non-copyleft "http://qwt.sourceforge.net/qwtlicense.html")
2399 ;; textengines/mathml/qwt_mml_document.{cpp,h} is dual LGPL2.1/GPL3 (either).
2400 license:lgpl2.1 license:gpl3))))
2401
2402 (define-public qtwebkit
2403 (package
2404 (name "qtwebkit")
2405 (version "5.212.0-alpha4")
2406 (source
2407 (origin
2408 (method url-fetch)
2409 (uri (string-append "https://github.com/annulen/webkit/releases/download/"
2410 "qtwebkit-" version "/qtwebkit-" version ".tar.xz"))
2411 (sha256
2412 (base32
2413 "1rm9sjkabxna67dl7myx9d9vpdyfxfdhrk9w7b94srkkjbd2d8cw"))
2414 (patches (search-patches "qtwebkit-pbutils-include.patch"))))
2415 (build-system cmake-build-system)
2416 (native-inputs
2417 `(("perl" ,perl)
2418 ("python" ,python)
2419 ("ruby" ,ruby)
2420 ("bison" ,bison)
2421 ("flex" ,flex)
2422 ("gperf" ,gperf)
2423 ("pkg-config" ,pkg-config)))
2424 (inputs
2425 `(("icu" ,icu4c)
2426 ("glib" ,glib)
2427 ("gst-plugins-base" ,gst-plugins-base)
2428 ("libjpeg" ,libjpeg-turbo)
2429 ("libpng" ,libpng)
2430 ("libwebp" ,libwebp)
2431 ("sqlite" ,sqlite)
2432 ("fontconfig" ,fontconfig)
2433 ("libxrender" ,libxrender)
2434 ("qtbase" ,qtbase)
2435 ("qtdeclarative" ,qtdeclarative)
2436 ("qtlocation" ,qtlocation)
2437 ("qtmultimedia" ,qtmultimedia)
2438 ("qtsensors" ,qtsensors)
2439 ("qtwebchannel" ,qtwebchannel)
2440 ("libxml2" ,libxml2)
2441 ("libxslt" ,libxslt)
2442 ("libx11" ,libx11)
2443 ("libxcomposite" ,libxcomposite)))
2444 (arguments
2445 `(#:tests? #f ; no apparent tests; it might be necessary to set
2446 ; ENABLE_API_TESTS, see CMakeLists.txt
2447
2448 ;; Parallel builds fail due to a race condition:
2449 ;; <https://bugs.gnu.org/34062>.
2450 #:parallel-build? #f
2451
2452 #:configure-flags (list ;"-DENABLE_API_TESTS=TRUE"
2453 "-DPORT=Qt"
2454 "-DUSE_LIBHYPHEN=OFF"
2455 "-DUSE_SYSTEM_MALLOC=ON"
2456 ;; XXX: relative dir installs to build dir?
2457 (string-append "-DECM_MKSPECS_INSTALL_DIR="
2458 %output "/lib/qt5/mkspecs/modules")
2459 ;; Sacrifice a little speed in order to link
2460 ;; libraries and test executables in a
2461 ;; reasonable amount of memory.
2462 "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,--no-keep-memory"
2463 "-DCMAKE_EXE_LINKER_FLAGS=-Wl,--no-keep-memory")))
2464 (home-page "https://www.webkit.org")
2465 (synopsis "Web browser engine and classes to render and interact with web
2466 content")
2467 (description "QtWebKit provides a Web browser engine that makes it easy to
2468 embed content from the World Wide Web into your Qt application. At the same
2469 time Web content can be enhanced with native controls.")
2470 ;; Building QtWebKit takes around 13 hours on an AArch64 machine. Give some
2471 ;; room for slower or busy hardware.
2472 (properties '((timeout . 64800))) ;18 hours
2473
2474 ;; XXX: This consumes too much RAM to successfully build on AArch64 (e.g.,
2475 ;; SoftIron OverDrive with 8 GiB of RAM), so instead of wasting resources,
2476 ;; disable it on non-Intel platforms.
2477 (supported-systems '("x86_64-linux" "i686-linux"))
2478
2479 (license license:lgpl2.1+)))
2480
2481 (define-public dotherside
2482 (package
2483 (name "dotherside")
2484 (version "0.6.4")
2485 (source
2486 (origin
2487 (method git-fetch)
2488 (uri (git-reference
2489 (url "https://github.com/filcuc/DOtherSide")
2490 (commit (string-append "v" version))))
2491 (file-name (git-file-name name version))
2492 (sha256
2493 (base32
2494 "09fz6v8rp28997f235yaifj8p4vvsyv45knc1iivgdvx7msgcd0m"))))
2495 (build-system cmake-build-system)
2496 (native-inputs
2497 `(("qttools" ,qttools)))
2498 (inputs
2499 `(("qtbase" ,qtbase)
2500 ("qtdeclarative" ,qtdeclarative)))
2501 (home-page "https://filcuc.github.io/DOtherSide/index.html")
2502 (synopsis "C language library for creating bindings for the Qt QML language")
2503 (description
2504 "DOtherSide is a C language library for creating bindings for the
2505 QT QML language. The following features are implementable from
2506 a binding language:
2507 @itemize
2508 @item Creating custom QObject
2509 @item Creating custom QAbstractListModels
2510 @item Creating custom properties, signals and slots
2511 @item Creating from QML QObject defined in the binded language
2512 @item Creating from Singleton QML QObject defined in the binded language
2513 @end itemize\n")
2514 (license license:lgpl3))) ;version 3 only (+ exception)
2515
2516 ;; There have been no public releases yet.
2517 (define-public qtcolorwidgets
2518 (let ((commit "a95f72e935fe9e046061a1d1c3930cbfbcb533e0")
2519 (revision "1"))
2520 (package
2521 (name "qtcolorwidgets")
2522 (version (git-version "0" revision commit))
2523 (source (origin
2524 (method git-fetch)
2525 (uri (git-reference
2526 (url "https://gitlab.com/mattia.basaglia/Qt-Color-Widgets")
2527 (commit commit)))
2528 (file-name (git-file-name name version))
2529 (sha256
2530 (base32
2531 "0dkiwlqh2gwhlp78c1fmchj3shl4p9inspcl96ya5aa8mn6kydy8"))))
2532 (build-system cmake-build-system)
2533 (arguments `(#:tests? #f)) ; There are no tests
2534 (native-inputs
2535 `(("qttools" ,qttools)))
2536 (inputs
2537 `(("qtbase" ,qtbase)))
2538 (home-page "https://gitlab.com/mattia.basaglia/Qt-Color-Widgets")
2539 (synopsis "Color management widgets")
2540 (description "QtColorWidgets provides a Qt color dialog that is more
2541 user-friendly than the default @code{QColorDialog} and several other
2542 color-related widgets.")
2543 ;; Includes a license exception for combining with GPL2 code.
2544 (license license:lgpl3+))))
2545
2546 (define-public python-shiboken-2
2547 (package
2548 (name "python-shiboken-2")
2549 (version "5.12.6")
2550 (source (origin
2551 (method url-fetch)
2552 (uri (string-append "https://download.qt.io/official_releases"
2553 "/QtForPython/pyside2/PySide2-" version
2554 "-src/pyside-setup-everywhere-src-"
2555 version ".tar.xz"))
2556 (sha256
2557 (base32
2558 "1n45l6xxyxs6cfp2l4rp8qs1c2fyfwyrdxa4qcpwfsqsi51rydsk"))))
2559 (build-system cmake-build-system)
2560 (inputs
2561 `(("clang-toolchain" ,clang-toolchain-6)
2562 ("libxml2" ,libxml2)
2563 ("libxslt" ,libxslt)
2564 ("python-wrapper" ,python-wrapper)
2565 ("qtbase" ,qtbase)
2566 ("qtxmlpatterns" ,qtxmlpatterns)))
2567 (arguments
2568 `(#:tests? #f
2569 ;; FIXME: Building tests fails
2570 #:configure-flags '("-DBUILD_TESTS=off")
2571 #:phases
2572 (modify-phases %standard-phases
2573 (add-after 'unpack 'use-shiboken-dir-only
2574 (lambda _ (chdir "sources/shiboken2") #t))
2575 (add-before 'configure 'make-files-writable-and-update-timestamps
2576 (lambda _
2577 ;; The build scripts need to modify some files in
2578 ;; the read-only source directory, and also attempts
2579 ;; to create Zip files which fails because the Zip
2580 ;; format does not support timestamps before 1980.
2581 (let ((circa-1980 (* 10 366 24 60 60)))
2582 (for-each (lambda (file)
2583 (make-file-writable file)
2584 (utime file circa-1980 circa-1980))
2585 (find-files ".")))
2586 #t))
2587 (add-before 'configure 'set-build-env
2588 (lambda* (#:key inputs #:allow-other-keys)
2589 (let ((llvm (assoc-ref inputs "clang-toolchain")))
2590 (setenv "CLANG_INSTALL_DIR" llvm)
2591 #t))))))
2592 (home-page "https://wiki.qt.io/Qt_for_Python")
2593 (synopsis
2594 "Shiboken generates bindings for C++ libraries using CPython source code")
2595 (description
2596 "Shiboken generates bindings for C++ libraries using CPython source code")
2597 (license
2598 (list
2599 ;; The main code is GPL3 or LGPL3.
2600 ;; Examples are BSD-3.
2601 license:gpl3
2602 license:lgpl3
2603 license:bsd-3))))
2604
2605 (define-public python-pyside-2
2606 (package
2607 (name "python-pyside-2")
2608 (version (package-version python-shiboken-2))
2609 (source (package-source python-shiboken-2))
2610 (build-system cmake-build-system)
2611 (inputs
2612 `(("libxml2" ,libxml2)
2613 ("libxslt" ,libxslt)
2614 ("clang-toolchain" ,clang-toolchain-6)
2615 ("qtbase" ,qtbase)
2616 ("qtdatavis3d" ,qtdatavis3d)
2617 ("qtlocation" ,qtlocation)
2618 ("qtmultimedia" ,qtmultimedia)
2619 ("qtquickcontrols" ,qtquickcontrols)
2620 ("qtscript" ,qtscript)
2621 ("qtscxml" ,qtscxml)
2622 ("qtsensors" ,qtsensors)
2623 ("qtspeech" ,qtspeech)
2624 ("qtsvg" ,qtsvg)
2625 ("qtwebchannel" ,qtwebchannel)
2626 ("qtwebsockets" ,qtwebsockets)
2627 ("qtx11extras" ,qtx11extras)
2628 ("qtxmlpatterns" ,qtxmlpatterns)))
2629 (native-inputs
2630 `(("cmake" ,cmake-minimal)
2631 ("python-shiboken-2" ,python-shiboken-2)
2632 ("python" ,python-wrapper)
2633 ("qttools" ,qttools)
2634 ("which" ,which)))
2635 (arguments
2636 `(#:tests? #f
2637 ;; FIXME: Building tests fail.
2638 #:configure-flags
2639 (list "-DBUILD_TESTS=FALSE"
2640 (string-append "-DPYTHON_EXECUTABLE="
2641 (assoc-ref %build-inputs "python")
2642 "/bin/python"))
2643 #:phases
2644 (modify-phases %standard-phases
2645 (add-after 'unpack 'go-to-source-dir
2646 (lambda _ (chdir "sources/pyside2") #t))
2647 (add-before 'configure 'set-clang-dir
2648 (lambda* (#:key inputs #:allow-other-keys)
2649 (let ((clang (assoc-ref inputs "clang-toolchain")))
2650 (setenv "CLANG_INSTALL_DIR" clang)
2651 #t))))))
2652 (home-page "https://wiki.qt.io/Qt_for_Python")
2653 (synopsis
2654 "The Qt for Python product enables the use of Qt5 APIs in Python applications")
2655 (description
2656 "The Qt for Python product enables the use of Qt5 APIs in Python
2657 applications. It lets Python developers utilize the full potential of Qt,
2658 using the PySide2 module. The PySide2 module provides access to the
2659 individual Qt modules such as QtCore, QtGui,and so on. Qt for Python also
2660 comes with the Shiboken2 CPython binding code generator, which can be used to
2661 generate Python bindings for your C or C++ code.")
2662 (license (list
2663 license:lgpl3
2664 ;;They state that:
2665 ;; this file may be used under the terms of the GNU General
2666 ;; Public License version 2.0 or (at your option) the GNU
2667 ;; General Public license version 3 or any later version
2668 ;; approved by the KDE Free Qt Foundation.
2669 ;; Thus, it is currently v2 or v3, but no "+".
2670 license:gpl3
2671 license:gpl2))))
2672
2673 (define-public python-pyside-2-tools
2674 (package
2675 (name "python-pyside-2-tools")
2676 (version (package-version python-shiboken-2))
2677 (source (package-source python-shiboken-2))
2678 (build-system cmake-build-system)
2679 (inputs
2680 `(("python-pyside-2" ,python-pyside-2)
2681 ("python-shiboken-2" ,python-shiboken-2)
2682 ("qtbase" ,qtbase)))
2683 (native-inputs
2684 `(("python" ,python-wrapper)))
2685 (arguments
2686 `(#:tests? #f
2687 #:configure-flags
2688 (list "-DBUILD_TESTS=off"
2689 (string-append "-DPYTHON_EXECUTABLE="
2690 (assoc-ref %build-inputs "python")
2691 "/bin/python"))
2692 #:phases (modify-phases %standard-phases
2693 (add-after 'unpack 'go-to-source-dir
2694 (lambda _ (chdir "sources/pyside2-tools") #t)))))
2695 (home-page "https://wiki.qt.io/Qt_for_Python")
2696 (synopsis
2697 "Contains command line tools for PySide2")
2698 (description
2699 "Contains lupdate, rcc and uic tools for PySide2")
2700 (license license:gpl2)))