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