gnu: Add qtxmlpatterns.
[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>
31580979 4;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
65e46ca0 5;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
bd677c2d
AE
6;;;
7;;; This file is part of GNU Guix.
8;;;
9;;; GNU Guix is free software; you can redistribute it and/or modify it
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
14;;; GNU Guix is distributed in the hope that it will be useful, but
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22(define-module (gnu packages qt)
7868000f 23 #:use-module ((guix licenses) #:select (bsd-3 gpl2 gpl3 lgpl2.1 lgpl2.1+ lgpl3 x11-style))
bd677c2d
AE
24 #:use-module (guix packages)
25 #:use-module (guix download)
f198ffd0 26 #:use-module (guix build utils)
9e81af9e 27 #:use-module (guix build-system cmake)
bd677c2d 28 #:use-module (guix build-system gnu)
84ef83dd
AE
29 #:use-module (guix packages)
30 #:use-module (guix utils)
1e9ed0e3 31 #:use-module (gnu packages)
b332e366
AE
32 #:use-module (gnu packages bison)
33 #:use-module (gnu packages compression)
2cba3d6f
SB
34 #:use-module (gnu packages cups)
35 #:use-module (gnu packages databases)
b332e366 36 #:use-module (gnu packages fontutils)
0009ed71 37 #:use-module (gnu packages flex)
8b6a5e0f 38 #:use-module (gnu packages gl)
b332e366 39 #:use-module (gnu packages glib)
0009ed71
SB
40 #:use-module (gnu packages gnuzilla)
41 #:use-module (gnu packages gperf)
f7fb0ccb 42 #:use-module (gnu packages gtk)
b332e366 43 #:use-module (gnu packages icu4c)
e55354b8 44 #:use-module (gnu packages image)
b332e366 45 #:use-module (gnu packages linux)
5f96f303 46 #:use-module (gnu packages databases)
0009ed71
SB
47 #:use-module (gnu packages pciutils)
48 #:use-module (gnu packages pcre)
b332e366
AE
49 #:use-module (gnu packages perl)
50 #:use-module (gnu packages pkg-config)
39fa8f6c 51 #:use-module (gnu packages pulseaudio)
b332e366 52 #:use-module (gnu packages python)
8b6a5e0f 53 #:use-module (gnu packages ruby)
cc2b77df 54 #:use-module (gnu packages tls)
0009ed71
SB
55 #:use-module (gnu packages xdisorg)
56 #:use-module (gnu packages xorg)
57 #:use-module (gnu packages xml))
bd677c2d 58
b332e366
AE
59(define-public qt
60 (package
61 (name "qt")
a10d3a68 62 (version "5.5.1")
b332e366
AE
63 (source (origin
64 (method url-fetch)
f7fb0ccb
AE
65 (uri
66 (string-append
67 "http://download.qt.io/official_releases/qt/"
68 (version-major+minor version)
69 "/" version
70 "/single/qt-everywhere-opensource-src-"
71 version ".tar.xz"))
b332e366 72 (sha256
f7fb0ccb 73 (base32
a10d3a68 74 "0615cn4n3n78v48lnmapqz2jizm2pzrjwvsjlnsf4awrsiiqw0kg"))
14bcc1e1
AE
75 (modules '((guix build utils)))
76 (snippet
bc554b43
AE
77 '(begin
78 ;; Remove qtwebengine, which relies on a bundled copy of
79 ;; chromium. Not only does it fail compilation in qt 5.5:
80 ;; 3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc:362:10:
81 ;; error: cannot convert ‘bool’ to ‘boolean’ in return
82 ;; it might also pose security problems.
83 ;; Alternatively, we could use the "-skip qtwebengine"
84 ;; configuration option.
85 (delete-file-recursively "qtwebengine")
86 ;; Remove one of the two bundled harfbuzz copies in addition
87 ;; to passing "-system-harfbuzz".
9c32e1fe
AE
88 (delete-file-recursively "qtbase/src/3rdparty/harfbuzz-ng")
89 ;; Remove the bundled sqlite copy in addition to
90 ;; passing "-system-sqlite".
91 (delete-file-recursively "qtbase/src/3rdparty/sqlite")))))
b332e366 92 (build-system gnu-build-system)
ef0cf53e
AE
93 (propagated-inputs
94 `(("mesa" ,mesa)))
b332e366 95 (inputs
b332e366
AE
96 `(("alsa-lib" ,alsa-lib)
97 ("dbus" ,dbus)
2cba3d6f 98 ("cups" ,cups)
0009ed71 99 ("expat" ,expat)
b332e366
AE
100 ("fontconfig" ,fontconfig)
101 ("freetype" ,freetype)
102 ("glib" ,glib)
f7fb0ccb 103 ("harfbuzz" ,harfbuzz)
b332e366 104 ("icu4c" ,icu4c)
f198ffd0 105 ("libjpeg" ,libjpeg)
2cba3d6f 106 ("libmng" ,libmng)
0009ed71 107 ("libpci" ,pciutils)
b332e366
AE
108 ("libpng" ,libpng)
109 ("libx11" ,libx11)
0009ed71
SB
110 ("libxcomposite" ,libxcomposite)
111 ("libxcursor" ,libxcursor)
112 ("libxfixes" ,libxfixes)
b332e366 113 ("libxi" ,libxi)
0009ed71 114 ("libxinerama" ,libxinerama)
b332e366 115 ("libxkbcommon" ,libxkbcommon)
0009ed71
SB
116 ("libxml2" ,libxml2)
117 ("libxrandr" ,libxrandr)
b332e366 118 ("libxrender" ,libxrender)
0009ed71
SB
119 ("libxslt" ,libxslt)
120 ("libxtst" ,libxtst)
121 ("mtdev" ,mtdev)
b332e366 122 ("mysql" ,mysql)
0009ed71 123 ("nss" ,nss)
b332e366 124 ("openssl" ,openssl)
2cba3d6f 125 ("postgresql" ,postgresql)
39fa8f6c 126 ("pulseaudio" ,pulseaudio)
0009ed71
SB
127 ("pcre" ,pcre)
128 ("sqlite" ,sqlite)
129 ("udev" ,eudev)
2cba3d6f 130 ("unixodbc" ,unixodbc)
b332e366
AE
131 ("xcb-util" ,xcb-util)
132 ("xcb-util-image" ,xcb-util-image)
133 ("xcb-util-keysyms" ,xcb-util-keysyms)
134 ("xcb-util-renderutil" ,xcb-util-renderutil)
135 ("xcb-util-wm" ,xcb-util-wm)
136 ("zlib" ,zlib)))
c4c4cc05 137 (native-inputs
0009ed71
SB
138 `(("bison" ,bison)
139 ("flex" ,flex)
140 ("gperf" ,gperf)
0009ed71
SB
141 ("perl" ,perl)
142 ("pkg-config" ,pkg-config)
143 ("python" ,python-2)
144 ("ruby" ,ruby)
ce0614dd 145 ("which" ,(@ (gnu packages base) which))))
b332e366 146 (arguments
46854e99
AE
147 `(;; FIXME: Disabling parallel building is a quick hack to avoid the
148 ;; failure described in
149 ;; https://lists.gnu.org/archive/html/guix-devel/2016-01/msg00837.html
150 ;; A more structural fix is needed.
151 #:parallel-build? #f
152 #:phases
b332e366
AE
153 (alist-replace
154 'configure
155 (lambda* (#:key outputs #:allow-other-keys)
156 (let ((out (assoc-ref outputs "out")))
157 (substitute* '("configure" "qtbase/configure")
5b490ab5
SB
158 (("/bin/pwd") (which "pwd")))
159 (substitute* "qtbase/src/corelib/global/global.pri"
160 (("/bin/ls") (which "ls")))
b332e366
AE
161 ;; do not pass "--enable-fast-install", which makes the
162 ;; configure process fail
206a5208
AE
163 (zero? (system*
164 "./configure"
165 "-verbose"
166 "-prefix" out
167 "-opensource"
168 "-confirm-license"
bc554b43
AE
169 ;; Most "-system-..." are automatic, but some use
170 ;; the bundled copy by default.
0009ed71 171 "-system-sqlite"
bc554b43 172 "-system-harfbuzz"
0009ed71
SB
173 ;; explicitly link with openssl instead of dlopening it
174 "-openssl-linked"
ff0a8c59
AE
175 ;; explicitly link with dbus instead of dlopening it
176 "-dbus-linked"
206a5208
AE
177 ;; drop special machine instructions not supported
178 ;; on all instances of the target
179 ,@(if (string-prefix? "x86_64"
180 (or (%current-target-system)
181 (%current-system)))
182 '()
183 '("-no-sse2"))
184 "-no-sse3"
185 "-no-ssse3"
186 "-no-sse4.1"
187 "-no-sse4.2"
188 "-no-avx"
189 "-no-avx2"
206a5208
AE
190 "-no-mips_dsp"
191 "-no-mips_dspr2"))))
b332e366
AE
192 %standard-phases)))
193 (home-page "http://qt-project.org/")
194 (synopsis "Cross-platform GUI library")
195 (description "Qt is a cross-platform application and UI framework for
196developers using C++ or QML, a CSS & JavaScript like language.")
f47638a3
LC
197 (license lgpl2.1)
198
199 ;; Qt 4: 'QBasicAtomicPointer' leads to build failures on MIPS;
200 ;; see <http://hydra.gnu.org/build/112828>.
201 ;; Qt 5: assembler error; see <http://hydra.gnu.org/build/112526>.
202 (supported-systems (delete "mips64el-linux" %supported-systems))))
1e9ed0e3
AE
203
204(define-public qt-4
205 (package (inherit qt)
d22b9397 206 (version "4.8.7")
1e9ed0e3
AE
207 (source (origin
208 (method url-fetch)
209 (uri (string-append "http://download.qt-project.org/official_releases/qt/"
210 (string-copy version 0 (string-rindex version #\.))
211 "/" version
89059aa1 212 "/qt-everywhere-opensource-src-"
1e9ed0e3
AE
213 version ".tar.gz"))
214 (sha256
215 (base32
d22b9397 216 "183fca7n7439nlhxyg1z7aky0izgbyll3iwakw4gwivy16aj5272"))
fc1adab1 217 (patches (search-patches "qt4-ldflags.patch"))
7431edea
AE
218 (modules '((guix build utils)))
219 (snippet
220 ;; Remove webkit module, which is not built.
221 '(delete-file-recursively "src/3rdparty/webkit"))))
f7fb0ccb
AE
222 (inputs `(,@(alist-delete "harfbuzz"
223 (alist-delete "libjpeg" (package-inputs qt)))
e7e5a4f8
AE
224 ("libjepg" ,libjpeg-8)
225 ("libsm" ,libsm)))
31580979
LC
226
227 ;; Note: there are 37 MiB of examples and a '-exampledir' configure flags,
228 ;; but we can't make them a separate output because "out" and "examples"
229 ;; would refer to each other.
230 (outputs '("out" ;112MiB core + 37MiB examples
231 "doc")) ;280MiB of HTML + code
1e9ed0e3
AE
232 (arguments
233 `(#:phases
cba632c4
LC
234 (modify-phases %standard-phases
235 (replace
1e9ed0e3
AE
236 'configure
237 (lambda* (#:key outputs #:allow-other-keys)
31580979
LC
238 (let ((out (assoc-ref outputs "out"))
239 (doc (assoc-ref outputs "doc")))
1e9ed0e3 240 (substitute* '("configure")
d2984346
LC
241 (("/bin/pwd") (which "pwd")))
242
206a5208
AE
243 (zero? (system*
244 "./configure"
245 "-verbose"
246 "-prefix" out
4b0f2ef7
LC
247 ;; Note: Don't pass '-docdir' since 'qmake' and
248 ;; libQtCore would record its value, thereby defeating
249 ;; the whole point of having a separate output.
ff1989a5
LC
250 "-datadir" (string-append out "/share/qt-" ,version
251 "/data")
252 "-importdir" (string-append out "/lib/qt-4"
253 "/imports")
254 "-plugindir" (string-append out "/lib/qt-4"
255 "/plugins")
256 "-translationdir" (string-append out "/share/qt-" ,version
257 "/translations")
31580979
LC
258 "-demosdir" (string-append out "/share/qt-" ,version
259 "/demos")
260 "-examplesdir" (string-append out "/share/qt-" ,version
261 "/examples")
206a5208
AE
262 "-opensource"
263 "-confirm-license"
ff0a8c59
AE
264 ;; explicitly link with dbus instead of dlopening it
265 "-dbus-linked"
7431edea
AE
266 ;; Skip the webkit module; it fails to build on armhf
267 ;; and, apart from that, may pose security risks.
268 "-no-webkit"
206a5208
AE
269 ;; drop special machine instructions not supported
270 ;; on all instances of the target
271 ,@(if (string-prefix? "x86_64"
272 (or (%current-target-system)
273 (%current-system)))
274 '()
275 '("-no-mmx"
1e9ed0e3
AE
276 "-no-3dnow"
277 "-no-sse"
206a5208
AE
278 "-no-sse2"))
279 "-no-sse3"
280 "-no-ssse3"
281 "-no-sse4.1"
282 "-no-sse4.2"
84811c22 283 "-no-avx")))))
4b0f2ef7
LC
284 (add-after
285 'install 'move-doc
286 (lambda* (#:key outputs #:allow-other-keys)
287 ;; Because of qt4-documentation-path.patch, documentation ends up
288 ;; being installed in OUT. Move it to the right place.
289 (let* ((out (assoc-ref outputs "out"))
290 (doc (assoc-ref outputs "doc"))
291 (olddoc (string-append out "/doc"))
292 (docdir (string-append doc "/share/doc/qt-" ,version)))
293 (mkdir-p (dirname docdir))
294
295 ;; Note: We can't use 'rename-file' here because OUT and DOC are
296 ;; different "devices" due to bind-mounts.
297 (copy-recursively olddoc docdir)
298 (delete-file-recursively olddoc)
299 #t))))))))
84ef83dd 300
7868000f
AE
301(define-public qtbase
302 (package
303 (name "qtbase")
aece7602 304 (version "5.6.1")
7868000f
AE
305 (source (origin
306 (method url-fetch)
307 (uri (string-append "https://download.qt.io/official_releases/qt/"
308 (version-major+minor version) "/" version
309 "/submodules/" name "-opensource-src-"
310 version ".tar.xz"))
311 (sha256
312 (base32
aece7602 313 "0r3jrqymnnxrig4f11xvs33c26f0kzfakbp3kcbdpv795gpc276h"))
7868000f
AE
314 (modules '((guix build utils)))
315 (snippet
316 '(begin
317 ;; Remove one of the two bundled harfbuzz copies in addition
318 ;; to passing "-system-harfbuzz".
319 (delete-file-recursively "src/3rdparty/harfbuzz-ng")
320 ;; Remove the bundled sqlite copy in addition to
321 ;; passing "-system-sqlite".
322 (delete-file-recursively "src/3rdparty/sqlite")))))
323 (build-system gnu-build-system)
324 (propagated-inputs
325 `(("mesa" ,mesa)))
326 (inputs
327 `(("alsa-lib" ,alsa-lib)
328 ("cups" ,cups)
329 ("dbus" ,dbus)
330 ("expat" ,expat)
331 ("fontconfig" ,fontconfig)
332 ("freetype" ,freetype)
333 ("glib" ,glib)
334 ("harfbuzz" ,harfbuzz)
335 ("icu4c" ,icu4c)
336 ("libjpeg" ,libjpeg)
337 ("libmng" ,libmng)
338 ("libpng" ,libpng)
339 ("libx11" ,libx11)
340 ("libxcomposite" ,libxcomposite)
341 ("libxcursor" ,libxcursor)
342 ("libxfixes" ,libxfixes)
343 ("libxi" ,libxi)
344 ("libxinerama" ,libxinerama)
345 ("libxkbcommon" ,libxkbcommon)
346 ("libxml2" ,libxml2)
347 ("libxrandr" ,libxrandr)
348 ("libxrender" ,libxrender)
349 ("libxslt" ,libxslt)
350 ("libxtst" ,libxtst)
351 ("mtdev" ,mtdev)
352 ("mysql" ,mysql)
353 ("nss" ,nss)
354 ("openssl" ,openssl)
355 ("pcre" ,pcre)
356 ("postgresql" ,postgresql)
357 ("pulseaudio" ,pulseaudio)
358 ("sqlite" ,sqlite)
359 ("unixodbc" ,unixodbc)
360 ("xcb-util" ,xcb-util)
361 ("xcb-util-image" ,xcb-util-image)
362 ("xcb-util-keysyms" ,xcb-util-keysyms)
363 ("xcb-util-renderutil" ,xcb-util-renderutil)
364 ("xcb-util-wm" ,xcb-util-wm)
365 ("zlib" ,zlib)))
366 (native-inputs
367 `(("bison" ,bison)
368 ("flex" ,flex)
369 ("gperf" ,gperf)
370 ("perl" ,perl)
371 ("pkg-config" ,pkg-config)
372 ("python" ,python-2)
373 ("ruby" ,ruby)
374 ("which" ,(@ (gnu packages base) which))))
375 (arguments
376 `(#:phases
377 (modify-phases %standard-phases
378 (add-after 'configure 'patch-bin-sh
379 (lambda _
380 (substitute* '("config.status"
381 "configure"
382 "mkspecs/features/qt_functions.prf"
383 "qmake/library/qmakebuiltins.cpp")
384 (("/bin/sh") (which "sh")))
385 #t))
386 (replace 'configure
387 (lambda* (#:key outputs #:allow-other-keys)
388 (let ((out (assoc-ref outputs "out")))
389 (substitute* "configure"
390 (("/bin/pwd") (which "pwd")))
391 (substitute* "src/corelib/global/global.pri"
392 (("/bin/ls") (which "ls")))
393 ;; do not pass "--enable-fast-install", which makes the
394 ;; configure process fail
395 (zero? (system*
396 "./configure"
397 "-verbose"
398 "-prefix" out
399 "-opensource"
400 "-confirm-license"
401 ;; Do not build examples; if desired, these could go
402 ;; into a separate output, but for the time being, we
403 ;; prefer to save the space and build time.
404 "-nomake" "examples"
405 ;; Most "-system-..." are automatic, but some use
406 ;; the bundled copy by default.
407 "-system-sqlite"
408 "-system-harfbuzz"
409 ;; explicitly link with openssl instead of dlopening it
410 "-openssl-linked"
411 ;; explicitly link with dbus instead of dlopening it
412 "-dbus-linked"
413 ;; drop special machine instructions not supported
414 ;; on all instances of the target
415 ,@(if (string-prefix? "x86_64"
416 (or (%current-target-system)
417 (%current-system)))
418 '()
419 '("-no-sse2"))
420 "-no-sse3"
421 "-no-ssse3"
422 "-no-sse4.1"
423 "-no-sse4.2"
424 "-no-avx"
425 "-no-avx2"
426 "-no-mips_dsp"
427 "-no-mips_dspr2"))))))))
428 (home-page "https://www.qt.io/")
429 (synopsis "Cross-platform GUI library")
430 (description "Qt is a cross-platform application and UI framework for
431developers using C++ or QML, a CSS & JavaScript like language.")
432 (license (list lgpl2.1 lgpl3))))
433
19c17631
EF
434(define-public qtsvg
435 (package (inherit qtbase)
436 (name "qtsvg")
437 (version "5.6.1")
438 (source (origin
439 (method url-fetch)
440 (uri (string-append "https://download.qt.io/official_releases/qt/"
441 (version-major+minor version) "/" version
442 "/submodules/" name "-opensource-src-"
443 version ".tar.xz"))
444 (sha256
445 (base32
446 "08ca5g46g75acy27jfnvnalmcias5hxmjp7491v3y4k9y7a4ybpi"))))
447 (propagated-inputs `())
448 (native-inputs `(("perl" ,perl)))
449 (inputs
450 `(("mesa" ,mesa)
451 ("qtbase" ,qtbase)
452 ("zlib" ,zlib)))
453 (arguments
454 `(#:phases
455 (modify-phases %standard-phases
456 (replace 'configure
457 (lambda* (#:key outputs #:allow-other-keys)
458 (let ((out (assoc-ref outputs "out")))
459 (zero? (system* "qmake" (string-append "PREFIX=" out))))))
460 (add-before 'install 'fix-Makefiles
461 (lambda* (#:key inputs outputs #:allow-other-keys)
462 (let ((out (assoc-ref outputs "out"))
463 (qtbase (assoc-ref inputs "qtbase")))
464 (substitute* (find-files "." "Makefile")
465 (((string-append "INSTALL_ROOT)" qtbase))
466 (string-append "INSTALL_ROOT)" out)))))))))))
467
9b694210
EF
468(define-public qtimageformats
469 (package (inherit qtsvg)
470 (name "qtimageformats")
471 (version "5.6.1")
472 (source (origin
473 (method url-fetch)
474 (uri (string-append "https://download.qt.io/official_releases/qt/"
475 (version-major+minor version) "/" version
476 "/submodules/" name "-opensource-src-"
477 version ".tar.xz"))
478 (sha256
479 (base32
480 "020v1148433zx4g87z2r8fgff32n0laajxqqsja1l3yzz7jbrwvl"))))
481 (native-inputs `())
482 (inputs
483 `(("libmng" ,libmng)
484 ("libtiff" ,libtiff)
485 ("libwebp" ,libwebp)
486 ("mesa" ,mesa)
487 ("qtbase" ,qtbase)
488 ("zlib" ,zlib)))))
489
f6c13613
EF
490(define-public qtx11extras
491 (package (inherit qtsvg)
492 (name "qtx11extras")
493 (version "5.6.1")
494 (source (origin
495 (method url-fetch)
496 (uri (string-append "https://download.qt.io/official_releases/qt/"
497 (version-major+minor version) "/" version
498 "/submodules/" name "-opensource-src-"
499 version ".tar.xz"))
500 (sha256
501 (base32
502 "0l736qiz8adrnh267xz63hv4sph6nhy90h836qfnnmv3p78ipsz8"))))
503 (native-inputs `(("perl" ,perl)))
504 (inputs
505 `(("mesa" ,mesa)
506 ("qtbase" ,qtbase)))))
507
98eec712
EF
508(define-public qtxmlpatterns
509 (package (inherit qtsvg)
510 (name "qtxmlpatterns")
511 (version "5.6.1")
512 (source (origin
513 (method url-fetch)
514 (uri (string-append "https://download.qt.io/official_releases/qt/"
515 (version-major+minor version) "/" version
516 "/submodules/" name "-opensource-src-"
517 version ".tar.xz"))
518 (sha256
519 (base32
520 "0q412jv3xbg7v05b8pbahifwx17gzlp96s90akh6zwhpm8i6xx34"))))
521 (native-inputs `(("perl" ,perl)))
522 (inputs `(("qtbase" ,qtbase)))))
523
dbbb45dd
AE
524(define-public qjson
525 (package
526 (name "qjson")
527 (version "0.8.1")
528 (source (origin
529 (method url-fetch)
530 (uri (string-append "https://github.com/flavio/qjson/archive/"
531 version ".tar.gz"))
532 (file-name (string-append name "-" version ".tar.gz"))
533 (sha256
534 (base32
535 "163fspi0xc705irv79qw861fmh68pjyla9vx3kqiq6xrdhb9834j"))))
536 (build-system cmake-build-system)
537 (inputs
538 `(("qt" ,qt-4)))
539 (arguments
540 `(#:tests? #f)) ; no test target
541 (home-page "http://qjson.sourceforge.net/")
542 (synopsis "Qt-based library for handling JSON")
543 (description "QJson is a Qt-based library that maps JSON data to QVariant
544objects and vice versa. JSON arrays are mapped to QVariantList instances,
545while JSON objects are mapped to QVariantMap.")
546 (license lgpl2.1+)))
547
84ef83dd
AE
548(define-public python-sip
549 (package
550 (name "python-sip")
8fa7f8d9 551 (version "4.18")
84ef83dd
AE
552 (source
553 (origin
554 (method url-fetch)
555 (uri
556 (string-append "mirror://sourceforge/pyqt/sip/"
8fa7f8d9 557 "sip-" version "/sip-" version ".tar.gz"))
84ef83dd
AE
558 (sha256
559 (base32
8fa7f8d9 560 "1dlw4kyiwd9bzmd1djm79c121r219abaz86lvizdk6ksq20mrp7i"))))
84ef83dd
AE
561 (build-system gnu-build-system)
562 (native-inputs
563 `(("python" ,python-wrapper)))
564 (arguments
565 `(#:tests? #f ; no check target
e8bdd73a
AE
566 #:modules ((srfi srfi-1)
567 ,@%gnu-build-system-modules)
84ef83dd 568 #:phases
39766868
EF
569 (modify-phases %standard-phases
570 (replace 'configure
571 (lambda* (#:key inputs outputs #:allow-other-keys)
572 (let* ((out (assoc-ref outputs "out"))
573 (bin (string-append out "/bin"))
574 (include (string-append out "/include"))
575 (python (assoc-ref inputs "python"))
576 (python-version
577 (last (string-split python #\-)))
578 (python-major+minor
579 (string-join
580 (take (string-split python-version #\.) 2)
581 "."))
582 (lib (string-append out "/lib/python"
583 python-major+minor
584 "/site-packages")))
585 (zero?
586 (system* "python" "configure.py"
587 "--bindir" bin
588 "--destdir" lib
589 "--incdir" include))))))))
590 (home-page "https://www.riverbankcomputing.com/software/sip/intro")
84ef83dd
AE
591 (synopsis "Python binding creator for C and C++ libraries")
592 (description
593 "SIP is a tool to create Python bindings for C and C++ libraries. It
594was originally developed to create PyQt, the Python bindings for the Qt
595toolkit, but can be used to create bindings for any C or C++ library.
596
597SIP comprises a code generator and a Python module. The code generator
598processes a set of specification files and generates C or C++ code, which
599is then compiled to create the bindings extension module. The SIP Python
600module provides support functions to the automatically generated code.")
601 ;; There is a choice between a python like license, gpl2 and gpl3.
602 ;; For compatibility with pyqt, we need gpl3.
603 (license gpl3)))
604
605(define-public python2-sip
606 (package (inherit python-sip)
607 (name "python2-sip")
608 (native-inputs
609 `(("python" ,python-2)))))
014e7dd8
AE
610
611(define-public python-pyqt
612 (package
613 (name "python-pyqt")
2be06813 614 (version "5.6")
014e7dd8
AE
615 (source
616 (origin
617 (method url-fetch)
618 (uri
619 (string-append "mirror://sourceforge/pyqt/PyQt5/"
2be06813 620 "PyQt-" version "/PyQt5_gpl-"
014e7dd8
AE
621 version ".tar.gz"))
622 (sha256
623 (base32
2be06813 624 "1qgh42zsr9jppl9k7fcdbhxcd1wrb7wyaj9lng9nxfa19in1lj1f"))
fc1adab1 625 (patches (search-patches "pyqt-configure.patch"))))
014e7dd8
AE
626 (build-system gnu-build-system)
627 (native-inputs
628 `(("python-sip" ,python-sip)
2be06813 629 ("qtbase" ,qtbase))) ; for qmake
014e7dd8
AE
630 (inputs
631 `(("python" ,python-wrapper)))
632 (arguments
e8bdd73a
AE
633 `(#:modules ((srfi srfi-1)
634 ,@%gnu-build-system-modules)
635 #:phases
eef988c8
EF
636 (modify-phases %standard-phases
637 (replace 'configure
638 (lambda* (#:key inputs outputs #:allow-other-keys)
639 (let* ((out (assoc-ref outputs "out"))
640 (bin (string-append out "/bin"))
641 (sip (string-append out "/share/sip"))
642 (plugins (string-append out "/plugins"))
643 (designer (string-append plugins "/designer"))
644 (qml (string-append plugins "/PyQt5"))
645 (python (assoc-ref inputs "python"))
646 (python-version
647 (last (string-split python #\-)))
648 (python-major+minor
649 (string-join
650 (take (string-split python-version #\.) 2)
651 "."))
652 (lib (string-append out "/lib/python"
653 python-major+minor
654 "/site-packages")))
655 (zero? (system* "python" "configure.py"
656 "--confirm-license"
657 "--bindir" bin
658 "--destdir" lib
659 "--designer-plugindir" designer
660 "--qml-plugindir" qml
661 "--sipdir" sip))))))))
662 (home-page "https://www.riverbankcomputing.com/software/pyqt/intro")
014e7dd8
AE
663 (synopsis "Python bindings for Qt")
664 (description
665 "PyQt is a set of Python v2 and v3 bindings for the Qt application
666framework. The bindings are implemented as a set of Python modules and
667contain over 620 classes.")
668 (license gpl3)))
669
670(define-public python2-pyqt
671 (package (inherit python-pyqt)
672 (name "python2-pyqt")
673 (native-inputs
674 `(("python-sip" ,python2-sip)
2be06813 675 ("qtbase" ,qtbase)))
014e7dd8
AE
676 (inputs
677 `(("python" ,python-2)))))
3e291958
AE
678
679(define-public python-pyqt-4
680 (package (inherit python-pyqt)
681 (name "python-pyqt")
99755491 682 (version "4.11.4")
3e291958
AE
683 (source
684 (origin
685 (method url-fetch)
686 (uri
687 (string-append "mirror://sourceforge/pyqt/PyQt4/"
688 "PyQt-" version "/PyQt-x11-gpl-"
689 version ".tar.gz"))
690 (sha256
691 (base32
99755491 692 "01zlviy5lq8g6db84wnvvpsrfnip9lbcpxagsyqa6as3jmsff7zw"))))
3e291958
AE
693 (native-inputs
694 `(("python-sip" ,python-sip)
695 ("qt" ,qt-4)))
696 (arguments
697 `(#:tests? #f ; no check target
e8bdd73a
AE
698 #:modules ((srfi srfi-1)
699 ,@%gnu-build-system-modules)
3e291958
AE
700 #:phases
701 (alist-replace
702 'configure
703 (lambda* (#:key inputs outputs #:allow-other-keys)
704 (let* ((out (assoc-ref outputs "out"))
705 (bin (string-append out "/bin"))
706 (sip (string-append out "/share/sip"))
e8bdd73a 707 (python (assoc-ref inputs "python"))
3e291958 708 (python-version
e8bdd73a
AE
709 (last (string-split python #\-)))
710 (python-major+minor
711 (string-join
712 (take (string-split python-version #\.) 2)
713 "."))
3e291958 714 (lib (string-append out "/lib/python"
e8bdd73a 715 python-major+minor
3e291958
AE
716 "/site-packages")))
717 (zero? (system* "python" "configure.py"
718 "--confirm-license"
719 "--bindir" bin
720 "--destdir" lib
721 "--sipdir" sip))))
722 %standard-phases)))
723 (license (list gpl2 gpl3)))) ; choice of either license
724
9e81af9e
EF
725(define-public qtkeychain
726 (package
727 (name "qtkeychain")
6e8dee98 728 (version "0.7.0")
9e81af9e
EF
729 (source
730 (origin
731 (method url-fetch)
732 (uri (string-append "https://github.com/frankosterfeld/qtkeychain/"
733 "archive/v" version ".tar.gz"))
734 (file-name (string-append name "-" version ".tar.gz"))
735 (sha256
6e8dee98 736 (base32 "0fka5q5cdzlf79igcjgbnb2smvwbwfasqawkzkbr34whispgm6lz"))))
9e81af9e
EF
737 (build-system cmake-build-system)
738 (inputs
b3546174 739 `(("qt" ,qt)))
9e81af9e
EF
740 (arguments
741 `(#:tests? #f ; No tests included
742 #:phases
743 (modify-phases %standard-phases
744 (add-before
745 'configure 'set-qt-trans-dir
746 (lambda _
747 (substitute* "CMakeLists.txt"
748 (("\\$\\{qt_translations_dir\\}")
749 "${CMAKE_INSTALL_PREFIX}/share/qt/translations")))))))
750 (home-page "https://github.com/frankosterfeld/qtkeychain")
751 (synopsis "Qt API to store passwords")
752 (description
753 "QtKeychain is a Qt library to store passwords and other secret data
754securely. It will not store any data unencrypted unless explicitly requested.")
755 (license bsd-3)))