Commit | Line | Data |
---|---|---|
927b6728 TUBK |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> | |
0aa0e1f8 | 3 | ;;; Copyright © 2016, 2018, 2020 Ricardo Wurmus <rekado@elephly.net> |
d109b1e8 | 4 | ;;; Copyright © 2016 Theodoros Foradis <theodoros@foradis.org> |
b353c7d2 | 5 | ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org> |
40c611a4 | 6 | ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org> |
59898500 | 7 | ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il> |
1d5b3f43 | 8 | ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be> |
94820083 | 9 | ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
2c0552cf | 10 | ;;; Copyright © 2019 Arun Isaac <arunisaac@systemreboot.net> |
927b6728 TUBK |
11 | ;;; |
12 | ;;; This file is part of GNU Guix. | |
13 | ;;; | |
14 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
15 | ;;; under the terms of the GNU General Public License as published by | |
16 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
17 | ;;; your option) any later version. | |
18 | ;;; | |
19 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
20 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 | ;;; GNU General Public License for more details. | |
23 | ;;; | |
24 | ;;; You should have received a copy of the GNU General Public License | |
25 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
26 | ||
27 | (define-module (gnu packages wxwidgets) | |
28 | #:use-module (guix packages) | |
29 | #:use-module (guix download) | |
3962a046 | 30 | #:use-module (guix git-download) |
927b6728 TUBK |
31 | #:use-module ((guix licenses) #:prefix l:) |
32 | #:use-module (guix build-system glib-or-gtk) | |
b353c7d2 | 33 | #:use-module (guix build-system python) |
1d5b3f43 | 34 | #:use-module (guix utils) |
927b6728 TUBK |
35 | #:use-module (gnu packages) |
36 | #:use-module (gnu packages compression) | |
37 | #:use-module (gnu packages databases) | |
94820083 | 38 | #:use-module (gnu packages freedesktop) |
927b6728 | 39 | #:use-module (gnu packages gl) |
93d9737d | 40 | #:use-module (gnu packages gnome) |
927b6728 TUBK |
41 | #:use-module (gnu packages gstreamer) |
42 | #:use-module (gnu packages gtk) | |
43 | #:use-module (gnu packages image) | |
a689185d TD |
44 | #:use-module (gnu packages photo) |
45 | #:use-module (gnu packages video) | |
927b6728 | 46 | #:use-module (gnu packages pkg-config) |
b353c7d2 | 47 | #:use-module (gnu packages python) |
2c0552cf | 48 | #:use-module (gnu packages python-xyz) |
927b6728 | 49 | #:use-module (gnu packages sdl) |
fc7c74e4 | 50 | #:use-module (gnu packages webkit) |
6fd5a80d LC |
51 | #:use-module (gnu packages xorg) |
52 | #:use-module ((srfi srfi-1) #:select (alist-delete))) | |
927b6728 TUBK |
53 | |
54 | (define-public wxwidgets | |
55 | (package | |
56 | (name "wxwidgets") | |
3cfbeebb | 57 | (version "3.0.5.1") |
927b6728 TUBK |
58 | (source |
59 | (origin | |
60 | (method url-fetch) | |
8ebdf9af AE |
61 | (uri (string-append "https://github.com/wxWidgets/wxWidgets/" |
62 | "releases/download/v" version | |
927b6728 TUBK |
63 | "/wxWidgets-" version ".tar.bz2")) |
64 | (sha256 | |
3cfbeebb | 65 | (base32 "01y89999jw5q7njrhxajincx7lydls6yq37ikazjryssrxrnw3s4")))) |
927b6728 | 66 | (build-system glib-or-gtk-build-system) |
927b6728 TUBK |
67 | (inputs |
68 | `(("glu" ,glu) | |
69 | ;; XXX gstreamer-0.10 builds fail | |
70 | ;; ("gstreamer" ,gstreamer-0.10) | |
71 | ("gtk" ,gtk+) | |
4bd428a7 | 72 | ("libjpeg" ,libjpeg-turbo) |
927b6728 TUBK |
73 | ("libmspack" ,libmspack) |
74 | ("libsm" ,libsm) | |
75 | ("libtiff" ,libtiff) | |
76 | ("mesa" ,mesa) | |
afb7cd8e | 77 | ("webkitgtk" ,webkitgtk) |
94820083 | 78 | ("sdl" ,sdl) |
93d9737d | 79 | ("shared-mime-info" ,shared-mime-info) |
94820083 | 80 | ("xdg-utils" ,xdg-utils))) |
927b6728 TUBK |
81 | (native-inputs |
82 | `(("pkg-config" ,pkg-config))) | |
83 | (arguments | |
59898500 | 84 | `(#:configure-flags |
b37b854e | 85 | '("--with-regex" "--with-libmspack" |
fc7c74e4 RW |
86 | "--with-sdl" |
87 | "--enable-webview" | |
88 | "--enable-webkit" | |
59898500 EF |
89 | "--enable-webviewwebkit" |
90 | ,@(if (string=? "aarch64-linux" | |
91 | (%current-system)) | |
92 | '("--build=aarch64-unknown-linux-gnu") | |
93 | '())) | |
a0a0b716 TUBK |
94 | #:make-flags |
95 | (list (string-append "LDFLAGS=-Wl,-rpath=" | |
96 | (assoc-ref %outputs "out") "/lib")) | |
927b6728 | 97 | ;; No 'check' target. |
94820083 TGR |
98 | #:tests? #f |
99 | #:phases | |
100 | (modify-phases %standard-phases | |
101 | (add-after 'unpack 'refer-to-inputs | |
93d9737d KK |
102 | (lambda* (#:key inputs #:allow-other-keys) |
103 | (let* ((mime (string-append (assoc-ref inputs "shared-mime-info") | |
104 | "/share/mime"))) | |
105 | (substitute* "src/unix/utilsx11.cpp" | |
106 | (("wxExecute\\(xdg_open \\+") | |
107 | (string-append "wxExecute(\"" (which "xdg-open") "\""))) | |
108 | (substitute* "src/unix/mimetype.cpp" | |
109 | (("/usr(/local)?/share/mime") mime)) | |
110 | #t)))))) | |
927b6728 TUBK |
111 | (home-page "https://www.wxwidgets.org/") |
112 | (synopsis "Widget toolkit for creating graphical user interfaces") | |
113 | (description | |
114 | "wxWidgets is a C++ library that lets developers create applications with | |
115 | a graphical user interface. It has language bindings for Python, Perl, Ruby | |
116 | and many other languages.") | |
117 | (license (list l:lgpl2.0+ (l:fsf-free "file://doc/license.txt"))))) | |
118 | ||
1aef4222 BH |
119 | (define-public wxwidgets-2 |
120 | (package | |
121 | (inherit wxwidgets) | |
122 | (version "2.8.12") | |
123 | (source | |
124 | (origin | |
125 | (method url-fetch) | |
126 | (uri (string-append "https://github.com/wxWidgets/wxWidgets/" | |
127 | "releases/download/v" version | |
128 | "/wxGTK-" version ".tar.gz")) | |
129 | (sha256 | |
130 | (base32 "1gjs9vfga60mk4j4ngiwsk9h6c7j22pw26m3asxr1jwvqbr8kkqk")))) | |
131 | (inputs | |
132 | `(("gtk" ,gtk+-2) | |
4bd428a7 | 133 | ("libjpeg" ,libjpeg-turbo) |
1aef4222 BH |
134 | ("libtiff" ,libtiff) |
135 | ("libmspack" ,libmspack) | |
136 | ("sdl" ,sdl) | |
137 | ("unixodbc" ,unixodbc))) | |
138 | (arguments | |
139 | `(#:configure-flags | |
140 | '("--enable-unicode" "--with-regex=sys" "--with-sdl") | |
141 | #:make-flags | |
142 | (list (string-append "LDFLAGS=-Wl,-rpath=" | |
143 | (assoc-ref %outputs "out") "/lib")) | |
144 | ;; No 'check' target. | |
0aa0e1f8 RW |
145 | #:tests? #f |
146 | #:phases | |
147 | (modify-phases %standard-phases | |
148 | (add-after 'unpack 'ignore-narrowing-errors | |
149 | (lambda _ | |
150 | (substitute* "configure" | |
151 | (("-Wall") "-Wall -Wno-narrowing")) | |
152 | #t))))))) | |
1aef4222 | 153 | |
2cd3b6fd | 154 | (define-public wxwidgets-gtk2 |
1a265842 | 155 | (package/inherit wxwidgets |
2cd3b6fd TF |
156 | (inputs `(("gtk+" ,gtk+-2) |
157 | ,@(alist-delete | |
158 | "gtk+" | |
159 | (package-inputs wxwidgets)))) | |
160 | (name "wxwidgets-gtk2"))) | |
b353c7d2 | 161 | |
1d5b3f43 TD |
162 | ;; Development version of wxWidgets, required to build against gstreamer-1.x. |
163 | ;; This can be removed when wxWidgets is updated to the next stable version. | |
164 | (define-public wxwidgets-3.1 | |
165 | (package (inherit wxwidgets) | |
166 | (version "3.1.0") | |
167 | (source | |
168 | (origin | |
3962a046 RW |
169 | (method git-fetch) |
170 | (uri (git-reference | |
b0e7b699 | 171 | (url "https://github.com/wxWidgets/wxWidgets") |
3962a046 RW |
172 | (commit (string-append "v" version)))) |
173 | (file-name (git-file-name "wxwidgets" version)) | |
1d5b3f43 | 174 | (sha256 |
3962a046 RW |
175 | (base32 |
176 | "14kl1rsngm70v3mbyv1mal15iz2b18k97avjx8jn7s81znha1c7f")))) | |
1d5b3f43 TD |
177 | (inputs `(("gstreamer" ,gstreamer) |
178 | ("gst-plugins-base" ,gst-plugins-base) | |
179 | ,@(package-inputs wxwidgets))) | |
180 | (arguments | |
181 | (substitute-keyword-arguments (package-arguments wxwidgets) | |
182 | ((#:configure-flags flags) | |
183 | `(cons "--enable-mediactrl" ,flags)))))) | |
184 | ||
3fd2ecb3 | 185 | (define-public wxwidgets-gtk2-3.1 |
1a265842 | 186 | (package/inherit wxwidgets-3.1 |
3fd2ecb3 DT |
187 | (inputs `(("gtk+" ,gtk+-2) |
188 | ,@(alist-delete | |
189 | "gtk+" | |
190 | (package-inputs wxwidgets-3.1)))) | |
191 | (name "wxwidgets-gtk2"))) | |
192 | ||
2c0552cf AI |
193 | (define-public python-wxpython |
194 | (package | |
195 | (name "python-wxpython") | |
196 | (version "4.0.7.post1") | |
197 | (source | |
198 | (origin | |
199 | (method url-fetch) | |
200 | (uri (pypi-uri "wxPython" version)) | |
201 | (sha256 | |
202 | (base32 | |
203 | "1jppcr3n428m8pgwb9q3g0iiqydxd451ncri4njk8b53xsiflhys")) | |
204 | (modules '((guix build utils))) | |
205 | (snippet | |
206 | '(begin | |
207 | ;; Remove bundled wxwidgets | |
208 | (delete-file-recursively "ext/wxWidgets") | |
209 | #t)))) | |
210 | (build-system python-build-system) | |
211 | (arguments | |
212 | `(#:phases | |
213 | (modify-phases %standard-phases | |
214 | (add-before 'build 'configure | |
215 | (lambda* (#:key inputs #:allow-other-keys) | |
216 | (setenv "WXWIN" (assoc-ref inputs "wxwidgets")) | |
217 | ;; Copy the waf executable to the source directory since it needs | |
218 | ;; to be in a writable directory. | |
219 | (copy-file (string-append (assoc-ref inputs "python-waf") "/bin/waf") | |
220 | "bin/waf") | |
221 | (setenv "WAF" "bin/waf") | |
222 | ;; The build script tries to copy license files from the | |
223 | ;; wxwidgets source tree. Prevent it. | |
224 | (substitute* "wscript" | |
225 | (("updateLicenseFiles\\(cfg\\)" all) | |
226 | (string-append "#" all))) | |
227 | ;; The build script tries to write to demo/version.py. So, we set | |
228 | ;; correct write permissions. | |
229 | (chmod "demo/version.py" #o644) | |
230 | ;; Build only the python bindings, not wxwidgets also. | |
231 | (substitute* "setup.py" | |
232 | (("'build']") "'build_py', '--use_syswx']")) | |
233 | #t))))) | |
234 | (inputs | |
235 | `(("gtk+" ,gtk+) | |
236 | ("wxwidgets" ,wxwidgets))) | |
237 | (native-inputs | |
238 | `(("pkg-config" ,pkg-config) | |
239 | ("python-waf" ,python-waf))) | |
240 | (propagated-inputs | |
241 | `(("python-numpy" ,python-numpy) | |
242 | ("python-pillow" ,python-pillow) | |
243 | ("python-six" ,python-six))) | |
2bc8143f | 244 | (home-page "https://wxpython.org/") |
2c0552cf AI |
245 | (synopsis "Cross platform GUI toolkit for Python") |
246 | (description "wxPython is a cross-platform GUI toolkit for the Python | |
247 | programming language. It is implemented as a set of Python extension modules | |
248 | that wrap the GUI components of the popular wxWidgets cross platform C++ | |
249 | library. In most cases, wxPython uses the native widgets on each platform to | |
250 | provide a 100% native look and feel for the application.") | |
251 | (license l:wxwindows3.1+))) | |
252 | ||
b353c7d2 TF |
253 | (define-public python2-wxpython |
254 | (package | |
255 | (name "python2-wxpython") | |
256 | (version "3.0.2.0") | |
257 | (source | |
258 | (origin | |
259 | (method url-fetch) | |
260 | (uri (string-append "mirror://sourceforge/wxpython/wxPython/" | |
261 | version "/wxPython-src-" version ".tar.bz2")) | |
262 | (sha256 | |
263 | (base32 | |
264 | "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm")) | |
265 | (modules '((guix build utils))) | |
266 | (snippet | |
267 | '(begin | |
268 | (lambda (folder) | |
269 | (delete-file-recursively (string-append "src/" folder)) | |
270 | '("expat" "jpeg" "png" "tiff" "zlib" "msw" "osx" "msdos")) | |
271 | (substitute* '("wxPython/setup.py") | |
272 | ;; setup.py tries to keep its own license the same as wxwidget's | |
273 | ;; license (which it expects under $WXWIN/docs). | |
274 | (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'") | |
6cbee49d MW |
275 | "")) |
276 | #t)))) | |
b353c7d2 TF |
277 | (build-system python-build-system) |
278 | (arguments | |
279 | `(#:python ,python-2 | |
280 | #:tests? #f ; tests fail | |
6f1dcafd HG |
281 | ;; wxPython directly extends distutils command classes, |
282 | ;; we can't easily make setup.py use setuptools. | |
283 | #:use-setuptools? #f | |
b353c7d2 TF |
284 | #:configure-flags (list "WXPORT=gtk2" |
285 | "UNICODE=1") | |
286 | #:phases | |
287 | (modify-phases %standard-phases | |
288 | (add-before 'build 'chdir | |
289 | (lambda _ | |
290 | (chdir "wxPython") | |
291 | #t)) | |
292 | (add-after 'chdir 'set-wx-out-dir | |
293 | (lambda* (#:key outputs #:allow-other-keys) | |
294 | ;; By default, install phase tries to copy the wxPython headers in | |
295 | ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are | |
296 | ;; redirected to the output directory by setting WXPREFIX. | |
297 | (substitute* "config.py" | |
298 | (("= getWxConfigValue\\('--prefix'\\)") | |
299 | (string-append "= '" (assoc-ref outputs "out") "'"))) | |
300 | (substitute* "wx/build/config.py" | |
301 | (("= getWxConfigValue\\('--prefix'\\)") | |
302 | (string-append "= '" (assoc-ref outputs "out") "'"))) | |
303 | #t)) | |
304 | (add-after 'set-wx-out-dir 'setenv | |
305 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
306 | (setenv "WXWIN" (assoc-ref inputs "wxwidgets")) | |
307 | (use-modules (ice-9 popen) (ice-9 rdelim)) | |
308 | (let ((port (open-pipe* OPEN_READ | |
309 | (string-append (assoc-ref inputs "wxwidgets") | |
310 | "/bin/wx-config") "--cppflags"))) | |
311 | (setenv "CPPFLAGS" (read-string port)) | |
312 | (close-pipe port)) | |
313 | #t))))) | |
314 | (native-inputs | |
315 | `(("mesa" ,mesa) ; for glcanvas | |
388606a7 | 316 | ("pkg-config" ,pkg-config))) |
b353c7d2 TF |
317 | (inputs |
318 | `(("gtk+" ,gtk+-2) ; for wxPython/src/helpers.cpp | |
319 | ("wxwidgets" ,wxwidgets-gtk2))) | |
320 | (synopsis "Python 2 Bindings for wxWidgets") | |
321 | (description "@code{wxpython} provides Python 2 bindings for wxWidgets.") | |
414b8d9e | 322 | (home-page "https://wxpython.org/") |
b353c7d2 | 323 | (license (package-license wxwidgets)))) |
a689185d TD |
324 | |
325 | (define-public wxsvg | |
326 | (package | |
327 | (name "wxsvg") | |
e81c9066 | 328 | (version "1.5.12") |
a689185d TD |
329 | (source |
330 | (origin | |
331 | (method url-fetch) | |
332 | (uri (string-append "mirror://sourceforge/wxsvg/wxsvg/" | |
333 | version "/wxsvg-" version ".tar.bz2")) | |
334 | (sha256 | |
335 | (base32 | |
e81c9066 | 336 | "1hn3h9kzsjs4wimlpknzjfgn7q0n792hh7v3mshjgsjxdcrckzan")))) |
a689185d TD |
337 | (build-system glib-or-gtk-build-system) |
338 | (inputs | |
339 | `(("wxwidgets" ,wxwidgets-3.1) | |
340 | ("cairo" ,cairo) | |
341 | ("pango" ,pango) | |
342 | ("libexif" ,libexif) | |
343 | ("ffmpeg" ,ffmpeg))) | |
344 | (native-inputs | |
345 | `(("pkg-config" ,pkg-config))) | |
346 | (synopsis "C++ library to create, manipulate and render SVG files") | |
347 | (description "wxSVG is a C++ library to create, manipulate and render | |
348 | @dfn{Scalable Vector Graphics} (SVG) files with the wxWidgets toolkit.") | |
349 | (home-page "http://wxsvg.sourceforge.net") | |
350 | ||
351 | ;; wxSVG is licenced under the "wxWindows library licence", which is | |
352 | ;; the LGPL2.0+, with a few extra permissions. | |
353 | (license (list l:lgpl2.0+ (l:fsf-free "file://COPYING"))))) |