gnu: wxwidgets: Update to 3.0.3.
[jackhill/guix/guix.git] / gnu / packages / wxwidgets.scm
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.for@openmailbox.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 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages wxwidgets)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module ((guix licenses) #:prefix l:)
29 #:use-module (guix build-system glib-or-gtk)
30 #:use-module (guix build-system python)
31 #:use-module (guix build utils)
32 #:use-module (guix utils)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages compression)
35 #:use-module (gnu packages databases)
36 #:use-module (gnu packages gl)
37 #:use-module (gnu packages gstreamer)
38 #:use-module (gnu packages gtk)
39 #:use-module (gnu packages image)
40 #:use-module (gnu packages photo)
41 #:use-module (gnu packages video)
42 #:use-module (gnu packages pkg-config)
43 #:use-module (gnu packages python)
44 #:use-module (gnu packages sdl)
45 #:use-module (gnu packages webkit)
46 #:use-module (gnu packages xorg))
47
48 (define-public wxwidgets
49 (package
50 (name "wxwidgets")
51 (version "3.0.3")
52 (source
53 (origin
54 (method url-fetch)
55 (uri (string-append "https://github.com/wxWidgets/wxWidgets/"
56 "releases/download/v" version
57 "/wxWidgets-" version ".tar.bz2"))
58 (sha256
59 (base32 "0yrhp5cs2g33cpbdwdzicmm5m4mfnlvxwv031x9266zc90zh7j08"))))
60 (build-system glib-or-gtk-build-system)
61 (inputs
62 `(("glu" ,glu)
63 ;; XXX gstreamer-0.10 builds fail
64 ;; ("gstreamer" ,gstreamer-0.10)
65 ("gtk" ,gtk+)
66 ("libjpeg" ,libjpeg)
67 ("libmspack" ,libmspack)
68 ("libsm" ,libsm)
69 ("libtiff" ,libtiff)
70 ("mesa" ,mesa)
71 ("webkitgtk" ,webkitgtk)
72 ("sdl" ,sdl)))
73 (native-inputs
74 `(("pkg-config" ,pkg-config)))
75 (arguments
76 `(#:configure-flags
77 '("--with-regex" "--with-libmspack"
78 "--with-sdl"
79 "--enable-webview"
80 "--enable-webkit"
81 "--enable-webviewwebkit"
82 ,@(if (string=? "aarch64-linux"
83 (%current-system))
84 '("--build=aarch64-unknown-linux-gnu")
85 '()))
86 #:make-flags
87 (list (string-append "LDFLAGS=-Wl,-rpath="
88 (assoc-ref %outputs "out") "/lib"))
89 ;; No 'check' target.
90 #:tests? #f))
91 (home-page "https://www.wxwidgets.org/")
92 (synopsis "Widget toolkit for creating graphical user interfaces")
93 (description
94 "wxWidgets is a C++ library that lets developers create applications with
95 a graphical user interface. It has language bindings for Python, Perl, Ruby
96 and many other languages.")
97 (license (list l:lgpl2.0+ (l:fsf-free "file://doc/license.txt")))))
98
99 (define-public wxwidgets-gtk2
100 (package (inherit wxwidgets)
101 (inputs `(("gtk+" ,gtk+-2)
102 ,@(alist-delete
103 "gtk+"
104 (package-inputs wxwidgets))))
105 (name "wxwidgets-gtk2")))
106
107 ;; Development version of wxWidgets, required to build against gstreamer-1.x.
108 ;; This can be removed when wxWidgets is updated to the next stable version.
109 (define-public wxwidgets-3.1
110 (package (inherit wxwidgets)
111 (version "3.1.0")
112 (source
113 (origin
114 (method url-fetch)
115 (uri (string-append "https://github.com/wxWidgets/wxWidgets/archive/v"
116 version ".tar.gz"))
117 (file-name (string-append "wxwidgets-" version ".tar.gz"))
118 (sha256
119 (base32 "1yan5ysjwh6a7xw82sfjd1xn0nsy1dn2s0cx9ac7cw19191blc3y"))))
120 (inputs `(("gstreamer" ,gstreamer)
121 ("gst-plugins-base" ,gst-plugins-base)
122 ,@(package-inputs wxwidgets)))
123 (arguments
124 (substitute-keyword-arguments (package-arguments wxwidgets)
125 ((#:configure-flags flags)
126 `(cons "--enable-mediactrl" ,flags))))))
127
128 (define-public python2-wxpython
129 (package
130 (name "python2-wxpython")
131 (version "3.0.2.0")
132 (source
133 (origin
134 (method url-fetch)
135 (uri (string-append "mirror://sourceforge/wxpython/wxPython/"
136 version "/wxPython-src-" version ".tar.bz2"))
137 (sha256
138 (base32
139 "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"))
140 (modules '((guix build utils)))
141 (snippet
142 '(begin
143 (lambda (folder)
144 (delete-file-recursively (string-append "src/" folder))
145 '("expat" "jpeg" "png" "tiff" "zlib" "msw" "osx" "msdos"))
146 (substitute* '("wxPython/setup.py")
147 ;; setup.py tries to keep its own license the same as wxwidget's
148 ;; license (which it expects under $WXWIN/docs).
149 (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'")
150 ""))))))
151 (build-system python-build-system)
152 (arguments
153 `(#:python ,python-2
154 #:tests? #f ; tests fail
155 ;; wxPython directly extends distutils command classes,
156 ;; we can't easily make setup.py use setuptools.
157 #:use-setuptools? #f
158 #:configure-flags (list "WXPORT=gtk2"
159 "UNICODE=1")
160 #:phases
161 (modify-phases %standard-phases
162 (add-before 'build 'chdir
163 (lambda _
164 (chdir "wxPython")
165 #t))
166 (add-after 'chdir 'set-wx-out-dir
167 (lambda* (#:key outputs #:allow-other-keys)
168 ;; By default, install phase tries to copy the wxPython headers in
169 ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are
170 ;; redirected to the output directory by setting WXPREFIX.
171 (substitute* "config.py"
172 (("= getWxConfigValue\\('--prefix'\\)")
173 (string-append "= '" (assoc-ref outputs "out") "'")))
174 (substitute* "wx/build/config.py"
175 (("= getWxConfigValue\\('--prefix'\\)")
176 (string-append "= '" (assoc-ref outputs "out") "'")))
177 #t))
178 (add-after 'set-wx-out-dir 'setenv
179 (lambda* (#:key inputs outputs #:allow-other-keys)
180 (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
181 (use-modules (ice-9 popen) (ice-9 rdelim))
182 (let ((port (open-pipe* OPEN_READ
183 (string-append (assoc-ref inputs "wxwidgets")
184 "/bin/wx-config") "--cppflags")))
185 (setenv "CPPFLAGS" (read-string port))
186 (close-pipe port))
187 #t)))))
188 (native-inputs
189 `(("mesa" ,mesa) ; for glcanvas
190 ("pkg-config" ,pkg-config)))
191 (inputs
192 `(("gtk+" ,gtk+-2) ; for wxPython/src/helpers.cpp
193 ("wxwidgets" ,wxwidgets-gtk2)))
194 (synopsis "Python 2 Bindings for wxWidgets")
195 (description "@code{wxpython} provides Python 2 bindings for wxWidgets.")
196 (home-page "http://wxpython.org/")
197 (license (package-license wxwidgets))))
198
199 (define-public wxsvg
200 (package
201 (name "wxsvg")
202 (version "1.5.11")
203 (source
204 (origin
205 (method url-fetch)
206 (uri (string-append "mirror://sourceforge/wxsvg/wxsvg/"
207 version "/wxsvg-" version ".tar.bz2"))
208 (sha256
209 (base32
210 "0m3ff8mjiq4hvy8rmxyc9fkpf24xwxhvr3a6jmvr2q5zc41xhz7x"))))
211 (build-system glib-or-gtk-build-system)
212 (inputs
213 `(("wxwidgets" ,wxwidgets-3.1)
214 ("cairo" ,cairo)
215 ("pango" ,pango)
216 ("libexif" ,libexif)
217 ("ffmpeg" ,ffmpeg)))
218 (native-inputs
219 `(("pkg-config" ,pkg-config)))
220 (synopsis "C++ library to create, manipulate and render SVG files")
221 (description "wxSVG is a C++ library to create, manipulate and render
222 @dfn{Scalable Vector Graphics} (SVG) files with the wxWidgets toolkit.")
223 (home-page "http://wxsvg.sourceforge.net")
224
225 ;; wxSVG is licenced under the "wxWindows library licence", which is
226 ;; the LGPL2.0+, with a few extra permissions.
227 (license (list l:lgpl2.0+ (l:fsf-free "file://COPYING")))))