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