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