diff options
Diffstat (limited to 'user/sdl2')
-rw-r--r-- | user/sdl2/APKBUILD | 46 | ||||
-rw-r--r-- | user/sdl2/altivec-detection.patch | 22 | ||||
-rw-r--r-- | user/sdl2/sdl2-soname.patch | 13 |
3 files changed, 59 insertions, 22 deletions
diff --git a/user/sdl2/APKBUILD b/user/sdl2/APKBUILD index 0ba480012..6e380a778 100644 --- a/user/sdl2/APKBUILD +++ b/user/sdl2/APKBUILD @@ -1,42 +1,44 @@ # Contributor: August Klein <amatcoder@gmail.com> # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=sdl2 -pkgver=2.0.10 -pkgrel=0 +pkgver=2.0.22 +pkgrel=1 pkgdesc="Low level audio, keyboard, mouse, joystick and graphics library" url="https://www.libsdl.org/" arch="all" +options="!check" # No test suite. license="zlib" depends="" makedepends="alsa-lib-dev libx11-dev libxcursor-dev libxext-dev libxi-dev libxkbcommon-dev libxrandr-dev libxrender-dev libusb-dev mesa-dev - libxscrnsaver-dev dbus-dev eudev-dev pulseaudio-dev" + libxscrnsaver-dev dbus-dev eudev-dev pulseaudio-dev libglvnd-dev cmake + libxinerama-dev wayland-dev wayland-protocols" subpackages="$pkgname-dev" -source="https://www.libsdl.org/release/SDL2-$pkgver.tar.gz" +source="https://www.libsdl.org/release/SDL2-$pkgver.tar.gz + altivec-detection.patch + sdl2-soname.patch + " builddir="$srcdir/SDL2-$pkgver" build() { # pmOS needs DirectFB for battery animations and LUKS unlocking - ./configure \ - --build=$CBUILD \ - --host=$CHOST \ - --prefix=/usr \ - --enable-alsa \ - --enable-clock_gettime \ - --disable-arts \ - --disable-esd \ - --disable-nas \ - --disable-rpath \ - --with-x \ - make -} - -check() { - [ "$($builddir/sdl2-config --version)" = "$pkgver" ] + if [ "$CBUILD" != "$CHOST" ]; then + CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" + fi + cmake \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DBUILD_SHARED_LIBS=True \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_C_FLAGS="$CFLAGS" \ + ${CMAKE_CROSSOPTS} -Bbuild + make -C build } package() { - make DESTDIR="$pkgdir" install + make DESTDIR="$pkgdir" -C build install } -sha512sums="f49b869362699b3282f6e82920e59c7fac581bcbf955f18a81cc126293c08093a90df7fcb39517cc8bc32708d2213fe645a42b655d6d811c1386efebb3d3c798 SDL2-2.0.10.tar.gz" +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); diff --git a/user/sdl2/sdl2-soname.patch b/user/sdl2/sdl2-soname.patch new file mode 100644 index 000000000..7ed5b14bf --- /dev/null +++ b/user/sdl2/sdl2-soname.patch @@ -0,0 +1,13 @@ +The library name is SDL2-2.0, not SDL2. This fixes builds against SDL. + +--- SDL2-2.0.10/CMakeLists.txt.old 2019-07-25 04:32:36.000000000 +0000 ++++ SDL2-2.0.10/CMakeLists.txt 2020-01-03 17:23:42.451699149 +0000 +@@ -233,7 +233,7 @@ + + # Those are used for pkg-config and friends, so that the SDL2.pc, sdl2-config, + # etc. are created correctly. +-set(SDL_LIBS "-lSDL2") ++set(SDL_LIBS "-lSDL2-2.0") + set(SDL_CFLAGS "") + + # When building shared lib for Windows with MinGW, |