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>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages wxwidgets)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module ((guix licenses) #:prefix l:)
26 #:use-module (guix build-system glib-or-gtk)
27 #:use-module (guix build-system python)
28 #:use-module (guix build utils)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages databases)
32 #:use-module (gnu packages gl)
33 #:use-module (gnu packages gstreamer)
34 #:use-module (gnu packages gtk)
35 #:use-module (gnu packages image)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages python)
38 #:use-module (gnu packages sdl)
39 #:use-module (gnu packages webkit)
40 #:use-module (gnu packages xorg))
42 (define-public wxwidgets
49 (uri (string-append "https://github.com/wxWidgets/wxWidgets/"
50 "releases/download/v" version
51 "/wxWidgets-" version ".tar.bz2"))
53 (base32 "0paq27brw4lv8kspxh9iklpa415mxi8zc117vbbbhfjgapf7js1l"))))
54 (build-system glib-or-gtk-build-system)
57 ;; XXX gstreamer-0.10 builds fail
58 ;; ("gstreamer" ,gstreamer-0.10)
61 ("libmspack" ,libmspack)
65 ("webkitgtk" ,webkitgtk-2.4)
68 `(("pkg-config" ,pkg-config)))
71 '("--with-regex" "--with-libmspack"
75 "--enable-webviewwebkit")
77 (list (string-append "LDFLAGS=-Wl,-rpath="
78 (assoc-ref %outputs "out") "/lib"))
81 (home-page "https://www.wxwidgets.org/")
82 (synopsis "Widget toolkit for creating graphical user interfaces")
84 "wxWidgets is a C++ library that lets developers create applications with
85 a graphical user interface. It has language bindings for Python, Perl, Ruby
86 and many other languages.")
87 (license (list l:lgpl2.0+ (l:fsf-free "file://doc/license.txt")))))
89 (define-public wxwidgets-2
96 (uri (string-append "https://github.com/wxWidgets/wxWidgets/"
97 "releases/download/v" version
98 "/wxGTK-" version ".tar.gz"))
100 (base32 "1gjs9vfga60mk4j4ngiwsk9h6c7j22pw26m3asxr1jwvqbr8kkqk"))))
105 ("libmspack" ,libmspack)
107 ("unixodbc" ,unixodbc)))
110 '("--enable-unicode" "--with-regex=sys" "--with-sdl")
112 (list (string-append "LDFLAGS=-Wl,-rpath="
113 (assoc-ref %outputs "out") "/lib"))
114 ;; No 'check' target.
117 (define-public wxwidgets-gtk2
118 (package (inherit wxwidgets)
119 (inputs `(("gtk+" ,gtk+-2)
122 (package-inputs wxwidgets))))
123 (name "wxwidgets-gtk2")))
125 (define-public python2-wxpython
127 (name "python2-wxpython")
132 (uri (string-append "mirror://sourceforge/wxpython/wxPython/"
133 version "/wxPython-src-" version ".tar.bz2"))
136 "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm"))
137 (modules '((guix build utils)))
141 (delete-file-recursively (string-append "src/" folder))
142 '("expat" "jpeg" "png" "tiff" "zlib" "msw" "osx" "msdos"))
143 (substitute* '("wxPython/setup.py")
144 ;; setup.py tries to keep its own license the same as wxwidget's
145 ;; license (which it expects under $WXWIN/docs).
146 (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'")
148 (build-system python-build-system)
151 #:tests? #f ; tests fail
152 ;; wxPython directly extends distutils command classes,
153 ;; we can't easily make setup.py use setuptools.
155 #:configure-flags (list "WXPORT=gtk2"
158 (modify-phases %standard-phases
159 (add-before 'build 'chdir
163 (add-after 'chdir 'set-wx-out-dir
164 (lambda* (#:key outputs #:allow-other-keys)
165 ;; By default, install phase tries to copy the wxPython headers in
166 ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are
167 ;; redirected to the output directory by setting WXPREFIX.
168 (substitute* "config.py"
169 (("= getWxConfigValue\\('--prefix'\\)")
170 (string-append "= '" (assoc-ref outputs "out") "'")))
171 (substitute* "wx/build/config.py"
172 (("= getWxConfigValue\\('--prefix'\\)")
173 (string-append "= '" (assoc-ref outputs "out") "'")))
175 (add-after 'set-wx-out-dir 'setenv
176 (lambda* (#:key inputs outputs #:allow-other-keys)
177 (setenv "WXWIN" (assoc-ref inputs "wxwidgets"))
178 (use-modules (ice-9 popen) (ice-9 rdelim))
179 (let ((port (open-pipe* OPEN_READ
180 (string-append (assoc-ref inputs "wxwidgets")
181 "/bin/wx-config") "--cppflags")))
182 (setenv "CPPFLAGS" (read-string port))
186 `(("mesa" ,mesa) ; for glcanvas
187 ("pkg-config" ,pkg-config)))
189 `(("gtk+" ,gtk+-2) ; for wxPython/src/helpers.cpp
190 ("wxwidgets" ,wxwidgets-gtk2)))
191 (synopsis "Python 2 Bindings for wxWidgets")
192 (description "@code{wxpython} provides Python 2 bindings for wxWidgets.")
193 (home-page "http://wxpython.org/")
194 (license (package-license wxwidgets))))