From f16358144f29dab64245669d285bff672371b91a Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 26 Nov 2022 17:43:26 +0100 Subject: gnu: wxWidgets: Update to 3.2.1. * gnu/packages/wxwidgets.scm (wxwidgets): Update to 3.2.1. [source](modules, snippet): New fields. [inputs]: Remove SDL. Add CATCH-FRAMEWORK, EXPAT, GSTREAMER, GST-PLUGINS-BASE, LIBNOTIFY, LIBPNG, LIBSECRET, PCRE, SDL2, WEBKITGTK-WITH-LIBSOUP2, and ZLIB [arguments]: Add "--enable-mediactrl" and "--enable-gui" to #:configure-flags. Remove aarch64 workaround. Install catch header in refer-to-inputs phase. Add phase to adjust WebKitGTK version. (wxwidgets-3.1, wxwidgets-gtk2-3.1): Remove variables. (wxwidgets-3.0, (wxwidgets-gtk2-3.0): New variables. (wxsvg)[inputs]: Change from WXWIDGETS-3.1 to WXWIDGETS. * gnu/packages/audio.scm (audacity)[inputs]: Likewise. * gnu/packages/cdrom.scm (dvdstyler)[inputs]: Likewise. * gnu/packages/astronomy.scm (imppg)[inputs]: Change from WXWIDGETS to WXWIDGETS-3.0. * gnu/packages/ftp.scm (filezilla)[inputs]: Likewise. * gnu/packages/games.scm (megaglest)[inputs]: Likewise. * gnu/packages/geo.scm (opencpn)[inputs]: Likewise. * gnu/packages/music.scm (sooperlooper)[inputs]: Likewise. * gnu/packages/engineering.scm (kicad)[arguments]: Enable EGL support. --- gnu/packages/astronomy.scm | 2 +- gnu/packages/audio.scm | 2 +- gnu/packages/cdrom.scm | 2 +- gnu/packages/engineering.scm | 1 + gnu/packages/ftp.scm | 2 +- gnu/packages/games.scm | 2 +- gnu/packages/geo.scm | 2 +- gnu/packages/music.scm | 2 +- gnu/packages/wxwidgets.scm | 206 +++++++++++++++++++++++++++---------------- 9 files changed, 138 insertions(+), 83 deletions(-) diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm index 66bff83033..759ccbec9e 100644 --- a/gnu/packages/astronomy.scm +++ b/gnu/packages/astronomy.scm @@ -1925,7 +1925,7 @@ It can be used to calculate the trajectory of satellites.") (native-inputs (list boost pkg-config)) (inputs - (list cfitsio freeimage glew wxwidgets)) + (list cfitsio freeimage glew wxwidgets-3.0)) (home-page "https://github.com/GreatAttractor/imppg") (synopsis "Astronomical Image Post-Proccessor (ImPPG)") (description diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index ead5ce5963..2f9cb9526e 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -892,7 +892,7 @@ engineers, musicians, soundtrack editors and composers.") #t)))) (build-system cmake-build-system) (inputs - (list wxwidgets-3.1 + (list wxwidgets gtk+ alsa-lib jack-1 diff --git a/gnu/packages/cdrom.scm b/gnu/packages/cdrom.scm index 8cf106b5e4..b544f0e59d 100644 --- a/gnu/packages/cdrom.scm +++ b/gnu/packages/cdrom.scm @@ -515,7 +515,7 @@ capacity is user-selectable.") #t))) #:tests? #f)) ; No tests. (inputs ; TODO package bundled wxvillalib - `(("wxwidgets" ,wxwidgets-3.1) + `(("wxwidgets" ,wxwidgets) ("wssvg" ,wxsvg) ("dbus" ,dbus) ("cdrtools" ,cdrtools) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 768980035c..782673dcac 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -964,6 +964,7 @@ Emacs).") #$(this-package-input "opencascade-occt") "/include/opencascade") "-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON" + "-DKICAD_USE_EGL=ON" ;because wxWidgets uses EGL "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE") #:phases (modify-phases %standard-phases diff --git a/gnu/packages/ftp.scm b/gnu/packages/ftp.scm index 05955ad59a..80ffa927e3 100644 --- a/gnu/packages/ftp.scm +++ b/gnu/packages/ftp.scm @@ -240,7 +240,7 @@ output. nettle pugixml sqlite - wxwidgets)) + wxwidgets-3.0)) (home-page "https://filezilla-project.org") (synopsis "Full-featured graphical FTP/FTPS/SFTP client") (description diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 9d79efbe94..bd46ad7392 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -6151,7 +6151,7 @@ starting a decryption sequence to reveal the original plaintext characters.") libvorbis lua sdl2 - wxwidgets)) + wxwidgets-3.0)) (native-inputs (list cppunit pkg-config)) (arguments diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm index 0f777c7f9b..b3a5c0df3f 100644 --- a/gnu/packages/geo.scm +++ b/gnu/packages/geo.scm @@ -2158,7 +2158,7 @@ exchanged form one Spatial DBMS and the other.") sqlite tinyxml wxsvg - wxwidgets + wxwidgets-3.0 xz zlib)) (arguments diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index b69ad2e517..d02d893f02 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -4040,7 +4040,7 @@ with a number of bugfixes and changes to improve IT playback.") (inputs (list jack-1 alsa-lib - wxwidgets-gtk2 + wxwidgets-gtk2-3.0 libsndfile libsamplerate liblo diff --git a/gnu/packages/wxwidgets.scm b/gnu/packages/wxwidgets.scm index f92ac64b54..9d665f3988 100644 --- a/gnu/packages/wxwidgets.scm +++ b/gnu/packages/wxwidgets.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2017 Thomas Danckaert ;;; Copyright © 2018, 2020, 2021 Tobias Geerinckx-Rice ;;; Copyright © 2019 Arun Isaac +;;; Copyright © 2022 Marius Bakke ;;; ;;; This file is part of GNU Guix. ;;; @@ -35,6 +36,7 @@ #:use-module (guix utils) #:use-module (gnu packages) #:use-module (gnu packages check) + #:use-module (gnu packages curl) #:use-module (gnu packages compression) #:use-module (gnu packages databases) #:use-module (gnu packages freedesktop) @@ -45,18 +47,19 @@ #:use-module (gnu packages image) #:use-module (gnu packages photo) #:use-module (gnu packages video) + #:use-module (gnu packages pcre) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) #:use-module (gnu packages sdl) #:use-module (gnu packages webkit) - #:use-module (gnu packages xorg) - #:use-module ((srfi srfi-1) #:select (alist-delete))) + #:use-module (gnu packages xml) + #:use-module (gnu packages xorg)) (define-public wxwidgets (package (name "wxwidgets") - (version "3.0.5.1") + (version "3.2.1") (source (origin (method url-fetch) @@ -64,24 +67,128 @@ "releases/download/v" version "/wxWidgets-" version ".tar.bz2")) (sha256 - (base32 "01y89999jw5q7njrhxajincx7lydls6yq37ikazjryssrxrnw3s4")))) + (base32 "0rpsyph7l7kmpld376y0940la3c94y5vdpxmbkj8isqknimrfaf2")) + (modules '((guix build utils) + (ice-9 ftw) + (srfi srfi-26))) + (snippet + '(begin + ;; wxWidgets bundles third-party code in the "3rdparty" directory as + ;; well as the "src" directory. Remove external components that are + ;; not required. + (let ((preserved-3rdparty '("nanosvg")) + ;; The src directory contains a mixture of third party libraries + ;; and similarly-named integration code. Cautiously use a + ;; blacklist approach here. + (bundled-src '("expat" "jpeg" "png" "tiff" "zlib"))) + (with-directory-excursion "3rdparty" + (for-each delete-file-recursively + (scandir "." (negate (cut member <> + (append '("." "..") + preserved-3rdparty)))))) + (with-directory-excursion "src" + (for-each delete-file-recursively bundled-src))))))) (build-system glib-or-gtk-build-system) (inputs - (list glu - ;; XXX gstreamer-0.10 builds fail - ;; ("gstreamer" ,gstreamer-0.10) + (list catch-framework + curl + expat + glu + gstreamer + gst-plugins-base gtk+ libjpeg-turbo libmspack + libnotify + libpng + libsecret libsm libtiff mesa - webkitgtk - sdl + pcre2 + sdl2 shared-mime-info - xdg-utils)) + webkitgtk-with-libsoup2 + xdg-utils + zlib)) (native-inputs (list pkg-config)) + (arguments + (list + #:configure-flags #~'("--with-libmspack" + "--with-regex" + "--with-sdl" + "--enable-gui" + "--enable-mediactrl" + "--enable-webview" + "--enable-webviewwebkit") + #:make-flags + #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")) + #:tests? #f ;TODO + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'use-newer-webkit + (lambda _ + ;; XXX: The configure script tests only for an ancient + ;; WebKitGTK version. + (substitute* "configure" + (("webkit2gtk-4\\.0") + "webkit2gtk-4.1")))) + (add-after 'unpack 'refer-to-inputs + (lambda* (#:key inputs #:allow-other-keys) + (let ((catch (search-input-file inputs "include/catch.hpp")) + (mime (search-input-directory inputs "share/mime")) + (xdg-open (search-input-file inputs "bin/xdg-open"))) + (install-file catch "3rdparty/catch/include/") + (substitute* "src/unix/utilsx11.cpp" + (("wxExecute\\(xdg_open \\+") + (string-append "wxExecute(\"" xdg-open "\""))) + (substitute* "src/unix/mimetype.cpp" + (("/usr(/local)?/share/mime") + mime))))) + (replace 'configure + (lambda* (#:key native-inputs inputs configure-flags + #:allow-other-keys) + (let ((sh (search-input-file (or native-inputs inputs) + "bin/sh"))) + ;; The configure script does not understand some of the default + ;; options of gnu-build-system, so run it "by hand". + (apply invoke "./configure" + (string-append "SHELL=" sh) + (string-append "CONFIG_SHELL=" sh) + (string-append "--prefix=" #$output) + configure-flags))))))) + (home-page "https://www.wxwidgets.org/") + (synopsis "Widget toolkit for creating graphical user interfaces") + (description + "wxWidgets is a C++ library that lets developers create applications with +a graphical user interface. It has language bindings for Python, Perl, Ruby +and many other languages.") + (license (list l:lgpl2.0+ (l:fsf-free "file://doc/license.txt"))))) + +(define-public wxwidgets-gtk2 + (package/inherit wxwidgets + (name "wxwidgets-gtk2") + (inputs (modify-inputs (package-inputs wxwidgets) + (delete "gtk+") + (prepend gtk+-2))) + (arguments + (substitute-keyword-arguments (package-arguments wxwidgets) + ((#:configure-flags flags #~'()) + #~(append #$flags '("--with-gtk=2"))))))) + +(define-public wxwidgets-3.0 + (package + (inherit wxwidgets) + (version "3.0.5.1") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/wxWidgets/wxWidgets/" + "releases/download/v" version + "/wxWidgets-" version ".tar.bz2")) + (sha256 + (base32 + "01y89999jw5q7njrhxajincx7lydls6yq37ikazjryssrxrnw3s4")))) (arguments `(#:configure-flags '("--with-regex" "--with-libmspack" @@ -108,15 +215,18 @@ (("wxExecute\\(xdg_open \\+") (string-append "wxExecute(\"" xdg-open "\""))) (substitute* "src/unix/mimetype.cpp" - (("/usr(/local)?/share/mime") mime)) - #t)))))) - (home-page "https://www.wxwidgets.org/") - (synopsis "Widget toolkit for creating graphical user interfaces") - (description - "wxWidgets is a C++ library that lets developers create applications with -a graphical user interface. It has language bindings for Python, Perl, Ruby -and many other languages.") - (license (list l:lgpl2.0+ (l:fsf-free "file://doc/license.txt"))))) + (("/usr(/local)?/share/mime") mime)))))))))) + +(define-public wxwidgets-gtk2-3.0 + (package/inherit wxwidgets-3.0 + (name "wxwidgets-gtk2") + (inputs (modify-inputs (package-inputs wxwidgets-3.0) + (delete "gtk+") + (prepend gtk+-2))) + (arguments + (substitute-keyword-arguments (package-arguments wxwidgets-3.0) + ((#:configure-flags flags #~'()) + #~(append #$flags '("--with-gtk=2"))))))) (define-public wxwidgets-2 (package @@ -153,62 +263,6 @@ and many other languages.") (("-Wall") "-Wall -Wno-narrowing")) #t))))))) -(define-public wxwidgets-gtk2 - (package/inherit wxwidgets - (name "wxwidgets-gtk2") - (inputs (modify-inputs (package-inputs wxwidgets) - (delete "gtk+") - (prepend gtk+-2))))) - -;; Development version of wxWidgets, required to build against gstreamer-1.x. -;; This can be removed when wxWidgets is updated to the next stable version. -(define-public wxwidgets-3.1 - (package (inherit wxwidgets) - (version "3.1.5") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/wxWidgets/wxWidgets") - (commit (string-append "v" version)))) - (file-name (git-file-name "wxwidgets" version)) - (sha256 - (base32 - "0j998nzqmycafignclxmahgqm5kgs1fiqbsiyvzm7bnpnafi333y")))) - (inputs (modify-inputs (package-inputs wxwidgets) - (prepend catch-framework gstreamer gst-plugins-base))) - (arguments - (substitute-keyword-arguments (package-arguments wxwidgets) - ((#:configure-flags flags) - '(list "--with-regex" "--with-libmspack" "--with-sdl" - "--enable-mediactrl" "--enable-webviewwebkit")) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'unpack 'add-catch - (lambda* (#:key inputs #:allow-other-keys) - (install-file - (search-input-file inputs "include/catch.hpp") - "3rdparty/catch/include/"))) - (replace 'configure - (lambda* (#:key configure-flags inputs native-inputs outputs - #:allow-other-keys) - (let ((sh (search-input-file (or native-inputs inputs) - "bin/sh"))) - (apply invoke "./configure" - (string-append "SHELL=" sh) - (string-append "CONFIG_SHELL=" sh) - (string-append "--prefix=" - (assoc-ref outputs "out")) - configure-flags)))))))))) - -(define-public wxwidgets-gtk2-3.1 - (package/inherit wxwidgets-3.1 - (inputs `(("gtk+" ,gtk+-2) - ,@(alist-delete - "gtk+" - (package-inputs wxwidgets-3.1)))) - (name "wxwidgets-gtk2"))) - (define-public python-wxpython (package (name "python-wxpython") @@ -278,7 +332,7 @@ provide a 100% native look and feel for the application.") (base32 "1fdbvihw1w2vm29xj54cqgpdabhlg0ydf3clkb0qrlf7mhgkc1rz")))) (build-system glib-or-gtk-build-system) (inputs - (list wxwidgets-3.1 cairo ffmpeg)) + (list wxwidgets cairo ffmpeg)) (native-inputs (list pkg-config)) (propagated-inputs -- cgit 1.4.1