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