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