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