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