| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 |
|
| 33 | (define-module (gnu packages wxwidgets)
|
| 34 | #:use-module (guix packages)
|
| 35 | #:use-module (guix gexp)
|
| 36 | #:use-module (guix download)
|
| 37 | #:use-module (guix git-download)
|
| 38 | #:use-module ((guix licenses) #:prefix l:)
|
| 39 | #:use-module (guix build-system glib-or-gtk)
|
| 40 | #:use-module (guix build-system perl)
|
| 41 | #:use-module (guix build-system pyproject)
|
| 42 | #:use-module (guix utils)
|
| 43 | #:use-module (gnu packages)
|
| 44 | #:use-module (gnu packages build-tools)
|
| 45 | #:use-module (gnu packages check)
|
| 46 | #:use-module (gnu packages curl)
|
| 47 | #:use-module (gnu packages compression)
|
| 48 | #:use-module (gnu packages databases)
|
| 49 | #:use-module (gnu packages freedesktop)
|
| 50 | #:use-module (gnu packages gl)
|
| 51 | #:use-module (gnu packages gnome)
|
| 52 | #:use-module (gnu packages graphics)
|
| 53 | #:use-module (gnu packages gstreamer)
|
| 54 | #:use-module (gnu packages gtk)
|
| 55 | #:use-module (gnu packages image)
|
| 56 | #:use-module (gnu packages pcre)
|
| 57 | #:use-module (gnu packages perl)
|
| 58 | #:use-module (gnu packages perl-check)
|
| 59 | #:use-module (gnu packages photo)
|
| 60 | #:use-module (gnu packages pkg-config)
|
| 61 | #:use-module (gnu packages python)
|
| 62 | #:use-module (gnu packages python-build)
|
| 63 | #:use-module (gnu packages python-xyz)
|
| 64 | #:use-module (gnu packages qt)
|
| 65 | #:use-module (gnu packages sdl)
|
| 66 | #:use-module (gnu packages video)
|
| 67 | #:use-module (gnu packages web)
|
| 68 | #:use-module (gnu packages webkit)
|
| 69 | #:use-module (gnu packages xml)
|
| 70 | #:use-module (gnu packages xorg))
|
| 71 |
|
| 72 | (define-public wxwidgets
|
| 73 | (package
|
| 74 | (name "wxwidgets")
|
| 75 | |
| 76 | (version "3.2.11")
|
| 77 | (source
|
| 78 | (origin
|
| 79 | (method url-fetch)
|
| 80 | (uri (string-append "https://github.com/wxWidgets/wxWidgets/"
|
| 81 | "releases/download/v" version
|
| 82 | "/wxWidgets-" version ".tar.bz2"))
|
| 83 | (sha256
|
| 84 | (base32 "025gj1mdn2ilp0p2zsa73n065naahl8l9v31pzj19sg2phar04ka"))
|
| 85 | (modules '((guix build utils)
|
| 86 | (ice-9 ftw)
|
| 87 | (srfi srfi-26)))
|
| 88 | (snippet
|
| 89 | '(begin
|
| 90 | |
| 91 | |
| 92 | |
| 93 | (let ((preserved-3rdparty '("nanosvg"))
|
| 94 | |
| 95 | |
| 96 | |
| 97 | (bundled-src '("expat" "jpeg" "png" "tiff" "zlib")))
|
| 98 | (with-directory-excursion "3rdparty"
|
| 99 | (for-each delete-file-recursively
|
| 100 | (scandir "." (negate (cut member <>
|
| 101 | (append '("." "..")
|
| 102 | preserved-3rdparty))))))
|
| 103 | (with-directory-excursion "src"
|
| 104 | (for-each delete-file-recursively bundled-src)))))))
|
| 105 | (outputs '("out" "debug"))
|
| 106 | (build-system glib-or-gtk-build-system)
|
| 107 | (inputs
|
| 108 | (list catch-framework
|
| 109 | curl
|
| 110 | expat
|
| 111 | glu
|
| 112 | gstreamer
|
| 113 | gst-plugins-base
|
| 114 | gtk+
|
| 115 | libjpeg-turbo
|
| 116 | libmspack
|
| 117 | libnotify
|
| 118 | libpng
|
| 119 | libsecret
|
| 120 | libsm
|
| 121 | libtiff
|
| 122 | libxtst |
| 123 | mesa
|
| 124 | pcre2
|
| 125 | sdl2
|
| 126 | shared-mime-info
|
| 127 | webkitgtk-for-gtk3
|
| 128 | xdg-utils
|
| 129 | zlib))
|
| 130 | (native-inputs
|
| 131 | (list pkg-config))
|
| 132 | (arguments
|
| 133 | (list
|
| 134 | #:configure-flags #~'("--with-libmspack"
|
| 135 | "--with-regex"
|
| 136 | "--with-sdl"
|
| 137 | "--enable-debug_info"
|
| 138 | "--enable-gui"
|
| 139 | "--enable-mediactrl"
|
| 140 | "--enable-webview")
|
| 141 | #:make-flags
|
| 142 | #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
|
| 143 | #:tests? #f |
| 144 | #:phases
|
| 145 | #~(modify-phases %standard-phases
|
| 146 | (add-after 'unpack 'refer-to-inputs
|
| 147 | (lambda* (#:key inputs #:allow-other-keys)
|
| 148 | (let ((catch (search-input-file inputs "include/catch.hpp"))
|
| 149 | (mime (search-input-directory inputs "share/mime"))
|
| 150 | (xdg-open (search-input-file inputs "bin/xdg-open")))
|
| 151 | (install-file catch "3rdparty/catch/include/")
|
| 152 | (substitute* "src/unix/utilsx11.cpp"
|
| 153 | (("wxExecute\\(xdg_open \\+")
|
| 154 | (string-append "wxExecute(\"" xdg-open "\"")))
|
| 155 | (substitute* "src/unix/mimetype.cpp"
|
| 156 | (("/usr(/local)?/share/mime")
|
| 157 | mime)))))
|
| 158 | (replace 'configure
|
| 159 | (lambda* (#:key native-inputs inputs configure-flags
|
| 160 | #:allow-other-keys)
|
| 161 | (let ((sh (search-input-file (or native-inputs inputs)
|
| 162 | "bin/sh")))
|
| 163 | |
| 164 | |
| 165 | (apply invoke "./configure"
|
| 166 | (string-append "SHELL=" sh)
|
| 167 | (string-append "CONFIG_SHELL=" sh)
|
| 168 | (string-append "--prefix=" #$output)
|
| 169 | configure-flags)))))))
|
| 170 | (home-page "https://wxwidgets.org/")
|
| 171 | (synopsis "Widget toolkit for creating graphical user interfaces")
|
| 172 | (description
|
| 173 | "wxWidgets is a C++ library that lets developers create applications with
|
| 174 | a graphical user interface. It has language bindings for Python, Perl, Ruby
|
| 175 | and many other languages.")
|
| 176 | (license (list l:lgpl2.0+ (l:fsf-free "file://doc/license.txt")))))
|
| 177 |
|
| 178 | (define-public wxwidgets-sans-egl
|
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | (package/inherit wxwidgets
|
| 187 | (name "wxwidgets-sans-egl")
|
| 188 | (arguments
|
| 189 | (substitute-keyword-arguments arguments
|
| 190 | ((#:configure-flags flags)
|
| 191 | #~(cons "--disable-glcanvasegl" #$flags))))))
|
| 192 |
|
| 193 | (define-public wxwidgets-3.0
|
| 194 | (package
|
| 195 | (inherit wxwidgets)
|
| 196 | (version "3.0.5.1")
|
| 197 | (source (origin
|
| 198 | (method url-fetch)
|
| 199 | (uri (string-append "https://github.com/wxWidgets/wxWidgets/"
|
| 200 | "releases/download/v" version
|
| 201 | "/wxWidgets-" version ".tar.bz2"))
|
| 202 | (sha256
|
| 203 | (base32
|
| 204 | "01y89999jw5q7njrhxajincx7lydls6yq37ikazjryssrxrnw3s4"))))
|
| 205 | (arguments
|
| 206 | `(#:configure-flags
|
| 207 | '("--with-regex" "--with-libmspack"
|
| 208 | "--with-sdl"
|
| 209 | "--enable-webview"
|
| 210 | "--enable-webkit"
|
| 211 | "--enable-webviewwebkit"
|
| 212 | ,@(if (string=? "aarch64-linux"
|
| 213 | (%current-system))
|
| 214 | '("--build=aarch64-unknown-linux-gnu")
|
| 215 | '()))
|
| 216 | #:make-flags
|
| 217 | (list (string-append "LDFLAGS=-Wl,-rpath="
|
| 218 | (assoc-ref %outputs "out") "/lib"))
|
| 219 | |
| 220 | #:tests? #f
|
| 221 | #:phases
|
| 222 | (modify-phases %standard-phases
|
| 223 | (add-after 'unpack 'refer-to-inputs
|
| 224 | (lambda* (#:key inputs #:allow-other-keys)
|
| 225 | (let ((mime (search-input-directory inputs "share/mime"))
|
| 226 | (xdg-open (search-input-file inputs "bin/xdg-open")))
|
| 227 | (substitute* "src/unix/utilsx11.cpp"
|
| 228 | (("wxExecute\\(xdg_open \\+")
|
| 229 | (string-append "wxExecute(\"" xdg-open "\"")))
|
| 230 | (substitute* "src/unix/mimetype.cpp"
|
| 231 | (("/usr(/local)?/share/mime") mime))))))))))
|
| 232 |
|
| 233 | (define-public python-wxpython
|
| 234 | (package
|
| 235 | (name "python-wxpython")
|
| 236 | (version "4.2.2")
|
| 237 | (source
|
| 238 | (origin
|
| 239 | (method url-fetch)
|
| 240 | (uri (pypi-uri "wxPython" version))
|
| 241 | (sha256
|
| 242 | (base32 "1fp2717a96hd5pdai6hlzc4pngdazxas55apjv2w5zb71xjv1g2x"))
|
| 243 | (modules '((guix build utils)))
|
| 244 | (snippet #~(begin
|
| 245 | |
| 246 | (delete-file-recursively "ext/wxWidgets")))))
|
| 247 | (build-system pyproject-build-system)
|
| 248 | (outputs '("out" "debug"))
|
| 249 | (arguments
|
| 250 | (list
|
| 251 | #:test-backend #~'custom
|
| 252 | #:test-flags #~(list "build.py" "-v" "test")
|
| 253 | #:modules '((guix build pyproject-build-system)
|
| 254 | (guix build utils)
|
| 255 | (ice-9 ftw)
|
| 256 | (ice-9 match)
|
| 257 | (srfi srfi-26))
|
| 258 | #:phases
|
| 259 | #~(modify-phases %standard-phases
|
| 260 | (add-after 'unpack 'patch-avoid-circular-import
|
| 261 | (lambda _
|
| 262 | (substitute* "wx/__init__.py"
|
| 263 | (("^import wx\\.__version__.*$") "\
|
| 264 | try:
|
| 265 | import wx.__version__
|
| 266 | except ImportError:
|
| 267 | pass\n")
|
| 268 | (("^__version__ = .*")
|
| 269 | (format #f "__version__ = ~s~%" #$version)))))
|
| 270 | (add-before 'build 'configure
|
| 271 | (lambda* (#:key inputs #:allow-other-keys)
|
| 272 | |
| 273 | |
| 274 | (setenv "WXPYTHON_BUILD_ARGS"
|
| 275 | (string-join '("--debug" |
| 276 | "--use_syswx"))) |
| 277 | (setenv "WXWIN" #$(this-package-input "wxwidgets"))
|
| 278 | |
| 279 | |
| 280 | (copy-file (search-input-file inputs "/bin/waf") "bin/waf")
|
| 281 | (setenv "WAF" "bin/waf")
|
| 282 | |
| 283 | |
| 284 | (substitute* "wscript"
|
| 285 | (("updateLicenseFiles\\(cfg\\)" all)
|
| 286 | (string-append "#" all)))
|
| 287 | |
| 288 | |
| 289 | (chmod "demo/version.py" #o644)))
|
| 290 | (add-before 'sanity-check 'add-missing-.so
|
| 291 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 292 | (let ((site (site-packages inputs outputs)))
|
| 293 | (with-directory-excursion (string-append site "/wx")
|
| 294 | (for-each
|
| 295 | (match-lambda
|
| 296 | ("siplib"
|
| 297 | (rename-file "siplib" "siplib.so"))
|
| 298 | ((? (cut string-prefix? "_" <>) file)
|
| 299 | (unless (string-prefix? "__" file)
|
| 300 | (rename-file file (string-append file ".so"))))
|
| 301 | (_ #t))
|
| 302 | (scandir ".")))))))))
|
| 303 | (inputs
|
| 304 | (list gtk+ wxwidgets))
|
| 305 | (native-inputs
|
| 306 | (list pkg-config python-setuptools waf))
|
| 307 | (propagated-inputs
|
| 308 | (list python-numpy python-pillow python-six))
|
| 309 | (home-page "https://wxpython.org/")
|
| 310 | (synopsis "Cross platform GUI toolkit for Python")
|
| 311 | (description "wxPython is a cross-platform GUI toolkit for the Python
|
| 312 | programming language. It is implemented as a set of Python extension modules
|
| 313 | that wrap the GUI components of the popular wxWidgets cross platform C++
|
| 314 | library. In most cases, wxPython uses the native widgets on each platform to
|
| 315 | provide a 100% native look and feel for the application.")
|
| 316 | (license l:wxwindows3.1+)))
|
| 317 |
|
| 318 | (define-public wxsvg
|
| 319 | (package
|
| 320 | (name "wxsvg")
|
| 321 | (version "1.5.25")
|
| 322 | (source
|
| 323 | (origin
|
| 324 | (method url-fetch)
|
| 325 | (uri (string-append "mirror://sourceforge/wxsvg/wxsvg/"
|
| 326 | version "/wxsvg-" version ".tar.bz2"))
|
| 327 | (sha256
|
| 328 | (base32 "0jsk4vrv7rkb7wrdbsdf60zvdnvj0pxfika8xydd2jxm65larxjv"))))
|
| 329 | (build-system glib-or-gtk-build-system)
|
| 330 | (inputs
|
| 331 | (list wxwidgets cairo ffmpeg))
|
| 332 | (native-inputs
|
| 333 | (list pkg-config))
|
| 334 | (propagated-inputs
|
| 335 | |
| 336 | (list libexif pango))
|
| 337 | (synopsis "C++ library to create, manipulate and render SVG files")
|
| 338 | (description "wxSVG is a C++ library to create, manipulate and render
|
| 339 | @dfn{Scalable Vector Graphics} (SVG) files with the wxWidgets toolkit.")
|
| 340 | (home-page "https://wxsvg.sourceforge.net")
|
| 341 |
|
| 342 | |
| 343 | |
| 344 | (license (list l:lgpl2.0+ (l:fsf-free "file://COPYING")))))
|
| 345 |
|
| 346 | (define-public perl-alien-wxwidgets
|
| 347 | (package
|
| 348 | (name "perl-alien-wxwidgets")
|
| 349 | (version "0.69")
|
| 350 | (source
|
| 351 | (origin
|
| 352 | (method url-fetch)
|
| 353 | (uri (string-append
|
| 354 | "mirror://cpan/authors/id/M/MD/MDOOTSON/Alien-wxWidgets-"
|
| 355 | version
|
| 356 | ".tar.gz"))
|
| 357 | (sha256
|
| 358 | (base32
|
| 359 | "0jg2dmkzhj03f6b0vmv597yryfw9cclsdn9ynvvlrzzgpd5lw8jk"))))
|
| 360 | (build-system perl-build-system)
|
| 361 | (native-inputs
|
| 362 | (list perl-lwp-protocol-https
|
| 363 | perl-module-build
|
| 364 | perl-test-pod
|
| 365 | perl-test-pod-coverage
|
| 366 | wxwidgets))
|
| 367 | (propagated-inputs (list perl-module-pluggable))
|
| 368 | (home-page "https://metacpan.org/release/Alien-wxWidgets")
|
| 369 | (synopsis "Perl module for wxWidgets binaries")
|
| 370 | (description "Alien::wxWidgets is a Perl module for detecting and
|
| 371 | getting configuration settings from an installed wxWidgets package.")
|
| 372 | (license l:perl-license)))
|