1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
3 ;;; Copyright © 2016 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 licenses) #:prefix l:)
30 #:use-module (guix build-system glib-or-gtk)
31 #:use-module (guix build-system python)
32 #:use-module (guix build utils)
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))
49 (define-public wxwidgets
56 (uri (string-append "https://github.com/wxWidgets/wxWidgets/"
57 "releases/download/v" version
58 "/wxWidgets-" version ".tar.bz2"))
60 (base32 "0yrhp5cs2g33cpbdwdzicmm5m4mfnlvxwv031x9266zc90zh7j08"))))
61 (build-system glib-or-gtk-build-system)
64 ;; XXX gstreamer-0.10 builds fail
65 ;; ("gstreamer" ,gstreamer-0.10)
68 ("libmspack" ,libmspack)
72 ("webkitgtk" ,webkitgtk)
75 `(("pkg-config" ,pkg-config)))
78 '("--with-regex" "--with-libmspack"
82 "--enable-webviewwebkit"
83 ,@(if (string=? "aarch64-linux"
85 '("--build=aarch64-unknown-linux-gnu")
88 (list (string-append "LDFLAGS=-Wl,-rpath="
89 (assoc-ref %outputs "out") "/lib"))
92 (home-page "https://www.wxwidgets.org/")
93 (synopsis "Widget toolkit for creating graphical user interfaces")
95 "wxWidgets is a C++ library that lets developers create applications with
96 a graphical user interface. It has language bindings for Python, Perl, Ruby
97 and many other languages.")
98 (license (list l:lgpl2.0+ (l:fsf-free "file://doc/license.txt")))))
100 (define-public wxwidgets-2
107 (uri (string-append "https://github.com/wxWidgets/wxWidgets/"
108 "releases/download/v" version
109 "/wxGTK-" version ".tar.gz"))
111 (base32 "1gjs9vfga60mk4j4ngiwsk9h6c7j22pw26m3asxr1jwvqbr8kkqk"))))
116 ("libmspack" ,libmspack)
118 ("unixodbc" ,unixodbc)))
121 '("--enable-unicode" "--with-regex=sys" "--with-sdl")
123 (list (string-append "LDFLAGS=-Wl,-rpath="
124 (assoc-ref %outputs "out") "/lib"))
125 ;; No 'check' target.
128 (define-public wxwidgets-gtk2
129 (package (inherit wxwidgets)
130 (inputs `(("gtk+" ,gtk+-2)
133 (package-inputs wxwidgets))))
134 (name "wxwidgets-gtk2")))
136 ;; Development version of wxWidgets, required to build against gstreamer-1.x.
137 ;; This can be removed when wxWidgets is updated to the next stable version.
138 (define-public wxwidgets-3.1
139 (package (inherit wxwidgets)
144 (uri (string-append "https://github.com/wxWidgets/wxWidgets/archive/v"
146 (file-name (string-append "wxwidgets-" version ".tar.gz"))
148 (base32 "1yan5ysjwh6a7xw82sfjd1xn0nsy1dn2s0cx9ac7cw19191blc3y"))))
149 (inputs `(("gstreamer" ,gstreamer)
150 ("gst-plugins-base" ,gst-plugins-base)
151 ,@(package-inputs wxwidgets)))
153 (substitute-keyword-arguments (package-arguments wxwidgets)
154 ((#:configure-flags flags)
155 `(cons "--enable-mediactrl" ,flags))))))
157 (define-public wxwidgets-gtk2-3.1
158 (package (inherit wxwidgets-3.1)
159 (inputs `(("gtk+" ,gtk+-2)
162 (package-inputs wxwidgets-3.1))))
163 (name "wxwidgets-gtk2")))
165 (define-public python2-wxpython
167 (name "python2-wxpython")
172 (uri (string-append "mirror://sourceforge/wxpython/wxPython/"
173 version "/wxPython-src-" version ".tar.bz2"))
176 "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"))
177 (modules '((guix build utils)))
181 (delete-file-recursively (string-append "src/" folder))
182 '("expat" "jpeg" "png" "tiff" "zlib" "msw" "osx" "msdos"))
183 (substitute* '("wxPython/setup.py")
184 ;; setup.py tries to keep its own license the same as wxwidget's
185 ;; license (which it expects under $WXWIN/docs).
186 (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'")
189 (build-system python-build-system)
192 #:tests? #f ; tests fail
193 ;; wxPython directly extends distutils command classes,
194 ;; we can't easily make setup.py use setuptools.
196 #:configure-flags (list "WXPORT=gtk2"
199 (modify-phases %standard-phases
200 (add-before 'build 'chdir
204 (add-after 'chdir 'set-wx-out-dir
205 (lambda* (#:key outputs #:allow-other-keys)
206 ;; By default, install phase tries to copy the wxPython headers in
207 ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are
208 ;; redirected to the output directory by setting WXPREFIX.
209 (substitute* "config.py"
210 (("= getWxConfigValue\\('--prefix'\\)")
211 (string-append "= '" (assoc-ref outputs "out") "'")))
212 (substitute* "wx/build/config.py"
213 (("= getWxConfigValue\\('--prefix'\\)")
214 (string-append "= '" (assoc-ref outputs "out") "'")))
216 (add-after 'set-wx-out-dir 'setenv
217 (lambda* (#:key inputs outputs #:allow-other-keys)
218 (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
219 (use-modules (ice-9 popen) (ice-9 rdelim))
220 (let ((port (open-pipe* OPEN_READ
221 (string-append (assoc-ref inputs "wxwidgets")
222 "/bin/wx-config") "--cppflags")))
223 (setenv "CPPFLAGS" (read-string port))
227 `(("mesa" ,mesa) ; for glcanvas
228 ("pkg-config" ,pkg-config)))
230 `(("gtk+" ,gtk+-2) ; for wxPython/src/helpers.cpp
231 ("wxwidgets" ,wxwidgets-gtk2)))
232 (synopsis "Python 2 Bindings for wxWidgets")
233 (description "@code{wxpython} provides Python 2 bindings for wxWidgets.")
234 (home-page "http://wxpython.org/")
235 (license (package-license wxwidgets))))
244 (uri (string-append "mirror://sourceforge/wxsvg/wxsvg/"
245 version "/wxsvg-" version ".tar.bz2"))
248 "1hn3h9kzsjs4wimlpknzjfgn7q0n792hh7v3mshjgsjxdcrckzan"))))
249 (build-system glib-or-gtk-build-system)
251 `(("wxwidgets" ,wxwidgets-3.1)
257 `(("pkg-config" ,pkg-config)))
258 (synopsis "C++ library to create, manipulate and render SVG files")
259 (description "wxSVG is a C++ library to create, manipulate and render
260 @dfn{Scalable Vector Graphics} (SVG) files with the wxWidgets toolkit.")
261 (home-page "http://wxsvg.sourceforge.net")
263 ;; wxSVG is licenced under the "wxWindows library licence", which is
264 ;; the LGPL2.0+, with a few extra permissions.
265 (license (list l:lgpl2.0+ (l:fsf-free "file://COPYING")))))