[packages/SDL2-compat] new
atler
atler at pld-linux.org
Sun Mar 2 17:06:39 CET 2025
commit d9b62dda21768e6a2c015e53d2e0753396fb5dd2
Author: Jan Palus <atler at pld-linux.org>
Date: Sun Mar 2 16:33:48 2025 +0100
new
SDL2-compat.spec | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
SDL2-config.patch | 16 +++++++++
2 files changed, 119 insertions(+)
---
diff --git a/SDL2-compat.spec b/SDL2-compat.spec
new file mode 100644
index 0000000..6506dcb
--- /dev/null
+++ b/SDL2-compat.spec
@@ -0,0 +1,103 @@
+#
+# Conditional build:
+%bcond_without static_libs # don't build static libraries
+
+Summary: SDL2 compatibility layer that uses SDL3 behind the scenes
+Name: SDL2-compat
+Version: 2.32.52
+Release: 1
+License: Zlib (BSD-like)
+Group: Libraries
+Source0: http://www.libsdl.org/release/sdl2-compat-%{version}.tar.gz
+# Source0-md5: 06419b1c2bc0dbd7fd5da399fa804951
+Patch0: SDL2-config.patch
+URL: http://www.libsdl.org/
+BuildRequires: SDL3-devel
+BuildRequires: automake
+BuildRequires: cmake >= 3.0
+BuildRequires: pkgconfig >= 1:0.7
+BuildRequires: rpmbuild(macros) >= 1.742
+# runtime (dlopened) dep actually but require it for convenience
+%requires_ge_to SDL3 SDL3-devel
+Provides: SDL2 = %{version}-%{release}
+Obsoletes: SDL2
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+SDL (Simple DirectMedia Layer) is a library that allows you portable,
+low level access to a video framebuffer, audio output, mouse, and
+keyboard. It can support both windowed and DGA modes of XFree86, and
+it is designed to be portable - applications linked with SDL can also
+be built on Win32 and BeOS.
+
+This package provides SDL2 compatibility layer that uses SDL3 behind
+the scenes.
+
+%package devel
+Summary: SDL2-compat Header files
+Group: Development/Libraries
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Provides: SDL2-devel = %{version}-%{release}
+Obsoletes: SDL2-devel
+
+%description devel
+SDL2-compat header files.
+
+%package static
+Summary: SDL2-compat static libraries
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}-%{release}
+Provides: SDL2-static = %{version}-%{release}
+Obsoletes: SDL2-static
+
+%description static
+SDL2-compat static libraries.
+
+%prep
+%setup -q -n sdl2-compat-%{version}
+%patch -P0 -p1
+
+%build
+install -d build
+cd build
+%cmake .. \
+ %{cmake_on_off static_libs SDL2COMPAT_STATIC} \
+ -DSDL2COMPAT_TESTS:BOOL=OFF
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} -C build install \
+ DESTDIR=$RPM_BUILD_ROOT \
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc BUGS.md COMPATIBILITY.md LICENSE.txt README.md
+%attr(755,root,root) %{_libdir}/libSDL2-2.0.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libSDL2-2.0.so.0
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/sdl2-config
+%attr(755,root,root) %{_libdir}/libSDL2.so
+%attr(755,root,root) %{_libdir}/libSDL2-2.0.so
+%{_libdir}/libSDL2_test.a
+%{_libdir}/libSDL2main.a
+%{_includedir}/SDL2
+%{_aclocaldir}/sdl2.m4
+%{_pkgconfigdir}/sdl2_compat.pc
+%{_libdir}/cmake/SDL2
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libSDL2.a
+%endif
diff --git a/SDL2-config.patch b/SDL2-config.patch
new file mode 100644
index 0000000..d7c94cb
--- /dev/null
+++ b/SDL2-config.patch
@@ -0,0 +1,16 @@
+--- SDL2-2.24.0/sdl2-config.in.orig 2022-08-19 19:06:52.080709841 +0200
++++ SDL2-2.24.0/sdl2-config.in 2022-08-19 19:07:49.427138664 +0200
+@@ -49,11 +49,11 @@
+ echo -I${includedir}/SDL2 @SDL_CFLAGS@
+ ;;
+ @ENABLE_SHARED_TRUE@ --libs)
+- at ENABLE_SHARED_TRUE@ echo -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@
++ at ENABLE_SHARED_TRUE@ echo @SDL_RLD_FLAGS@ @SDL_LIBS@
+ @ENABLE_SHARED_TRUE@ ;;
+ @ENABLE_STATIC_TRUE@@ENABLE_SHARED_TRUE@ --static-libs)
+ @ENABLE_STATIC_TRUE@@ENABLE_SHARED_FALSE@ --libs|--static-libs)
+- at ENABLE_STATIC_TRUE@ echo -L${libdir} @SDL_LIBS@ @SDL_STATIC_LIBS@
++ at ENABLE_STATIC_TRUE@ echo @SDL_LIBS@ @SDL_STATIC_LIBS@
+ @ENABLE_STATIC_TRUE@ ;;
+ *)
+ echo "${usage}" 1>&2
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/SDL2-compat.git/commitdiff/d9b62dda21768e6a2c015e53d2e0753396fb5dd2
More information about the pld-cvs-commit
mailing list