Package Details: sdl2-compat-git r701.44a2d4d-1

Git Clone URL: https://aur.archlinux.org/sdl2-compat-git.git (read-only, click to copy)
Package Base: sdl2-compat-git
Description: SDL2 runtime compatibility library using SDL3
Upstream URL: https://github.com/libsdl-org/sdl2-compat
Licenses: MIT
Conflicts: sdl2
Provides: sdl2
Submitter: DexterHaxxor
Maintainer: DexterHaxxor (HurricanePootis)
Last Packager: HurricanePootis
Votes: 2
Popularity: 0.018988
First Submitted: 2024-03-28 08:49 (UTC)
Last Updated: 2024-11-08 00:00 (UTC)

Required by (1334)

Sources (1)

Latest Comments

HurricanePootis commented on 2024-05-22 22:47 (UTC)

Hello, this package currently has some problems.

  1. Does not have git as a make depend
  2. Uses an unnecessary and incorrect replace(). Replace is only meant to forcefully replace old versions of software with new one. It is not meant for software that is providing an alternative, like a compatability layer while the original SDL2 is around.
  3. Cmake build type needs to be set to None to respect Arch Linux build flags in /etc/makepkg.conf. Read more on the wiki for Cmake packages.

I am the maintainer for lib32-sdl3-git, lib32-sdl2-compat-git, and (co-maintainer) for sdl3-git. I would not mind being a co-maintainer for this as well.

Here is the patch:

diff --git a/PKGBUILD b/PKGBUILD
index 1029b0f..e3c6c70 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,31 +2,38 @@
 # Contributor: Jelle van der Waa <jelle@archlinux.org>

 pkgname=sdl2-compat-git
-pkgver=r522.44fec4d
+pkgver=r561.cddd4fa
 pkgrel=1
 pkgdesc="SDL2 runtime compatibility library using SDL3"
 url="https://github.com/libsdl-org/sdl2-compat"
 depends=('sdl3')
-makedepends=('cmake' 'libgl' 'ninja')
+makedepends=('cmake' 'libgl' 'ninja' 'git')
 arch=('x86_64')
 conflicts=('sdl2')
 provides=('sdl2')
-replaces=('sdl2')
 license=('MIT')
 source=("git+https://github.com/libsdl-org/sdl2-compat.git")
 sha512sums=('SKIP')

 pkgver() {
-  cd sdl2-compat
+  cd "$srcdir/sdl2-compat"
   printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
 }

 build() {
-  cmake -B build -S sdl2-compat -DCMAKE_INSTALL_PREFIX=/usr -GNinja
+  cd "$srcdir"
+
+  cmake -B build -S sdl2-compat \
+  -DCMAKE_INSTALL_PREFIX=/usr \
+  -DCMAKE_BUILD_TYPE=None \
+  -GNinja
+
   cmake --build build
 }

 package() {
+  cd "$srcdir"
+
   DESTDIR="${pkgdir}" cmake --install build
   install -Dm644 "${srcdir}/sdl2-compat/LICENSE.txt" "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
 }