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