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