gnu: Add qtx11extras.
[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
dbbb45dd
AE
508(define-public qjson
509 (package
510 (name "qjson")
511 (version "0.8.1")
512 (source (origin
513 (method url-fetch)
514 (uri (string-append "https://github.com/flavio/qjson/archive/"
515 version ".tar.gz"))
516 (file-name (string-append name "-" version ".tar.gz"))
517 (sha256
518 (base32
519 "163fspi0xc705irv79qw861fmh68pjyla9vx3kqiq6xrdhb9834j"))))
520 (build-system cmake-build-system)
521 (inputs
522 `(("qt" ,qt-4)))
523 (arguments
524 `(#:tests? #f)) ; no test target
525 (home-page "http://qjson.sourceforge.net/")
526 (synopsis "Qt-based library for handling JSON")
527 (description "QJson is a Qt-based library that maps JSON data to QVariant
528objects and vice versa. JSON arrays are mapped to QVariantList instances,
529while JSON objects are mapped to QVariantMap.")
530 (license lgpl2.1+)))
531
84ef83dd
AE
532(define-public python-sip
533 (package
534 (name "python-sip")
8fa7f8d9 535 (version "4.18")
84ef83dd
AE
536 (source
537 (origin
538 (method url-fetch)
539 (uri
540 (string-append "mirror://sourceforge/pyqt/sip/"
8fa7f8d9 541 "sip-" version "/sip-" version ".tar.gz"))
84ef83dd
AE
542 (sha256
543 (base32
8fa7f8d9 544 "1dlw4kyiwd9bzmd1djm79c121r219abaz86lvizdk6ksq20mrp7i"))))
84ef83dd
AE
545 (build-system gnu-build-system)
546 (native-inputs
547 `(("python" ,python-wrapper)))
548 (arguments
549 `(#:tests? #f ; no check target
e8bdd73a
AE
550 #:modules ((srfi srfi-1)
551 ,@%gnu-build-system-modules)
84ef83dd 552 #:phases
39766868
EF
553 (modify-phases %standard-phases
554 (replace 'configure
555 (lambda* (#:key inputs outputs #:allow-other-keys)
556 (let* ((out (assoc-ref outputs "out"))
557 (bin (string-append out "/bin"))
558 (include (string-append out "/include"))
559 (python (assoc-ref inputs "python"))
560 (python-version
561 (last (string-split python #\-)))
562 (python-major+minor
563 (string-join
564 (take (string-split python-version #\.) 2)
565 "."))
566 (lib (string-append out "/lib/python"
567 python-major+minor
568 "/site-packages")))
569 (zero?
570 (system* "python" "configure.py"
571 "--bindir" bin
572 "--destdir" lib
573 "--incdir" include))))))))
574 (home-page "https://www.riverbankcomputing.com/software/sip/intro")
84ef83dd
AE
575 (synopsis "Python binding creator for C and C++ libraries")
576 (description
577 "SIP is a tool to create Python bindings for C and C++ libraries. It
578was originally developed to create PyQt, the Python bindings for the Qt
579toolkit, but can be used to create bindings for any C or C++ library.
580
581SIP comprises a code generator and a Python module. The code generator
582processes a set of specification files and generates C or C++ code, which
583is then compiled to create the bindings extension module. The SIP Python
584module provides support functions to the automatically generated code.")
585 ;; There is a choice between a python like license, gpl2 and gpl3.
586 ;; For compatibility with pyqt, we need gpl3.
587 (license gpl3)))
588
589(define-public python2-sip
590 (package (inherit python-sip)
591 (name "python2-sip")
592 (native-inputs
593 `(("python" ,python-2)))))
014e7dd8
AE
594
595(define-public python-pyqt
596 (package
597 (name "python-pyqt")
2be06813 598 (version "5.6")
014e7dd8
AE
599 (source
600 (origin
601 (method url-fetch)
602 (uri
603 (string-append "mirror://sourceforge/pyqt/PyQt5/"
2be06813 604 "PyQt-" version "/PyQt5_gpl-"
014e7dd8
AE
605 version ".tar.gz"))
606 (sha256
607 (base32
2be06813 608 "1qgh42zsr9jppl9k7fcdbhxcd1wrb7wyaj9lng9nxfa19in1lj1f"))
fc1adab1 609 (patches (search-patches "pyqt-configure.patch"))))
014e7dd8
AE
610 (build-system gnu-build-system)
611 (native-inputs
612 `(("python-sip" ,python-sip)
2be06813 613 ("qtbase" ,qtbase))) ; for qmake
014e7dd8
AE
614 (inputs
615 `(("python" ,python-wrapper)))
616 (arguments
e8bdd73a
AE
617 `(#:modules ((srfi srfi-1)
618 ,@%gnu-build-system-modules)
619 #:phases
eef988c8
EF
620 (modify-phases %standard-phases
621 (replace 'configure
622 (lambda* (#:key inputs outputs #:allow-other-keys)
623 (let* ((out (assoc-ref outputs "out"))
624 (bin (string-append out "/bin"))
625 (sip (string-append out "/share/sip"))
626 (plugins (string-append out "/plugins"))
627 (designer (string-append plugins "/designer"))
628 (qml (string-append plugins "/PyQt5"))
629 (python (assoc-ref inputs "python"))
630 (python-version
631 (last (string-split python #\-)))
632 (python-major+minor
633 (string-join
634 (take (string-split python-version #\.) 2)
635 "."))
636 (lib (string-append out "/lib/python"
637 python-major+minor
638 "/site-packages")))
639 (zero? (system* "python" "configure.py"
640 "--confirm-license"
641 "--bindir" bin
642 "--destdir" lib
643 "--designer-plugindir" designer
644 "--qml-plugindir" qml
645 "--sipdir" sip))))))))
646 (home-page "https://www.riverbankcomputing.com/software/pyqt/intro")
014e7dd8
AE
647 (synopsis "Python bindings for Qt")
648 (description
649 "PyQt is a set of Python v2 and v3 bindings for the Qt application
650framework. The bindings are implemented as a set of Python modules and
651contain over 620 classes.")
652 (license gpl3)))
653
654(define-public python2-pyqt
655 (package (inherit python-pyqt)
656 (name "python2-pyqt")
657 (native-inputs
658 `(("python-sip" ,python2-sip)
2be06813 659 ("qtbase" ,qtbase)))
014e7dd8
AE
660 (inputs
661 `(("python" ,python-2)))))
3e291958
AE
662
663(define-public python-pyqt-4
664 (package (inherit python-pyqt)
665 (name "python-pyqt")
99755491 666 (version "4.11.4")
3e291958
AE
667 (source
668 (origin
669 (method url-fetch)
670 (uri
671 (string-append "mirror://sourceforge/pyqt/PyQt4/"
672 "PyQt-" version "/PyQt-x11-gpl-"
673 version ".tar.gz"))
674 (sha256
675 (base32
99755491 676 "01zlviy5lq8g6db84wnvvpsrfnip9lbcpxagsyqa6as3jmsff7zw"))))
3e291958
AE
677 (native-inputs
678 `(("python-sip" ,python-sip)
679 ("qt" ,qt-4)))
680 (arguments
681 `(#:tests? #f ; no check target
e8bdd73a
AE
682 #:modules ((srfi srfi-1)
683 ,@%gnu-build-system-modules)
3e291958
AE
684 #:phases
685 (alist-replace
686 'configure
687 (lambda* (#:key inputs outputs #:allow-other-keys)
688 (let* ((out (assoc-ref outputs "out"))
689 (bin (string-append out "/bin"))
690 (sip (string-append out "/share/sip"))
e8bdd73a 691 (python (assoc-ref inputs "python"))
3e291958 692 (python-version
e8bdd73a
AE
693 (last (string-split python #\-)))
694 (python-major+minor
695 (string-join
696 (take (string-split python-version #\.) 2)
697 "."))
3e291958 698 (lib (string-append out "/lib/python"
e8bdd73a 699 python-major+minor
3e291958
AE
700 "/site-packages")))
701 (zero? (system* "python" "configure.py"
702 "--confirm-license"
703 "--bindir" bin
704 "--destdir" lib
705 "--sipdir" sip))))
706 %standard-phases)))
707 (license (list gpl2 gpl3)))) ; choice of either license
708
9e81af9e
EF
709(define-public qtkeychain
710 (package
711 (name "qtkeychain")
6e8dee98 712 (version "0.7.0")
9e81af9e
EF
713 (source
714 (origin
715 (method url-fetch)
716 (uri (string-append "https://github.com/frankosterfeld/qtkeychain/"
717 "archive/v" version ".tar.gz"))
718 (file-name (string-append name "-" version ".tar.gz"))
719 (sha256
6e8dee98 720 (base32 "0fka5q5cdzlf79igcjgbnb2smvwbwfasqawkzkbr34whispgm6lz"))))
9e81af9e
EF
721 (build-system cmake-build-system)
722 (inputs
b3546174 723 `(("qt" ,qt)))
9e81af9e
EF
724 (arguments
725 `(#:tests? #f ; No tests included
726 #:phases
727 (modify-phases %standard-phases
728 (add-before
729 'configure 'set-qt-trans-dir
730 (lambda _
731 (substitute* "CMakeLists.txt"
732 (("\\$\\{qt_translations_dir\\}")
733 "${CMAKE_INSTALL_PREFIX}/share/qt/translations")))))))
734 (home-page "https://github.com/frankosterfeld/qtkeychain")
735 (synopsis "Qt API to store passwords")
736 (description
737 "QtKeychain is a Qt library to store passwords and other secret data
738securely. It will not store any data unencrypted unless explicitly requested.")
739 (license bsd-3)))