summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--user/sdl2/APKBUILD4
-rw-r--r--user/sdl2/altivec-detection.patch22
2 files changed, 25 insertions, 1 deletions
diff --git a/user/sdl2/APKBUILD b/user/sdl2/APKBUILD
index 22026bb6c..6e380a778 100644
--- a/user/sdl2/APKBUILD
+++ b/user/sdl2/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=sdl2
pkgver=2.0.22
-pkgrel=0
+pkgrel=1
pkgdesc="Low level audio, keyboard, mouse, joystick and graphics library"
url="https://www.libsdl.org/"
arch="all"
@@ -15,6 +15,7 @@ makedepends="alsa-lib-dev libx11-dev libxcursor-dev libxext-dev libxi-dev
libxinerama-dev wayland-dev wayland-protocols"
subpackages="$pkgname-dev"
source="https://www.libsdl.org/release/SDL2-$pkgver.tar.gz
+ altivec-detection.patch
sdl2-soname.patch
"
builddir="$srcdir/SDL2-$pkgver"
@@ -39,4 +40,5 @@ package() {
}
sha512sums="ca4b690433cd4d9d73b797da98666317128e7e817ab60e874a49d94791ea41e8a6b4fc43649593120daa0702190c0f8a6ed326c908d87375c8da9f369d994f6a SDL2-2.0.22.tar.gz
+f7ca983c0450e95a760041c5c329e715bb513100efbd12c2469fd283e7ca4d3643b8180d6d5e64c66075ea03e1e88364853aa76d3db6dbcc8d22e8eb385881d6 altivec-detection.patch
81b5807cd9f2683231c14562e961467fcd7ba257140d1a266932d6a6a5103633e3af896c09b261620b2934d521809e08ed79d3287c0897f4783c6afc1c01a566 sdl2-soname.patch"
diff --git a/user/sdl2/altivec-detection.patch b/user/sdl2/altivec-detection.patch
new file mode 100644
index 000000000..ccb60a375
--- /dev/null
+++ b/user/sdl2/altivec-detection.patch
@@ -0,0 +1,22 @@
+Use getauxval on Linux if available.
+
+--- SDL2-2.0.22/src/cpuinfo/SDL_cpuinfo.c.old 2022-01-08 02:29:52.000000000 +0000
++++ SDL2-2.0.22/src/cpuinfo/SDL_cpuinfo.c 2025-04-27 18:58:12.097867624 +0000
+@@ -113,7 +113,7 @@
+ #define CPU_HAS_AVX512F (1 << 12)
+ #define CPU_HAS_ARM_SIMD (1 << 13)
+
+-#if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP && !__MACOSX__ && !__OpenBSD__ && !__FreeBSD__
++#if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP && !__MACOSX__ && !__OpenBSD__ && !__FreeBSD__ && !__linux__
+ /* This is the brute force way of detecting instruction sets...
+ the idea is borrowed from the libmpeg2 library - thanks!
+ */
+@@ -333,6 +333,8 @@
+ elf_aux_info(AT_HWCAP, &cpufeatures, sizeof(cpufeatures));
+ altivec = cpufeatures & PPC_FEATURE_HAS_ALTIVEC;
+ return altivec;
++#elif defined(__linux__) && defined(__powerpc__) && HAVE_GETAUXVAL
++ altivec = getauxval(AT_HWCAP) & PPC_FEATURE_HAS_ALTIVEC;
+ #elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
+ void (*handler) (int sig);
+ handler = signal(SIGILL, illegal_instruction);