1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
3 ;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2016 Theodoros Foradis <theodoros@foradis.org>
5 ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
6 ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
7 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
8 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
9 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2019 Arun Isaac <arunisaac@systemreboot.net>
12 ;;; This file is part of GNU Guix.
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.
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.
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/>.
27 (define-module (gnu packages wxwidgets)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix git-download)
31 #:use-module ((guix licenses) #:prefix l:)
32 #:use-module (guix build-system glib-or-gtk)
33 #:use-module (guix build-system python)
34 #:use-module (guix utils)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages compression)
37 #:use-module (gnu packages databases)
38 #:use-module (gnu packages gl)
39 #:use-module (gnu packages gstreamer)
40 #:use-module (gnu packages gtk)
41 #:use-module (gnu packages image)
42 #:use-module (gnu packages photo)
43 #:use-module (gnu packages video)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages python)
46 #:use-module (gnu packages python-xyz)
47 #:use-module (gnu packages sdl)
48 #:use-module (gnu packages webkit)
49 #:use-module (gnu packages xorg)
50 #:use-module ((srfi srfi-1) #:select (alist-delete)))
52 (define-public wxwidgets
59 (uri (string-append "https://github.com/wxWidgets/wxWidgets/"
60 "releases/download/v" version
61 "/wxWidgets-" version ".tar.bz2"))
63 (base32 "1w7pgfqjab7n84lc4aarydl3g55d1hdgl2ilwml766r6inc7y5cn"))))
64 (build-system glib-or-gtk-build-system)
67 ;; XXX gstreamer-0.10 builds fail
68 ;; ("gstreamer" ,gstreamer-0.10)
71 ("libmspack" ,libmspack)
75 ("webkitgtk" ,webkitgtk)
78 `(("pkg-config" ,pkg-config)))
81 '("--with-regex" "--with-libmspack"
85 "--enable-webviewwebkit"
86 ,@(if (string=? "aarch64-linux"
88 '("--build=aarch64-unknown-linux-gnu")
91 (list (string-append "LDFLAGS=-Wl,-rpath="
92 (assoc-ref %outputs "out") "/lib"))
95 (home-page "https://www.wxwidgets.org/")
96 (synopsis "Widget toolkit for creating graphical user interfaces")
98 "wxWidgets is a C++ library that lets developers create applications with
99 a graphical user interface. It has language bindings for Python, Perl, Ruby
100 and many other languages.")
101 (license (list l:lgpl2.0+ (l:fsf-free "file://doc/license.txt")))))
103 (define-public wxwidgets-2
110 (uri (string-append "https://github.com/wxWidgets/wxWidgets/"
111 "releases/download/v" version
112 "/wxGTK-" version ".tar.gz"))
114 (base32 "1gjs9vfga60mk4j4ngiwsk9h6c7j22pw26m3asxr1jwvqbr8kkqk"))))
119 ("libmspack" ,libmspack)
121 ("unixodbc" ,unixodbc)))
124 '("--enable-unicode" "--with-regex=sys" "--with-sdl")
126 (list (string-append "LDFLAGS=-Wl,-rpath="
127 (assoc-ref %outputs "out") "/lib"))
128 ;; No 'check' target.
131 (define-public wxwidgets-gtk2
132 (package (inherit wxwidgets)
133 (inputs `(("gtk+" ,gtk+-2)
136 (package-inputs wxwidgets))))
137 (name "wxwidgets-gtk2")))
139 ;; Development version of wxWidgets, required to build against gstreamer-1.x.
140 ;; This can be removed when wxWidgets is updated to the next stable version.
141 (define-public wxwidgets-3.1
142 (package (inherit wxwidgets)
148 (url "https://github.com/wxWidgets/wxWidgets.git")
149 (commit (string-append "v" version))))
150 (file-name (git-file-name "wxwidgets" version))
153 "14kl1rsngm70v3mbyv1mal15iz2b18k97avjx8jn7s81znha1c7f"))))
154 (inputs `(("gstreamer" ,gstreamer)
155 ("gst-plugins-base" ,gst-plugins-base)
156 ,@(package-inputs wxwidgets)))
158 (substitute-keyword-arguments (package-arguments wxwidgets)
159 ((#:configure-flags flags)
160 `(cons "--enable-mediactrl" ,flags))))))
162 (define-public wxwidgets-gtk2-3.1
163 (package (inherit wxwidgets-3.1)
164 (inputs `(("gtk+" ,gtk+-2)
167 (package-inputs wxwidgets-3.1))))
168 (name "wxwidgets-gtk2")))
170 (define-public python-wxpython
172 (name "python-wxpython")
173 (version "4.0.7.post1")
177 (uri (pypi-uri "wxPython" version))
180 "1jppcr3n428m8pgwb9q3g0iiqydxd451ncri4njk8b53xsiflhys"))
181 (modules '((guix build utils)))
184 ;; Remove bundled wxwidgets
185 (delete-file-recursively "ext/wxWidgets")
187 (build-system python-build-system)
190 (modify-phases %standard-phases
191 (add-before 'build 'configure
192 (lambda* (#:key inputs #:allow-other-keys)
193 (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
194 ;; Copy the waf executable to the source directory since it needs
195 ;; to be in a writable directory.
196 (copy-file (string-append (assoc-ref inputs "python-waf") "/bin/waf")
198 (setenv "WAF" "bin/waf")
199 ;; The build script tries to copy license files from the
200 ;; wxwidgets source tree. Prevent it.
201 (substitute* "wscript"
202 (("updateLicenseFiles\\(cfg\\)" all)
203 (string-append "#" all)))
204 ;; The build script tries to write to demo/version.py. So, we set
205 ;; correct write permissions.
206 (chmod "demo/version.py" #o644)
207 ;; Build only the python bindings, not wxwidgets also.
208 (substitute* "setup.py"
209 (("'build']") "'build_py', '--use_syswx']"))
213 ("wxwidgets" ,wxwidgets)))
215 `(("pkg-config" ,pkg-config)
216 ("python-waf" ,python-waf)))
218 `(("python-numpy" ,python-numpy)
219 ("python-pillow" ,python-pillow)
220 ("python-six" ,python-six)))
221 (home-page "http://wxPython.org/")
222 (synopsis "Cross platform GUI toolkit for Python")
223 (description "wxPython is a cross-platform GUI toolkit for the Python
224 programming language. It is implemented as a set of Python extension modules
225 that wrap the GUI components of the popular wxWidgets cross platform C++
226 library. In most cases, wxPython uses the native widgets on each platform to
227 provide a 100% native look and feel for the application.")
228 (license l:wxwindows3.1+)))
230 (define-public python2-wxpython
232 (name "python2-wxpython")
237 (uri (string-append "mirror://sourceforge/wxpython/wxPython/"
238 version "/wxPython-src-" version ".tar.bz2"))
241 "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"))
242 (modules '((guix build utils)))
246 (delete-file-recursively (string-append "src/" folder))
247 '("expat" "jpeg" "png" "tiff" "zlib" "msw" "osx" "msdos"))
248 (substitute* '("wxPython/setup.py")
249 ;; setup.py tries to keep its own license the same as wxwidget's
250 ;; license (which it expects under $WXWIN/docs).
251 (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'")
254 (build-system python-build-system)
257 #:tests? #f ; tests fail
258 ;; wxPython directly extends distutils command classes,
259 ;; we can't easily make setup.py use setuptools.
261 #:configure-flags (list "WXPORT=gtk2"
264 (modify-phases %standard-phases
265 (add-before 'build 'chdir
269 (add-after 'chdir 'set-wx-out-dir
270 (lambda* (#:key outputs #:allow-other-keys)
271 ;; By default, install phase tries to copy the wxPython headers in
272 ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are
273 ;; redirected to the output directory by setting WXPREFIX.
274 (substitute* "config.py"
275 (("= getWxConfigValue\\('--prefix'\\)")
276 (string-append "= '" (assoc-ref outputs "out") "'")))
277 (substitute* "wx/build/config.py"
278 (("= getWxConfigValue\\('--prefix'\\)")
279 (string-append "= '" (assoc-ref outputs "out") "'")))
281 (add-after 'set-wx-out-dir 'setenv
282 (lambda* (#:key inputs outputs #:allow-other-keys)
283 (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
284 (use-modules (ice-9 popen) (ice-9 rdelim))
285 (let ((port (open-pipe* OPEN_READ
286 (string-append (assoc-ref inputs "wxwidgets")
287 "/bin/wx-config") "--cppflags")))
288 (setenv "CPPFLAGS" (read-string port))
292 `(("mesa" ,mesa) ; for glcanvas
293 ("pkg-config" ,pkg-config)))
295 `(("gtk+" ,gtk+-2) ; for wxPython/src/helpers.cpp
296 ("wxwidgets" ,wxwidgets-gtk2)))
297 (synopsis "Python 2 Bindings for wxWidgets")
298 (description "@code{wxpython} provides Python 2 bindings for wxWidgets.")
299 (home-page "http://wxpython.org/")
300 (license (package-license wxwidgets))))
309 (uri (string-append "mirror://sourceforge/wxsvg/wxsvg/"
310 version "/wxsvg-" version ".tar.bz2"))
313 "1hn3h9kzsjs4wimlpknzjfgn7q0n792hh7v3mshjgsjxdcrckzan"))))
314 (build-system glib-or-gtk-build-system)
316 `(("wxwidgets" ,wxwidgets-3.1)
322 `(("pkg-config" ,pkg-config)))
323 (synopsis "C++ library to create, manipulate and render SVG files")
324 (description "wxSVG is a C++ library to create, manipulate and render
325 @dfn{Scalable Vector Graphics} (SVG) files with the wxWidgets toolkit.")
326 (home-page "http://wxsvg.sourceforge.net")
328 ;; wxSVG is licenced under the "wxWindows library licence", which is
329 ;; the LGPL2.0+, with a few extra permissions.
330 (license (list l:lgpl2.0+ (l:fsf-free "file://COPYING")))))