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