| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> |
| 3 | ;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado@elephly.net> |
| 4 | ;;; Copyright © 2016 Theodoros Foradis <theodoros@foradis.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 | ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
| 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 git-download) |
| 30 | #:use-module ((guix licenses) #:prefix l:) |
| 31 | #:use-module (guix build-system glib-or-gtk) |
| 32 | #:use-module (guix build-system python) |
| 33 | #:use-module (guix utils) |
| 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) |
| 41 | #:use-module (gnu packages photo) |
| 42 | #:use-module (gnu packages video) |
| 43 | #:use-module (gnu packages pkg-config) |
| 44 | #:use-module (gnu packages python) |
| 45 | #:use-module (gnu packages sdl) |
| 46 | #:use-module (gnu packages webkit) |
| 47 | #:use-module (gnu packages xorg) |
| 48 | #:use-module ((srfi srfi-1) #:select (alist-delete))) |
| 49 | |
| 50 | (define-public wxwidgets |
| 51 | (package |
| 52 | (name "wxwidgets") |
| 53 | (version "3.0.4") |
| 54 | (source |
| 55 | (origin |
| 56 | (method url-fetch) |
| 57 | (uri (string-append "https://github.com/wxWidgets/wxWidgets/" |
| 58 | "releases/download/v" version |
| 59 | "/wxWidgets-" version ".tar.bz2")) |
| 60 | (sha256 |
| 61 | (base32 "1w7pgfqjab7n84lc4aarydl3g55d1hdgl2ilwml766r6inc7y5cn")))) |
| 62 | (build-system glib-or-gtk-build-system) |
| 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) |
| 73 | ("webkitgtk" ,webkitgtk) |
| 74 | ("sdl" ,sdl))) |
| 75 | (native-inputs |
| 76 | `(("pkg-config" ,pkg-config))) |
| 77 | (arguments |
| 78 | `(#:configure-flags |
| 79 | '("--with-regex" "--with-libmspack" |
| 80 | "--with-sdl" |
| 81 | "--enable-webview" |
| 82 | "--enable-webkit" |
| 83 | "--enable-webviewwebkit" |
| 84 | ,@(if (string=? "aarch64-linux" |
| 85 | (%current-system)) |
| 86 | '("--build=aarch64-unknown-linux-gnu") |
| 87 | '())) |
| 88 | #:make-flags |
| 89 | (list (string-append "LDFLAGS=-Wl,-rpath=" |
| 90 | (assoc-ref %outputs "out") "/lib")) |
| 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 |
| 97 | a graphical user interface. It has language bindings for Python, Perl, Ruby |
| 98 | and many other languages.") |
| 99 | (license (list l:lgpl2.0+ (l:fsf-free "file://doc/license.txt"))))) |
| 100 | |
| 101 | (define-public wxwidgets-2 |
| 102 | (package |
| 103 | (inherit wxwidgets) |
| 104 | (version "2.8.12") |
| 105 | (source |
| 106 | (origin |
| 107 | (method url-fetch) |
| 108 | (uri (string-append "https://github.com/wxWidgets/wxWidgets/" |
| 109 | "releases/download/v" version |
| 110 | "/wxGTK-" version ".tar.gz")) |
| 111 | (sha256 |
| 112 | (base32 "1gjs9vfga60mk4j4ngiwsk9h6c7j22pw26m3asxr1jwvqbr8kkqk")))) |
| 113 | (inputs |
| 114 | `(("gtk" ,gtk+-2) |
| 115 | ("libjpeg" ,libjpeg) |
| 116 | ("libtiff" ,libtiff) |
| 117 | ("libmspack" ,libmspack) |
| 118 | ("sdl" ,sdl) |
| 119 | ("unixodbc" ,unixodbc))) |
| 120 | (arguments |
| 121 | `(#:configure-flags |
| 122 | '("--enable-unicode" "--with-regex=sys" "--with-sdl") |
| 123 | #:make-flags |
| 124 | (list (string-append "LDFLAGS=-Wl,-rpath=" |
| 125 | (assoc-ref %outputs "out") "/lib")) |
| 126 | ;; No 'check' target. |
| 127 | #:tests? #f)))) |
| 128 | |
| 129 | (define-public wxwidgets-gtk2 |
| 130 | (package (inherit wxwidgets) |
| 131 | (inputs `(("gtk+" ,gtk+-2) |
| 132 | ,@(alist-delete |
| 133 | "gtk+" |
| 134 | (package-inputs wxwidgets)))) |
| 135 | (name "wxwidgets-gtk2"))) |
| 136 | |
| 137 | ;; Development version of wxWidgets, required to build against gstreamer-1.x. |
| 138 | ;; This can be removed when wxWidgets is updated to the next stable version. |
| 139 | (define-public wxwidgets-3.1 |
| 140 | (package (inherit wxwidgets) |
| 141 | (version "3.1.0") |
| 142 | (source |
| 143 | (origin |
| 144 | (method git-fetch) |
| 145 | (uri (git-reference |
| 146 | (url "https://github.com/wxWidgets/wxWidgets.git") |
| 147 | (commit (string-append "v" version)))) |
| 148 | (file-name (git-file-name "wxwidgets" version)) |
| 149 | (sha256 |
| 150 | (base32 |
| 151 | "14kl1rsngm70v3mbyv1mal15iz2b18k97avjx8jn7s81znha1c7f")))) |
| 152 | (inputs `(("gstreamer" ,gstreamer) |
| 153 | ("gst-plugins-base" ,gst-plugins-base) |
| 154 | ,@(package-inputs wxwidgets))) |
| 155 | (arguments |
| 156 | (substitute-keyword-arguments (package-arguments wxwidgets) |
| 157 | ((#:configure-flags flags) |
| 158 | `(cons "--enable-mediactrl" ,flags)))))) |
| 159 | |
| 160 | (define-public wxwidgets-gtk2-3.1 |
| 161 | (package (inherit wxwidgets-3.1) |
| 162 | (inputs `(("gtk+" ,gtk+-2) |
| 163 | ,@(alist-delete |
| 164 | "gtk+" |
| 165 | (package-inputs wxwidgets-3.1)))) |
| 166 | (name "wxwidgets-gtk2"))) |
| 167 | |
| 168 | (define-public python2-wxpython |
| 169 | (package |
| 170 | (name "python2-wxpython") |
| 171 | (version "3.0.2.0") |
| 172 | (source |
| 173 | (origin |
| 174 | (method url-fetch) |
| 175 | (uri (string-append "mirror://sourceforge/wxpython/wxPython/" |
| 176 | version "/wxPython-src-" version ".tar.bz2")) |
| 177 | (sha256 |
| 178 | (base32 |
| 179 | "0qfzx3sqx4mwxv99sfybhsij4b5pc03ricl73h4vhkzazgjjjhfm")) |
| 180 | (modules '((guix build utils))) |
| 181 | (snippet |
| 182 | '(begin |
| 183 | (lambda (folder) |
| 184 | (delete-file-recursively (string-append "src/" folder)) |
| 185 | '("expat" "jpeg" "png" "tiff" "zlib" "msw" "osx" "msdos")) |
| 186 | (substitute* '("wxPython/setup.py") |
| 187 | ;; setup.py tries to keep its own license the same as wxwidget's |
| 188 | ;; license (which it expects under $WXWIN/docs). |
| 189 | (("'preamble.txt', 'licence.txt', 'licendoc.txt', 'lgpl.txt'") |
| 190 | "")) |
| 191 | #t)))) |
| 192 | (build-system python-build-system) |
| 193 | (arguments |
| 194 | `(#:python ,python-2 |
| 195 | #:tests? #f ; tests fail |
| 196 | ;; wxPython directly extends distutils command classes, |
| 197 | ;; we can't easily make setup.py use setuptools. |
| 198 | #:use-setuptools? #f |
| 199 | #:configure-flags (list "WXPORT=gtk2" |
| 200 | "UNICODE=1") |
| 201 | #:phases |
| 202 | (modify-phases %standard-phases |
| 203 | (add-before 'build 'chdir |
| 204 | (lambda _ |
| 205 | (chdir "wxPython") |
| 206 | #t)) |
| 207 | (add-after 'chdir 'set-wx-out-dir |
| 208 | (lambda* (#:key outputs #:allow-other-keys) |
| 209 | ;; By default, install phase tries to copy the wxPython headers in |
| 210 | ;; gnu/store/...-wxwidgets-3.0.2 , which it can't, so they are |
| 211 | ;; redirected to the output directory by setting WXPREFIX. |
| 212 | (substitute* "config.py" |
| 213 | (("= getWxConfigValue\\('--prefix'\\)") |
| 214 | (string-append "= '" (assoc-ref outputs "out") "'"))) |
| 215 | (substitute* "wx/build/config.py" |
| 216 | (("= getWxConfigValue\\('--prefix'\\)") |
| 217 | (string-append "= '" (assoc-ref outputs "out") "'"))) |
| 218 | #t)) |
| 219 | (add-after 'set-wx-out-dir 'setenv |
| 220 | (lambda* (#:key inputs outputs #:allow-other-keys) |
| 221 | (setenv "WXWIN" (assoc-ref inputs "wxwidgets")) |
| 222 | (use-modules (ice-9 popen) (ice-9 rdelim)) |
| 223 | (let ((port (open-pipe* OPEN_READ |
| 224 | (string-append (assoc-ref inputs "wxwidgets") |
| 225 | "/bin/wx-config") "--cppflags"))) |
| 226 | (setenv "CPPFLAGS" (read-string port)) |
| 227 | (close-pipe port)) |
| 228 | #t))))) |
| 229 | (native-inputs |
| 230 | `(("mesa" ,mesa) ; for glcanvas |
| 231 | ("pkg-config" ,pkg-config))) |
| 232 | (inputs |
| 233 | `(("gtk+" ,gtk+-2) ; for wxPython/src/helpers.cpp |
| 234 | ("wxwidgets" ,wxwidgets-gtk2))) |
| 235 | (synopsis "Python 2 Bindings for wxWidgets") |
| 236 | (description "@code{wxpython} provides Python 2 bindings for wxWidgets.") |
| 237 | (home-page "http://wxpython.org/") |
| 238 | (license (package-license wxwidgets)))) |
| 239 | |
| 240 | (define-public wxsvg |
| 241 | (package |
| 242 | (name "wxsvg") |
| 243 | (version "1.5.12") |
| 244 | (source |
| 245 | (origin |
| 246 | (method url-fetch) |
| 247 | (uri (string-append "mirror://sourceforge/wxsvg/wxsvg/" |
| 248 | version "/wxsvg-" version ".tar.bz2")) |
| 249 | (sha256 |
| 250 | (base32 |
| 251 | "1hn3h9kzsjs4wimlpknzjfgn7q0n792hh7v3mshjgsjxdcrckzan")))) |
| 252 | (build-system glib-or-gtk-build-system) |
| 253 | (inputs |
| 254 | `(("wxwidgets" ,wxwidgets-3.1) |
| 255 | ("cairo" ,cairo) |
| 256 | ("pango" ,pango) |
| 257 | ("libexif" ,libexif) |
| 258 | ("ffmpeg" ,ffmpeg))) |
| 259 | (native-inputs |
| 260 | `(("pkg-config" ,pkg-config))) |
| 261 | (synopsis "C++ library to create, manipulate and render SVG files") |
| 262 | (description "wxSVG is a C++ library to create, manipulate and render |
| 263 | @dfn{Scalable Vector Graphics} (SVG) files with the wxWidgets toolkit.") |
| 264 | (home-page "http://wxsvg.sourceforge.net") |
| 265 | |
| 266 | ;; wxSVG is licenced under the "wxWindows library licence", which is |
| 267 | ;; the LGPL2.0+, with a few extra permissions. |
| 268 | (license (list l:lgpl2.0+ (l:fsf-free "file://COPYING"))))) |