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