gnu: rest: Update to 0.8.1.
[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>
31580979 4;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
843bdfb7 5;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
f048f12b 6;;; Copyright © 2016, 2017 ng0 <ng0@libertad.pw>
fc381a33 7;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
3befd0a9
RW
8;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
9;;; Copyright © 2017 Quiliro <quiliro@fsfla.org>
bd677c2d
AE
10;;;
11;;; This file is part of GNU Guix.
12;;;
13;;; GNU Guix is free software; you can redistribute it and/or modify it
14;;; under the terms of the GNU General Public License as published by
15;;; the Free Software Foundation; either version 3 of the License, or (at
16;;; your option) any later version.
17;;;
18;;; GNU Guix is distributed in the hope that it will be useful, but
19;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;;; GNU General Public License for more details.
22;;;
23;;; You should have received a copy of the GNU General Public License
24;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26(define-module (gnu packages qt)
225941b0 27 #:use-module ((guix licenses) #:prefix license:)
bd677c2d
AE
28 #:use-module (guix packages)
29 #:use-module (guix download)
f198ffd0 30 #:use-module (guix build utils)
9e81af9e 31 #:use-module (guix build-system cmake)
bd677c2d 32 #:use-module (guix build-system gnu)
2456153a 33 #:use-module (guix build-system trivial)
84ef83dd
AE
34 #:use-module (guix packages)
35 #:use-module (guix utils)
1e9ed0e3 36 #:use-module (gnu packages)
b332e366
AE
37 #:use-module (gnu packages bison)
38 #:use-module (gnu packages compression)
2cba3d6f
SB
39 #:use-module (gnu packages cups)
40 #:use-module (gnu packages databases)
aa8c0ada 41 #:use-module (gnu packages documentation)
b332e366 42 #:use-module (gnu packages fontutils)
0009ed71 43 #:use-module (gnu packages flex)
bc8ede01 44 #:use-module (gnu packages freedesktop)
8b6a5e0f 45 #:use-module (gnu packages gl)
b332e366 46 #:use-module (gnu packages glib)
0009ed71
SB
47 #:use-module (gnu packages gnuzilla)
48 #:use-module (gnu packages gperf)
04231311 49 #:use-module (gnu packages gstreamer)
f7fb0ccb 50 #:use-module (gnu packages gtk)
b332e366 51 #:use-module (gnu packages icu4c)
e55354b8 52 #:use-module (gnu packages image)
b332e366 53 #:use-module (gnu packages linux)
04f8decf 54 #:use-module (gnu packages maths)
0009ed71
SB
55 #:use-module (gnu packages pciutils)
56 #:use-module (gnu packages pcre)
b332e366
AE
57 #:use-module (gnu packages perl)
58 #:use-module (gnu packages pkg-config)
39fa8f6c 59 #:use-module (gnu packages pulseaudio)
b332e366 60 #:use-module (gnu packages python)
8b6a5e0f 61 #:use-module (gnu packages ruby)
51519fd3 62 #:use-module (gnu packages sdl)
cc2b77df 63 #:use-module (gnu packages tls)
0009ed71
SB
64 #:use-module (gnu packages xdisorg)
65 #:use-module (gnu packages xorg)
66 #:use-module (gnu packages xml))
bd677c2d 67
aa8c0ada
TD
68(define-public grantlee
69 (package
70 (name "grantlee")
71 (version "5.1.0")
72 (source
73 (origin
74 (method url-fetch)
75 (uri (string-append "https://github.com/steveire/grantlee/archive/v"
76 version ".tar.gz"))
77 (file-name (string-append name "-" version ".tar.gz"))
78 (sha256
79 (base32 "1lf9rkv0i0kd7fvpgg5l8jb87zw8dzcwd1liv6hji7g4wlpmfdiq"))))
80 (native-inputs
868b1a02 81 ;; Optional: lcov and cccc, both are for code coverage
aa8c0ada
TD
82 `(("doxygen" ,doxygen)))
83 (inputs
84 `(("qtbase" ,qtbase)
85 ("qtscript" ,qtscript)))
86 (build-system cmake-build-system)
87 (arguments
88 `(#:phases
89 (modify-phases %standard-phases
868b1a02
HG
90 (add-before 'check 'check-setup
91 (lambda _
92 ;; make Qt render "offscreen", required for tests
93 (setenv "QT_QPA_PLATFORM" "offscreen")
94 #t)))))
aa8c0ada
TD
95 (home-page "https://github.com/steveire/grantlee")
96 (synopsis "Libraries for text templating with Qt")
97 (description "Grantlee Templates can be used for theming and generation of
98other text such as code. The syntax uses the syntax of the Django template
99system, and the core design of Django is reused in Grantlee.")
100 (license license:lgpl2.0+)))
101
b332e366
AE
102(define-public qt
103 (package
104 (name "qt")
5acd59ee
EF
105 (version "5.9.2")
106 (outputs '("out" "examples"))
b332e366
AE
107 (source (origin
108 (method url-fetch)
f7fb0ccb
AE
109 (uri
110 (string-append
111 "http://download.qt.io/official_releases/qt/"
112 (version-major+minor version)
113 "/" version
114 "/single/qt-everywhere-opensource-src-"
115 version ".tar.xz"))
b332e366 116 (sha256
f7fb0ccb 117 (base32
5acd59ee 118 "1zr0hvhryn2ada53ln7cycymh602cncli86n291bsgzas6j72qbc"))
14bcc1e1
AE
119 (modules '((guix build utils)))
120 (snippet
bc554b43
AE
121 '(begin
122 ;; Remove qtwebengine, which relies on a bundled copy of
123 ;; chromium. Not only does it fail compilation in qt 5.5:
124 ;; 3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc:362:10:
125 ;; error: cannot convert ‘bool’ to ‘boolean’ in return
126 ;; it might also pose security problems.
127 ;; Alternatively, we could use the "-skip qtwebengine"
128 ;; configuration option.
129 (delete-file-recursively "qtwebengine")
5acd59ee
EF
130 ;; The following snippets are copied from their mondular-qt counterparts.
131 (for-each
132 (lambda (dir)
133 (delete-file-recursively (string-append "qtbase/src/3rdparty/" dir)))
134 (list "double-conversion" "freetype" "harfbuzz-ng"
135 "libpng" "libjpeg" "pcre2" "sqlite" "xcb"
136 "xkbcommon" "zlib"))
137 (for-each
138 (lambda (dir)
139 (delete-file-recursively dir))
140 (list "qtimageformats/src/3rdparty"
141 "qtmultimedia/examples/multimedia/spectrum/3rdparty"
142 "qtwayland/examples"
143 "qtcanvas3d/examples/canvas3d/3rdparty"))
144 ;; Tests depend on this example, which depends on the 3rd party code.
145 (substitute* "qtmultimedia/examples/multimedia/multimedia.pro"
146 (("spectrum") "#"))))))
b332e366 147 (build-system gnu-build-system)
ef0cf53e
AE
148 (propagated-inputs
149 `(("mesa" ,mesa)))
b332e366 150 (inputs
b332e366 151 `(("alsa-lib" ,alsa-lib)
5acd59ee 152 ("bluez" ,bluez)
2cba3d6f 153 ("cups" ,cups)
5acd59ee
EF
154 ("dbus" ,dbus)
155 ("double-conversion" ,double-conversion)
0009ed71 156 ("expat" ,expat)
b332e366
AE
157 ("fontconfig" ,fontconfig)
158 ("freetype" ,freetype)
159 ("glib" ,glib)
5acd59ee
EF
160 ("gstreamer" ,gstreamer)
161 ("gst-plugins-base" ,gst-plugins-base)
f7fb0ccb 162 ("harfbuzz" ,harfbuzz)
b332e366 163 ("icu4c" ,icu4c)
5acd59ee
EF
164 ("jasper" ,jasper)
165 ("libinput" ,libinput-minimal)
f198ffd0 166 ("libjpeg" ,libjpeg)
2cba3d6f 167 ("libmng" ,libmng)
0009ed71 168 ("libpci" ,pciutils)
b332e366 169 ("libpng" ,libpng)
5acd59ee
EF
170 ("libtiff" ,libtiff)
171 ("libwebp" ,libwebp)
b332e366 172 ("libx11" ,libx11)
0009ed71
SB
173 ("libxcomposite" ,libxcomposite)
174 ("libxcursor" ,libxcursor)
5acd59ee 175 ("libxext" ,libxext)
0009ed71 176 ("libxfixes" ,libxfixes)
b332e366 177 ("libxi" ,libxi)
0009ed71 178 ("libxinerama" ,libxinerama)
b332e366 179 ("libxkbcommon" ,libxkbcommon)
0009ed71
SB
180 ("libxml2" ,libxml2)
181 ("libxrandr" ,libxrandr)
b332e366 182 ("libxrender" ,libxrender)
0009ed71
SB
183 ("libxslt" ,libxslt)
184 ("libxtst" ,libxtst)
185 ("mtdev" ,mtdev)
b332e366 186 ("mysql" ,mysql)
0009ed71 187 ("nss" ,nss)
b332e366 188 ("openssl" ,openssl)
2cba3d6f 189 ("postgresql" ,postgresql)
39fa8f6c 190 ("pulseaudio" ,pulseaudio)
5acd59ee 191 ("pcre2" ,pcre2)
0009ed71
SB
192 ("sqlite" ,sqlite)
193 ("udev" ,eudev)
2cba3d6f 194 ("unixodbc" ,unixodbc)
5acd59ee 195 ("wayland" ,wayland)
b332e366
AE
196 ("xcb-util" ,xcb-util)
197 ("xcb-util-image" ,xcb-util-image)
198 ("xcb-util-keysyms" ,xcb-util-keysyms)
199 ("xcb-util-renderutil" ,xcb-util-renderutil)
200 ("xcb-util-wm" ,xcb-util-wm)
201 ("zlib" ,zlib)))
c4c4cc05 202 (native-inputs
0009ed71
SB
203 `(("bison" ,bison)
204 ("flex" ,flex)
205 ("gperf" ,gperf)
0009ed71
SB
206 ("perl" ,perl)
207 ("pkg-config" ,pkg-config)
208 ("python" ,python-2)
209 ("ruby" ,ruby)
ce0614dd 210 ("which" ,(@ (gnu packages base) which))))
b332e366 211 (arguments
5acd59ee 212 `(#:phases
cce28b0c 213 (modify-phases %standard-phases
2470d779
AE
214 (add-after 'configure 'patch-bin-sh
215 (lambda _
5acd59ee 216 (substitute* '("qtbase/configure"
2470d779
AE
217 "qtbase/mkspecs/features/qt_functions.prf"
218 "qtbase/qmake/library/qmakebuiltins.cpp")
219 (("/bin/sh") (which "sh")))
220 #t))
cce28b0c
AE
221 (replace 'configure
222 (lambda* (#:key outputs #:allow-other-keys)
5acd59ee
EF
223 (let ((out (assoc-ref outputs "out"))
224 (examples (assoc-ref outputs "examples")))
cce28b0c
AE
225 (substitute* '("configure" "qtbase/configure")
226 (("/bin/pwd") (which "pwd")))
227 (substitute* "qtbase/src/corelib/global/global.pri"
228 (("/bin/ls") (which "ls")))
229 ;; do not pass "--enable-fast-install", which makes the
230 ;; configure process fail
231 (zero? (system*
232 "./configure"
233 "-verbose"
234 "-prefix" out
5acd59ee 235 "-examplesdir" examples ; 89MiB
cce28b0c
AE
236 "-opensource"
237 "-confirm-license"
5acd59ee 238 ;; Do not build examples; for the time being, we
4dd0a8b6 239 ;; prefer to save the space and build time.
5acd59ee 240 "-no-compile-examples"
cce28b0c
AE
241 ;; Most "-system-..." are automatic, but some use
242 ;; the bundled copy by default.
243 "-system-sqlite"
244 "-system-harfbuzz"
245 ;; explicitly link with openssl instead of dlopening it
246 "-openssl-linked"
247 ;; explicitly link with dbus instead of dlopening it
248 "-dbus-linked"
5acd59ee
EF
249 ;; don't use the precompiled headers
250 "-no-pch"
cce28b0c
AE
251 ;; drop special machine instructions not supported
252 ;; on all instances of the target
253 ,@(if (string-prefix? "x86_64"
254 (or (%current-target-system)
255 (%current-system)))
256 '()
257 '("-no-sse2"))
cce28b0c
AE
258 "-no-mips_dsp"
259 "-no-mips_dspr2"))))))))
2e36f7e6 260 (home-page "https://www.qt.io/")
b332e366
AE
261 (synopsis "Cross-platform GUI library")
262 (description "Qt is a cross-platform application and UI framework for
263developers using C++ or QML, a CSS & JavaScript like language.")
225941b0 264 (license license:lgpl2.1)
f47638a3
LC
265
266 ;; Qt 4: 'QBasicAtomicPointer' leads to build failures on MIPS;
267 ;; see <http://hydra.gnu.org/build/112828>.
268 ;; Qt 5: assembler error; see <http://hydra.gnu.org/build/112526>.
269 (supported-systems (delete "mips64el-linux" %supported-systems))))
1e9ed0e3
AE
270
271(define-public qt-4
272 (package (inherit qt)
d22b9397 273 (version "4.8.7")
1e9ed0e3
AE
274 (source (origin
275 (method url-fetch)
276 (uri (string-append "http://download.qt-project.org/official_releases/qt/"
277 (string-copy version 0 (string-rindex version #\.))
278 "/" version
89059aa1 279 "/qt-everywhere-opensource-src-"
1e9ed0e3
AE
280 version ".tar.gz"))
281 (sha256
282 (base32
d22b9397 283 "183fca7n7439nlhxyg1z7aky0izgbyll3iwakw4gwivy16aj5272"))
fc1adab1 284 (patches (search-patches "qt4-ldflags.patch"))
7431edea
AE
285 (modules '((guix build utils)))
286 (snippet
287 ;; Remove webkit module, which is not built.
288 '(delete-file-recursively "src/3rdparty/webkit"))))
f7fb0ccb
AE
289 (inputs `(,@(alist-delete "harfbuzz"
290 (alist-delete "libjpeg" (package-inputs qt)))
e7e5a4f8
AE
291 ("libjepg" ,libjpeg-8)
292 ("libsm" ,libsm)))
31580979
LC
293
294 ;; Note: there are 37 MiB of examples and a '-exampledir' configure flags,
295 ;; but we can't make them a separate output because "out" and "examples"
296 ;; would refer to each other.
297 (outputs '("out" ;112MiB core + 37MiB examples
298 "doc")) ;280MiB of HTML + code
1e9ed0e3
AE
299 (arguments
300 `(#:phases
cba632c4
LC
301 (modify-phases %standard-phases
302 (replace
1e9ed0e3
AE
303 'configure
304 (lambda* (#:key outputs #:allow-other-keys)
31580979
LC
305 (let ((out (assoc-ref outputs "out"))
306 (doc (assoc-ref outputs "doc")))
1e9ed0e3 307 (substitute* '("configure")
d2984346
LC
308 (("/bin/pwd") (which "pwd")))
309
206a5208
AE
310 (zero? (system*
311 "./configure"
312 "-verbose"
313 "-prefix" out
4b0f2ef7
LC
314 ;; Note: Don't pass '-docdir' since 'qmake' and
315 ;; libQtCore would record its value, thereby defeating
316 ;; the whole point of having a separate output.
ff1989a5
LC
317 "-datadir" (string-append out "/share/qt-" ,version
318 "/data")
319 "-importdir" (string-append out "/lib/qt-4"
320 "/imports")
321 "-plugindir" (string-append out "/lib/qt-4"
322 "/plugins")
323 "-translationdir" (string-append out "/share/qt-" ,version
324 "/translations")
31580979
LC
325 "-demosdir" (string-append out "/share/qt-" ,version
326 "/demos")
327 "-examplesdir" (string-append out "/share/qt-" ,version
328 "/examples")
206a5208
AE
329 "-opensource"
330 "-confirm-license"
ff0a8c59
AE
331 ;; explicitly link with dbus instead of dlopening it
332 "-dbus-linked"
7431edea
AE
333 ;; Skip the webkit module; it fails to build on armhf
334 ;; and, apart from that, may pose security risks.
335 "-no-webkit"
206a5208
AE
336 ;; drop special machine instructions not supported
337 ;; on all instances of the target
338 ,@(if (string-prefix? "x86_64"
339 (or (%current-target-system)
340 (%current-system)))
341 '()
342 '("-no-mmx"
1e9ed0e3
AE
343 "-no-3dnow"
344 "-no-sse"
206a5208
AE
345 "-no-sse2"))
346 "-no-sse3"
347 "-no-ssse3"
348 "-no-sse4.1"
349 "-no-sse4.2"
84811c22 350 "-no-avx")))))
4b0f2ef7
LC
351 (add-after
352 'install 'move-doc
353 (lambda* (#:key outputs #:allow-other-keys)
354 ;; Because of qt4-documentation-path.patch, documentation ends up
355 ;; being installed in OUT. Move it to the right place.
356 (let* ((out (assoc-ref outputs "out"))
357 (doc (assoc-ref outputs "doc"))
358 (olddoc (string-append out "/doc"))
359 (docdir (string-append doc "/share/doc/qt-" ,version)))
360 (mkdir-p (dirname docdir))
361
362 ;; Note: We can't use 'rename-file' here because OUT and DOC are
363 ;; different "devices" due to bind-mounts.
364 (copy-recursively olddoc docdir)
365 (delete-file-recursively olddoc)
366 #t))))))))
84ef83dd 367
7868000f
AE
368(define-public qtbase
369 (package
370 (name "qtbase")
f18c9470 371 (version "5.9.2")
7868000f
AE
372 (source (origin
373 (method url-fetch)
374 (uri (string-append "https://download.qt.io/official_releases/qt/"
375 (version-major+minor version) "/" version
376 "/submodules/" name "-opensource-src-"
377 version ".tar.xz"))
378 (sha256
c7386f4e 379 (base32
f18c9470 380 "16v0dny4rcyd5p8qsnsfg89w98k8kqk3rp9x3g3k7xjmi53bpqkz"))
7868000f
AE
381 (modules '((guix build utils)))
382 (snippet
924e6ddf 383 ;; corelib uses bundled harfbuzz, md4, md5, sha3
7868000f 384 '(begin
924e6ddf
EF
385 (for-each
386 (lambda (dir)
387 (delete-file-recursively (string-append "src/3rdparty/" dir)))
388 (list "double-conversion" "freetype" "harfbuzz-ng"
389 "libpng" "libjpeg" "pcre2" "sqlite" "xcb"
390 "xkbcommon" "zlib"))
391 #t))))
7868000f 392 (build-system gnu-build-system)
48d4ce6e 393 (propagated-inputs
8075b623
SB
394 `(("mesa" ,mesa)
395 ("which" ,(@ (gnu packages base) which))))
7868000f
AE
396 (inputs
397 `(("alsa-lib" ,alsa-lib)
398 ("cups" ,cups)
399 ("dbus" ,dbus)
04f8decf 400 ("double-conversion" ,double-conversion)
f66970a7 401 ("eudev" ,eudev)
7868000f
AE
402 ("expat" ,expat)
403 ("fontconfig" ,fontconfig)
404 ("freetype" ,freetype)
405 ("glib" ,glib)
406 ("harfbuzz" ,harfbuzz)
407 ("icu4c" ,icu4c)
9ed9b44e 408 ("libinput" ,libinput-minimal)
7868000f
AE
409 ("libjpeg" ,libjpeg)
410 ("libmng" ,libmng)
411 ("libpng" ,libpng)
412 ("libx11" ,libx11)
413 ("libxcomposite" ,libxcomposite)
414 ("libxcursor" ,libxcursor)
415 ("libxfixes" ,libxfixes)
416 ("libxi" ,libxi)
417 ("libxinerama" ,libxinerama)
418 ("libxkbcommon" ,libxkbcommon)
419 ("libxml2" ,libxml2)
420 ("libxrandr" ,libxrandr)
421 ("libxrender" ,libxrender)
422 ("libxslt" ,libxslt)
423 ("libxtst" ,libxtst)
424 ("mtdev" ,mtdev)
425 ("mysql" ,mysql)
426 ("nss" ,nss)
427 ("openssl" ,openssl)
924e6ddf 428 ("pcre2" ,pcre2)
7868000f
AE
429 ("postgresql" ,postgresql)
430 ("pulseaudio" ,pulseaudio)
431 ("sqlite" ,sqlite)
432 ("unixodbc" ,unixodbc)
433 ("xcb-util" ,xcb-util)
434 ("xcb-util-image" ,xcb-util-image)
435 ("xcb-util-keysyms" ,xcb-util-keysyms)
436 ("xcb-util-renderutil" ,xcb-util-renderutil)
437 ("xcb-util-wm" ,xcb-util-wm)
438 ("zlib" ,zlib)))
439 (native-inputs
440 `(("bison" ,bison)
441 ("flex" ,flex)
442 ("gperf" ,gperf)
443 ("perl" ,perl)
444 ("pkg-config" ,pkg-config)
445 ("python" ,python-2)
8075b623 446 ("ruby" ,ruby)))
7868000f
AE
447 (arguments
448 `(#:phases
449 (modify-phases %standard-phases
450 (add-after 'configure 'patch-bin-sh
451 (lambda _
452 (substitute* '("config.status"
453 "configure"
454 "mkspecs/features/qt_functions.prf"
455 "qmake/library/qmakebuiltins.cpp")
456 (("/bin/sh") (which "sh")))
457 #t))
458 (replace 'configure
459 (lambda* (#:key outputs #:allow-other-keys)
460 (let ((out (assoc-ref outputs "out")))
461 (substitute* "configure"
462 (("/bin/pwd") (which "pwd")))
463 (substitute* "src/corelib/global/global.pri"
464 (("/bin/ls") (which "ls")))
7972d8a2
AE
465 ;; The configuration files for other Qt5 packages are searched
466 ;; through a call to "find_package" in Qt5Config.cmake, which
467 ;; disables the use of CMAKE_PREFIX_PATH via the parameter
468 ;; "NO_DEFAULT_PATH". Re-enable it so that the different
469 ;; components can be installed in different places.
470 (substitute* (find-files "." ".*\\.cmake")
471 (("NO_DEFAULT_PATH") ""))
7868000f
AE
472 ;; do not pass "--enable-fast-install", which makes the
473 ;; configure process fail
474 (zero? (system*
475 "./configure"
476 "-verbose"
477 "-prefix" out
6fc0e157
SB
478 "-docdir" (string-append out "/share/doc/qt5")
479 "-headerdir" (string-append out "/include/qt5")
480 "-archdatadir" (string-append out "/lib/qt5")
481 "-datadir" (string-append out "/share/qt5")
482 "-examplesdir" (string-append
483 out "/share/doc/qt5/examples")
7868000f
AE
484 "-opensource"
485 "-confirm-license"
486 ;; Do not build examples; if desired, these could go
487 ;; into a separate output, but for the time being, we
488 ;; prefer to save the space and build time.
924e6ddf 489 "-no-compile-examples"
7868000f
AE
490 ;; Most "-system-..." are automatic, but some use
491 ;; the bundled copy by default.
492 "-system-sqlite"
493 "-system-harfbuzz"
924e6ddf 494 "-system-pcre"
7868000f
AE
495 ;; explicitly link with openssl instead of dlopening it
496 "-openssl-linked"
497 ;; explicitly link with dbus instead of dlopening it
498 "-dbus-linked"
4e825e2d
EF
499 ;; don't use the precompiled headers
500 "-no-pch"
501 ;; drop special machine instructions that do not have
502 ;; runtime detection
7868000f
AE
503 ,@(if (string-prefix? "x86_64"
504 (or (%current-target-system)
505 (%current-system)))
506 '()
507 '("-no-sse2"))
7868000f 508 "-no-mips_dsp"
5ca6ef95 509 "-no-mips_dspr2")))))
8075b623 510 (add-after 'install 'patch-mkspecs
5ca6ef95
SB
511 (lambda* (#:key outputs #:allow-other-keys)
512 (let* ((out (assoc-ref outputs "out"))
8075b623
SB
513 (archdata (string-append out "/lib/qt5"))
514 (mkspecs (string-append archdata "/mkspecs"))
5ca6ef95 515 (qt_config.prf (string-append
6fc0e157 516 mkspecs "/features/qt_config.prf")))
5ca6ef95
SB
517 ;; For each Qt module, let `qmake' uses search paths in the
518 ;; module directory instead of all in QT_INSTALL_PREFIX.
519 (substitute* qt_config.prf
520 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
6fc0e157 521 "$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt5))")
5ca6ef95 522 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
6fc0e157 523 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
5ca6ef95 524 (("\\$\\$\\[QT_HOST_LIBS\\]")
6fc0e157 525 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
5ca6ef95 526 (("\\$\\$\\[QT_INSTALL_BINS\\]")
6fc0e157 527 "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))"))
8075b623
SB
528
529 ;; Searches Qt tools in the current PATH instead of QT_HOST_BINS.
530 (substitute* (string-append mkspecs "/features/qt_functions.prf")
531 (("cmd = \\$\\$\\[QT_HOST_BINS\\]/\\$\\$2")
532 "cmd = $$system(which $${2}.pl 2>/dev/null || which $${2})"))
533
534 ;; Resolve qmake spec files within qtbase by absolute paths.
535 (substitute*
536 (map (lambda (file)
537 (string-append mkspecs "/features/" file))
538 '("device_config.prf" "moc.prf" "qt_build_config.prf"
539 "qt_config.prf" "winrt/package_manifest.prf"))
540 (("\\$\\$\\[QT_HOST_DATA/get\\]") archdata)
541 (("\\$\\$\\[QT_HOST_DATA/src\\]") archdata))
5ca6ef95
SB
542 #t))))))
543 (native-search-paths
544 (list (search-path-specification
545 (variable "QMAKEPATH")
6fc0e157 546 (files '("lib/qt5")))
ed02e1fe
DC
547 (search-path-specification
548 (variable "QML2_IMPORT_PATH")
6fc0e157 549 (files '("lib/qt5/qml")))
ed02e1fe
DC
550 (search-path-specification
551 (variable "QT_PLUGIN_PATH")
6fc0e157 552 (files '("lib/qt5/plugins")))
ed02e1fe
DC
553 (search-path-specification
554 (variable "XDG_DATA_DIRS")
555 (files '("share")))
556 (search-path-specification
557 (variable "XDG_CONFIG_DIRS")
558 (files '("etc/xdg")))))
7868000f
AE
559 (home-page "https://www.qt.io/")
560 (synopsis "Cross-platform GUI library")
561 (description "Qt is a cross-platform application and UI framework for
562developers using C++ or QML, a CSS & JavaScript like language.")
225941b0 563 (license (list license:lgpl2.1 license:lgpl3))))
7868000f 564
19c17631
EF
565(define-public qtsvg
566 (package (inherit qtbase)
567 (name "qtsvg")
f18c9470 568 (version "5.9.2")
19c17631
EF
569 (source (origin
570 (method url-fetch)
571 (uri (string-append "https://download.qt.io/official_releases/qt/"
572 (version-major+minor version) "/" version
573 "/submodules/" name "-opensource-src-"
574 version ".tar.xz"))
575 (sha256
576 (base32
f18c9470 577 "020icrl9vi8jh8ygsssqrx2bl8bx28m15dwmf9a969qdnvxyp5ms"))))
48d4ce6e 578 (propagated-inputs `())
19c17631
EF
579 (native-inputs `(("perl" ,perl)))
580 (inputs
581 `(("mesa" ,mesa)
582 ("qtbase" ,qtbase)
583 ("zlib" ,zlib)))
584 (arguments
585 `(#:phases
586 (modify-phases %standard-phases
8075b623 587 (add-before 'configure 'configure-qmake
19c17631 588 (lambda* (#:key inputs outputs #:allow-other-keys)
8075b623
SB
589 (let* ((out (assoc-ref outputs "out"))
590 (qtbase (assoc-ref inputs "qtbase"))
591 (tmpdir (string-append (getenv "TMPDIR")))
592 (qmake (string-append tmpdir "/qmake"))
593 (qt.conf (string-append tmpdir "/qt.conf")))
594 ;; Use qmake with a customized qt.conf to override install
595 ;; paths to $out.
596 (symlink (which "qmake") qmake)
597 (setenv "PATH" (string-append tmpdir ":" (getenv "PATH")))
598 (with-output-to-file qt.conf
599 (lambda ()
600 (format #t "[Paths]
601Prefix=~a
602ArchData=lib/qt5
603Data=share/qt5
604Documentation=share/doc/qt5
605Headers=include/qt5
606Libraries=lib
607LibraryExecutables=lib/qt5/libexec
608Binaries=bin
609Tests=tests
610Plugins=lib/qt5/plugins
611Imports=lib/qt5/imports
612Qml2Imports=lib/qt5/qml
613Translations=share/qt5/translations
614Settings=etc/xdg
615Examples=share/doc/qt5/examples
616HostPrefix=~a
617HostData=lib/qt5
618HostBinaries=bin
619HostLibraries=lib
620" out out)))
c195b5ba 621 #t)))
8075b623
SB
622 (replace 'configure
623 (lambda* (#:key inputs outputs #:allow-other-keys)
624 ;; Valid QT_BUILD_PARTS variables are:
625 ;; libs tools tests examples demos docs translations
626 (zero? (system* "qmake" "QT_BUILD_PARTS = libs tools tests"))))
627 (add-before 'check 'set-display
628 (lambda _
629 ;; make Qt render "offscreen", required for tests
630 (setenv "QT_QPA_PLATFORM" "offscreen")
631 #t)))))
96412f34
EF
632 (synopsis "Qt module for displaying SVGs")
633 (description "The QtSvg module provides classes for displaying the
634 contents of SVG files.")))
19c17631 635
9b694210
EF
636(define-public qtimageformats
637 (package (inherit qtsvg)
638 (name "qtimageformats")
f18c9470 639 (version "5.9.2")
9b694210
EF
640 (source (origin
641 (method url-fetch)
642 (uri (string-append "https://download.qt.io/official_releases/qt/"
643 (version-major+minor version) "/" version
644 "/submodules/" name "-opensource-src-"
645 version ".tar.xz"))
646 (sha256
647 (base32
f18c9470 648 "1wwxxcl24mk1p4w6knyfai09axmwqsm6cgsbkjsmdz3zmjh6qqis"))
c04854da
EF
649 (modules '((guix build utils)))
650 (snippet
a20e00dd 651 '(delete-file-recursively "src/3rdparty"))))
9b694210
EF
652 (native-inputs `())
653 (inputs
a532a671
EF
654 `(("jasper" ,jasper)
655 ("libmng" ,libmng)
9b694210
EF
656 ("libtiff" ,libtiff)
657 ("libwebp" ,libwebp)
658 ("mesa" ,mesa)
659 ("qtbase" ,qtbase)
96412f34
EF
660 ("zlib" ,zlib)))
661 (synopsis "Additional Image Format plugins for Qt")
662 (description "The QtImageFormats module contains plugins for adding
663support for MNG, TGA, TIFF and WBMP image formats.")))
9b694210 664
f6c13613
EF
665(define-public qtx11extras
666 (package (inherit qtsvg)
667 (name "qtx11extras")
f18c9470 668 (version "5.9.2")
f6c13613
EF
669 (source (origin
670 (method url-fetch)
671 (uri (string-append "https://download.qt.io/official_releases/qt/"
672 (version-major+minor version) "/" version
673 "/submodules/" name "-opensource-src-"
674 version ".tar.xz"))
675 (sha256
676 (base32
f18c9470 677 "1ias745j5lfnrfkgyk0pr8n8zlkqs08gq7yyzaj1c645sh54b1fv"))))
c195b5ba
EF
678 (arguments
679 (substitute-keyword-arguments (package-arguments qtsvg)
680 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
f6c13613
EF
681 (native-inputs `(("perl" ,perl)))
682 (inputs
683 `(("mesa" ,mesa)
96412f34
EF
684 ("qtbase" ,qtbase)))
685 (synopsis "Qt Extras for X11")
686 (description "The QtX11Extras module includes the library to access X11
687from within Qt 5.")))
f6c13613 688
98eec712
EF
689(define-public qtxmlpatterns
690 (package (inherit qtsvg)
691 (name "qtxmlpatterns")
f18c9470 692 (version "5.9.2")
98eec712
EF
693 (source (origin
694 (method url-fetch)
695 (uri (string-append "https://download.qt.io/official_releases/qt/"
696 (version-major+minor version) "/" version
697 "/submodules/" name "-opensource-src-"
698 version ".tar.xz"))
699 (sha256
700 (base32
f18c9470 701 "0knk4bplqhvsxar1wv16bzfw57q0aja12gdaxz7m8mvx121sm9ha"))))
c195b5ba
EF
702 (arguments
703 (substitute-keyword-arguments (package-arguments qtsvg)
f66b3e15
EF
704 ((#:phases phases)
705 `(modify-phases ,phases
706 (add-after 'unpack 'disable-network-tests
707 (lambda _ (substitute* "tests/auto/auto.pro"
708 (("qxmlquery") "# qxmlquery")
a20e00dd 709 (("xmlpatterns ") "# xmlpatterns"))
f66b3e15 710 #t))))))
98eec712 711 (native-inputs `(("perl" ,perl)))
96412f34
EF
712 (inputs `(("qtbase" ,qtbase)))
713 (synopsis "Qt XML patterns module")
714 (description "The QtXmlPatterns module is a XQuery and XPath engine for
715XML and custom data models. It contains programs such as xmlpatterns and
716xmlpatternsvalidator.")))
98eec712 717
e3a2ed81
EF
718(define-public qtdeclarative
719 (package (inherit qtsvg)
720 (name "qtdeclarative")
f18c9470 721 (version "5.9.2")
e3a2ed81
EF
722 (source (origin
723 (method url-fetch)
724 (uri (string-append "https://download.qt.io/official_releases/qt/"
725 (version-major+minor version) "/" version
726 "/submodules/" name "-opensource-src-"
727 version ".tar.xz"))
728 (sha256
729 (base32
f18c9470 730 "020bha6q8byxc8cj5zw7gms5rgsjg71hv31hv1rr2fy7x56zsh0d"))))
c195b5ba
EF
731 (arguments
732 (substitute-keyword-arguments (package-arguments qtsvg)
733 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
e3a2ed81
EF
734 (native-inputs
735 `(("perl" ,perl)
736 ("pkg-config" ,pkg-config)
737 ("python" ,python-2)
738 ("qtsvg" ,qtsvg)
739 ("qtxmlpatterns" ,qtxmlpatterns)))
740 (inputs
741 `(("mesa" ,mesa)
96412f34
EF
742 ("qtbase" ,qtbase)))
743 (synopsis "Qt QML module (Quick 2)")
744 (description "The Qt QML module provides a framework for developing
745applications and libraries with the QML language. It defines and implements the
746language and engine infrastructure, and provides an API to enable application
747developers to extend the QML language with custom types and integrate QML code
748with JavaScript and C++.")))
e3a2ed81 749
e98cb96d
EF
750(define-public qtconnectivity
751 (package (inherit qtsvg)
752 (name "qtconnectivity")
f18c9470 753 (version "5.9.2")
e98cb96d
EF
754 (source (origin
755 (method url-fetch)
756 (uri (string-append "https://download.qt.io/official_releases/qt/"
757 (version-major+minor version) "/" version
758 "/submodules/" name "-opensource-src-"
759 version ".tar.xz"))
760 (sha256
761 (base32
f18c9470 762 "1k7kjmlny0ykm40qx796wbsg3310v6b8hqizkbr597cmxjbrax9c"))))
45f5bc0e
EF
763 (arguments
764 (substitute-keyword-arguments (package-arguments qtsvg)
765 ((#:phases phases)
766 `(modify-phases ,phases
767 (add-after 'unpack 'disable-failing-tests
768 ;; this test fails on armhf and aarch64
769 (lambda _
770 (substitute* "tests/auto/qndefnfcsmartposterrecord/tst_qndefnfcsmartposterrecord.cpp"
771 (("QCOMPARE\\(record.action\\(\\), QNdefNfcSmartPosterRecord::UnspecifiedAction")
772 "//QCOMPARE(record.action(), QNdefNfcSmartPosterRecord::UnspecifiedAction"))
773 #t))))))
e98cb96d
EF
774 (native-inputs
775 `(("perl" ,perl)
776 ("pkg-config" ,pkg-config)
777 ("qtdeclarative" ,qtdeclarative)))
778 (inputs
779 `(("bluez" ,bluez)
96412f34
EF
780 ("qtbase" ,qtbase)))
781 (synopsis "Qt Connectivity module")
782 (description "The Qt Connectivity modules provides modules for interacting
783with Bluetooth and NFC.")))
e98cb96d 784
cac893ec
EF
785(define-public qtwebsockets
786 (package (inherit qtsvg)
787 (name "qtwebsockets")
f18c9470 788 (version "5.9.2")
cac893ec
EF
789 (source (origin
790 (method url-fetch)
791 (uri (string-append "https://download.qt.io/official_releases/qt/"
792 (version-major+minor version) "/" version
793 "/submodules/" name "-opensource-src-"
794 version ".tar.xz"))
795 (sha256
796 (base32
f18c9470 797 "0x0nx1ampqsgj9qlc3l32z3ham1a5vq7m2lnxk5pr92yj6yw3pdg"))))
c195b5ba
EF
798 (arguments
799 (substitute-keyword-arguments (package-arguments qtsvg)
800 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
cac893ec
EF
801 (native-inputs
802 `(("perl" ,perl)
803 ("qtdeclarative" ,qtdeclarative)))
96412f34
EF
804 (inputs `(("qtbase" ,qtbase)))
805 (synopsis "Qt Web Sockets module")
806 (description "WebSocket is a web-based protocol designed to enable two-way
807communication between a client application and a remote host. The Qt
808WebSockets module provides C++ and QML interfaces that enable Qt applications
809to act as a server that can process WebSocket requests, or a client that can
810consume data received from the server, or both.")))
cac893ec 811
3474767c
EF
812(define-public qtsensors
813 (package (inherit qtsvg)
814 (name "qtsensors")
f18c9470 815 (version "5.9.2")
3474767c
EF
816 (source (origin
817 (method url-fetch)
818 (uri (string-append "https://download.qt.io/official_releases/qt/"
819 (version-major+minor version) "/" version
820 "/submodules/" name "-opensource-src-"
821 version ".tar.xz"))
822 (sha256
823 (base32
f18c9470 824 "1lxmhi19dbb8vjhpjph0l0ss6zh72hb4908lp4s1pgf8r641ai3r"))))
202afee2
EF
825 (arguments
826 (substitute-keyword-arguments (package-arguments qtsvg)
827 ((#:phases phases)
828 `(modify-phases ,phases
829 (add-after 'unpack 'lengthen-test-timeout
830 (lambda _
831 (substitute* "tests/auto/qsensorgestures_gestures/tst_sensorgestures_gestures.cpp"
832 (("2000") "5000"))
833 #t))))))
3474767c
EF
834 (native-inputs
835 `(("perl" ,perl)
836 ("qtdeclarative" ,qtdeclarative)))
96412f34
EF
837 (inputs `(("qtbase" ,qtbase)))
838 (synopsis "Qt Sensors module")
839 (description "The Qt Sensors API provides access to sensor hardware via QML
840and C++ interfaces. The Qt Sensors API also provides a motion gesture
841recognition API for devices.")))
3474767c 842
15378f93
EF
843(define-public qtmultimedia
844 (package (inherit qtsvg)
845 (name "qtmultimedia")
f18c9470 846 (version "5.9.2")
15378f93
EF
847 (source (origin
848 (method url-fetch)
849 (uri (string-append "https://download.qt.io/official_releases/qt/"
850 (version-major+minor version) "/" version
851 "/submodules/" name "-opensource-src-"
852 version ".tar.xz"))
853 (sha256
854 (base32
f18c9470 855 "0815hi3cxy5zy6yc5fkdpx2xd6rk7968j1ziwl2g4wa80802g9n9"))
63d8f08f
EF
856 (modules '((guix build utils)))
857 (snippet
858 '(begin
859 (delete-file-recursively
c195b5ba
EF
860 "examples/multimedia/spectrum/3rdparty")
861 ;; We also prevent the spectrum example from being built.
862 (substitute* "examples/multimedia/multimedia.pro"
863 (("spectrum") "#"))))))
864 (arguments
865 (substitute-keyword-arguments (package-arguments qtsvg)
04231311
RW
866 ((#:phases phases)
867 `(modify-phases ,phases
868 (replace 'configure
869 (lambda* (#:key outputs #:allow-other-keys)
870 (let ((out (assoc-ref outputs "out")))
871 (zero? (system* "qmake" "QT_BUILD_PARTS = libs tools tests"
872 (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out "/lib -Wl,-rpath,")
873 (string-append "PREFIX=" out))))))))
874 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
15378f93
EF
875 (native-inputs
876 `(("perl" ,perl)
877 ("pkg-config" ,pkg-config)
878 ("python" ,python-2)
879 ("qtdeclarative" ,qtdeclarative)))
880 (inputs
881 `(("alsa-lib" ,alsa-lib)
882 ("mesa" ,mesa)
883 ("pulseaudio" ,pulseaudio)
04231311
RW
884 ("qtbase" ,qtbase)
885 ;; Gstreamer is needed for the mediaplayer plugin
886 ("gstreamer" ,gstreamer)
96412f34
EF
887 ("gst-plugins-base" ,gst-plugins-base)))
888 (synopsis "Qt Multimedia module")
889 (description "The Qt Multimedia module provides set of APIs to play and
890record media, and manage a collection of media content. It also contains a
891set of plugins for interacting with pulseaudio and GStreamer.")))
15378f93 892
bc8ede01
EF
893(define-public qtwayland
894 (package (inherit qtsvg)
895 (name "qtwayland")
f18c9470 896 (version "5.9.2")
bc8ede01
EF
897 (source (origin
898 (method url-fetch)
899 (uri (string-append "https://download.qt.io/official_releases/qt/"
900 (version-major+minor version) "/" version
901 "/submodules/" name "-opensource-src-"
902 version ".tar.xz"))
903 (sha256
904 (base32
f18c9470 905 "1ipn4xh0dj1kjg5i4vfl4gpx3hg2377w5gls47xpv1ikz41lshzn"))
924e6ddf
EF
906 (modules '((guix build utils)))
907 (snippet
908 ;; The examples try to build and cause the build to fail
909 '(delete-file-recursively "examples"))))
6fc0e157
SB
910 (arguments
911 (substitute-keyword-arguments (package-arguments qtsvg)
912 ((#:phases phases)
913 `(modify-phases ,phases
914 (add-before 'check 'set-ld-library-path
915 ;; <https://lists.gnu.org/archive/html/guix-devel/2017-09/msg00019.html>
916 ;;
917 ;; Make the uninstalled libQt5WaylandClient.so.5 available to the
918 ;; wayland platform plugin.
919 (lambda _
920 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/lib"))
921 #t))))))
bc8ede01
EF
922 (native-inputs
923 `(("glib" ,glib)
924 ("perl" ,perl)
925 ("pkg-config" ,pkg-config)
926 ("qtdeclarative" ,qtdeclarative)))
927 (inputs
928 `(("fontconfig" ,fontconfig)
929 ("freetype" ,freetype)
930 ("libx11" ,libx11)
931 ("libxcomposite" ,libxcomposite)
932 ("libxext" ,libxext)
933 ("libxkbcommon" ,libxkbcommon)
934 ("libxrender" ,libxrender)
935 ("mesa" ,mesa)
936 ("mtdev" ,mtdev)
937 ("qtbase" ,qtbase)
96412f34
EF
938 ("wayland" ,wayland)))
939 (synopsis "Qt Wayland module")
940 (description "The Qt Wayland module provides the QtWayland client and
941compositor libraries.")))
bc8ede01 942
00806f2b
EF
943(define-public qtserialport
944 (package (inherit qtsvg)
945 (name "qtserialport")
f18c9470 946 (version "5.9.2")
00806f2b
EF
947 (source (origin
948 (method url-fetch)
949 (uri (string-append "https://download.qt.io/official_releases/qt/"
950 (version-major+minor version) "/" version
951 "/submodules/" name "-opensource-src-"
952 version ".tar.xz"))
953 (sha256
954 (base32
f18c9470 955 "0hndc9z7qzxazzjvc6k5yd58afw13444plk70b05nqdi5p19rvah"))))
00806f2b 956 (native-inputs `(("perl" ,perl)))
33741e16
EF
957 (inputs
958 `(("qtbase" ,qtbase)
96412f34
EF
959 ("eudev" ,eudev)))
960 (synopsis "Qt Serial Port module")
961 (description "The Qt Serial Port module provides the library for
962interacting with serial ports from within Qt.")))
00806f2b 963
a98ffab5
EF
964(define-public qtserialbus
965 (package (inherit qtsvg)
966 (name "qtserialbus")
f18c9470 967 (version "5.9.2")
a98ffab5
EF
968 (source (origin
969 (method url-fetch)
970 (uri (string-append "https://download.qt.io/official_releases/qt/"
971 (version-major+minor version) "/" version
972 "/submodules/" name "-opensource-src-"
973 version ".tar.xz"))
974 (sha256
975 (base32
f18c9470 976 "025yv7zajz5scrmkjkmgkyvxpgkliqvrzc88is0gr481zpd4phmv"))))
a98ffab5
EF
977 (inputs
978 `(("qtbase" ,qtbase)
96412f34
EF
979 ("qtserialport" ,qtserialport)))
980 (synopsis "Qt Serial Bus module")
981 (description "The Qt Serial Bus API provides classes and functions to
982access the various industrial serial buses and protocols, such as CAN, ModBus,
983and others.")))
a98ffab5 984
f5377013
EF
985(define-public qtwebchannel
986 (package (inherit qtsvg)
987 (name "qtwebchannel")
f18c9470 988 (version "5.9.2")
f5377013
EF
989 (source (origin
990 (method url-fetch)
991 (uri (string-append "https://download.qt.io/official_releases/qt/"
992 (version-major+minor version) "/" version
993 "/submodules/" name "-opensource-src-"
994 version ".tar.xz"))
995 (sha256
996 (base32
f18c9470 997 "09iss70c1iqgf8qpik35qlgrdw5y9935v0fm2ppgkmxdxkpls6ww"))))
f5377013
EF
998 (native-inputs
999 `(("perl" ,perl)
1000 ("qtdeclarative" ,qtdeclarative)
1001 ("qtwebsockets" ,qtwebsockets)))
96412f34
EF
1002 (inputs `(("qtbase" ,qtbase)))
1003 (synopsis "Web communication library for Qt")
1004 (description "The Qt WebChannel module enables peer-to-peer communication
1005between the host (QML/C++ application) and the client (HTML/JavaScript
1006application). The transport mechanism is supported out of the box by the two
1007popular web engines, Qt WebKit 2 and Qt WebEngine.")))
f5377013 1008
d5ca54ce
EF
1009(define-public qtlocation
1010 (package (inherit qtsvg)
1011 (name "qtlocation")
f18c9470 1012 (version "5.9.2")
d5ca54ce
EF
1013 (source (origin
1014 (method url-fetch)
1015 (uri (string-append "https://download.qt.io/official_releases/qt/"
1016 (version-major+minor version) "/" version
1017 "/submodules/" name "-opensource-src-"
1018 version ".tar.xz"))
1019 (sha256
1020 (base32
f18c9470 1021 "033b6l6jbvmc0k5qvbgh5vkzvfga7npqcphrywrrqkmx9vj446n8"))))
c195b5ba
EF
1022 (arguments
1023 (substitute-keyword-arguments (package-arguments qtsvg)
1024 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
d5ca54ce
EF
1025 (native-inputs
1026 `(("perl" ,perl)
1027 ("qtdeclarative" ,qtdeclarative)
9a935ef2 1028 ("qtquickcontrols" ,qtquickcontrols)
d5ca54ce 1029 ("qtserialport" ,qtserialport)))
924e6ddf
EF
1030 (inputs
1031 `(("icu4c" ,icu4c)
1032 ("openssl" ,openssl)
1033 ("qtbase" ,qtbase)
96412f34
EF
1034 ("zlib" ,zlib)))
1035 (synopsis "Qt Location and Positioning modules")
1036 (description "The Qt Location module provides an interface for location,
1037positioning and geolocation plugins.")))
d5ca54ce 1038
d438c968
EF
1039(define-public qttools
1040 (package (inherit qtsvg)
1041 (name "qttools")
f18c9470 1042 (version "5.9.2")
d438c968
EF
1043 (source (origin
1044 (method url-fetch)
1045 (uri (string-append "https://download.qt.io/official_releases/qt/"
1046 (version-major+minor version) "/" version
1047 "/submodules/" name "-opensource-src-"
1048 version ".tar.xz"))
1049 (sha256
1050 (base32
f18c9470 1051 "06nqsa5mj0mc9w9xbm7mgdkb66x4wlvkhnas32f97sb8ic8rdf9b"))))
c195b5ba
EF
1052 (arguments
1053 (substitute-keyword-arguments (package-arguments qtsvg)
1054 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
d438c968
EF
1055 (native-inputs
1056 `(("perl" ,perl)
1057 ("qtdeclarative" ,qtdeclarative)))
1058 (inputs
1059 `(("mesa" ,mesa)
96412f34
EF
1060 ("qtbase" ,qtbase)))
1061 (synopsis "Qt Tools and Designer modules")
1062 (description "The Qt Tools module provides a set of applications to browse
1063the documentation, translate applications, generate help files and other stuff
1064that helps in Qt development.")))
d438c968 1065
4742c4de
EF
1066(define-public qtscript
1067 (package (inherit qtsvg)
1068 (name "qtscript")
f18c9470 1069 (version "5.9.2")
4742c4de
EF
1070 (source (origin
1071 (method url-fetch)
1072 (uri (string-append "https://download.qt.io/official_releases/qt/"
1073 (version-major+minor version) "/" version
1074 "/submodules/" name "-opensource-src-"
1075 version ".tar.xz"))
1076 (sha256
1077 (base32
f18c9470 1078 "1wa0rnbphkhgydnwkf5bjwn0llskl6hgs0964nh0jik8qaspv027"))
7c5cf7a2 1079 (patches (search-patches "qtscript-disable-tests.patch"))))
4742c4de
EF
1080 (native-inputs
1081 `(("perl" ,perl)
1082 ("qttools" ,qttools)))
1083 (inputs
96412f34
EF
1084 `(("qtbase" ,qtbase)))
1085 (synopsis "Qt Script module")
1086 (description "Qt provides support for application scripting with ECMAScript.
1087The following guides and references cover aspects of programming with
1088ECMAScript and Qt.")))
4742c4de 1089
ae0e5133
DC
1090(define-public qtquickcontrols
1091 (package (inherit qtsvg)
1092 (name "qtquickcontrols")
f18c9470 1093 (version "5.9.2")
ae0e5133
DC
1094 (source (origin
1095 (method url-fetch)
1096 (uri (string-append "https://download.qt.io/official_releases/qt/"
1097 (version-major+minor version) "/" version
1098 "/submodules/" name "-opensource-src-"
1099 version ".tar.xz"))
1100 (sha256
1101 (base32
f18c9470 1102 "07xxhkfsljwdwlp9jfp88pwkrig02y2pnwhdsaz8mkcackwfq2az"))))
c195b5ba
EF
1103 (arguments
1104 (substitute-keyword-arguments (package-arguments qtsvg)
1105 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
ae0e5133
DC
1106 (inputs
1107 `(("qtbase" ,qtbase)
96412f34
EF
1108 ("qtdeclarative" ,qtdeclarative)))
1109 (synopsis "Qt Quick Controls and other Quick modules")
1110 (description "The QtScript module provides classes for making Qt
1111applications scriptable. This module provides a set of extra components that
1112can be used to build complete interfaces in Qt Quick.")))
ae0e5133 1113
42da1492
DC
1114(define-public qtquickcontrols2
1115 (package (inherit qtsvg)
1116 (name "qtquickcontrols2")
f18c9470 1117 (version "5.9.2")
42da1492
DC
1118 (source (origin
1119 (method url-fetch)
1120 (uri (string-append "https://download.qt.io/official_releases/qt/"
1121 (version-major+minor version) "/" version
1122 "/submodules/" name "-opensource-src-"
1123 version ".tar.xz"))
1124 (sha256
1125 (base32
f18c9470 1126 "1ln83afxyp5dmvdnq6n7as82xrd5k3xvfx7b1jxnljivslyxsm9b"))))
c195b5ba
EF
1127 (arguments
1128 (substitute-keyword-arguments (package-arguments qtsvg)
1129 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
42da1492
DC
1130 (inputs
1131 `(("qtbase" ,qtbase)
96412f34
EF
1132 ("qtdeclarative" ,qtdeclarative)))
1133 (synopsis "Qt Quick Controls 2 and other Quick 2 modules")
1134 (description "The Qt Quick Controls 2 module contains the Qt Labs Platform
1135module that provides platform integration: native dialogs, menus and menu bars,
1136and tray icons. It falls back to Qt Widgets when a native implementation is
1137not available.")))
42da1492 1138
4e4ed0ee
DC
1139(define-public qtgraphicaleffects
1140 (package (inherit qtsvg)
1141 (name "qtgraphicaleffects")
f18c9470 1142 (version "5.9.2")
4e4ed0ee
DC
1143 (source (origin
1144 (method url-fetch)
1145 (uri (string-append "https://download.qt.io/official_releases/qt/"
1146 (version-major+minor version) "/" version
1147 "/submodules/" name "-opensource-src-"
1148 version ".tar.xz"))
1149 (sha256
1150 (base32
f18c9470 1151 "0xpvigfiqfqvf05ywj8x69y57rp8dwq2hs1kpxlxs15pniz4wn8l"))))
c195b5ba
EF
1152 (arguments
1153 (substitute-keyword-arguments (package-arguments qtsvg)
1154 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
4e4ed0ee
DC
1155 (inputs
1156 `(("qtbase" ,qtbase)
96412f34
EF
1157 ("qtdeclarative" ,qtdeclarative)))
1158 (synopsis "Qt Graphical Effects module")
1159 (description "The Qt Graphical Effects module provides a set of QML types
1160for adding visually impressive and configurable effects to user interfaces.
1161Effects are visual items that can be added to Qt Quick user interface as UI
1162components. The API consists of over 20 effects provided as separate QML
1163types. The effects cover functional areas such as blending, masking, blurring,
1164coloring, and many more.")))
4e4ed0ee 1165
843bdfb7 1166(define-public qtdeclarative-render2d
a20e00dd 1167 ;; As of Qt-5.8.0 this module has been merged into qtdeclarative
843bdfb7
EF
1168 (package (inherit qtsvg)
1169 (name "qtdeclarative-render2d")
1170 (version "5.7.1")
1171 (source (origin
1172 (method url-fetch)
1173 (uri (string-append "https://download.qt.io/official_releases/qt/"
1174 (version-major+minor version) "/" version
1175 "/submodules/" name "-opensource-src-"
1176 version ".tar.xz"))
1177 (sha256
1178 (base32
1179 "0zwch9vn17f3bpy300jcfxx6cx9qymk5j7khx0x9k1xqid4166c3"))
1180 (modules '((guix build utils)))
1181 (snippet
1182 '(delete-file-recursively "tools/opengldummy/3rdparty"))))
1183 (native-inputs `())
1184 (inputs
1185 `(("qtbase" ,qtbase)
a20e00dd 1186 ("qtdeclarative" ,qtdeclarative)))
96412f34
EF
1187 (synopsis "Qt Declarative Render module")
1188 (description "The Qt Declarative Render 2D module provides a Raster
1189backend for QtQuick scene graph.")
a20e00dd 1190 (properties `((superseded . ,qtdeclarative)))))
843bdfb7 1191
51519fd3
EF
1192(define-public qtgamepad
1193 (package (inherit qtsvg)
1194 (name "qtgamepad")
f18c9470 1195 (version "5.9.2")
51519fd3
EF
1196 (source (origin
1197 (method url-fetch)
1198 (uri (string-append "https://download.qt.io/official_releases/qt/"
1199 (version-major+minor version) "/" version
1200 "/submodules/" name "-opensource-src-"
1201 version ".tar.xz"))
1202 (sha256
1203 (base32
f18c9470 1204 "0lm5v43psf7r8zc79dcjdmmdnz4jm30ylgkvsyv8k88mj06yklbn"))))
51519fd3
EF
1205 (native-inputs
1206 `(("perl" ,perl)
1207 ("pkg-config" ,pkg-config)))
1208 (inputs
1209 `(("fontconfig" ,fontconfig)
1210 ("freetype" ,freetype)
1211 ("libxrender" ,libxrender)
1212 ("sdl2" ,sdl2)
1213 ("qtbase" ,qtbase)
96412f34
EF
1214 ("qtdeclarative" ,qtdeclarative)))
1215 (synopsis "Qt Gamepad module")
1216 (description "The Qt Gamepad module is an add-on library that enables Qt
1217applications to support the use of gamepad hardware and in some cases remote
1218control equipment. The module provides both QML and C++ interfaces. The
1219primary target audience are embedded devices with fullscreen user interfaces,
1220and mobile applications targeting TV-like form factors.")))
51519fd3 1221
56cd88fd
EF
1222(define-public qtscxml
1223 (package (inherit qtsvg)
1224 (name "qtscxml")
f18c9470 1225 (version "5.9.2")
56cd88fd
EF
1226 (source (origin
1227 (method url-fetch)
1228 (uri (string-append "https://download.qt.io/official_releases/qt/"
1229 (version-major+minor version) "/" version
1230 "/submodules/" name "-opensource-src-"
1231 version ".tar.xz"))
1232 (sha256
1233 (base32
f18c9470 1234 "0pdimqwdrj8hckm81lwy1z58ji4bdv0bzgv336m0a8v3pj914awx"))
56cd88fd
EF
1235 (modules '((guix build utils)))
1236 (snippet
c195b5ba
EF
1237 '(begin
1238 (delete-file-recursively "tests/3rdparty")
1239 ;; the scion test refers to the bundled 3rd party test code.
1240 (substitute* "tests/auto/auto.pro"
1241 (("scion") "#"))))))
56cd88fd
EF
1242 (inputs
1243 `(("qtbase" ,qtbase)
96412f34
EF
1244 ("qtdeclarative" ,qtdeclarative)))
1245 (synopsis "Qt SCXML module")
1246 (description "The Qt SCXML module provides functionality to create state
1247machines from SCXML files. This includes both dynamically creating state
1248machines (loading the SCXML file and instantiating states and transitions) and
1249generating a C++ file that has a class implementing the state machine. It
1250also contains functionality to support data models and executable content.")))
56cd88fd 1251
de5e0180
EF
1252(define-public qtpurchasing
1253 (package (inherit qtsvg)
1254 (name "qtpurchasing")
f18c9470 1255 (version "5.9.2")
de5e0180
EF
1256 (source (origin
1257 (method url-fetch)
1258 (uri (string-append "https://download.qt.io/official_releases/qt/"
1259 (version-major+minor version) "/" version
1260 "/submodules/" name "-opensource-src-"
1261 version ".tar.xz"))
1262 (sha256
1263 (base32
f18c9470 1264 "04f28y7qcr4kd0pw26mm515qj7haxr0i8lijn1q47wkikxyhawca"))))
de5e0180
EF
1265 (inputs
1266 `(("qtbase" ,qtbase)
96412f34
EF
1267 ("qtdeclarative" ,qtdeclarative)))
1268 (synopsis "Qt Purchasing module")
1269 (description "The Qt Purchasing module provides and in-app API for
1270purchasing goods and services.")))
de5e0180 1271
173b54b9
EF
1272(define-public qtcanvas3d
1273 (package (inherit qtsvg)
1274 (name "qtcanvas3d")
f18c9470 1275 (version "5.9.2")
173b54b9
EF
1276 (source (origin
1277 (method url-fetch)
1278 (uri (string-append "https://download.qt.io/official_releases/qt/"
1279 (version-major+minor version) "/" version
1280 "/submodules/" name "-opensource-src-"
1281 version ".tar.xz"))
1282 (sha256
1283 (base32
f18c9470 1284 "1siyzgm1mjx90rwyzzq9vw2s2xzyf6n7q0vn8gw7mdim5indda44"))
173b54b9
EF
1285 (modules '((guix build utils)))
1286 (snippet
1287 '(delete-file-recursively "examples/canvas3d/3rdparty"))))
c195b5ba
EF
1288 (arguments
1289 (substitute-keyword-arguments (package-arguments qtsvg)
1290 ;; Building the tests depends on the bundled 3rd party javascript files,
1291 ;; and the test phase fails to import QtCanvas3D, causing the phase to
1292 ;; fail, so we skip building them for now.
1293 ((#:phases phases)
1294 `(modify-phases ,phases
1295 (replace 'configure
1296 (lambda* (#:key outputs #:allow-other-keys)
1297 (let ((out (assoc-ref outputs "out")))
1298 (zero? (system* "qmake" "QT_BUILD_PARTS = libs tools"
1299 (string-append "PREFIX=" out))))))))
1300 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
173b54b9
EF
1301 (native-inputs `())
1302 (inputs
1303 `(("qtbase" ,qtbase)
96412f34
EF
1304 ("qtdeclarative" ,qtdeclarative)))
1305 (synopsis "Qt Canvas 3D module")
1306 (description "The Qt Canvas 3D module provides a way to make WebGL-like 3D
1307drawing calls from Qt Quick JavaScript.")))
173b54b9 1308
68bbe14b
EF
1309(define-public qtcharts
1310 (package (inherit qtsvg)
1311 (name "qtcharts")
f18c9470 1312 (version "5.9.2")
68bbe14b
EF
1313 (source (origin
1314 (method url-fetch)
1315 (uri (string-append "https://download.qt.io/official_releases/qt/"
1316 (version-major+minor version) "/" version
1317 "/submodules/" name "-opensource-src-"
1318 version ".tar.xz"))
1319 (sha256
1320 (base32
f18c9470 1321 "193a3imkgryw42s0gbwaj9gpqd673h3jrg86jvmy33l2fc5gfyjf"))))
c195b5ba
EF
1322 (arguments
1323 (substitute-keyword-arguments (package-arguments qtsvg)
1324 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
68bbe14b
EF
1325 (inputs
1326 `(("qtbase" ,qtbase)
96412f34
EF
1327 ("qtdeclarative" ,qtdeclarative)))
1328 (synopsis "Qt Charts module")
1329 (description "The Qt Charts module provides a set of easy to use chart
1330components. It uses the Qt Graphics View Framework, therefore charts can be
1331easily integrated to modern user interfaces. Qt Charts can be used as QWidgets,
1332QGraphicsWidget, or QML types. Users can easily create impressive graphs by
9c2c524d
EF
1333selecting one of the charts themes.")
1334 (license license:gpl3)))
68bbe14b 1335
a69945a7
EF
1336(define-public qtdatavis3d
1337 (package (inherit qtsvg)
1338 (name "qtdatavis3d")
f18c9470 1339 (version "5.9.2")
a69945a7
EF
1340 (source (origin
1341 (method url-fetch)
1342 (uri (string-append "https://download.qt.io/official_releases/qt/"
1343 (version-major+minor version) "/" version
1344 "/submodules/" name "-opensource-src-"
1345 version ".tar.xz"))
1346 (sha256
1347 (base32
f18c9470 1348 "1cmjjbbmdqdix1f8b7qyc2vwhj9pvchc8r4lp65qw11dhycmdbh6"))))
c195b5ba
EF
1349 (arguments
1350 (substitute-keyword-arguments (package-arguments qtsvg)
1351 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
a69945a7
EF
1352 (inputs
1353 `(("qtbase" ,qtbase)
96412f34
EF
1354 ("qtdeclarative" ,qtdeclarative)))
1355 (synopsis "Qt Data Visualization module")
1356 (description "The Qt Data Visualization module provides a way to visualize
1357data in 3D as bar, scatter, and surface graphs. It is especially useful for
1358visualizing depth maps and large quantities of rapidly changing data, such as
1359data received from multiple sensors. The look and feel of graphs can be
9c2c524d
EF
1360customized by using themes or by adding custom items and labels to them.")
1361 (license license:gpl3)))
f47d2793
EF
1362
1363(define-public qtnetworkauth
1364 (package (inherit qtsvg)
1365 (name "qtnetworkauth")
f18c9470 1366 (version "5.9.2")
f47d2793
EF
1367 (source (origin
1368 (method url-fetch)
1369 (uri (string-append "https://download.qt.io/official_releases/qt/"
1370 (version-major+minor version) "/" version
1371 "/submodules/" name "-opensource-src-"
1372 version ".tar.xz"))
1373 (sha256
1374 (base32
f18c9470
EF
1375 "16i33m8x5yii22ciq97bpfmnw0lwhvgv84i2az30a1ikm9dg00x0"))))
1376 (arguments
1377 (substitute-keyword-arguments (package-arguments qtsvg)
1378 ((#:phases phases)
1379 `(modify-phases ,phases
1380 (add-after 'unpack 'remove-failing-test
1381 (lambda _
1382 ;; These tests can't find their test data.
1383 (substitute* "tests/auto/auto.pro"
1384 (("oauth1 ") "# oauth1 "))
1385 #t))))))
f47d2793 1386 (inputs
96412f34
EF
1387 `(("qtbase" ,qtbase)))
1388 (synopsis "Qt Network Authorization module")
1389 (description "The Qt Network Authorization module provides an
1390implementation of OAuth and OAuth2 authenticathon methods for Qt.")))
213238d9
EF
1391
1392(define-public qtremoteobjects
1393 (package (inherit qtsvg)
1394 (name "qtremoteobjects")
f18c9470 1395 (version "5.9.2")
213238d9
EF
1396 (source (origin
1397 (method url-fetch)
1398 (uri (string-append "https://download.qt.io/official_releases/qt/"
1399 (version-major+minor version) "/" version
1400 "/submodules/" name "-opensource-src-"
1401 version ".tar.xz"))
1402 (sha256
1403 (base32
f18c9470 1404 "1ylphdwis34y4pm9xiwh2xqfd0hh2gp8kkawlps2q5mh2bm11376"))))
213238d9
EF
1405 (inputs
1406 `(("qtbase" ,qtbase)
96412f34
EF
1407 ("qtdeclarative" ,qtdeclarative)))
1408 (synopsis "Qt Remote Objects module")
1409 (description "The Qt Remote Objects module is an @dfn{inter-process
1410communication} (IPC) module developed for Qt. The idea is to extend existing
1411Qt's functionalities to enable an easy exchange of information between
1412processes or computers.")))
b84cc89a
EF
1413
1414(define-public qtspeech
1415 (package (inherit qtsvg)
1416 (name "qtspeech")
f18c9470 1417 (version "5.9.2")
b84cc89a
EF
1418 (source (origin
1419 (method url-fetch)
1420 (uri (string-append "https://download.qt.io/official_releases/qt/"
1421 (version-major+minor version) "/" version
1422 "/submodules/" name "-opensource-src-"
1423 version ".tar.xz"))
1424 (sha256
1425 (base32
f18c9470 1426 "0cq33dffi7q7dnvzhdivky5prakb8xnwap0b76fwgirhbbn88ypg"))))
b84cc89a
EF
1427 (inputs
1428 `(("qtbase" ,qtbase)))
1429 (native-inputs
1430 `(("perl" ,perl)
1431 ("qtdeclarative" ,qtdeclarative)
1432 ("qtmultimedia" ,qtmultimedia)
96412f34
EF
1433 ("qtxmlpatterns" ,qtxmlpatterns)))
1434 (synopsis "Qt Speech module")
1435 (description "The Qt Speech module enables a Qt application to support
1436accessibility features such as text-to-speech, which is useful for end-users
1437who are visually challenged or cannot access the application for whatever
1438reason. The most common use case where text-to-speech comes in handy is when
1439the end-user is driving and cannot attend the incoming messages on the phone.
1440In such a scenario, the messaging application can read out the incoming
1441message.")))
a69945a7 1442
84ef83dd
AE
1443(define-public python-sip
1444 (package
1445 (name "python-sip")
f6da41b5 1446 (version "4.19.2")
84ef83dd
AE
1447 (source
1448 (origin
1449 (method url-fetch)
1450 (uri
1451 (string-append "mirror://sourceforge/pyqt/sip/"
8fa7f8d9 1452 "sip-" version "/sip-" version ".tar.gz"))
84ef83dd
AE
1453 (sha256
1454 (base32
f6da41b5 1455 "0cq5r21fmjyw5v7a6l4sfbaj3zgm7k5b2cryj6bnjki54nnllas3"))))
84ef83dd
AE
1456 (build-system gnu-build-system)
1457 (native-inputs
1458 `(("python" ,python-wrapper)))
1459 (arguments
1460 `(#:tests? #f ; no check target
e8bdd73a
AE
1461 #:modules ((srfi srfi-1)
1462 ,@%gnu-build-system-modules)
84ef83dd 1463 #:phases
39766868
EF
1464 (modify-phases %standard-phases
1465 (replace 'configure
1466 (lambda* (#:key inputs outputs #:allow-other-keys)
1467 (let* ((out (assoc-ref outputs "out"))
1468 (bin (string-append out "/bin"))
1469 (include (string-append out "/include"))
1470 (python (assoc-ref inputs "python"))
1471 (python-version
1472 (last (string-split python #\-)))
1473 (python-major+minor
1474 (string-join
1475 (take (string-split python-version #\.) 2)
1476 "."))
1477 (lib (string-append out "/lib/python"
1478 python-major+minor
1479 "/site-packages")))
1480 (zero?
1481 (system* "python" "configure.py"
1482 "--bindir" bin
1483 "--destdir" lib
1484 "--incdir" include))))))))
1485 (home-page "https://www.riverbankcomputing.com/software/sip/intro")
84ef83dd
AE
1486 (synopsis "Python binding creator for C and C++ libraries")
1487 (description
1488 "SIP is a tool to create Python bindings for C and C++ libraries. It
1489was originally developed to create PyQt, the Python bindings for the Qt
1490toolkit, but can be used to create bindings for any C or C++ library.
1491
1492SIP comprises a code generator and a Python module. The code generator
1493processes a set of specification files and generates C or C++ code, which
1494is then compiled to create the bindings extension module. The SIP Python
1495module provides support functions to the automatically generated code.")
1496 ;; There is a choice between a python like license, gpl2 and gpl3.
1497 ;; For compatibility with pyqt, we need gpl3.
225941b0 1498 (license license:gpl3)))
84ef83dd
AE
1499
1500(define-public python2-sip
1501 (package (inherit python-sip)
1502 (name "python2-sip")
1503 (native-inputs
1504 `(("python" ,python-2)))))
014e7dd8
AE
1505
1506(define-public python-pyqt
1507 (package
1508 (name "python-pyqt")
5ac3a671 1509 (version "5.8.2")
014e7dd8
AE
1510 (source
1511 (origin
1512 (method url-fetch)
1513 (uri
1514 (string-append "mirror://sourceforge/pyqt/PyQt5/"
2be06813 1515 "PyQt-" version "/PyQt5_gpl-"
014e7dd8
AE
1516 version ".tar.gz"))
1517 (sha256
1518 (base32
5ac3a671 1519 "1s1nalcspam9dc7f63jkqn1i2sv9lrqn57p2zsc61g8bncahbmzb"))
fc1adab1 1520 (patches (search-patches "pyqt-configure.patch"))))
014e7dd8
AE
1521 (build-system gnu-build-system)
1522 (native-inputs
499991cf
EB
1523 `(("qtbase" ,qtbase))) ; for qmake
1524 (propagated-inputs
1525 `(("python-sip" ,python-sip)))
014e7dd8 1526 (inputs
e9adcd81
EF
1527 `(("python" ,python-wrapper)
1528 ("qtbase" ,qtbase)
1529 ("qtconnectivity" ,qtconnectivity)
1530 ("qtdeclarative" ,qtdeclarative)
1531 ("qtlocation" ,qtlocation)
1532 ("qtmultimedia" ,qtmultimedia)
1533 ("qtsensors" ,qtsensors)
1534 ("qtserialport" ,qtserialport)
1535 ("qtsvg" ,qtsvg)
1536 ("qttools" ,qttools)
1537 ("qtwebchannel" ,qtwebchannel)
1538 ("qtwebkit" ,qtwebkit)
1539 ("qtwebsockets" ,qtwebsockets)
1540 ("qtx11extras" ,qtx11extras)
1541 ("qtxmlpatterns" ,qtxmlpatterns)))
014e7dd8 1542 (arguments
e8bdd73a
AE
1543 `(#:modules ((srfi srfi-1)
1544 ,@%gnu-build-system-modules)
1545 #:phases
eef988c8
EF
1546 (modify-phases %standard-phases
1547 (replace 'configure
1548 (lambda* (#:key inputs outputs #:allow-other-keys)
1549 (let* ((out (assoc-ref outputs "out"))
1550 (bin (string-append out "/bin"))
1551 (sip (string-append out "/share/sip"))
1552 (plugins (string-append out "/plugins"))
1553 (designer (string-append plugins "/designer"))
1554 (qml (string-append plugins "/PyQt5"))
1555 (python (assoc-ref inputs "python"))
1556 (python-version
1557 (last (string-split python #\-)))
1558 (python-major+minor
1559 (string-join
1560 (take (string-split python-version #\.) 2)
1561 "."))
1562 (lib (string-append out "/lib/python"
1563 python-major+minor
43e8824d
HG
1564 "/site-packages"))
1565 (stubs (string-append lib "/PyQt5")))
eef988c8
EF
1566 (zero? (system* "python" "configure.py"
1567 "--confirm-license"
1568 "--bindir" bin
1569 "--destdir" lib
1570 "--designer-plugindir" designer
1571 "--qml-plugindir" qml
43e8824d
HG
1572 ; Where to install the PEP 484 Type Hints stub
1573 ; files. Without this the stubs are tried to be
1574 ; installed into the python package's
1575 ; site-package directory, which is read-only.
1576 "--stubsdir" stubs
eef988c8
EF
1577 "--sipdir" sip))))))))
1578 (home-page "https://www.riverbankcomputing.com/software/pyqt/intro")
014e7dd8
AE
1579 (synopsis "Python bindings for Qt")
1580 (description
1581 "PyQt is a set of Python v2 and v3 bindings for the Qt application
1582framework. The bindings are implemented as a set of Python modules and
1583contain over 620 classes.")
225941b0 1584 (license license:gpl3)))
014e7dd8
AE
1585
1586(define-public python2-pyqt
1587 (package (inherit python-pyqt)
1588 (name "python2-pyqt")
1589 (native-inputs
1590 `(("python-sip" ,python2-sip)
2be06813 1591 ("qtbase" ,qtbase)))
014e7dd8 1592 (inputs
e9adcd81
EF
1593 `(("python" ,python-2)
1594 ,@(alist-delete "python" (package-inputs python-pyqt))))))
3e291958
AE
1595
1596(define-public python-pyqt-4
1597 (package (inherit python-pyqt)
1598 (name "python-pyqt")
41fa164a 1599 (version "4.12")
3e291958
AE
1600 (source
1601 (origin
1602 (method url-fetch)
1603 (uri
1604 (string-append "mirror://sourceforge/pyqt/PyQt4/"
41fa164a 1605 "PyQt-" version "/PyQt4_gpl_x11-"
3e291958
AE
1606 version ".tar.gz"))
1607 (sha256
1608 (base32
41fa164a 1609 "1nw8r88a5g2d550yvklawlvns8gd5slw53yy688kxnsa65aln79w"))))
3e291958
AE
1610 (native-inputs
1611 `(("python-sip" ,python-sip)
1612 ("qt" ,qt-4)))
e9adcd81 1613 (inputs `(("python" ,python-wrapper)))
3e291958
AE
1614 (arguments
1615 `(#:tests? #f ; no check target
e8bdd73a
AE
1616 #:modules ((srfi srfi-1)
1617 ,@%gnu-build-system-modules)
3e291958 1618 #:phases
f9513086
EF
1619 (modify-phases %standard-phases
1620 (replace 'configure
1621 (lambda* (#:key inputs outputs #:allow-other-keys)
1622 (let* ((out (assoc-ref outputs "out"))
1623 (bin (string-append out "/bin"))
1624 (sip (string-append out "/share/sip"))
1625 (python (assoc-ref inputs "python"))
1626 (python-version
1627 (last (string-split python #\-)))
1628 (python-major+minor
1629 (string-join
1630 (take (string-split python-version #\.) 2)
1631 "."))
1632 (lib (string-append out "/lib/python"
1633 python-major+minor
1634 "/site-packages")))
1635 (zero? (system* "python" "configure.py"
1636 "--confirm-license"
1637 "--bindir" bin
1638 "--destdir" lib
1639 "--sipdir" sip))))))))
225941b0 1640 (license (list license:gpl2 license:gpl3)))) ; choice of either license
3e291958 1641
6d8e14d0 1642(define-public python2-pyqt-4
1643 (package (inherit python-pyqt-4)
9fde8778 1644 (name "python2-pyqt")
6d8e14d0 1645 (native-inputs
1646 `(("python-sip" ,python2-sip)
1647 ("qt" ,qt-4)))
1648 (inputs
1649 `(("python" ,python-2)))))
1650
3befd0a9
RW
1651(define-public qscintilla
1652 (package
1653 (name "qscintilla")
1654 (version "2.10.1")
1655 (source (origin
1656 (method url-fetch)
1657 (uri (string-append "mirror://sourceforge/pyqt/QScintilla2/"
1658 "QScintilla-" version "/QScintilla_gpl-"
1659 version ".tar.gz"))
1660 (sha256
1661 (base32
1662 "0r7s7ndblv3jc0xig1y4l64b6mfr879cdv3zwdndn27rj6fqmycp"))))
1663 (build-system gnu-build-system)
1664 (arguments
1665 `(#:phases
1666 (modify-phases %standard-phases
1667 (replace 'configure
1668 (lambda* (#:key outputs #:allow-other-keys)
1669 (let ((out (assoc-ref outputs "out")))
1670 (chdir "Qt4Qt5")
1671 (substitute* "qscintilla.pro"
1672 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
1673 (string-append out "/lib"))
1674 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
1675 (string-append out "/include"))
1676 (("\\$\\$\\[QT_INSTALL_TRANSLATIONS\\]")
1677 (string-append out "/translations"))
5430732b
HG
1678 (("\\$\\$\\[QT_INSTALL_DATA\\]")
1679 (string-append out "/lib/qt$${QT_MAJOR_VERSION}"))
1680 (("\\$\\$\\[QT_HOST_DATA\\]")
1681 (string-append out "/lib/qt$${QT_MAJOR_VERSION}")))
3befd0a9
RW
1682 (zero? (system* "qmake"))))))))
1683 (native-inputs `(("qtbase" ,qtbase)))
1684 (home-page "http://www.riverbankcomputing.co.uk/software/qscintilla/intro")
1685 (synopsis "Qt port of the Scintilla C++ editor control")
1686 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
1687editor control. QScintilla includes features especially useful when editing
1688and debugging source code. These include support for syntax styling, error
1689indicators, code completion and call tips.")
1690 (license license:gpl3+)))
1691
06d04dbc
RW
1692(define-public python-qscintilla
1693 (package (inherit qscintilla)
1694 (name "python-qscintilla")
1695 (arguments
1696 `(#:configure-flags
1697 (list "--pyqt=PyQt5"
1698 (string-append "--pyqt-sipdir="
1699 (assoc-ref %build-inputs "python-pyqt")
1700 "/share/sip")
1701 (string-append "--qsci-incdir="
1702 (assoc-ref %build-inputs "qscintilla")
1703 "/include")
1704 (string-append "--qsci-libdir="
1705 (assoc-ref %build-inputs "qscintilla")
1706 "/lib"))
1707 #:phases
1708 (modify-phases %standard-phases
1709 (replace 'configure
1710 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1711 (chdir "Python")
1712 (and (zero? (apply system* "python3" "configure.py"
1713 configure-flags))
1714 ;; Install to the right directory
1715 (begin
1716 (substitute* '("Makefile"
1717 "Qsci/Makefile")
1718 (("\\$\\(INSTALL_ROOT\\)/gnu/store/[^/]+")
1719 (assoc-ref outputs "out")))
1720 #t)))))))
1721 (inputs
1722 `(("qscintilla" ,qscintilla)
1723 ("python" ,python)
1724 ("python-pyqt" ,python-pyqt)))
1725 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
1726editor control. QScintilla includes features especially useful when editing
1727and debugging source code. These include support for syntax styling, error
1728indicators, code completion and call tips.
1729
1730This package provides the Python bindings.")))
1731
2456153a
RW
1732;; PyQt only looks for modules in its own directory. It ignores environment
1733;; variables such as PYTHONPATH, so we need to build a union package to make
1734;; it work.
1735(define-public python-pyqt+qscintilla
1736 (package (inherit python-pyqt)
1737 (name "python-pyqt+qscintilla")
1738 (source #f)
1739 (build-system trivial-build-system)
1740 (arguments
1741 '(#:modules ((guix build union))
1742 #:builder (begin
1743 (use-modules (ice-9 match)
1744 (guix build union))
1745 (match %build-inputs
1746 (((names . directories) ...)
1747 (union-build (assoc-ref %outputs "out")
1748 directories))))))
1749 (inputs
1750 `(("python-pyqt" ,python-pyqt)
1751 ("python-qscintilla" ,python-qscintilla)))
1752 (synopsis "Union of PyQt and the Qscintilla extension")
1753 (description
1754 "This package contains the union of PyQt and the Qscintilla extension.")))
1755
9e81af9e
EF
1756(define-public qtkeychain
1757 (package
1758 (name "qtkeychain")
4ad70ad8 1759 (version "0.8.0")
9e81af9e
EF
1760 (source
1761 (origin
1762 (method url-fetch)
1763 (uri (string-append "https://github.com/frankosterfeld/qtkeychain/"
1764 "archive/v" version ".tar.gz"))
1765 (file-name (string-append name "-" version ".tar.gz"))
1766 (sha256
4ad70ad8 1767 (base32 "0bxi5pfhxdvwk8yxa06lk2d7lcibmfqhahbin82bqf3m341zd4ml"))))
9e81af9e 1768 (build-system cmake-build-system)
18174d8a 1769 (native-inputs
f8127d26
HG
1770 `(("pkg-config" ,pkg-config)
1771 ("qttools" ,qttools)))
9e81af9e 1772 (inputs
18174d8a 1773 `(("qtbase" ,qtbase)))
9e81af9e
EF
1774 (arguments
1775 `(#:tests? #f ; No tests included
1776 #:phases
1777 (modify-phases %standard-phases
1778 (add-before
1779 'configure 'set-qt-trans-dir
1780 (lambda _
1781 (substitute* "CMakeLists.txt"
1782 (("\\$\\{qt_translations_dir\\}")
4ad70ad8
EF
1783 "${CMAKE_INSTALL_PREFIX}/share/qt/translations"))
1784 #t)))))
9e81af9e
EF
1785 (home-page "https://github.com/frankosterfeld/qtkeychain")
1786 (synopsis "Qt API to store passwords")
1787 (description
1788 "QtKeychain is a Qt library to store passwords and other secret data
1789securely. It will not store any data unencrypted unless explicitly requested.")
225941b0 1790 (license license:bsd-3)))
fc381a33
TD
1791
1792(define-public qwt
1793 (package
1794 (name "qwt")
1795 (version "6.1.3")
1796 (source
1797 (origin
1798 (method url-fetch)
1799 (uri
1800 (string-append "mirror://sourceforge/qwt/qwt/"
1801 version "/qwt-" version ".tar.bz2"))
1802 (sha256
1803 (base32 "0cwp63s03dw351xavb3pzbjlqvx7kj88wv7v4a2b18m9f97d7v7k"))))
1804 (build-system gnu-build-system)
1805 (inputs
1806 `(("qtbase" ,qtbase)
1807 ("qtsvg" ,qtsvg)
1808 ("qttools" ,qttools)))
1809 (arguments
1810 `(#:phases
1811 (modify-phases %standard-phases
1812 (replace 'configure
1813 (lambda* (#:key outputs #:allow-other-keys)
163651cb
SB
1814 (let* ((out (assoc-ref outputs "out"))
1815 (docdir (string-append out "/share/doc/qwt"))
1816 (incdir (string-append out "/include/qwt"))
1817 (pluginsdir (string-append out "/lib/qt5/plugins/designer"))
1818 (featuresdir (string-append out "/lib/qt5/mkspecs/features")))
fc381a33 1819 (substitute* '("qwtconfig.pri")
163651cb
SB
1820 (("^(\\s*QWT_INSTALL_PREFIX)\\s*=.*" _ x)
1821 (format #f "~a = ~a\n" x out))
1822 (("^(QWT_INSTALL_DOCS)\\s*=.*" _ x)
1823 (format #f "~a = ~a\n" x docdir))
1824 (("^(QWT_INSTALL_HEADERS)\\s*=.*" _ x)
1825 (format #f "~a = ~a\n" x incdir))
1826 (("^(QWT_INSTALL_PLUGINS)\\s*=.*" _ x)
1827 (format #f "~a = ~a\n" x pluginsdir))
1828 (("^(QWT_INSTALL_FEATURES)\\s*=.*" _ x)
1829 (format #f "~a = ~a\n" x featuresdir)))
1830 (substitute* '("doc/doc.pro")
1831 ;; We'll install them in the 'install-man-pages' phase.
1832 (("^unix:doc\\.files.*") ""))
fc381a33 1833 (zero? (system* "qmake")))))
163651cb 1834 (add-after 'install 'install-man-pages
fc381a33
TD
1835 (lambda* (#:key outputs #:allow-other-keys)
1836 (let* ((out (assoc-ref outputs "out"))
1837 (man (string-append out "/share/man")))
1838 ;; Remove some incomplete manual pages.
1839 (for-each delete-file (find-files "doc/man/man3" "^_tmp.*"))
1840 (mkdir-p man)
1841 (copy-recursively "doc/man" man)
1842 #t))))))
1843 (home-page "http://qwt.sourceforge.net")
1844 (synopsis "Qt widgets for plots, scales, dials and other technical software
1845GUI components")
1846 (description
1847 "The Qwt library contains widgets and components which are primarily useful
1848for technical and scientific purposes. It includes a 2-D plotting widget,
1849different kinds of sliders, and much more.")
1850 (license
1851 (list
1852 ;; The Qwt license is LGPL2.1 with some exceptions.
1853 (license:non-copyleft "http://qwt.sourceforge.net/qwtlicense.html")
1854 ;; textengines/mathml/qwt_mml_document.{cpp,h} is dual LGPL2.1/GPL3 (either).
1855 license:lgpl2.1 license:gpl3))))
47e1d280
TD
1856
1857(define-public qtwebkit
1858 (package
1859 (name "qtwebkit")
fdaf6cd3 1860 (version "5.9.1")
47e1d280
TD
1861 (source
1862 (origin
1863 (method url-fetch)
fdaf6cd3
EF
1864 (uri (string-append "https://download.qt.io/official_releases/qt/"
1865 (version-major+minor version) "/" version
1866 "/submodules/" name "-opensource-src-"
a20e00dd 1867 version ".tar.xz"))
47e1d280
TD
1868 (sha256
1869 (base32
fdaf6cd3 1870 "1ksjn1vjbfhdm4y4rg08ag4krk87ahp7qcdcpwll42l0rnz61998"))))
47e1d280
TD
1871 (build-system gnu-build-system)
1872 (native-inputs
1873 `(("perl" ,perl)
1874 ("python" ,python-2.7)
1875 ("ruby" ,ruby)
1876 ("bison" ,bison)
1877 ("flex" ,flex)
1878 ("gperf" ,gperf)
1879 ("pkg-config" ,pkg-config)))
1880 (inputs
1881 `(("icu" ,icu4c)
1882 ("libjpeg" ,libjpeg)
1883 ("libpng" ,libpng)
1884 ("libwebp" ,libwebp)
1885 ("sqlite" ,sqlite)
1886 ("fontconfig" ,fontconfig)
1887 ("libxrender", libxrender)
1888 ("qtbase" ,qtbase)
1889 ("qtdeclarative" ,qtdeclarative)
1890 ("qtmultimedia" ,qtmultimedia)
1891 ("libxml2" ,libxml2)
1892 ("libxslt" ,libxslt)
1893 ("libx11" ,libx11)
1894 ("libxcomposite" ,libxcomposite)))
1895 (arguments
1896 `(#:phases
1897 (modify-phases %standard-phases
4eb972b9
HG
1898 (add-before 'configure 'fix-qmlwebkit-plugins-rpath
1899 (lambda _
1900 (substitute* "Source/WebKit/qt/declarative/experimental/experimental.pri"
1901 (("RPATHDIR_RELATIVE_TO_DESTDIR = \\.\\./\\.\\./lib")
1902 "RPATHDIR_RELATIVE_TO_DESTDIR = ../../../../../lib"))
1903 (substitute* "Source/WebKit/qt/declarative/public.pri"
1904 (("RPATHDIR_RELATIVE_TO_DESTDIR = \\.\\./\\.\\./lib")
1905 "RPATHDIR_RELATIVE_TO_DESTDIR = ../../../../lib"))
1906 #t))
47e1d280
TD
1907 (replace 'configure
1908 (lambda* (#:key outputs #:allow-other-keys)
1909 (let ((out (assoc-ref outputs "out")))
1910 (setenv "QMAKEPATH"
1911 (string-append (getcwd) "/Tools/qmake:"
1912 (getenv "QMAKEPATH")))
1913 (system* "qmake"))))
1914 ;; prevent webkit from trying to install into the qtbase store directory,
1915 ;; and replace references to the build directory in linker options:
1916 (add-before 'build 'patch-installpaths
1917 (lambda* (#:key outputs inputs #:allow-other-keys)
1918 (let* ((out (assoc-ref outputs "out"))
1919 (qtbase (assoc-ref inputs "qtbase"))
1920 (builddir (getcwd))
1921 (linkbuild (string-append "-L" builddir))
1922 (linkout (string-append "-L" out))
1923 (makefiles
1924 (map-in-order
1925 (lambda (i)
1926 (let* ((in (car i))
1927 (mf (string-append (dirname in) "/"
1928 (cdr i))))
1929 ;; by default, these Makefiles are
1930 ;; generated during install, but we need
1931 ;; to generate them now
1932 (system* "qmake" in "-o" mf)
1933 mf))
1934 '(("Source/api.pri" . "Makefile.api")
1935 ("Source/widgetsapi.pri"
1936 . "Makefile.widgetsapi")
1937 ("Source/WebKit2/WebProcess.pro"
1938 . "Makefile.WebProcess")
1939 ("Source/WebKit2/PluginProcess.pro"
1940 . "Makefile.PluginProcess")
1941 ("Source/WebKit/qt/declarative/public.pri"
1942 . "Makefile.declarative.public")
1943 ("Source/WebKit/qt/declarative/experimental/experimental.pri"
1944 . "Makefile.declarative.experimental")
1945 ("Source/WebKit/qt/examples/platformplugin/platformplugin.pro"
1946 . "Makefile")))))
1947 ;; Order of qmake calls and substitutions matters here.
1948 (system* "qmake" "-prl" "Source/widgetsapi.pri"
1949 "-o" "Source/Makefile")
1950 (substitute* (find-files "lib" "libQt5.*\\.prl")
1951 ((linkbuild) linkout))
1952 (substitute* (find-files "lib"
1953 "libQt5WebKit.*\\.la")
1954 (("libdir='.*'")
1955 (string-append "libdir='" out "/lib'"))
1956 ((linkbuild) linkout))
1957 (substitute* (find-files "lib/pkgconfig"
1958 "Qt5WebKit.*\\.pc")
1959 (((string-append "prefix=" qtbase))
1960 (string-append "prefix=" out))
1961 ((linkbuild) linkout))
1962 ;; Makefiles must be modified after .prl/.la/.pc
1963 ;; files, lest they get rebuilt:
1964 (substitute* makefiles
1965 (((string-append "\\$\\(INSTALL_ROOT\\)" qtbase))
1966 out )
1967 (((string-append "-Wl,-rpath," builddir))
1968 (string-append "-Wl,-rpath," out)))))))))
1969 (home-page "https://www.webkit.org")
1970 (synopsis "Web browser engine and classes to render and interact with web
1971content")
1972 (description "QtWebKit provides a Web browser engine that makes it easy to
1973embed content from the World Wide Web into your Qt application. At the same
1974time Web content can be enhanced with native controls.")
1975
1976 (license license:lgpl2.1+)))
f048f12b 1977
1978(define-public dotherside
1979 (package
1980 (name "dotherside")
1981 (version "0.5.2")
1982 (source
1983 (origin
1984 (method url-fetch)
1985 (uri (string-append "https://github.com/filcuc/DOtherSide/"
1986 "archive/v" version ".tar.gz"))
1987 (file-name (string-append name "-" version ".tar.gz"))
1988 (sha256
1989 (base32
1990 "0pqlrvy4ajjir80ra79ka3n0rjj0ir0f0m91cq86iz3nnw8w148z"))))
1991 (build-system cmake-build-system)
1992 (native-inputs
1993 `(("qttools" ,qttools)))
1994 (inputs
1995 `(("qtbase" ,qtbase)
1996 ("qtdeclarative" ,qtdeclarative)))
1997 (home-page "https://github.com/frankosterfeld/qtkeychain")
1998 (synopsis "C language library for creating bindings for the Qt QML language")
1999 (description
2000 "DOtherSide is a C language library for creating bindings for the
2001QT QML language. The following features are implementable from
2002a binding language:
2003@itemize
2004@item Creating custom QObject
2005@item Creating custom QAbstractListModels
2006@item Creating custom properties, signals and slots
2007@item Creating from QML QObject defined in the binded language
2008@item Creating from Singleton QML QObject defined in the binded language
2009@end itemize\n")
2010 (license license:lgpl3))) ;version 3 only (+ exception)