Merge branch 'master' into staging
[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>
2cd3b6fd 4;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.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")
51 (version "3.0.2")
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
40c611a4
RS
59 (base32 "0paq27brw4lv8kspxh9iklpa415mxi8zc117vbbbhfjgapf7js1l"))
60 (patches (search-patches
61 "wxwidgets-fix-windowGTK.patch"))))
927b6728 62 (build-system glib-or-gtk-build-system)
927b6728
TUBK
63 (inputs
64 `(("glu" ,glu)
65 ;; XXX gstreamer-0.10 builds fail
66 ;; ("gstreamer" ,gstreamer-0.10)
67 ("gtk" ,gtk+)
68 ("libjpeg" ,libjpeg)
69 ("libmspack" ,libmspack)
70 ("libsm" ,libsm)
71 ("libtiff" ,libtiff)
72 ("mesa" ,mesa)
2314474b 73 ("webkitgtk" ,webkitgtk)
927b6728
TUBK
74 ("sdl" ,sdl)))
75 (native-inputs
76 `(("pkg-config" ,pkg-config)))
77 (arguments
59898500 78 `(#:configure-flags
b37b854e 79 '("--with-regex" "--with-libmspack"
fc7c74e4
RW
80 "--with-sdl"
81 "--enable-webview"
82 "--enable-webkit"
59898500
EF
83 "--enable-webviewwebkit"
84 ,@(if (string=? "aarch64-linux"
85 (%current-system))
86 '("--build=aarch64-unknown-linux-gnu")
87 '()))
a0a0b716
TUBK
88 #:make-flags
89 (list (string-append "LDFLAGS=-Wl,-rpath="
90 (assoc-ref %outputs "out") "/lib"))
927b6728
TUBK
91 ;; No 'check' target.
92 #:tests? #f))
93 (home-page "https://www.wxwidgets.org/")
94 (synopsis "Widget toolkit for creating graphical user interfaces")
95 (description
96 "wxWidgets is a C++ library that lets developers create applications with
97a graphical user interface. It has language bindings for Python, Perl, Ruby
98and many other languages.")
99 (license (list l:lgpl2.0+ (l:fsf-free "file://doc/license.txt")))))
100
2cd3b6fd
TF
101(define-public wxwidgets-gtk2
102 (package (inherit wxwidgets)
103 (inputs `(("gtk+" ,gtk+-2)
104 ,@(alist-delete
105 "gtk+"
106 (package-inputs wxwidgets))))
107 (name "wxwidgets-gtk2")))
b353c7d2 108
1d5b3f43
TD
109;; Development version of wxWidgets, required to build against gstreamer-1.x.
110;; This can be removed when wxWidgets is updated to the next stable version.
111(define-public wxwidgets-3.1
112 (package (inherit wxwidgets)
113 (version "3.1.0")
114 (source
115 (origin
116 (method url-fetch)
117 (uri (string-append "https://github.com/wxWidgets/wxWidgets/archive/v"
118 version ".tar.gz"))
119 (file-name (string-append "wxwidgets-" version ".tar.gz"))
120 (sha256
121 (base32 "1yan5ysjwh6a7xw82sfjd1xn0nsy1dn2s0cx9ac7cw19191blc3y"))))
122 (inputs `(("gstreamer" ,gstreamer)
123 ("gst-plugins-base" ,gst-plugins-base)
124 ,@(package-inputs wxwidgets)))
125 (arguments
126 (substitute-keyword-arguments (package-arguments wxwidgets)
127 ((#:configure-flags flags)
128 `(cons "--enable-mediactrl" ,flags))))))
129
b353c7d2
TF
130(define-public python2-wxpython
131 (package
132 (name "python2-wxpython")
133 (version "3.0.2.0")
134 (source
135 (origin
136 (method url-fetch)
137 (uri (string-append "mirror://sourceforge/wxpython/wxPython/"
138 version "/wxPython-src-" version ".tar.bz2"))
139 (sha256
140 (base32
141 "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"))
142 (modules '((guix build utils)))
143 (snippet
144 '(begin
145 (lambda (folder)
146 (delete-file-recursively (string-append "src/" folder))
147 '("expat" "jpeg" "png" "tiff" "zlib" "msw" "osx" "msdos"))
148 (substitute* '("wxPython/setup.py")
149 ;; setup.py tries to keep its own license the same as wxwidget's
150 ;; license (which it expects under $WXWIN/docs).
151 (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'")
152 ""))))))
153 (build-system python-build-system)
154 (arguments
155 `(#:python ,python-2
156 #:tests? #f ; tests fail
6f1dcafd
HG
157 ;; wxPython directly extends distutils command classes,
158 ;; we can't easily make setup.py use setuptools.
159 #:use-setuptools? #f
b353c7d2
TF
160 #:configure-flags (list "WXPORT=gtk2"
161 "UNICODE=1")
162 #:phases
163 (modify-phases %standard-phases
164 (add-before 'build 'chdir
165 (lambda _
166 (chdir "wxPython")
167 #t))
168 (add-after 'chdir 'set-wx-out-dir
169 (lambda* (#:key outputs #:allow-other-keys)
170 ;; By default, install phase tries to copy the wxPython headers in
171 ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are
172 ;; redirected to the output directory by setting WXPREFIX.
173 (substitute* "config.py"
174 (("= getWxConfigValue\\('--prefix'\\)")
175 (string-append "= '" (assoc-ref outputs "out") "'")))
176 (substitute* "wx/build/config.py"
177 (("= getWxConfigValue\\('--prefix'\\)")
178 (string-append "= '" (assoc-ref outputs "out") "'")))
179 #t))
180 (add-after 'set-wx-out-dir 'setenv
181 (lambda* (#:key inputs outputs #:allow-other-keys)
182 (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
183 (use-modules (ice-9 popen) (ice-9 rdelim))
184 (let ((port (open-pipe* OPEN_READ
185 (string-append (assoc-ref inputs "wxwidgets")
186 "/bin/wx-config") "--cppflags")))
187 (setenv "CPPFLAGS" (read-string port))
188 (close-pipe port))
189 #t)))))
190 (native-inputs
191 `(("mesa" ,mesa) ; for glcanvas
388606a7 192 ("pkg-config" ,pkg-config)))
b353c7d2
TF
193 (inputs
194 `(("gtk+" ,gtk+-2) ; for wxPython/src/helpers.cpp
195 ("wxwidgets" ,wxwidgets-gtk2)))
196 (synopsis "Python 2 Bindings for wxWidgets")
197 (description "@code{wxpython} provides Python 2 bindings for wxWidgets.")
198 (home-page "http://wxpython.org/")
199 (license (package-license wxwidgets))))
a689185d
TD
200
201(define-public wxsvg
202 (package
203 (name "wxsvg")
204 (version "1.5.11")
205 (source
206 (origin
207 (method url-fetch)
208 (uri (string-append "mirror://sourceforge/wxsvg/wxsvg/"
209 version "/wxsvg-" version ".tar.bz2"))
210 (sha256
211 (base32
212 "0m3ff8mjiq4hvy8rmxyc9fkpf24xwxhvr3a6jmvr2q5zc41xhz7x"))))
213 (build-system glib-or-gtk-build-system)
214 (inputs
215 `(("wxwidgets" ,wxwidgets-3.1)
216 ("cairo" ,cairo)
217 ("pango" ,pango)
218 ("libexif" ,libexif)
219 ("ffmpeg" ,ffmpeg)))
220 (native-inputs
221 `(("pkg-config" ,pkg-config)))
222 (synopsis "C++ library to create, manipulate and render SVG files")
223 (description "wxSVG is a C++ library to create, manipulate and render
224@dfn{Scalable Vector Graphics} (SVG) files with the wxWidgets toolkit.")
225 (home-page "http://wxsvg.sourceforge.net")
226
227 ;; wxSVG is licenced under the "wxWindows library licence", which is
228 ;; the LGPL2.0+, with a few extra permissions.
229 (license (list l:lgpl2.0+ (l:fsf-free "file://COPYING")))))