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>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages wxwidgets)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix git-download)
30 #:use-module ((guix licenses) #:prefix l:)
31 #:use-module (guix build-system glib-or-gtk)
32 #:use-module (guix build-system python)
33 #:use-module (guix utils)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages compression)
36 #:use-module (gnu packages databases)
37 #:use-module (gnu packages gl)
38 #:use-module (gnu packages gstreamer)
39 #:use-module (gnu packages gtk)
40 #:use-module (gnu packages image)
41 #:use-module (gnu packages photo)
42 #:use-module (gnu packages video)
43 #:use-module (gnu packages pkg-config)
44 #:use-module (gnu packages python)
45 #:use-module (gnu packages sdl)
46 #:use-module (gnu packages webkit)
47 #:use-module (gnu packages xorg)
48 #:use-module ((srfi srfi-1) #:select (alist-delete)))
50 (define-public wxwidgets
57 (uri (string-append "https://github.com/wxWidgets/wxWidgets/"
58 "releases/download/v" version
59 "/wxWidgets-" version ".tar.bz2"))
61 (base32 "1w7pgfqjab7n84lc4aarydl3g55d1hdgl2ilwml766r6inc7y5cn"))))
62 (build-system glib-or-gtk-build-system)
65 ;; XXX gstreamer-0.10 builds fail
66 ;; ("gstreamer" ,gstreamer-0.10)
69 ("libmspack" ,libmspack)
73 ("webkitgtk" ,webkitgtk)
76 `(("pkg-config" ,pkg-config)))
79 '("--with-regex" "--with-libmspack"
83 "--enable-webviewwebkit"
84 ,@(if (string=? "aarch64-linux"
86 '("--build=aarch64-unknown-linux-gnu")
89 (list (string-append "LDFLAGS=-Wl,-rpath="
90 (assoc-ref %outputs "out") "/lib"))
93 (home-page "https://www.wxwidgets.org/")
94 (synopsis "Widget toolkit for creating graphical user interfaces")
96 "wxWidgets is a C++ library that lets developers create applications with
97 a graphical user interface. It has language bindings for Python, Perl, Ruby
98 and many other languages.")
99 (license (list l:lgpl2.0+ (l:fsf-free "file://doc/license.txt")))))
101 (define-public wxwidgets-2
108 (uri (string-append "https://github.com/wxWidgets/wxWidgets/"
109 "releases/download/v" version
110 "/wxGTK-" version ".tar.gz"))
112 (base32 "1gjs9vfga60mk4j4ngiwsk9h6c7j22pw26m3asxr1jwvqbr8kkqk"))))
117 ("libmspack" ,libmspack)
119 ("unixodbc" ,unixodbc)))
122 '("--enable-unicode" "--with-regex=sys" "--with-sdl")
124 (list (string-append "LDFLAGS=-Wl,-rpath="
125 (assoc-ref %outputs "out") "/lib"))
126 ;; No 'check' target.
129 (define-public wxwidgets-gtk2
130 (package (inherit wxwidgets)
131 (inputs `(("gtk+" ,gtk+-2)
134 (package-inputs wxwidgets))))
135 (name "wxwidgets-gtk2")))
137 ;; Development version of wxWidgets, required to build against gstreamer-1.x.
138 ;; This can be removed when wxWidgets is updated to the next stable version.
139 (define-public wxwidgets-3.1
140 (package (inherit wxwidgets)
146 (url "https://github.com/wxWidgets/wxWidgets.git")
147 (commit (string-append "v" version))))
148 (file-name (git-file-name "wxwidgets" version))
151 "14kl1rsngm70v3mbyv1mal15iz2b18k97avjx8jn7s81znha1c7f"))))
152 (inputs `(("gstreamer" ,gstreamer)
153 ("gst-plugins-base" ,gst-plugins-base)
154 ,@(package-inputs wxwidgets)))
156 (substitute-keyword-arguments (package-arguments wxwidgets)
157 ((#:configure-flags flags)
158 `(cons "--enable-mediactrl" ,flags))))))
160 (define-public wxwidgets-gtk2-3.1
161 (package (inherit wxwidgets-3.1)
162 (inputs `(("gtk+" ,gtk+-2)
165 (package-inputs wxwidgets-3.1))))
166 (name "wxwidgets-gtk2")))
168 (define-public python2-wxpython
170 (name "python2-wxpython")
175 (uri (string-append "mirror://sourceforge/wxpython/wxPython/"
176 version "/wxPython-src-" version ".tar.bz2"))
179 "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"))
180 (modules '((guix build utils)))
184 (delete-file-recursively (string-append "src/" folder))
185 '("expat" "jpeg" "png" "tiff" "zlib" "msw" "osx" "msdos"))
186 (substitute* '("wxPython/setup.py")
187 ;; setup.py tries to keep its own license the same as wxwidget's
188 ;; license (which it expects under $WXWIN/docs).
189 (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'")
192 (build-system python-build-system)
195 #:tests? #f ; tests fail
196 ;; wxPython directly extends distutils command classes,
197 ;; we can't easily make setup.py use setuptools.
199 #:configure-flags (list "WXPORT=gtk2"
202 (modify-phases %standard-phases
203 (add-before 'build 'chdir
207 (add-after 'chdir 'set-wx-out-dir
208 (lambda* (#:key outputs #:allow-other-keys)
209 ;; By default, install phase tries to copy the wxPython headers in
210 ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are
211 ;; redirected to the output directory by setting WXPREFIX.
212 (substitute* "config.py"
213 (("= getWxConfigValue\\('--prefix'\\)")
214 (string-append "= '" (assoc-ref outputs "out") "'")))
215 (substitute* "wx/build/config.py"
216 (("= getWxConfigValue\\('--prefix'\\)")
217 (string-append "= '" (assoc-ref outputs "out") "'")))
219 (add-after 'set-wx-out-dir 'setenv
220 (lambda* (#:key inputs outputs #:allow-other-keys)
221 (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
222 (use-modules (ice-9 popen) (ice-9 rdelim))
223 (let ((port (open-pipe* OPEN_READ
224 (string-append (assoc-ref inputs "wxwidgets")
225 "/bin/wx-config") "--cppflags")))
226 (setenv "CPPFLAGS" (read-string port))
230 `(("mesa" ,mesa) ; for glcanvas
231 ("pkg-config" ,pkg-config)))
233 `(("gtk+" ,gtk+-2) ; for wxPython/src/helpers.cpp
234 ("wxwidgets" ,wxwidgets-gtk2)))
235 (synopsis "Python 2 Bindings for wxWidgets")
236 (description "@code{wxpython} provides Python 2 bindings for wxWidgets.")
237 (home-page "http://wxpython.org/")
238 (license (package-license wxwidgets))))
247 (uri (string-append "mirror://sourceforge/wxsvg/wxsvg/"
248 version "/wxsvg-" version ".tar.bz2"))
251 "1hn3h9kzsjs4wimlpknzjfgn7q0n792hh7v3mshjgsjxdcrckzan"))))
252 (build-system glib-or-gtk-build-system)
254 `(("wxwidgets" ,wxwidgets-3.1)
260 `(("pkg-config" ,pkg-config)))
261 (synopsis "C++ library to create, manipulate and render SVG files")
262 (description "wxSVG is a C++ library to create, manipulate and render
263 @dfn{Scalable Vector Graphics} (SVG) files with the wxWidgets toolkit.")
264 (home-page "http://wxsvg.sourceforge.net")
266 ;; wxSVG is licenced under the "wxWindows library licence", which is
267 ;; the LGPL2.0+, with a few extra permissions.
268 (license (list l:lgpl2.0+ (l:fsf-free "file://COPYING")))))