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> |
70af5bf1 | 9 | ;;; Copyright © 2018, 2020, 2021 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) | |
4ff6b340 | 29 | #:use-module (guix gexp) |
927b6728 | 30 | #:use-module (guix download) |
3962a046 | 31 | #:use-module (guix git-download) |
927b6728 TUBK |
32 | #:use-module ((guix licenses) #:prefix l:) |
33 | #:use-module (guix build-system glib-or-gtk) | |
b353c7d2 | 34 | #:use-module (guix build-system python) |
1d5b3f43 | 35 | #:use-module (guix utils) |
927b6728 | 36 | #:use-module (gnu packages) |
4ff6b340 | 37 | #:use-module (gnu packages check) |
927b6728 TUBK |
38 | #:use-module (gnu packages compression) |
39 | #:use-module (gnu packages databases) | |
94820083 | 40 | #:use-module (gnu packages freedesktop) |
927b6728 | 41 | #:use-module (gnu packages gl) |
93d9737d | 42 | #:use-module (gnu packages gnome) |
927b6728 TUBK |
43 | #:use-module (gnu packages gstreamer) |
44 | #:use-module (gnu packages gtk) | |
45 | #:use-module (gnu packages image) | |
a689185d TD |
46 | #:use-module (gnu packages photo) |
47 | #:use-module (gnu packages video) | |
927b6728 | 48 | #:use-module (gnu packages pkg-config) |
b353c7d2 | 49 | #:use-module (gnu packages python) |
2c0552cf | 50 | #:use-module (gnu packages python-xyz) |
927b6728 | 51 | #:use-module (gnu packages sdl) |
fc7c74e4 | 52 | #:use-module (gnu packages webkit) |
6fd5a80d LC |
53 | #:use-module (gnu packages xorg) |
54 | #:use-module ((srfi srfi-1) #:select (alist-delete))) | |
927b6728 TUBK |
55 | |
56 | (define-public wxwidgets | |
57 | (package | |
58 | (name "wxwidgets") | |
3cfbeebb | 59 | (version "3.0.5.1") |
927b6728 TUBK |
60 | (source |
61 | (origin | |
62 | (method url-fetch) | |
8ebdf9af AE |
63 | (uri (string-append "https://github.com/wxWidgets/wxWidgets/" |
64 | "releases/download/v" version | |
927b6728 TUBK |
65 | "/wxWidgets-" version ".tar.bz2")) |
66 | (sha256 | |
3cfbeebb | 67 | (base32 "01y89999jw5q7njrhxajincx7lydls6yq37ikazjryssrxrnw3s4")))) |
927b6728 | 68 | (build-system glib-or-gtk-build-system) |
927b6728 TUBK |
69 | (inputs |
70 | `(("glu" ,glu) | |
71 | ;; XXX gstreamer-0.10 builds fail | |
72 | ;; ("gstreamer" ,gstreamer-0.10) | |
73 | ("gtk" ,gtk+) | |
4bd428a7 | 74 | ("libjpeg" ,libjpeg-turbo) |
927b6728 TUBK |
75 | ("libmspack" ,libmspack) |
76 | ("libsm" ,libsm) | |
77 | ("libtiff" ,libtiff) | |
78 | ("mesa" ,mesa) | |
afb7cd8e | 79 | ("webkitgtk" ,webkitgtk) |
94820083 | 80 | ("sdl" ,sdl) |
93d9737d | 81 | ("shared-mime-info" ,shared-mime-info) |
94820083 | 82 | ("xdg-utils" ,xdg-utils))) |
927b6728 | 83 | (native-inputs |
8394619b | 84 | (list pkg-config)) |
927b6728 | 85 | (arguments |
59898500 | 86 | `(#:configure-flags |
b37b854e | 87 | '("--with-regex" "--with-libmspack" |
fc7c74e4 RW |
88 | "--with-sdl" |
89 | "--enable-webview" | |
90 | "--enable-webkit" | |
59898500 EF |
91 | "--enable-webviewwebkit" |
92 | ,@(if (string=? "aarch64-linux" | |
93 | (%current-system)) | |
94 | '("--build=aarch64-unknown-linux-gnu") | |
95 | '())) | |
a0a0b716 TUBK |
96 | #:make-flags |
97 | (list (string-append "LDFLAGS=-Wl,-rpath=" | |
98 | (assoc-ref %outputs "out") "/lib")) | |
927b6728 | 99 | ;; No 'check' target. |
94820083 TGR |
100 | #:tests? #f |
101 | #:phases | |
102 | (modify-phases %standard-phases | |
103 | (add-after 'unpack 'refer-to-inputs | |
93d9737d | 104 | (lambda* (#:key inputs #:allow-other-keys) |
d468a03a | 105 | (let* ((mime (search-input-directory inputs "/share/mime"))) |
93d9737d KK |
106 | (substitute* "src/unix/utilsx11.cpp" |
107 | (("wxExecute\\(xdg_open \\+") | |
108 | (string-append "wxExecute(\"" (which "xdg-open") "\""))) | |
109 | (substitute* "src/unix/mimetype.cpp" | |
110 | (("/usr(/local)?/share/mime") mime)) | |
111 | #t)))))) | |
927b6728 TUBK |
112 | (home-page "https://www.wxwidgets.org/") |
113 | (synopsis "Widget toolkit for creating graphical user interfaces") | |
114 | (description | |
115 | "wxWidgets is a C++ library that lets developers create applications with | |
116 | a graphical user interface. It has language bindings for Python, Perl, Ruby | |
117 | and many other languages.") | |
118 | (license (list l:lgpl2.0+ (l:fsf-free "file://doc/license.txt"))))) | |
119 | ||
1aef4222 BH |
120 | (define-public wxwidgets-2 |
121 | (package | |
122 | (inherit wxwidgets) | |
123 | (version "2.8.12") | |
124 | (source | |
125 | (origin | |
126 | (method url-fetch) | |
127 | (uri (string-append "https://github.com/wxWidgets/wxWidgets/" | |
128 | "releases/download/v" version | |
129 | "/wxGTK-" version ".tar.gz")) | |
130 | (sha256 | |
131 | (base32 "1gjs9vfga60mk4j4ngiwsk9h6c7j22pw26m3asxr1jwvqbr8kkqk")))) | |
132 | (inputs | |
133 | `(("gtk" ,gtk+-2) | |
4bd428a7 | 134 | ("libjpeg" ,libjpeg-turbo) |
1aef4222 BH |
135 | ("libtiff" ,libtiff) |
136 | ("libmspack" ,libmspack) | |
137 | ("sdl" ,sdl) | |
138 | ("unixodbc" ,unixodbc))) | |
139 | (arguments | |
140 | `(#:configure-flags | |
141 | '("--enable-unicode" "--with-regex=sys" "--with-sdl") | |
142 | #:make-flags | |
143 | (list (string-append "LDFLAGS=-Wl,-rpath=" | |
144 | (assoc-ref %outputs "out") "/lib")) | |
145 | ;; No 'check' target. | |
0aa0e1f8 RW |
146 | #:tests? #f |
147 | #:phases | |
148 | (modify-phases %standard-phases | |
149 | (add-after 'unpack 'ignore-narrowing-errors | |
150 | (lambda _ | |
151 | (substitute* "configure" | |
152 | (("-Wall") "-Wall -Wno-narrowing")) | |
153 | #t))))))) | |
1aef4222 | 154 | |
2cd3b6fd | 155 | (define-public wxwidgets-gtk2 |
1a265842 | 156 | (package/inherit wxwidgets |
2cd3b6fd TF |
157 | (inputs `(("gtk+" ,gtk+-2) |
158 | ,@(alist-delete | |
159 | "gtk+" | |
160 | (package-inputs wxwidgets)))) | |
161 | (name "wxwidgets-gtk2"))) | |
b353c7d2 | 162 | |
1d5b3f43 TD |
163 | ;; Development version of wxWidgets, required to build against gstreamer-1.x. |
164 | ;; This can be removed when wxWidgets is updated to the next stable version. | |
165 | (define-public wxwidgets-3.1 | |
166 | (package (inherit wxwidgets) | |
4ff6b340 | 167 | (version "3.1.5") |
1d5b3f43 TD |
168 | (source |
169 | (origin | |
3962a046 RW |
170 | (method git-fetch) |
171 | (uri (git-reference | |
b0e7b699 | 172 | (url "https://github.com/wxWidgets/wxWidgets") |
3962a046 RW |
173 | (commit (string-append "v" version)))) |
174 | (file-name (git-file-name "wxwidgets" version)) | |
1d5b3f43 | 175 | (sha256 |
3962a046 | 176 | (base32 |
4ff6b340 | 177 | "0j998nzqmycafignclxmahgqm5kgs1fiqbsiyvzm7bnpnafi333y")))) |
8394619b | 178 | (inputs (modify-inputs (package-inputs wxwidgets) |
4ff6b340 | 179 | (prepend catch-framework gstreamer gst-plugins-base))) |
1d5b3f43 TD |
180 | (arguments |
181 | (substitute-keyword-arguments (package-arguments wxwidgets) | |
182 | ((#:configure-flags flags) | |
4ff6b340 LMP |
183 | '(list "--with-regex" "--with-libmspack" "--with-sdl" |
184 | "--enable-mediactrl" "--enable-webviewwebkit")) | |
185 | ((#:phases phases) | |
186 | `(modify-phases ,phases | |
187 | (add-after 'unpack 'add-catch | |
188 | (lambda* (#:key inputs #:allow-other-keys) | |
189 | (install-file | |
190 | (search-input-file inputs "include/catch.hpp") | |
191 | "3rdparty/catch/include/"))) | |
192 | (replace 'configure | |
193 | (lambda* (#:key configure-flags inputs native-inputs outputs | |
194 | #:allow-other-keys) | |
195 | (let ((sh (search-input-file (or native-inputs inputs) | |
196 | "bin/sh"))) | |
197 | (apply invoke "./configure" | |
198 | (string-append "SHELL=" sh) | |
199 | (string-append "CONFIG_SHELL=" sh) | |
200 | (string-append "--prefix=" | |
201 | (assoc-ref outputs "out")) | |
202 | configure-flags)))))))))) | |
1d5b3f43 | 203 | |
3fd2ecb3 | 204 | (define-public wxwidgets-gtk2-3.1 |
1a265842 | 205 | (package/inherit wxwidgets-3.1 |
3fd2ecb3 DT |
206 | (inputs `(("gtk+" ,gtk+-2) |
207 | ,@(alist-delete | |
208 | "gtk+" | |
209 | (package-inputs wxwidgets-3.1)))) | |
210 | (name "wxwidgets-gtk2"))) | |
211 | ||
2c0552cf AI |
212 | (define-public python-wxpython |
213 | (package | |
214 | (name "python-wxpython") | |
215 | (version "4.0.7.post1") | |
216 | (source | |
217 | (origin | |
218 | (method url-fetch) | |
219 | (uri (pypi-uri "wxPython" version)) | |
220 | (sha256 | |
221 | (base32 | |
222 | "1jppcr3n428m8pgwb9q3g0iiqydxd451ncri4njk8b53xsiflhys")) | |
223 | (modules '((guix build utils))) | |
224 | (snippet | |
225 | '(begin | |
226 | ;; Remove bundled wxwidgets | |
227 | (delete-file-recursively "ext/wxWidgets") | |
228 | #t)))) | |
229 | (build-system python-build-system) | |
230 | (arguments | |
231 | `(#:phases | |
232 | (modify-phases %standard-phases | |
233 | (add-before 'build 'configure | |
234 | (lambda* (#:key inputs #:allow-other-keys) | |
235 | (setenv "WXWIN" (assoc-ref inputs "wxwidgets")) | |
236 | ;; Copy the waf executable to the source directory since it needs | |
237 | ;; to be in a writable directory. | |
bc64d955 | 238 | (copy-file (search-input-file inputs "/bin/waf") |
2c0552cf AI |
239 | "bin/waf") |
240 | (setenv "WAF" "bin/waf") | |
241 | ;; The build script tries to copy license files from the | |
242 | ;; wxwidgets source tree. Prevent it. | |
243 | (substitute* "wscript" | |
244 | (("updateLicenseFiles\\(cfg\\)" all) | |
245 | (string-append "#" all))) | |
246 | ;; The build script tries to write to demo/version.py. So, we set | |
247 | ;; correct write permissions. | |
248 | (chmod "demo/version.py" #o644) | |
249 | ;; Build only the python bindings, not wxwidgets also. | |
250 | (substitute* "setup.py" | |
251 | (("'build']") "'build_py', '--use_syswx']")) | |
252 | #t))))) | |
253 | (inputs | |
8394619b | 254 | (list gtk+ wxwidgets)) |
2c0552cf | 255 | (native-inputs |
8394619b | 256 | (list pkg-config python-waf)) |
2c0552cf | 257 | (propagated-inputs |
8394619b | 258 | (list python-numpy python-pillow python-six)) |
2bc8143f | 259 | (home-page "https://wxpython.org/") |
2c0552cf AI |
260 | (synopsis "Cross platform GUI toolkit for Python") |
261 | (description "wxPython is a cross-platform GUI toolkit for the Python | |
262 | programming language. It is implemented as a set of Python extension modules | |
263 | that wrap the GUI components of the popular wxWidgets cross platform C++ | |
264 | library. In most cases, wxPython uses the native widgets on each platform to | |
265 | provide a 100% native look and feel for the application.") | |
266 | (license l:wxwindows3.1+))) | |
267 | ||
a689185d TD |
268 | (define-public wxsvg |
269 | (package | |
270 | (name "wxsvg") | |
f2ff26f3 | 271 | (version "1.5.23") |
a689185d TD |
272 | (source |
273 | (origin | |
274 | (method url-fetch) | |
275 | (uri (string-append "mirror://sourceforge/wxsvg/wxsvg/" | |
276 | version "/wxsvg-" version ".tar.bz2")) | |
277 | (sha256 | |
f2ff26f3 | 278 | (base32 "1fdbvihw1w2vm29xj54cqgpdabhlg0ydf3clkb0qrlf7mhgkc1rz")))) |
a689185d TD |
279 | (build-system glib-or-gtk-build-system) |
280 | (inputs | |
8394619b | 281 | (list wxwidgets-3.1 cairo ffmpeg)) |
a689185d | 282 | (native-inputs |
8394619b | 283 | (list pkg-config)) |
70af5bf1 TGR |
284 | (propagated-inputs |
285 | ;; In Requires.private of libwxsvg.pc. | |
8394619b | 286 | (list libexif pango)) |
a689185d TD |
287 | (synopsis "C++ library to create, manipulate and render SVG files") |
288 | (description "wxSVG is a C++ library to create, manipulate and render | |
289 | @dfn{Scalable Vector Graphics} (SVG) files with the wxWidgets toolkit.") | |
290 | (home-page "http://wxsvg.sourceforge.net") | |
291 | ||
292 | ;; wxSVG is licenced under the "wxWindows library licence", which is | |
293 | ;; the LGPL2.0+, with a few extra permissions. | |
294 | (license (list l:lgpl2.0+ (l:fsf-free "file://COPYING"))))) |