gnu: python-sip: Use 'modify-phases'.
[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")
304 (version "5.6.0")
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
313 "0ynnvcs5idivzldsq5ciqg9myg82b3l3906l4vjv54lyamf8mykf"))
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
dbbb45dd
AE
434(define-public qjson
435 (package
436 (name "qjson")
437 (version "0.8.1")
438 (source (origin
439 (method url-fetch)
440 (uri (string-append "https://github.com/flavio/qjson/archive/"
441 version ".tar.gz"))
442 (file-name (string-append name "-" version ".tar.gz"))
443 (sha256
444 (base32
445 "163fspi0xc705irv79qw861fmh68pjyla9vx3kqiq6xrdhb9834j"))))
446 (build-system cmake-build-system)
447 (inputs
448 `(("qt" ,qt-4)))
449 (arguments
450 `(#:tests? #f)) ; no test target
451 (home-page "http://qjson.sourceforge.net/")
452 (synopsis "Qt-based library for handling JSON")
453 (description "QJson is a Qt-based library that maps JSON data to QVariant
454objects and vice versa. JSON arrays are mapped to QVariantList instances,
455while JSON objects are mapped to QVariantMap.")
456 (license lgpl2.1+)))
457
84ef83dd
AE
458(define-public python-sip
459 (package
460 (name "python-sip")
8fa7f8d9 461 (version "4.18")
84ef83dd
AE
462 (source
463 (origin
464 (method url-fetch)
465 (uri
466 (string-append "mirror://sourceforge/pyqt/sip/"
8fa7f8d9 467 "sip-" version "/sip-" version ".tar.gz"))
84ef83dd
AE
468 (sha256
469 (base32
8fa7f8d9 470 "1dlw4kyiwd9bzmd1djm79c121r219abaz86lvizdk6ksq20mrp7i"))))
84ef83dd
AE
471 (build-system gnu-build-system)
472 (native-inputs
473 `(("python" ,python-wrapper)))
474 (arguments
475 `(#:tests? #f ; no check target
e8bdd73a
AE
476 #:modules ((srfi srfi-1)
477 ,@%gnu-build-system-modules)
84ef83dd 478 #:phases
39766868
EF
479 (modify-phases %standard-phases
480 (replace 'configure
481 (lambda* (#:key inputs outputs #:allow-other-keys)
482 (let* ((out (assoc-ref outputs "out"))
483 (bin (string-append out "/bin"))
484 (include (string-append out "/include"))
485 (python (assoc-ref inputs "python"))
486 (python-version
487 (last (string-split python #\-)))
488 (python-major+minor
489 (string-join
490 (take (string-split python-version #\.) 2)
491 "."))
492 (lib (string-append out "/lib/python"
493 python-major+minor
494 "/site-packages")))
495 (zero?
496 (system* "python" "configure.py"
497 "--bindir" bin
498 "--destdir" lib
499 "--incdir" include))))))))
500 (home-page "https://www.riverbankcomputing.com/software/sip/intro")
84ef83dd
AE
501 (synopsis "Python binding creator for C and C++ libraries")
502 (description
503 "SIP is a tool to create Python bindings for C and C++ libraries. It
504was originally developed to create PyQt, the Python bindings for the Qt
505toolkit, but can be used to create bindings for any C or C++ library.
506
507SIP comprises a code generator and a Python module. The code generator
508processes a set of specification files and generates C or C++ code, which
509is then compiled to create the bindings extension module. The SIP Python
510module provides support functions to the automatically generated code.")
511 ;; There is a choice between a python like license, gpl2 and gpl3.
512 ;; For compatibility with pyqt, we need gpl3.
513 (license gpl3)))
514
515(define-public python2-sip
516 (package (inherit python-sip)
517 (name "python2-sip")
518 (native-inputs
519 `(("python" ,python-2)))))
014e7dd8
AE
520
521(define-public python-pyqt
522 (package
523 (name "python-pyqt")
0c84e33e 524 (version "5.5")
014e7dd8
AE
525 (source
526 (origin
527 (method url-fetch)
528 (uri
529 (string-append "mirror://sourceforge/pyqt/PyQt5/"
530 "PyQt-" version "/PyQt-gpl-"
531 version ".tar.gz"))
532 (sha256
533 (base32
0c84e33e 534 "056qmkv02wdcfblqdaxiswrgn4wa88sz22i1x58dpb1iniavplfd"))
fc1adab1 535 (patches (search-patches "pyqt-configure.patch"))))
014e7dd8
AE
536 (build-system gnu-build-system)
537 (native-inputs
538 `(("python-sip" ,python-sip)
539 ("qt" ,qt))) ; for qmake
540 (inputs
541 `(("python" ,python-wrapper)))
542 (arguments
e8bdd73a
AE
543 `(#:modules ((srfi srfi-1)
544 ,@%gnu-build-system-modules)
545 #:phases
014e7dd8
AE
546 (alist-replace
547 'configure
548 (lambda* (#:key inputs outputs #:allow-other-keys)
549 (let* ((out (assoc-ref outputs "out"))
550 (bin (string-append out "/bin"))
551 (sip (string-append out "/share/sip"))
552 (plugins (string-append out "/plugins"))
553 (designer (string-append plugins "/designer"))
554 (qml (string-append plugins "/PyQt5"))
e8bdd73a 555 (python (assoc-ref inputs "python"))
014e7dd8 556 (python-version
e8bdd73a
AE
557 (last (string-split python #\-)))
558 (python-major+minor
559 (string-join
560 (take (string-split python-version #\.) 2)
561 "."))
014e7dd8 562 (lib (string-append out "/lib/python"
e8bdd73a 563 python-major+minor
014e7dd8
AE
564 "/site-packages")))
565 (zero? (system* "python" "configure.py"
566 "--confirm-license"
567 "--bindir" bin
568 "--destdir" lib
569 "--designer-plugindir" designer
570 "--qml-plugindir" qml
571 "--sipdir" sip))))
572 %standard-phases)))
573 (home-page "http://www.riverbankcomputing.com/software/pyqt/intro")
574 (synopsis "Python bindings for Qt")
575 (description
576 "PyQt is a set of Python v2 and v3 bindings for the Qt application
577framework. The bindings are implemented as a set of Python modules and
578contain over 620 classes.")
579 (license gpl3)))
580
581(define-public python2-pyqt
582 (package (inherit python-pyqt)
583 (name "python2-pyqt")
584 (native-inputs
585 `(("python-sip" ,python2-sip)
586 ("qt" ,qt)))
587 (inputs
588 `(("python" ,python-2)))))
3e291958
AE
589
590(define-public python-pyqt-4
591 (package (inherit python-pyqt)
592 (name "python-pyqt")
99755491 593 (version "4.11.4")
3e291958
AE
594 (source
595 (origin
596 (method url-fetch)
597 (uri
598 (string-append "mirror://sourceforge/pyqt/PyQt4/"
599 "PyQt-" version "/PyQt-x11-gpl-"
600 version ".tar.gz"))
601 (sha256
602 (base32
99755491 603 "01zlviy5lq8g6db84wnvvpsrfnip9lbcpxagsyqa6as3jmsff7zw"))))
3e291958
AE
604 (native-inputs
605 `(("python-sip" ,python-sip)
606 ("qt" ,qt-4)))
607 (arguments
608 `(#:tests? #f ; no check target
e8bdd73a
AE
609 #:modules ((srfi srfi-1)
610 ,@%gnu-build-system-modules)
3e291958
AE
611 #:phases
612 (alist-replace
613 'configure
614 (lambda* (#:key inputs outputs #:allow-other-keys)
615 (let* ((out (assoc-ref outputs "out"))
616 (bin (string-append out "/bin"))
617 (sip (string-append out "/share/sip"))
e8bdd73a 618 (python (assoc-ref inputs "python"))
3e291958 619 (python-version
e8bdd73a
AE
620 (last (string-split python #\-)))
621 (python-major+minor
622 (string-join
623 (take (string-split python-version #\.) 2)
624 "."))
3e291958 625 (lib (string-append out "/lib/python"
e8bdd73a 626 python-major+minor
3e291958
AE
627 "/site-packages")))
628 (zero? (system* "python" "configure.py"
629 "--confirm-license"
630 "--bindir" bin
631 "--destdir" lib
632 "--sipdir" sip))))
633 %standard-phases)))
634 (license (list gpl2 gpl3)))) ; choice of either license
635
9e81af9e
EF
636(define-public qtkeychain
637 (package
638 (name "qtkeychain")
65e46ca0 639 (version "0.6.2")
9e81af9e
EF
640 (source
641 (origin
642 (method url-fetch)
643 (uri (string-append "https://github.com/frankosterfeld/qtkeychain/"
644 "archive/v" version ".tar.gz"))
645 (file-name (string-append name "-" version ".tar.gz"))
646 (sha256
65e46ca0 647 (base32 "0g76pa786mg0fxy52hrljw09dvi6kffk2ms42lxapvpy6j94a4xf"))))
9e81af9e
EF
648 (build-system cmake-build-system)
649 (inputs
b3546174 650 `(("qt" ,qt)))
9e81af9e
EF
651 (arguments
652 `(#:tests? #f ; No tests included
653 #:phases
654 (modify-phases %standard-phases
655 (add-before
656 'configure 'set-qt-trans-dir
657 (lambda _
658 (substitute* "CMakeLists.txt"
659 (("\\$\\{qt_translations_dir\\}")
660 "${CMAKE_INSTALL_PREFIX}/share/qt/translations")))))))
661 (home-page "https://github.com/frankosterfeld/qtkeychain")
662 (synopsis "Qt API to store passwords")
663 (description
664 "QtKeychain is a Qt library to store passwords and other secret data
665securely. It will not store any data unencrypted unless explicitly requested.")
666 (license bsd-3)))