commit 45e6cd0644df4b12df98a2a4ca653cef1919072f
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Sun Nov 1 21:56:10 2020 +0000
fix
Restrict-the-usage-of-undocumented-wxBitmap.patch | 35 +++++++++++++++++++++++
aegisub.spec | 6 ++--
2 files changed, 39 insertions(+), 2 deletions(-)
---
diff --git a/Restrict-the-usage-of-undocumented-wxBitmap.patch
b/Restrict-the-usage-of-undocumented-wxBitmap.patch
new file mode 100644
index 0000000..2d82ad4
--- /dev/null
+++ b/Restrict-the-usage-of-undocumented-wxBitmap.patch
@@ -0,0 +1,35 @@
+From 5f235ff459e6a7ec36639894d1f45a638a9d73f3 Mon Sep 17 00:00:00 2001
+From: wangqr <wangqr(a)wangqr.tk>
+Date: Sun, 23 Feb 2020 00:42:45 -0500
+Subject: [PATCH] Restrict the usage of undocumented wxBitmap ctor to wxWidgets
+ > 3.1.0
+
+Fix build for wxWidgets 3.0
+---
+ src/libresrc/libresrc.cpp | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/libresrc/libresrc.cpp b/src/libresrc/libresrc.cpp
+index 79dc0f16c..b308c69d5 100644
+--- a/src/libresrc/libresrc.cpp
++++ b/src/libresrc/libresrc.cpp
+@@ -22,9 +22,17 @@
+
+ wxBitmap libresrc_getimage(const unsigned char *buff, size_t size, double scale, int
dir) {
+ wxMemoryInputStream mem(buff, size);
++#if wxCHECK_VERSION(3, 1, 0)
++ // Since wxWidgets 3.1.0, there is an undocumented third parameter in the ctor of
wxBitmap from wxImage
++ // This "scale" parameter sets the logical scale factor of the created
wxBitmap
+ if (dir != wxLayout_RightToLeft)
+- return wxBitmap(wxImage(mem), -1, scale);
+- return wxBitmap(wxImage(mem).Mirror(), -1, scale);
++ return wxBitmap(wxImage(mem), wxBITMAP_SCREEN_DEPTH, scale);
++ return wxBitmap(wxImage(mem).Mirror(), wxBITMAP_SCREEN_DEPTH, scale);
++#else
++ if (dir != wxLayout_RightToLeft)
++ return wxBitmap(wxImage(mem));
++ return wxBitmap(wxImage(mem).Mirror());
++#endif
+ }
+
+ wxIcon libresrc_geticon(const unsigned char *buff, size_t size) {
diff --git a/aegisub.spec b/aegisub.spec
index 08781a6..ec3af5d 100644
--- a/aegisub.spec
+++ b/aegisub.spec
@@ -24,6 +24,7 @@ Patch4: luabins.patch
Patch5: aegisub-git-version.patch
#
https://github.com/wangqr/Aegisub/commit/f4cc905c69ca69c68cb95674cefce4ab...
Patch6: aegisub-fix_build_with_make4.3.patch
+Patch7: Restrict-the-usage-of-undocumented-wxBitmap.patch
# luajit isn't available on powerpc
# boost m4 detection is failing on i686 and armv7hl
@@ -54,7 +55,7 @@ BuildRequires: luajit-devel
BuildRequires: portaudio-devel
BuildRequires: pulseaudio-libs-devel
BuildRequires: uchardet-devel
-BuildRequires: wxGTK-devel
+BuildRequires: wxGTK3-devel
BuildRequires: zlib-devel
#needed for the perl script downloading the additional documentation from wiki
@@ -80,12 +81,13 @@ including a built-in real-time video preview.
%build
+export CXXFLAGS="%{optflags} -Wno-deprecated-declarations
-Wno-deprecated-copy"
./autogen.sh
%configure \
--disable-update-checker \
--with-player-audio=PulseAudio \
--without-oss \
- --with-wx-config=wx-config-3.1
+ --with-wx-config=wx-config-3.0
%make_build