From b980eade7660e4880dd14d647cc119da2fac267a Mon Sep 17 00:00:00 2001 From: lb90 Date: Sat, 28 Jun 2025 10:52:00 +0200 Subject: [PATCH] Libepoxy add patch (#24646) * libepoxy: Add patch to fix use of uninitialized dispatch table Fixes #24571 * libepoxy: Remove unused patch --- ...Ensure-dispatch-table-initialization.patch | 70 +++++++++++++++++++ mingw-w64-libepoxy/002-mingw-dllimport.patch | 11 --- mingw-w64-libepoxy/PKGBUILD | 9 ++- 3 files changed, 76 insertions(+), 14 deletions(-) create mode 100644 mingw-w64-libepoxy/0001-Ensure-dispatch-table-initialization.patch delete mode 100644 mingw-w64-libepoxy/002-mingw-dllimport.patch diff --git a/mingw-w64-libepoxy/0001-Ensure-dispatch-table-initialization.patch b/mingw-w64-libepoxy/0001-Ensure-dispatch-table-initialization.patch new file mode 100644 index 0000000000..0b202fe781 --- /dev/null +++ b/mingw-w64-libepoxy/0001-Ensure-dispatch-table-initialization.patch @@ -0,0 +1,70 @@ +From ee931cf79f5d0d138d5547a3d771cc8f49881483 Mon Sep 17 00:00:00 2001 +From: Luca Bacci +Date: Wed, 25 Jun 2025 15:41:18 +0200 +Subject: [PATCH] Ensure dispatch table initialization + +Fixes https://github.com/msys2/MINGW-packages/issues/24571 +--- + src/dispatch_wgl.c | 18 ++++-------------- + 1 file changed, 4 insertions(+), 14 deletions(-) + +diff --git a/src/dispatch_wgl.c b/src/dispatch_wgl.c +index 7baf130..a65ee01 100644 +--- a/src/dispatch_wgl.c ++++ b/src/dispatch_wgl.c +@@ -144,11 +144,9 @@ DllMain(HINSTANCE dll, DWORD reason, LPVOID reserved) + WRAPPER_VISIBILITY (BOOL) + WRAPPER(epoxy_wglMakeCurrent)(HDC hdc, HGLRC hglrc) + { +- BOOL ret = epoxy_wglMakeCurrent_unwrapped(hdc, hglrc); +- + epoxy_handle_external_wglMakeCurrent(); + +- return ret; ++ return epoxy_wglMakeCurrent_unwrapped(hdc, hglrc); + } + + +@@ -157,12 +155,9 @@ WRAPPER(epoxy_wglMakeContextCurrentARB)(HDC hDrawDC, + HDC hReadDC, + HGLRC hglrc) + { +- BOOL ret = epoxy_wglMakeContextCurrentARB_unwrapped(hDrawDC, hReadDC, +- hglrc); +- + epoxy_handle_external_wglMakeCurrent(); + +- return ret; ++ return epoxy_wglMakeContextCurrentARB_unwrapped(hDrawDC, hReadDC, hglrc); + } + + +@@ -171,23 +166,18 @@ WRAPPER(epoxy_wglMakeContextCurrentEXT)(HDC hDrawDC, + HDC hReadDC, + HGLRC hglrc) + { +- BOOL ret = epoxy_wglMakeContextCurrentEXT_unwrapped(hDrawDC, hReadDC, +- hglrc); +- + epoxy_handle_external_wglMakeCurrent(); + +- return ret; ++ return epoxy_wglMakeContextCurrentEXT_unwrapped(hDrawDC, hReadDC, hglrc); + } + + + WRAPPER_VISIBILITY (BOOL) + WRAPPER(epoxy_wglMakeAssociatedContextCurrentAMD)(HGLRC hglrc) + { +- BOOL ret = epoxy_wglMakeAssociatedContextCurrentAMD_unwrapped(hglrc); +- + epoxy_handle_external_wglMakeCurrent(); + +- return ret; ++ return epoxy_wglMakeAssociatedContextCurrentAMD_unwrapped(hglrc); + } + + PFNWGLMAKECURRENTPROC epoxy_wglMakeCurrent = epoxy_wglMakeCurrent_wrapped; +-- +2.49.0.windows.1 + diff --git a/mingw-w64-libepoxy/002-mingw-dllimport.patch b/mingw-w64-libepoxy/002-mingw-dllimport.patch deleted file mode 100644 index 27e014bbbd..0000000000 --- a/mingw-w64-libepoxy/002-mingw-dllimport.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- libepoxy-1.5.10/include/epoxy/common.h.orig 2025-06-16 22:22:26.475976900 +0300 -+++ libepoxy-1.5.10/include/epoxy/common.h 2025-06-16 22:22:41.998741600 +0300 -@@ -38,7 +38,7 @@ - #endif - - #ifndef EPOXY_PUBLIC --# if defined(_MSC_VER) -+# if defined(_WIN32) - # define EPOXY_PUBLIC __declspec(dllimport) extern - # else - # define EPOXY_PUBLIC extern diff --git a/mingw-w64-libepoxy/PKGBUILD b/mingw-w64-libepoxy/PKGBUILD index 77a6625a27..3e422347d0 100644 --- a/mingw-w64-libepoxy/PKGBUILD +++ b/mingw-w64-libepoxy/PKGBUILD @@ -4,7 +4,7 @@ _realname=libepoxy pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=1.5.10 -pkgrel=6 +pkgrel=7 pkgdesc="A library for handling OpenGL function pointer management for you (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64') @@ -20,17 +20,20 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc" source=("https://github.com/anholt/libepoxy/archive/${pkgver}/${_realname}-${pkgver}.tar.gz" "001-egl-missing-prototype.patch" "https://github.com/anholt/libepoxy/pull/285.patch" - "https://github.com/anholt/libepoxy/pull/294.patch") + "https://github.com/anholt/libepoxy/pull/294.patch" + "0001-Ensure-dispatch-table-initialization.patch") sha256sums=('a7ced37f4102b745ac86d6a70a9da399cc139ff168ba6b8002b4d8d43c900c15' '5fb6b63e93cb92052f25c0ac230f3b4d89054a28e02dc37a42eb9f866cd0cbc1' 'e86994609738190e9fb84ea96184639a1282ee4eee5a5ae0272d9a2d83a802ce' - '3ef53c2126e3a27bc090f40bbc423ae70e08edbc6291a74f22a0bebcd00da8a8') + '3ef53c2126e3a27bc090f40bbc423ae70e08edbc6291a74f22a0bebcd00da8a8' + 'd035fc71735ce8364cb2e8c4783c9e0396bc84bff29221de48f152bd36e60b9f') prepare() { cd ${_realname}-${pkgver} patch -p1 -i ${srcdir}/001-egl-missing-prototype.patch patch -p1 -i ${srcdir}/285.patch patch -p1 -i ${srcdir}/294.patch + patch -p1 -i ${srcdir}/0001-Ensure-dispatch-table-initialization.patch } build() {