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