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 ;; Do not build examples; if desired, these could go
493 ;; into a separate output, but for the time being, we
494 ;; prefer to save the space and build time.
495 "-no-compile-examples"
496 ;; Most "-system-..." are automatic, but some use
497 ;; the bundled copy by default.
498 ;; System sqlite fails on 5.10+
499 ;;.obj/qsql_sqlite.o: In function `QSQLiteResultPrivate::initColumns(bool)':
500 ;;qsql_sqlite.cpp:(.text+0x190c): undefined reference to `sqlite3_column_table_name16'
501 ;"-system-sqlite"
502 "-system-harfbuzz"
503 "-system-pcre"
504 ;; explicitly link with openssl instead of dlopening it
505 "-openssl-linked"
506 ;; explicitly link with dbus instead of dlopening it
507 "-dbus-linked"
508 ;; don't use the precompiled headers
509 "-no-pch"
510 ;; drop special machine instructions that do not have
511 ;; runtime detection
512 ,@(if (string-prefix? "x86_64"
513 (or (%current-target-system)
514 (%current-system)))
515 '()
516 '("-no-sse2"))
517 "-no-mips_dsp"
518 "-no-mips_dspr2"))))
519 (add-after 'install 'patch-mkspecs
520 (lambda* (#:key outputs #:allow-other-keys)
521 (let* ((out (assoc-ref outputs "out"))
522 (archdata (string-append out "/lib/qt5"))
523 (mkspecs (string-append archdata "/mkspecs"))
524 (qt_config.prf (string-append
525 mkspecs "/features/qt_config.prf")))
526 ;; For each Qt module, let `qmake' uses search paths in the
527 ;; module directory instead of all in QT_INSTALL_PREFIX.
528 (substitute* qt_config.prf
529 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
530 "$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt5))")
531 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
532 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
533 (("\\$\\$\\[QT_HOST_LIBS\\]")
534 "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
535 (("\\$\\$\\[QT_INSTALL_BINS\\]")
536 "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))"))
537
538 ;; Searches Qt tools in the current PATH instead of QT_HOST_BINS.
539 (substitute* (string-append mkspecs "/features/qt_functions.prf")
540 (("cmd = \\$\\$\\[QT_HOST_BINS\\]/\\$\\$2")
541 "cmd = $$system(which $${2}.pl 2>/dev/null || which $${2})"))
542
543 ;; Resolve qmake spec files within qtbase by absolute paths.
544 (substitute*
545 (map (lambda (file)
546 (string-append mkspecs "/features/" file))
547 '("device_config.prf" "moc.prf" "qt_build_config.prf"
548 "qt_config.prf" "winrt/package_manifest.prf"))
549 (("\\$\\$\\[QT_HOST_DATA/get\\]") archdata)
550 (("\\$\\$\\[QT_HOST_DATA/src\\]") archdata))
551 #t)))
552 (add-after 'unpack 'patch-paths
553 ;; Use the absolute paths for dynamically loaded libs, otherwise
554 ;; the lib will be searched in LD_LIBRARY_PATH which typically is
555 ;; not set in guix.
556 (lambda* (#:key inputs #:allow-other-keys)
557 ;; libresolve
558 (let ((glibc (assoc-ref inputs ,(if (%current-target-system)
559 "cross-libc" "libc"))))
560 (substitute* '("src/network/kernel/qdnslookup_unix.cpp"
561 "src/network/kernel/qhostinfo_unix.cpp")
562 (("^\\s*(lib.setFileName\\(QLatin1String\\(\")(resolv\"\\)\\);)" _ a b)
563 (string-append a glibc "/lib/lib" b))))
564 ;; X11/locale (compose path)
565 (substitute* "src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp"
566 ;; Don't search in /usr/…/X11/locale, …
567 (("^\\s*m_possibleLocations.append\\(QStringLiteral\\(\"/usr/.*/X11/locale\"\\)\\);" line)
568 (string-append "// " line))
569 ;; … but use libx11's path
570 (("^\\s*(m_possibleLocations.append\\(QStringLiteral\\()X11_PREFIX \"(/.*/X11/locale\"\\)\\);)" _ a b)
571 (string-append a "\"" (assoc-ref inputs "libx11") b)))
572 ;; libGL
573 (substitute* "src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp"
574 (("^\\s*(QLibrary lib\\(QLatin1String\\(\")(GL\"\\)\\);)" _ a b)
575 (string-append a (assoc-ref inputs "mesa") "/lib/lib" b)))
576 ;; libXcursor
577 (substitute* "src/plugins/platforms/xcb/qxcbcursor.cpp"
578 (("^\\s*(QLibrary xcursorLib\\(QLatin1String\\(\")(Xcursor\"\\), 1\\);)" _ a b)
579 (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b))
580 (("^\\s*(xcursorLib.setFileName\\(QLatin1String\\(\")(Xcursor\"\\)\\);)" _ a b)
581 (string-append a (assoc-ref inputs "libxcursor") "/lib/lib" b)))
582 #t)))))
583 (native-search-paths
584 (list (search-path-specification
585 (variable "QMAKEPATH")
586 (files '("lib/qt5")))
587 (search-path-specification
588 (variable "QML2_IMPORT_PATH")
589 (files '("lib/qt5/qml")))
590 (search-path-specification
591 (variable "QT_PLUGIN_PATH")
592 (files '("lib/qt5/plugins")))
593 (search-path-specification
594 (variable "XDG_DATA_DIRS")
595 (files '("share")))
596 (search-path-specification
597 (variable "XDG_CONFIG_DIRS")
598 (files '("etc/xdg")))))
599 (home-page "https://www.qt.io/")
600 (synopsis "Cross-platform GUI library")
601 (description "Qt is a cross-platform application and UI framework for
602 developers using C++ or QML, a CSS & JavaScript like language.")
603 (license (list license:lgpl2.1 license:lgpl3))))
604
605 (define-public qtsvg
606 (package (inherit qtbase)
607 (name "qtsvg")
608 (version "5.11.0")
609 (source (origin
610 (method url-fetch)
611 (uri (string-append "https://download.qt.io/official_releases/qt/"
612 (version-major+minor version) "/" version
613 "/submodules/" name "-everywhere-src-"
614 version ".tar.xz"))
615 (sha256
616 (base32
617 "0m0zglp0m5gv75ivma6l3hm8brb0cf44dhbc6lqwfdwacxhgx3jb"))))
618 (propagated-inputs `())
619 (native-inputs `(("perl" ,perl)))
620 (inputs
621 `(("mesa" ,mesa)
622 ("qtbase" ,qtbase)
623 ("zlib" ,zlib)))
624 (arguments
625 `(#:phases
626 (modify-phases %standard-phases
627 (add-before 'configure 'configure-qmake
628 (lambda* (#:key inputs outputs #:allow-other-keys)
629 (let* ((out (assoc-ref outputs "out"))
630 (qtbase (assoc-ref inputs "qtbase"))
631 (tmpdir (string-append (getenv "TMPDIR")))
632 (qmake (string-append tmpdir "/qmake"))
633 (qt.conf (string-append tmpdir "/qt.conf")))
634 ;; Use qmake with a customized qt.conf to override install
635 ;; paths to $out.
636 (symlink (which "qmake") qmake)
637 (setenv "PATH" (string-append tmpdir ":" (getenv "PATH")))
638 (with-output-to-file qt.conf
639 (lambda ()
640 (format #t "[Paths]
641 Prefix=~a
642 ArchData=lib/qt5
643 Data=share/qt5
644 Documentation=share/doc/qt5
645 Headers=include/qt5
646 Libraries=lib
647 LibraryExecutables=lib/qt5/libexec
648 Binaries=bin
649 Tests=tests
650 Plugins=lib/qt5/plugins
651 Imports=lib/qt5/imports
652 Qml2Imports=lib/qt5/qml
653 Translations=share/qt5/translations
654 Settings=etc/xdg
655 Examples=share/doc/qt5/examples
656 HostPrefix=~a
657 HostData=lib/qt5
658 HostBinaries=bin
659 HostLibraries=lib
660
661 [EffectiveSourcePaths]
662 HostPrefix=~a
663 HostData=lib/qt5
664 " out out qtbase)))
665 #t)))
666 (replace 'configure
667 (lambda* (#:key inputs outputs #:allow-other-keys)
668 ;; Valid QT_BUILD_PARTS variables are:
669 ;; libs tools tests examples demos docs translations
670 (invoke "qmake" "QT_BUILD_PARTS = libs tools tests")))
671 (add-before 'check 'set-display
672 (lambda _
673 ;; make Qt render "offscreen", required for tests
674 (setenv "QT_QPA_PLATFORM" "offscreen")
675 #t)))))
676 (synopsis "Qt module for displaying SVGs")
677 (description "The QtSvg module provides classes for displaying the
678 contents of SVG files.")))
679
680 (define-public qtimageformats
681 (package (inherit qtsvg)
682 (name "qtimageformats")
683 (version "5.11.0")
684 (source (origin
685 (method url-fetch)
686 (uri (string-append "https://download.qt.io/official_releases/qt/"
687 (version-major+minor version) "/" version
688 "/submodules/" name "-everywhere-src-"
689 version ".tar.xz"))
690 (sha256
691 (base32
692 "0w0yy7zzln3v7dm7ksjxkzhq8r0a9nwk823wv4f1x7vsa3pnyh2q"))
693 (modules '((guix build utils)))
694 (snippet
695 '(begin
696 (delete-file-recursively "src/3rdparty")
697 #t))))
698 (native-inputs `())
699 (inputs
700 `(("jasper" ,jasper)
701 ("libmng" ,libmng)
702 ("libtiff" ,libtiff)
703 ("libwebp" ,libwebp)
704 ("mesa" ,mesa)
705 ("qtbase" ,qtbase)
706 ("zlib" ,zlib)))
707 (synopsis "Additional Image Format plugins for Qt")
708 (description "The QtImageFormats module contains plugins for adding
709 support for MNG, TGA, TIFF and WBMP image formats.")))
710
711 (define-public qtx11extras
712 (package (inherit qtsvg)
713 (name "qtx11extras")
714 (version "5.11.0")
715 (source (origin
716 (method url-fetch)
717 (uri (string-append "https://download.qt.io/official_releases/qt/"
718 (version-major+minor version) "/" version
719 "/submodules/" name "-everywhere-src-"
720 version ".tar.xz"))
721 (sha256
722 (base32
723 "13vbx61wcd8pnpgk3j5r665pm03s7jp2s98apvc6fhp1njlr0rhi"))))
724 (arguments
725 (substitute-keyword-arguments (package-arguments qtsvg)
726 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
727 (native-inputs `(("perl" ,perl)))
728 (inputs
729 `(("mesa" ,mesa)
730 ("qtbase" ,qtbase)))
731 (synopsis "Qt Extras for X11")
732 (description "The QtX11Extras module includes the library to access X11
733 from within Qt 5.")))
734
735 (define-public qtxmlpatterns
736 (package (inherit qtsvg)
737 (name "qtxmlpatterns")
738 (version "5.11.0")
739 (source (origin
740 (method url-fetch)
741 (uri (string-append "https://download.qt.io/official_releases/qt/"
742 (version-major+minor version) "/" version
743 "/submodules/" name "-everywhere-src-"
744 version ".tar.xz"))
745 (sha256
746 (base32
747 "13nj2pa706sy874bqbv7y94ypicr4k09x6n2jyxkw93flb5pi8qr"))))
748 (arguments
749 (substitute-keyword-arguments (package-arguments qtsvg)
750 ((#:phases phases)
751 `(modify-phases ,phases
752 (add-after 'unpack 'disable-network-tests
753 (lambda _ (substitute* "tests/auto/auto.pro"
754 (("qxmlquery") "# qxmlquery")
755 (("xmlpatterns ") "# xmlpatterns"))
756 #t))))))
757 (native-inputs `(("perl" ,perl)))
758 (inputs `(("qtbase" ,qtbase)))
759 (synopsis "Qt XML patterns module")
760 (description "The QtXmlPatterns module is a XQuery and XPath engine for
761 XML and custom data models. It contains programs such as xmlpatterns and
762 xmlpatternsvalidator.")))
763
764 (define-public qtdeclarative
765 (package (inherit qtsvg)
766 (name "qtdeclarative")
767 (version "5.11.0")
768 (source (origin
769 (method url-fetch)
770 (uri (string-append "https://download.qt.io/official_releases/qt/"
771 (version-major+minor version) "/" version
772 "/submodules/" name "-everywhere-src-"
773 version ".tar.xz"))
774 (sha256
775 (base32
776 "1h2pbyr7dnak4q96373xpa6gk6rl528rnqima8xnvhdi2y5kgagf"))))
777 (arguments
778 (substitute-keyword-arguments (package-arguments qtsvg)
779 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
780 (native-inputs
781 `(("perl" ,perl)
782 ("pkg-config" ,pkg-config)
783 ("python" ,python-2)
784 ("qtsvg" ,qtsvg)
785 ("qtxmlpatterns" ,qtxmlpatterns)))
786 (inputs
787 `(("mesa" ,mesa)
788 ("qtbase" ,qtbase)))
789 (synopsis "Qt QML module (Quick 2)")
790 (description "The Qt QML module provides a framework for developing
791 applications and libraries with the QML language. It defines and implements the
792 language and engine infrastructure, and provides an API to enable application
793 developers to extend the QML language with custom types and integrate QML code
794 with JavaScript and C++.")))
795
796 (define-public qtconnectivity
797 (package (inherit qtsvg)
798 (name "qtconnectivity")
799 (version "5.11.0")
800 (source (origin
801 (method url-fetch)
802 (uri (string-append "https://download.qt.io/official_releases/qt/"
803 (version-major+minor version) "/" version
804 "/submodules/" name "-everywhere-src-"
805 version ".tar.xz"))
806 (sha256
807 (base32
808 "0wqq5q5saf007aphvpn5pvj6l0qp0z7wxvfba6v9iq5ylyqm6bnd"))))
809 (native-inputs
810 `(("perl" ,perl)
811 ("pkg-config" ,pkg-config)
812 ("qtdeclarative" ,qtdeclarative)))
813 (inputs
814 `(("bluez" ,bluez)
815 ("qtbase" ,qtbase)))
816 (synopsis "Qt Connectivity module")
817 (description "The Qt Connectivity modules provides modules for interacting
818 with Bluetooth and NFC.")))
819
820 (define-public qtwebsockets
821 (package (inherit qtsvg)
822 (name "qtwebsockets")
823 (version "5.11.0")
824 (source (origin
825 (method url-fetch)
826 (uri (string-append "https://download.qt.io/official_releases/qt/"
827 (version-major+minor version) "/" version
828 "/submodules/" name "-everywhere-src-"
829 version ".tar.xz"))
830 (sha256
831 (base32
832 "1drr6nxxbkwpmz39bhyfmmsqjhy11bj3w1nc3q9dwhpcbf04an3x"))))
833 (arguments
834 (substitute-keyword-arguments (package-arguments qtsvg)
835 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
836 (native-inputs
837 `(("perl" ,perl)
838 ("qtdeclarative" ,qtdeclarative)))
839 (inputs `(("qtbase" ,qtbase)))
840 (synopsis "Qt Web Sockets module")
841 (description "WebSocket is a web-based protocol designed to enable two-way
842 communication between a client application and a remote host. The Qt
843 WebSockets module provides C++ and QML interfaces that enable Qt applications
844 to act as a server that can process WebSocket requests, or a client that can
845 consume data received from the server, or both.")))
846
847 (define-public qtsensors
848 (package (inherit qtsvg)
849 (name "qtsensors")
850 (version "5.11.0")
851 (source (origin
852 (method url-fetch)
853 (uri (string-append "https://download.qt.io/official_releases/qt/"
854 (version-major+minor version) "/" version
855 "/submodules/" name "-everywhere-src-"
856 version ".tar.xz"))
857 (sha256
858 (base32
859 "1az22rdkpc1m44qb3dyh7cpiprplkvynzjr629ai05i8ngbfdi0g"))))
860 (arguments
861 (substitute-keyword-arguments (package-arguments qtsvg)
862 ((#:parallel-tests? _ #f) #f) ; can lead to race condition
863 ((#:phases phases)
864 `(modify-phases ,phases
865 (add-after 'unpack 'fix-tests
866 (lambda _
867 (substitute* "tests/auto/qsensorgestures_gestures/tst_sensorgestures_gestures.cpp"
868 (("2000") "5000") ;lengthen test timeout
869 (("QTest::newRow(\"twist\") << \"twist\"") "")) ;failing test
870 #t))))))
871 (native-inputs
872 `(("perl" ,perl)
873 ("qtdeclarative" ,qtdeclarative)))
874 (inputs `(("qtbase" ,qtbase)))
875 (synopsis "Qt Sensors module")
876 (description "The Qt Sensors API provides access to sensor hardware via QML
877 and C++ interfaces. The Qt Sensors API also provides a motion gesture
878 recognition API for devices.")))
879
880 (define-public qtmultimedia
881 (package (inherit qtsvg)
882 (name "qtmultimedia")
883 (version "5.11.0")
884 (source (origin
885 (method url-fetch)
886 (uri (string-append "https://download.qt.io/official_releases/qt/"
887 (version-major+minor version) "/" version
888 "/submodules/" name "-everywhere-src-"
889 version ".tar.xz"))
890 (sha256
891 (base32
892 "0g4x1w251imq58zp1px6yschwj6icsxzwl3fy7pjfbgd27qjhlzg"))
893 (modules '((guix build utils)))
894 (snippet
895 '(begin
896 (delete-file-recursively
897 "examples/multimedia/spectrum/3rdparty")
898 ;; We also prevent the spectrum example from being built.
899 (substitute* "examples/multimedia/multimedia.pro"
900 (("spectrum") "#"))
901 #t))))
902 (arguments
903 (substitute-keyword-arguments (package-arguments qtsvg)
904 ((#:phases phases)
905 `(modify-phases ,phases
906 (replace 'configure
907 (lambda* (#:key outputs #:allow-other-keys)
908 (let ((out (assoc-ref outputs "out")))
909 (invoke "qmake" "QT_BUILD_PARTS = libs tools tests"
910 (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out "/lib -Wl,-rpath,")
911 (string-append "PREFIX=" out)))))))
912 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
913 (native-inputs
914 `(("perl" ,perl)
915 ("pkg-config" ,pkg-config)
916 ("python" ,python-2)
917 ("qtdeclarative" ,qtdeclarative)))
918 (inputs
919 `(("alsa-lib" ,alsa-lib)
920 ("mesa" ,mesa)
921 ("pulseaudio" ,pulseaudio)
922 ("qtbase" ,qtbase)
923 ;; Gstreamer is needed for the mediaplayer plugin
924 ("gstreamer" ,gstreamer)
925 ("gst-plugins-base" ,gst-plugins-base)))
926 (synopsis "Qt Multimedia module")
927 (description "The Qt Multimedia module provides set of APIs to play and
928 record media, and manage a collection of media content. It also contains a
929 set of plugins for interacting with pulseaudio and GStreamer.")))
930
931 (define-public qtwayland
932 (package (inherit qtsvg)
933 (name "qtwayland")
934 (version "5.11.0")
935 (source (origin
936 (method url-fetch)
937 (uri (string-append "https://download.qt.io/official_releases/qt/"
938 (version-major+minor version) "/" version
939 "/submodules/" name "-everywhere-src-"
940 version ".tar.xz"))
941 (sha256
942 (base32
943 "09s1ckqj0cgjmmi7jylsf039vgzlq7i9rr4swb590fkz427lx0b8"))
944 (modules '((guix build utils)))
945 (snippet
946 ;; The examples try to build and cause the build to fail
947 '(begin
948 (delete-file-recursively "examples")
949 #t))))
950 (arguments
951 (substitute-keyword-arguments (package-arguments qtsvg)
952 ((#:phases phases)
953 `(modify-phases ,phases
954 (add-before 'check 'set-ld-library-path
955 ;; <https://lists.gnu.org/archive/html/guix-devel/2017-09/msg00019.html>
956 ;;
957 ;; Make the uninstalled libQt5WaylandClient.so.5 available to the
958 ;; wayland platform plugin.
959 (lambda _
960 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/lib"))
961 #t))))))
962 (native-inputs
963 `(("glib" ,glib)
964 ("perl" ,perl)
965 ("pkg-config" ,pkg-config)
966 ("qtdeclarative" ,qtdeclarative)))
967 (inputs
968 `(("fontconfig" ,fontconfig)
969 ("freetype" ,freetype)
970 ("libx11" ,libx11)
971 ("libxcomposite" ,libxcomposite)
972 ("libxext" ,libxext)
973 ("libxkbcommon" ,libxkbcommon)
974 ("libxrender" ,libxrender)
975 ("mesa" ,mesa)
976 ("mtdev" ,mtdev)
977 ("qtbase" ,qtbase)
978 ("wayland" ,wayland)))
979 (synopsis "Qt Wayland module")
980 (description "The Qt Wayland module provides the QtWayland client and
981 compositor libraries.")))
982
983 (define-public qtserialport
984 (package (inherit qtsvg)
985 (name "qtserialport")
986 (version "5.11.0")
987 (source (origin
988 (method url-fetch)
989 (uri (string-append "https://download.qt.io/official_releases/qt/"
990 (version-major+minor version) "/" version
991 "/submodules/" name "-everywhere-src-"
992 version ".tar.xz"))
993 (sha256
994 (base32
995 "1cbf1jsginp5p3y17cyb6dfhsafxal0bn9pya6aybz0q799zgvl5"))))
996 (native-inputs `(("perl" ,perl)))
997 (inputs
998 `(("qtbase" ,qtbase)
999 ("eudev" ,eudev)))
1000 (arguments
1001 (substitute-keyword-arguments (package-arguments qtsvg)
1002 ((#:phases phases)
1003 `(modify-phases ,phases
1004 (add-after 'unpack 'patch-dlopen-paths
1005 (lambda* (#:key inputs #:allow-other-keys)
1006 (substitute* "src/serialport/qtudev_p.h"
1007 ;; Use the absolute paths for dynamically loaded libs,
1008 ;; otherwise the lib will be searched in LD_LIBRARY_PATH which
1009 ;; typically is not set in guix.
1010 (("^\\s*(udevLibrary->setFileNameAndVersion\\(QStringLiteral\\(\")(udev\"\\),\\s*[0-9]+\\);)" _ a b)
1011 (string-append a (assoc-ref inputs "eudev") "/lib/lib" b)))
1012 #t))))))
1013 (synopsis "Qt Serial Port module")
1014 (description "The Qt Serial Port module provides the library for
1015 interacting with serial ports from within Qt.")))
1016
1017 (define-public qtserialbus
1018 (package (inherit qtsvg)
1019 (name "qtserialbus")
1020 (version "5.11.0")
1021 (source (origin
1022 (method url-fetch)
1023 (uri (string-append "https://download.qt.io/official_releases/qt/"
1024 (version-major+minor version) "/" version
1025 "/submodules/" name "-everywhere-src-"
1026 version ".tar.xz"))
1027 (sha256
1028 (base32
1029 "0r3crk7gw0xs6wk1gvw2k8r9s9vam3sfwrji1njhswavii9fbp85"))))
1030 (inputs
1031 `(("qtbase" ,qtbase)
1032 ("qtserialport" ,qtserialport)))
1033 (synopsis "Qt Serial Bus module")
1034 (description "The Qt Serial Bus API provides classes and functions to
1035 access the various industrial serial buses and protocols, such as CAN, ModBus,
1036 and others.")))
1037
1038 (define-public qtwebchannel
1039 (package (inherit qtsvg)
1040 (name "qtwebchannel")
1041 (version "5.11.0")
1042 (source (origin
1043 (method url-fetch)
1044 (uri (string-append "https://download.qt.io/official_releases/qt/"
1045 (version-major+minor version) "/" version
1046 "/submodules/" name "-everywhere-src-"
1047 version ".tar.xz"))
1048 (sha256
1049 (base32
1050 "05fa5pwvk24cjp8m6pbw3ma95vnls762crpjdgvygfk0h8xilxmh"))))
1051 (native-inputs
1052 `(("perl" ,perl)
1053 ("qtdeclarative" ,qtdeclarative)
1054 ("qtwebsockets" ,qtwebsockets)))
1055 (inputs `(("qtbase" ,qtbase)))
1056 (synopsis "Web communication library for Qt")
1057 (description "The Qt WebChannel module enables peer-to-peer communication
1058 between the host (QML/C++ application) and the client (HTML/JavaScript
1059 application). The transport mechanism is supported out of the box by the two
1060 popular web engines, Qt WebKit 2 and Qt WebEngine.")))
1061
1062 (define-public qtlocation
1063 (package (inherit qtsvg)
1064 (name "qtlocation")
1065 (version "5.11.0")
1066 (source (origin
1067 (method url-fetch)
1068 (uri (string-append "https://download.qt.io/official_releases/qt/"
1069 (version-major+minor version) "/" version
1070 "/submodules/" name "-everywhere-src-"
1071 version ".tar.xz"))
1072 (sha256
1073 (base32
1074 "074cjqhr14mqlsqj9rzagzdcqnayyichp31lq02k05q07wg93xi8"))))
1075 (arguments
1076 (substitute-keyword-arguments (package-arguments qtsvg)
1077 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1078 (native-inputs
1079 `(("perl" ,perl)
1080 ("qtdeclarative" ,qtdeclarative)
1081 ("qtquickcontrols" ,qtquickcontrols)
1082 ("qtserialport" ,qtserialport)))
1083 (inputs
1084 `(("icu4c" ,icu4c)
1085 ("openssl" ,openssl)
1086 ("qtbase" ,qtbase)
1087 ("zlib" ,zlib)))
1088 (synopsis "Qt Location and Positioning modules")
1089 (description "The Qt Location module provides an interface for location,
1090 positioning and geolocation plugins.")))
1091
1092 (define-public qttools
1093 (package (inherit qtsvg)
1094 (name "qttools")
1095 (version "5.11.0")
1096 (source (origin
1097 (method url-fetch)
1098 (uri (string-append "https://download.qt.io/official_releases/qt/"
1099 (version-major+minor version) "/" version
1100 "/submodules/" name "-everywhere-src-"
1101 version ".tar.xz"))
1102 (sha256
1103 (base32
1104 "1nb77bfs63nyy0wkhsci9qbqmahncy3sdcrwj4qr1prc4y2cm4wx"))))
1105 (arguments
1106 (substitute-keyword-arguments (package-arguments qtsvg)
1107 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1108 (native-inputs
1109 `(("perl" ,perl)
1110 ("qtdeclarative" ,qtdeclarative)))
1111 (inputs
1112 `(("mesa" ,mesa)
1113 ("qtbase" ,qtbase)))
1114 (synopsis "Qt Tools and Designer modules")
1115 (description "The Qt Tools module provides a set of applications to browse
1116 the documentation, translate applications, generate help files and other stuff
1117 that helps in Qt development.")))
1118
1119 (define-public qtscript
1120 (package (inherit qtsvg)
1121 (name "qtscript")
1122 (version "5.11.0")
1123 (source (origin
1124 (method url-fetch)
1125 (uri (string-append "https://download.qt.io/official_releases/qt/"
1126 (version-major+minor version) "/" version
1127 "/submodules/" name "-everywhere-src-"
1128 version ".tar.xz"))
1129 (sha256
1130 (base32
1131 "1ib8a5gsxarbm2j94j5d097ly3ap4snqkx2imz3sl6xk6gknm4i5"))
1132 (patches (search-patches "qtscript-disable-tests.patch"))))
1133 (native-inputs
1134 `(("perl" ,perl)
1135 ("qttools" ,qttools)))
1136 (inputs
1137 `(("qtbase" ,qtbase)))
1138 (synopsis "Qt Script module")
1139 (description "Qt provides support for application scripting with ECMAScript.
1140 The following guides and references cover aspects of programming with
1141 ECMAScript and Qt.")))
1142
1143 (define-public qtquickcontrols
1144 (package (inherit qtsvg)
1145 (name "qtquickcontrols")
1146 (version "5.11.0")
1147 (source (origin
1148 (method url-fetch)
1149 (uri (string-append "https://download.qt.io/official_releases/qt/"
1150 (version-major+minor version) "/" version
1151 "/submodules/" name "-everywhere-src-"
1152 version ".tar.xz"))
1153 (sha256
1154 (base32
1155 "01ziibf4afdhb5b3gfci8maprmviqwhdvma2z1jlq2ck45cpsqi6"))))
1156 (arguments
1157 (substitute-keyword-arguments (package-arguments qtsvg)
1158 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1159 (inputs
1160 `(("qtbase" ,qtbase)
1161 ("qtdeclarative" ,qtdeclarative)))
1162 (synopsis "Qt Quick Controls and other Quick modules")
1163 (description "The QtScript module provides classes for making Qt
1164 applications scriptable. This module provides a set of extra components that
1165 can be used to build complete interfaces in Qt Quick.")))
1166
1167 (define-public qtquickcontrols2
1168 (package (inherit qtsvg)
1169 (name "qtquickcontrols2")
1170 (version "5.11.0")
1171 (source (origin
1172 (method url-fetch)
1173 (uri (string-append "https://download.qt.io/official_releases/qt/"
1174 (version-major+minor version) "/" version
1175 "/submodules/" name "-everywhere-src-"
1176 version ".tar.xz"))
1177 (sha256
1178 (base32
1179 "1hsa8n4dlqpyz9xq2kq1hsxrxsjc7ywzzfhqijylgzzclvlqgb7y"))))
1180 (arguments
1181 (substitute-keyword-arguments (package-arguments qtsvg)
1182 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1183 (inputs
1184 `(("qtbase" ,qtbase)
1185 ("qtdeclarative" ,qtdeclarative)))
1186 (synopsis "Qt Quick Controls 2 and other Quick 2 modules")
1187 (description "The Qt Quick Controls 2 module contains the Qt Labs Platform
1188 module that provides platform integration: native dialogs, menus and menu bars,
1189 and tray icons. It falls back to Qt Widgets when a native implementation is
1190 not available.")))
1191
1192 (define-public qtgraphicaleffects
1193 (package (inherit qtsvg)
1194 (name "qtgraphicaleffects")
1195 (version "5.11.0")
1196 (source (origin
1197 (method url-fetch)
1198 (uri (string-append "https://download.qt.io/official_releases/qt/"
1199 (version-major+minor version) "/" version
1200 "/submodules/" name "-everywhere-src-"
1201 version ".tar.xz"))
1202 (sha256
1203 (base32
1204 "0xzr4421w7idlgndxnd68wwc2asabycjiskkyl1f8nwqv34lcy3j"))))
1205 (arguments
1206 (substitute-keyword-arguments (package-arguments qtsvg)
1207 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1208 (inputs
1209 `(("qtbase" ,qtbase)
1210 ("qtdeclarative" ,qtdeclarative)))
1211 (synopsis "Qt Graphical Effects module")
1212 (description "The Qt Graphical Effects module provides a set of QML types
1213 for adding visually impressive and configurable effects to user interfaces.
1214 Effects are visual items that can be added to Qt Quick user interface as UI
1215 components. The API consists of over 20 effects provided as separate QML
1216 types. The effects cover functional areas such as blending, masking, blurring,
1217 coloring, and many more.")))
1218
1219 (define-public qtdeclarative-render2d
1220 ;; As of Qt-5.8.0 this module has been merged into qtdeclarative
1221 (package (inherit qtsvg)
1222 (name "qtdeclarative-render2d")
1223 (version "5.7.1")
1224 (source (origin
1225 (method url-fetch)
1226 (uri (string-append "https://download.qt.io/official_releases/qt/"
1227 (version-major+minor version) "/" version
1228 "/submodules/" name "-everywhere-src-"
1229 version ".tar.xz"))
1230 (sha256
1231 (base32
1232 "0zwch9vn17f3bpy300jcfxx6cx9qymk5j7khx0x9k1xqid4166c3"))
1233 (modules '((guix build utils)))
1234 (snippet
1235 '(begin
1236 (delete-file-recursively "tools/opengldummy/3rdparty")
1237 #t))))
1238 (native-inputs `())
1239 (inputs
1240 `(("qtbase" ,qtbase)
1241 ("qtdeclarative" ,qtdeclarative)))
1242 (synopsis "Qt Declarative Render module")
1243 (description "The Qt Declarative Render 2D module provides a Raster
1244 backend for QtQuick scene graph.")
1245 (properties `((superseded . ,qtdeclarative)))))
1246
1247 (define-public qtgamepad
1248 (package (inherit qtsvg)
1249 (name "qtgamepad")
1250 (version "5.11.0")
1251 (source (origin
1252 (method url-fetch)
1253 (uri (string-append "https://download.qt.io/official_releases/qt/"
1254 (version-major+minor version) "/" version
1255 "/submodules/" name "-everywhere-src-"
1256 version ".tar.xz"))
1257 (sha256
1258 (base32
1259 "0g52c03gdgz57h7szdxvc5hdy45l7q7m29yfzhwqc57hwdfl98bi"))))
1260 (native-inputs
1261 `(("perl" ,perl)
1262 ("pkg-config" ,pkg-config)))
1263 (inputs
1264 `(("fontconfig" ,fontconfig)
1265 ("freetype" ,freetype)
1266 ("libxrender" ,libxrender)
1267 ("sdl2" ,sdl2)
1268 ("qtbase" ,qtbase)
1269 ("qtdeclarative" ,qtdeclarative)))
1270 (synopsis "Qt Gamepad module")
1271 (description "The Qt Gamepad module is an add-on library that enables Qt
1272 applications to support the use of gamepad hardware and in some cases remote
1273 control equipment. The module provides both QML and C++ interfaces. The
1274 primary target audience are embedded devices with fullscreen user interfaces,
1275 and mobile applications targeting TV-like form factors.")))
1276
1277 (define-public qtscxml
1278 (package (inherit qtsvg)
1279 (name "qtscxml")
1280 (version "5.11.0")
1281 (source (origin
1282 (method url-fetch)
1283 (uri (string-append "https://download.qt.io/official_releases/qt/"
1284 (version-major+minor version) "/" version
1285 "/submodules/" name "-everywhere-src-"
1286 version ".tar.xz"))
1287 (sha256
1288 (base32
1289 "00wb89ris8fyivhz9qpqn72mzpkh6mqdjss82j3q10g3c142072k"))
1290 (modules '((guix build utils)))
1291 (snippet
1292 '(begin
1293 (delete-file-recursively "tests/3rdparty")
1294 ;; the scion test refers to the bundled 3rd party test code.
1295 (substitute* "tests/auto/auto.pro"
1296 (("scion") "#"))
1297 #t))))
1298 (inputs
1299 `(("qtbase" ,qtbase)
1300 ("qtdeclarative" ,qtdeclarative)))
1301 (synopsis "Qt SCXML module")
1302 (description "The Qt SCXML module provides functionality to create state
1303 machines from SCXML files. This includes both dynamically creating state
1304 machines (loading the SCXML file and instantiating states and transitions) and
1305 generating a C++ file that has a class implementing the state machine. It
1306 also contains functionality to support data models and executable content.")))
1307
1308 (define-public qtpurchasing
1309 (package (inherit qtsvg)
1310 (name "qtpurchasing")
1311 (version "5.11.0")
1312 (source (origin
1313 (method url-fetch)
1314 (uri (string-append "https://download.qt.io/official_releases/qt/"
1315 (version-major+minor version) "/" version
1316 "/submodules/" name "-everywhere-src-"
1317 version ".tar.xz"))
1318 (sha256
1319 (base32
1320 "1c92yv2yi38sic06nyr9r6zpq3y4sxnasmj14d3jmg50gc1ncqfs"))))
1321 (inputs
1322 `(("qtbase" ,qtbase)
1323 ("qtdeclarative" ,qtdeclarative)))
1324 (synopsis "Qt Purchasing module")
1325 (description "The Qt Purchasing module provides and in-app API for
1326 purchasing goods and services.")))
1327
1328 (define-public qtcanvas3d
1329 (package (inherit qtsvg)
1330 (name "qtcanvas3d")
1331 (version "5.11.0")
1332 (source (origin
1333 (method url-fetch)
1334 (uri (string-append "https://download.qt.io/official_releases/qt/"
1335 (version-major+minor version) "/" version
1336 "/submodules/" name "-everywhere-src-"
1337 version ".tar.xz"))
1338 (sha256
1339 (base32
1340 "1kqcaks6lkz8cp9s3pwrvgrr8381rjzf5fbf2bzshdw7psphxiiz"))
1341 (modules '((guix build utils)))
1342 (snippet
1343 '(begin
1344 (delete-file-recursively "examples/canvas3d/3rdparty")
1345 #t))))
1346 (arguments
1347 (substitute-keyword-arguments (package-arguments qtsvg)
1348 ;; Building the tests depends on the bundled 3rd party javascript files,
1349 ;; and the test phase fails to import QtCanvas3D, causing the phase to
1350 ;; fail, so we skip building them for now.
1351 ((#:phases phases)
1352 `(modify-phases ,phases
1353 (replace 'configure
1354 (lambda* (#:key outputs #:allow-other-keys)
1355 (let ((out (assoc-ref outputs "out")))
1356 (invoke "qmake" "QT_BUILD_PARTS = libs tools"
1357 (string-append "PREFIX=" out)))))))
1358 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1359 (native-inputs `())
1360 (inputs
1361 `(("qtbase" ,qtbase)
1362 ("qtdeclarative" ,qtdeclarative)))
1363 (synopsis "Qt Canvas 3D module")
1364 (description "The Qt Canvas 3D module provides a way to make WebGL-like 3D
1365 drawing calls from Qt Quick JavaScript.")))
1366
1367 (define-public qtcharts
1368 (package (inherit qtsvg)
1369 (name "qtcharts")
1370 (version "5.11.0")
1371 (source (origin
1372 (method url-fetch)
1373 (uri (string-append "https://download.qt.io/official_releases/qt/"
1374 (version-major+minor version) "/" version
1375 "/submodules/" name "-everywhere-src-"
1376 version ".tar.xz"))
1377 (sha256
1378 (base32
1379 "0lg39vd6i0l76spjz6bhb1kkpbk2mgc0hxccj7733xxbxaz14vn4"))))
1380 (arguments
1381 (substitute-keyword-arguments (package-arguments qtsvg)
1382 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1383 (inputs
1384 `(("qtbase" ,qtbase)
1385 ("qtdeclarative" ,qtdeclarative)))
1386 (synopsis "Qt Charts module")
1387 (description "The Qt Charts module provides a set of easy to use chart
1388 components. It uses the Qt Graphics View Framework, therefore charts can be
1389 easily integrated to modern user interfaces. Qt Charts can be used as QWidgets,
1390 QGraphicsWidget, or QML types. Users can easily create impressive graphs by
1391 selecting one of the charts themes.")
1392 (license license:gpl3)))
1393
1394 (define-public qtdatavis3d
1395 (package (inherit qtsvg)
1396 (name "qtdatavis3d")
1397 (version "5.11.0")
1398 (source (origin
1399 (method url-fetch)
1400 (uri (string-append "https://download.qt.io/official_releases/qt/"
1401 (version-major+minor version) "/" version
1402 "/submodules/" name "-everywhere-src-"
1403 version ".tar.xz"))
1404 (sha256
1405 (base32
1406 "1s7gmgh6g3aia74yiqahffrc6n8f4491vb7g3i4i10ilandipg34"))))
1407 (arguments
1408 (substitute-keyword-arguments (package-arguments qtsvg)
1409 ((#:tests? _ #f) #f))) ; TODO: Enable the tests
1410 (inputs
1411 `(("qtbase" ,qtbase)
1412 ("qtdeclarative" ,qtdeclarative)))
1413 (synopsis "Qt Data Visualization module")
1414 (description "The Qt Data Visualization module provides a way to visualize
1415 data in 3D as bar, scatter, and surface graphs. It is especially useful for
1416 visualizing depth maps and large quantities of rapidly changing data, such as
1417 data received from multiple sensors. The look and feel of graphs can be
1418 customized by using themes or by adding custom items and labels to them.")
1419 (license license:gpl3)))
1420
1421 (define-public qtnetworkauth
1422 (package (inherit qtsvg)
1423 (name "qtnetworkauth")
1424 (version "5.11.0")
1425 (source (origin
1426 (method url-fetch)
1427 (uri (string-append "https://download.qt.io/official_releases/qt/"
1428 (version-major+minor version) "/" version
1429 "/submodules/" name "-everywhere-src-"
1430 version ".tar.xz"))
1431 (sha256
1432 (base32
1433 "1kr8hwjsb8a5cypvqj48vrnkcvm2rcni102dh6i909i70a7hcsym"))))
1434 (arguments
1435 (substitute-keyword-arguments (package-arguments qtsvg)
1436 ((#:phases phases)
1437 `(modify-phases ,phases
1438 (add-after 'unpack 'remove-failing-test
1439 (lambda _
1440 ;; These tests can't find their test data.
1441 (substitute* "tests/auto/auto.pro"
1442 (("oauth1 ") "# oauth1 "))
1443 #t))))))
1444 (inputs
1445 `(("qtbase" ,qtbase)))
1446 (synopsis "Qt Network Authorization module")
1447 (description "The Qt Network Authorization module provides an
1448 implementation of OAuth and OAuth2 authenticathon methods for Qt.")))
1449
1450 (define-public qtremoteobjects
1451 (package (inherit qtsvg)
1452 (name "qtremoteobjects")
1453 (version "5.11.0")
1454 (source (origin
1455 (method url-fetch)
1456 (uri (string-append "https://download.qt.io/official_releases/qt/"
1457 (version-major+minor version) "/" version
1458 "/submodules/" name "-everywhere-src-"
1459 version ".tar.xz"))
1460 (sha256
1461 (base32
1462 "1chn1xxhapfwvhrlv4chwfgf2dw8x8kn1lssdmpmg5s420z3pbq9"))))
1463 (arguments
1464 (substitute-keyword-arguments (package-arguments qtsvg)
1465 ((#:phases phases)
1466 `(modify-phases ,phases
1467 (add-after 'unpack 'remove-failing-test
1468 (lambda _
1469 ;; This test can't find its imports.
1470 (substitute* "tests/auto/qml/qml.pro"
1471 (("integration") "# integration"))
1472 #t))))))
1473 (inputs
1474 `(("qtbase" ,qtbase)
1475 ("qtdeclarative" ,qtdeclarative)))
1476 (synopsis "Qt Remote Objects module")
1477 (description "The Qt Remote Objects module is an @dfn{inter-process
1478 communication} (IPC) module developed for Qt. The idea is to extend existing
1479 Qt's functionalities to enable an easy exchange of information between
1480 processes or computers.")))
1481
1482 (define-public qtspeech
1483 (package (inherit qtsvg)
1484 (name "qtspeech")
1485 (version "5.11.0")
1486 (source (origin
1487 (method url-fetch)
1488 (uri (string-append "https://download.qt.io/official_releases/qt/"
1489 (version-major+minor version) "/" version
1490 "/submodules/" name "-everywhere-src-"
1491 version ".tar.xz"))
1492 (sha256
1493 (base32
1494 "1bgfg0akqf1nfzm28n8dhvhj0p1niwxrfs763gj7m0g6vpwjbhd1"))))
1495 (inputs
1496 `(("qtbase" ,qtbase)))
1497 (native-inputs
1498 `(("perl" ,perl)
1499 ("qtdeclarative" ,qtdeclarative)
1500 ("qtmultimedia" ,qtmultimedia)
1501 ("qtxmlpatterns" ,qtxmlpatterns)))
1502 (synopsis "Qt Speech module")
1503 (description "The Qt Speech module enables a Qt application to support
1504 accessibility features such as text-to-speech, which is useful for end-users
1505 who are visually challenged or cannot access the application for whatever
1506 reason. The most common use case where text-to-speech comes in handy is when
1507 the end-user is driving and cannot attend the incoming messages on the phone.
1508 In such a scenario, the messaging application can read out the incoming
1509 message.")))
1510
1511 (define-public python-sip
1512 (package
1513 (name "python-sip")
1514 (version "4.19.3")
1515 (source
1516 (origin
1517 (method url-fetch)
1518 (uri
1519 (string-append "mirror://sourceforge/pyqt/sip/"
1520 "sip-" version "/sip-" version ".tar.gz"))
1521 (sha256
1522 (base32
1523 "0x2bghbprwl3az1ni3p87i0bq8r99694la93kg65vi0cz12gh3bl"))))
1524 (build-system gnu-build-system)
1525 (native-inputs
1526 `(("python" ,python-wrapper)))
1527 (arguments
1528 `(#:tests? #f ; no check target
1529 #:modules ((srfi srfi-1)
1530 ,@%gnu-build-system-modules)
1531 #:phases
1532 (modify-phases %standard-phases
1533 (replace 'configure
1534 (lambda* (#:key inputs outputs #:allow-other-keys)
1535 (let* ((out (assoc-ref outputs "out"))
1536 (bin (string-append out "/bin"))
1537 (include (string-append out "/include"))
1538 (python (assoc-ref inputs "python"))
1539 (python-version
1540 (last (string-split python #\-)))
1541 (python-major+minor
1542 (string-join
1543 (take (string-split python-version #\.) 2)
1544 "."))
1545 (lib (string-append out "/lib/python"
1546 python-major+minor
1547 "/site-packages")))
1548 (zero?
1549 (system* "python" "configure.py"
1550 "--bindir" bin
1551 "--destdir" lib
1552 "--incdir" include))))))))
1553 (home-page "https://www.riverbankcomputing.com/software/sip/intro")
1554 (synopsis "Python binding creator for C and C++ libraries")
1555 (description
1556 "SIP is a tool to create Python bindings for C and C++ libraries. It
1557 was originally developed to create PyQt, the Python bindings for the Qt
1558 toolkit, but can be used to create bindings for any C or C++ library.
1559
1560 SIP comprises a code generator and a Python module. The code generator
1561 processes a set of specification files and generates C or C++ code, which
1562 is then compiled to create the bindings extension module. The SIP Python
1563 module provides support functions to the automatically generated code.")
1564 ;; There is a choice between a python like license, gpl2 and gpl3.
1565 ;; For compatibility with pyqt, we need gpl3.
1566 (license license:gpl3)))
1567
1568 (define-public python2-sip
1569 (package (inherit python-sip)
1570 (name "python2-sip")
1571 (native-inputs
1572 `(("python" ,python-2)))))
1573
1574 (define-public python-pyqt
1575 (package
1576 (name "python-pyqt")
1577 (version "5.9")
1578 (source
1579 (origin
1580 (method url-fetch)
1581 (uri
1582 (string-append "mirror://sourceforge/pyqt/PyQt5/"
1583 "PyQt-" version "/PyQt5_gpl-"
1584 version ".tar.gz"))
1585 (sha256
1586 (base32
1587 "15hh4z5vd45dcswjla58q6rrfr6ic7jfz2n7c8lwfb10rycpj3mb"))
1588 (patches (search-patches "pyqt-configure.patch"))))
1589 (build-system gnu-build-system)
1590 (native-inputs
1591 `(("qtbase" ,qtbase))) ; for qmake
1592 (propagated-inputs
1593 `(("python-sip" ,python-sip)))
1594 (inputs
1595 `(("python" ,python-wrapper)
1596 ("qtbase" ,qtbase)
1597 ("qtconnectivity" ,qtconnectivity)
1598 ("qtdeclarative" ,qtdeclarative)
1599 ("qtlocation" ,qtlocation)
1600 ("qtmultimedia" ,qtmultimedia)
1601 ("qtsensors" ,qtsensors)
1602 ("qtserialport" ,qtserialport)
1603 ("qtsvg" ,qtsvg)
1604 ("qttools" ,qttools)
1605 ("qtwebchannel" ,qtwebchannel)
1606 ("qtwebkit" ,qtwebkit)
1607 ("qtwebsockets" ,qtwebsockets)
1608 ("qtx11extras" ,qtx11extras)
1609 ("qtxmlpatterns" ,qtxmlpatterns)))
1610 (arguments
1611 `(#:modules ((srfi srfi-1)
1612 ,@%gnu-build-system-modules)
1613 #:phases
1614 (modify-phases %standard-phases
1615 (replace 'configure
1616 (lambda* (#:key inputs outputs #:allow-other-keys)
1617 (let* ((out (assoc-ref outputs "out"))
1618 (bin (string-append out "/bin"))
1619 (sip (string-append out "/share/sip"))
1620 (plugins (string-append out "/plugins"))
1621 (designer (string-append plugins "/designer"))
1622 (qml (string-append plugins "/PyQt5"))
1623 (python (assoc-ref inputs "python"))
1624 (python-version
1625 (last (string-split python #\-)))
1626 (python-major+minor
1627 (string-join
1628 (take (string-split python-version #\.) 2)
1629 "."))
1630 (lib (string-append out "/lib/python"
1631 python-major+minor
1632 "/site-packages"))
1633 (stubs (string-append lib "/PyQt5")))
1634 (zero? (system* "python" "configure.py"
1635 "--confirm-license"
1636 "--bindir" bin
1637 "--destdir" lib
1638 "--designer-plugindir" designer
1639 "--qml-plugindir" qml
1640 ; Where to install the PEP 484 Type Hints stub
1641 ; files. Without this the stubs are tried to be
1642 ; installed into the python package's
1643 ; site-package directory, which is read-only.
1644 "--stubsdir" stubs
1645 "--sipdir" sip))))))))
1646 (home-page "https://www.riverbankcomputing.com/software/pyqt/intro")
1647 (synopsis "Python bindings for Qt")
1648 (description
1649 "PyQt is a set of Python v2 and v3 bindings for the Qt application
1650 framework. The bindings are implemented as a set of Python modules and
1651 contain over 620 classes.")
1652 (license license:gpl3)))
1653
1654 (define-public python2-pyqt
1655 (package (inherit python-pyqt)
1656 (name "python2-pyqt")
1657 (native-inputs
1658 `(("python-sip" ,python2-sip)
1659 ("qtbase" ,qtbase)))
1660 (inputs
1661 `(("python" ,python-2)
1662 ,@(alist-delete "python" (package-inputs python-pyqt))))))
1663
1664 (define-public python-pyqt-4
1665 (package (inherit python-pyqt)
1666 (name "python-pyqt")
1667 (version "4.12")
1668 (source
1669 (origin
1670 (method url-fetch)
1671 (uri
1672 (string-append "mirror://sourceforge/pyqt/PyQt4/"
1673 "PyQt-" version "/PyQt4_gpl_x11-"
1674 version ".tar.gz"))
1675 (sha256
1676 (base32
1677 "1nw8r88a5g2d550yvklawlvns8gd5slw53yy688kxnsa65aln79w"))))
1678 (native-inputs
1679 `(("python-sip" ,python-sip)
1680 ("qt" ,qt-4)))
1681 (inputs `(("python" ,python-wrapper)))
1682 (arguments
1683 `(#:tests? #f ; no check target
1684 #:modules ((srfi srfi-1)
1685 ,@%gnu-build-system-modules)
1686 #:phases
1687 (modify-phases %standard-phases
1688 (replace 'configure
1689 (lambda* (#:key inputs outputs #:allow-other-keys)
1690 (let* ((out (assoc-ref outputs "out"))
1691 (bin (string-append out "/bin"))
1692 (sip (string-append out "/share/sip"))
1693 (python (assoc-ref inputs "python"))
1694 (python-version
1695 (last (string-split python #\-)))
1696 (python-major+minor
1697 (string-join
1698 (take (string-split python-version #\.) 2)
1699 "."))
1700 (lib (string-append out "/lib/python"
1701 python-major+minor
1702 "/site-packages")))
1703 (zero? (system* "python" "configure.py"
1704 "--confirm-license"
1705 "--bindir" bin
1706 "--destdir" lib
1707 "--sipdir" sip))))))))
1708 (license (list license:gpl2 license:gpl3)))) ; choice of either license
1709
1710 (define-public python2-pyqt-4
1711 (package (inherit python-pyqt-4)
1712 (name "python2-pyqt")
1713 (native-inputs
1714 `(("python-sip" ,python2-sip)
1715 ("qt" ,qt-4)))
1716 (inputs
1717 `(("python" ,python-2)))))
1718
1719 (define-public qscintilla
1720 (package
1721 (name "qscintilla")
1722 (version "2.10.3")
1723 (source (origin
1724 (method url-fetch)
1725 (uri (string-append "mirror://sourceforge/pyqt/QScintilla2/"
1726 "QScintilla-" version "/QScintilla_gpl-"
1727 version ".tar.gz"))
1728 (sha256
1729 (base32
1730 "1rw1nlwnyzj5pb86cc5kk56qhrvwvrjvjzgrkwh3g7b9wxl7lrfj"))))
1731 (build-system gnu-build-system)
1732 (arguments
1733 `(#:phases
1734 (modify-phases %standard-phases
1735 (replace 'configure
1736 (lambda* (#:key outputs #:allow-other-keys)
1737 (let ((out (assoc-ref outputs "out")))
1738 (chdir "Qt4Qt5")
1739 (substitute* "qscintilla.pro"
1740 (("\\$\\$\\[QT_INSTALL_LIBS\\]")
1741 (string-append out "/lib"))
1742 (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
1743 (string-append out "/include"))
1744 (("\\$\\$\\[QT_INSTALL_TRANSLATIONS\\]")
1745 (string-append out "/translations"))
1746 (("\\$\\$\\[QT_INSTALL_DATA\\]")
1747 (string-append out "/lib/qt$${QT_MAJOR_VERSION}"))
1748 (("\\$\\$\\[QT_HOST_DATA\\]")
1749 (string-append out "/lib/qt$${QT_MAJOR_VERSION}")))
1750 (invoke "qmake")))))))
1751 (native-inputs `(("qtbase" ,qtbase)))
1752 (home-page "https://www.riverbankcomputing.co.uk/software/qscintilla/intro")
1753 (synopsis "Qt port of the Scintilla C++ editor control")
1754 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
1755 editor control. QScintilla includes features especially useful when editing
1756 and debugging source code. These include support for syntax styling, error
1757 indicators, code completion and call tips.")
1758 (license license:gpl3+)))
1759
1760 (define-public python-qscintilla
1761 (package (inherit qscintilla)
1762 (name "python-qscintilla")
1763 (arguments
1764 `(#:configure-flags
1765 (list "--pyqt=PyQt5"
1766 (string-append "--pyqt-sipdir="
1767 (assoc-ref %build-inputs "python-pyqt")
1768 "/share/sip")
1769 (string-append "--qsci-incdir="
1770 (assoc-ref %build-inputs "qscintilla")
1771 "/include")
1772 (string-append "--qsci-libdir="
1773 (assoc-ref %build-inputs "qscintilla")
1774 "/lib"))
1775 #:phases
1776 (modify-phases %standard-phases
1777 (replace 'configure
1778 (lambda* (#:key outputs configure-flags #:allow-other-keys)
1779 (chdir "Python")
1780 (apply invoke "python3" "configure.py"
1781 configure-flags)
1782 ;; Install to the right directory
1783 (substitute* '("Makefile"
1784 "Qsci/Makefile")
1785 (("\\$\\(INSTALL_ROOT\\)/gnu/store/[^/]+")
1786 (assoc-ref outputs "out")))
1787 #t)))))
1788 (inputs
1789 `(("qscintilla" ,qscintilla)
1790 ("python" ,python)
1791 ("python-pyqt" ,python-pyqt)))
1792 (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
1793 editor control. QScintilla includes features especially useful when editing
1794 and debugging source code. These include support for syntax styling, error
1795 indicators, code completion and call tips.
1796
1797 This package provides the Python bindings.")))
1798
1799 ;; PyQt only looks for modules in its own directory. It ignores environment
1800 ;; variables such as PYTHONPATH, so we need to build a union package to make
1801 ;; it work.
1802 (define-public python-pyqt+qscintilla
1803 (package (inherit python-pyqt)
1804 (name "python-pyqt+qscintilla")
1805 (source #f)
1806 (build-system trivial-build-system)
1807 (arguments
1808 '(#:modules ((guix build union))
1809 #:builder (begin
1810 (use-modules (ice-9 match)
1811 (guix build union))
1812 (match %build-inputs
1813 (((names . directories) ...)
1814 (union-build (assoc-ref %outputs "out")
1815 directories)
1816 #t)))))
1817 (inputs
1818 `(("python-pyqt" ,python-pyqt)
1819 ("python-qscintilla" ,python-qscintilla)))
1820 (synopsis "Union of PyQt and the Qscintilla extension")
1821 (description
1822 "This package contains the union of PyQt and the Qscintilla extension.")))
1823
1824 (define-public qtkeychain
1825 (package
1826 (name "qtkeychain")
1827 (version "0.8.0")
1828 (source
1829 (origin
1830 (method url-fetch)
1831 (uri (string-append "https://github.com/frankosterfeld/qtkeychain/"
1832 "archive/v" version ".tar.gz"))
1833 (file-name (string-append name "-" version ".tar.gz"))
1834 (sha256
1835 (base32 "0bxi5pfhxdvwk8yxa06lk2d7lcibmfqhahbin82bqf3m341zd4ml"))))
1836 (build-system cmake-build-system)
1837 (native-inputs
1838 `(("pkg-config" ,pkg-config)
1839 ("qttools" ,qttools)))
1840 (inputs
1841 `(("qtbase" ,qtbase)))
1842 (arguments
1843 `(#:tests? #f ; No tests included
1844 #:phases
1845 (modify-phases %standard-phases
1846 (add-before
1847 'configure 'set-qt-trans-dir
1848 (lambda _
1849 (substitute* "CMakeLists.txt"
1850 (("\\$\\{qt_translations_dir\\}")
1851 "${CMAKE_INSTALL_PREFIX}/share/qt/translations"))
1852 #t)))))
1853 (home-page "https://github.com/frankosterfeld/qtkeychain")
1854 (synopsis "Qt API to store passwords")
1855 (description
1856 "QtKeychain is a Qt library to store passwords and other secret data
1857 securely. It will not store any data unencrypted unless explicitly requested.")
1858 (license license:bsd-3)))
1859
1860 (define-public qwt
1861 (package
1862 (name "qwt")
1863 (version "6.1.3")
1864 (source
1865 (origin
1866 (method url-fetch)
1867 (uri
1868 (string-append "mirror://sourceforge/qwt/qwt/"
1869 version "/qwt-" version ".tar.bz2"))
1870 (sha256
1871 (base32 "0cwp63s03dw351xavb3pzbjlqvx7kj88wv7v4a2b18m9f97d7v7k"))))
1872 (build-system gnu-build-system)
1873 (inputs
1874 `(("qtbase" ,qtbase)
1875 ("qtsvg" ,qtsvg)
1876 ("qttools" ,qttools)))
1877 (arguments
1878 `(#:phases
1879 (modify-phases %standard-phases
1880 (replace 'configure
1881 (lambda* (#:key outputs #:allow-other-keys)
1882 (let* ((out (assoc-ref outputs "out"))
1883 (docdir (string-append out "/share/doc/qwt"))
1884 (incdir (string-append out "/include/qwt"))
1885 (pluginsdir (string-append out "/lib/qt5/plugins/designer"))
1886 (featuresdir (string-append out "/lib/qt5/mkspecs/features")))
1887 (substitute* '("qwtconfig.pri")
1888 (("^(\\s*QWT_INSTALL_PREFIX)\\s*=.*" _ x)
1889 (format #f "~a = ~a\n" x out))
1890 (("^(QWT_INSTALL_DOCS)\\s*=.*" _ x)
1891 (format #f "~a = ~a\n" x docdir))
1892 (("^(QWT_INSTALL_HEADERS)\\s*=.*" _ x)
1893 (format #f "~a = ~a\n" x incdir))
1894 (("^(QWT_INSTALL_PLUGINS)\\s*=.*" _ x)
1895 (format #f "~a = ~a\n" x pluginsdir))
1896 (("^(QWT_INSTALL_FEATURES)\\s*=.*" _ x)
1897 (format #f "~a = ~a\n" x featuresdir)))
1898 (substitute* '("doc/doc.pro")
1899 ;; We'll install them in the 'install-man-pages' phase.
1900 (("^unix:doc\\.files.*") ""))
1901 (zero? (system* "qmake")))))
1902 (add-after 'install 'install-man-pages
1903 (lambda* (#:key outputs #:allow-other-keys)
1904 (let* ((out (assoc-ref outputs "out"))
1905 (man (string-append out "/share/man")))
1906 ;; Remove some incomplete manual pages.
1907 (for-each delete-file (find-files "doc/man/man3" "^_tmp.*"))
1908 (mkdir-p man)
1909 (copy-recursively "doc/man" man)
1910 #t))))))
1911 (home-page "http://qwt.sourceforge.net")
1912 (synopsis "Qt widgets for plots, scales, dials and other technical software
1913 GUI components")
1914 (description
1915 "The Qwt library contains widgets and components which are primarily useful
1916 for technical and scientific purposes. It includes a 2-D plotting widget,
1917 different kinds of sliders, and much more.")
1918 (license
1919 (list
1920 ;; The Qwt license is LGPL2.1 with some exceptions.
1921 (license:non-copyleft "http://qwt.sourceforge.net/qwtlicense.html")
1922 ;; textengines/mathml/qwt_mml_document.{cpp,h} is dual LGPL2.1/GPL3 (either).
1923 license:lgpl2.1 license:gpl3))))
1924
1925 (define-public qtwebkit
1926 (package
1927 (name "qtwebkit")
1928 (version "5.9.1")
1929 (source
1930 (origin
1931 (method url-fetch)
1932 (uri (string-append "https://download.qt.io/official_releases/qt/"
1933 (version-major+minor version) "/" version
1934 "/submodules/" name "-opensource-src-"
1935 version ".tar.xz"))
1936 (sha256
1937 (base32
1938 "1ksjn1vjbfhdm4y4rg08ag4krk87ahp7qcdcpwll42l0rnz61998"))))
1939 (build-system gnu-build-system)
1940 (native-inputs
1941 `(("perl" ,perl)
1942 ("python" ,python-2.7)
1943 ("ruby" ,ruby)
1944 ("bison" ,bison)
1945 ("flex" ,flex)
1946 ("gperf" ,gperf)
1947 ("pkg-config" ,pkg-config)))
1948 (inputs
1949 `(("icu" ,icu4c)
1950 ("libjpeg" ,libjpeg)
1951 ("libpng" ,libpng)
1952 ("libwebp" ,libwebp)
1953 ("sqlite" ,sqlite)
1954 ("fontconfig" ,fontconfig)
1955 ("libxrender" ,libxrender)
1956 ("qtbase" ,qtbase)
1957 ("qtdeclarative" ,qtdeclarative)
1958 ("qtmultimedia" ,qtmultimedia)
1959 ("libxml2" ,libxml2)
1960 ("libxslt" ,libxslt)
1961 ("libx11" ,libx11)
1962 ("libxcomposite" ,libxcomposite)))
1963 (arguments
1964 `(#:phases
1965 (modify-phases %standard-phases
1966 (add-before 'configure 'fix-qmlwebkit-plugins-rpath
1967 (lambda _
1968 (substitute* "Source/WebKit/qt/declarative/experimental/experimental.pri"
1969 (("RPATHDIR_RELATIVE_TO_DESTDIR = \\.\\./\\.\\./lib")
1970 "RPATHDIR_RELATIVE_TO_DESTDIR = ../../../../../lib"))
1971 (substitute* "Source/WebKit/qt/declarative/public.pri"
1972 (("RPATHDIR_RELATIVE_TO_DESTDIR = \\.\\./\\.\\./lib")
1973 "RPATHDIR_RELATIVE_TO_DESTDIR = ../../../../lib"))
1974 #t))
1975 (replace 'configure
1976 (lambda* (#:key outputs #:allow-other-keys)
1977 (let ((out (assoc-ref outputs "out")))
1978 (setenv "QMAKEPATH"
1979 (string-append (getcwd) "/Tools/qmake:"
1980 (getenv "QMAKEPATH")))
1981 (system* "qmake"))))
1982 ;; prevent webkit from trying to install into the qtbase store directory,
1983 ;; and replace references to the build directory in linker options:
1984 (add-before 'build 'patch-installpaths
1985 (lambda* (#:key outputs inputs #:allow-other-keys)
1986 (let* ((out (assoc-ref outputs "out"))
1987 (qtbase (assoc-ref inputs "qtbase"))
1988 (builddir (getcwd))
1989 (linkbuild (string-append "-L" builddir))
1990 (linkout (string-append "-L" out))
1991 (makefiles
1992 (map-in-order
1993 (lambda (i)
1994 (let* ((in (car i))
1995 (mf (string-append (dirname in) "/"
1996 (cdr i))))
1997 ;; by default, these Makefiles are
1998 ;; generated during install, but we need
1999 ;; to generate them now
2000 (system* "qmake" in "-o" mf)
2001 mf))
2002 '(("Source/api.pri" . "Makefile.api")
2003 ("Source/widgetsapi.pri"
2004 . "Makefile.widgetsapi")
2005 ("Source/WebKit2/WebProcess.pro"
2006 . "Makefile.WebProcess")
2007 ("Source/WebKit2/PluginProcess.pro"
2008 . "Makefile.PluginProcess")
2009 ("Source/WebKit/qt/declarative/public.pri"
2010 . "Makefile.declarative.public")
2011 ("Source/WebKit/qt/declarative/experimental/experimental.pri"
2012 . "Makefile.declarative.experimental")
2013 ("Source/WebKit/qt/examples/platformplugin/platformplugin.pro"
2014 . "Makefile")))))
2015 ;; Order of qmake calls and substitutions matters here.
2016 (system* "qmake" "-prl" "Source/widgetsapi.pri"
2017 "-o" "Source/Makefile")
2018 (substitute* (find-files "lib" "libQt5.*\\.prl")
2019 ((linkbuild) linkout))
2020 (substitute* (find-files "lib"
2021 "libQt5WebKit.*\\.la")
2022 (("libdir='.*'")
2023 (string-append "libdir='" out "/lib'"))
2024 ((linkbuild) linkout))
2025 (substitute* (find-files "lib/pkgconfig"
2026 "Qt5WebKit.*\\.pc")
2027 (((string-append "prefix=" qtbase))
2028 (string-append "prefix=" out))
2029 ((linkbuild) linkout))
2030 ;; Makefiles must be modified after .prl/.la/.pc
2031 ;; files, lest they get rebuilt:
2032 (substitute* makefiles
2033 (((string-append "\\$\\(INSTALL_ROOT\\)" qtbase))
2034 out )
2035 (((string-append "-Wl,-rpath," builddir))
2036 (string-append "-Wl,-rpath," out)))))))))
2037 (home-page "https://www.webkit.org")
2038 (synopsis "Web browser engine and classes to render and interact with web
2039 content")
2040 (description "QtWebKit provides a Web browser engine that makes it easy to
2041 embed content from the World Wide Web into your Qt application. At the same
2042 time Web content can be enhanced with native controls.")
2043
2044 (license license:lgpl2.1+)))
2045
2046 (define-public dotherside
2047 (package
2048 (name "dotherside")
2049 (version "0.6.3")
2050 (source
2051 (origin
2052 (method url-fetch)
2053 (uri (string-append "https://github.com/filcuc/DOtherSide/"
2054 "archive/v" version ".tar.gz"))
2055 (file-name (string-append name "-" version ".tar.gz"))
2056 (sha256
2057 (base32
2058 "0azq7qlsrfdwbd6qsi7d3c1knn42qw0r47g43xf7clwbinapswpz"))))
2059 (build-system cmake-build-system)
2060 (native-inputs
2061 `(("qttools" ,qttools)))
2062 (inputs
2063 `(("qtbase" ,qtbase)
2064 ("qtdeclarative" ,qtdeclarative)))
2065 (home-page "https://github.com/frankosterfeld/qtkeychain")
2066 (synopsis "C language library for creating bindings for the Qt QML language")
2067 (description
2068 "DOtherSide is a C language library for creating bindings for the
2069 QT QML language. The following features are implementable from
2070 a binding language:
2071 @itemize
2072 @item Creating custom QObject
2073 @item Creating custom QAbstractListModels
2074 @item Creating custom properties, signals and slots
2075 @item Creating from QML QObject defined in the binded language
2076 @item Creating from Singleton QML QObject defined in the binded language
2077 @end itemize\n")
2078 (license license:lgpl3))) ;version 3 only (+ exception)