diff --git a/packages/sdl2-compat/pkgbuild.py b/packages/sdl2-compat/pkgbuild.py new file mode 100644 index 0000000..e6678c7 --- /dev/null +++ b/packages/sdl2-compat/pkgbuild.py @@ -0,0 +1,36 @@ +from lib import cpp, packie +from lib.make import * + + +version("2.32.74+compat3") +description("An SDL2 compatibility layer that uses SDL3 behind the scenes.") +maintainer("sisungo ") +source_managed("github://libsdl-org/sdl2-compat#release-2.32.74") + +builddep("shortcut/c++") +builddep("shortcut/cmake") +builddep("libsdl-dev (~3) @target") + + +def build(): + cpp.cmake([ + "-DCMAKE_INSTALL_PREFIX=/", + f"-DCMAKE_INSTALL_LIBDIR={get_prefix('libsdl')}/lib", + f"-DCMAKE_INSTALL_INCLUDEDIR={get_prefix('libsdl-dev')}/include", + f"-DSDL3_INCLUDE_DIRS={packie.prefix_of('libsdl-dev (~3)')}/include", + "-DSDL2COMPAT_X11=OFF", + ]) + cpp.ninja() + cpp.ninja_install() + +on_build(build) + + +package("libsdl") +dep("libsdl (~3) @same-arch") +cpp.use_auto_pack(["lib"]) + +package("libsdl-dev") +dep("libsdl (same)") +dep("libsdl-dev (~3) @same-arch") +cpp.use_auto_pack(["dev", "bin"])