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