gnu: video, xml: Fix typo.
[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>
fc7c74e4 3;;; Copyright © 2016 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>
927b6728
TUBK
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)
b353c7d2 30 #:use-module (guix build-system python)
927b6728 31 #:use-module (guix build utils)
1d5b3f43 32 #:use-module (guix utils)
927b6728
TUBK
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)
a689185d
TD
40 #:use-module (gnu packages photo)
41 #:use-module (gnu packages video)
927b6728 42 #:use-module (gnu packages pkg-config)
b353c7d2 43 #:use-module (gnu packages python)
927b6728 44 #:use-module (gnu packages sdl)
fc7c74e4 45 #:use-module (gnu packages webkit)
927b6728
TUBK
46 #:use-module (gnu packages xorg))
47
48(define-public wxwidgets
49 (package
50 (name "wxwidgets")
1c059a6e 51 (version "3.0.3")
927b6728
TUBK
52 (source
53 (origin
54 (method url-fetch)
8ebdf9af
AE
55 (uri (string-append "https://github.com/wxWidgets/wxWidgets/"
56 "releases/download/v" version
927b6728
TUBK
57 "/wxWidgets-" version ".tar.bz2"))
58 (sha256
1c059a6e 59 (base32 "0yrhp5cs2g33cpbdwdzicmm5m4mfnlvxwv031x9266zc90zh7j08"))))
927b6728 60 (build-system glib-or-gtk-build-system)
927b6728
TUBK
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)
2314474b 71 ("webkitgtk" ,webkitgtk)
927b6728
TUBK
72 ("sdl" ,sdl)))
73 (native-inputs
74 `(("pkg-config" ,pkg-config)))
75 (arguments
59898500 76 `(#:configure-flags
b37b854e 77 '("--with-regex" "--with-libmspack"
fc7c74e4
RW
78 "--with-sdl"
79 "--enable-webview"
80 "--enable-webkit"
59898500
EF
81 "--enable-webviewwebkit"
82 ,@(if (string=? "aarch64-linux"
83 (%current-system))
84 '("--build=aarch64-unknown-linux-gnu")
85 '()))
a0a0b716
TUBK
86 #:make-flags
87 (list (string-append "LDFLAGS=-Wl,-rpath="
88 (assoc-ref %outputs "out") "/lib"))
927b6728
TUBK
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
95a graphical user interface. It has language bindings for Python, Perl, Ruby
96and many other languages.")
97 (license (list l:lgpl2.0+ (l:fsf-free "file://doc/license.txt")))))
98
2cd3b6fd
TF
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")))
b353c7d2 106
1d5b3f43
TD
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
b353c7d2
TF
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
6f1dcafd
HG
155 ;; wxPython directly extends distutils command classes,
156 ;; we can't easily make setup.py use setuptools.
157 #:use-setuptools? #f
b353c7d2
TF
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
388606a7 190 ("pkg-config" ,pkg-config)))
b353c7d2
TF
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))))
a689185d
TD
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")))))