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