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