commit ba90234d747553b84ba602cfcb79b478438494ce Author: CentOS Sources Date: Tue Jan 11 12:19:08 2022 -0500 import sdl12-compat-0.0.1~git.20211125.4e4527a-3.el9 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..264a634 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/sdl12-compat-4e4527a.tar.gz diff --git a/.sdl12-compat.metadata b/.sdl12-compat.metadata new file mode 100644 index 0000000..5a4bee4 --- /dev/null +++ b/.sdl12-compat.metadata @@ -0,0 +1 @@ +1e5f8f43b1ceef2003b83cc63c3b90542c5c880b SOURCES/sdl12-compat-4e4527a.tar.gz diff --git a/SOURCES/SDL_config.h b/SOURCES/SDL_config.h new file mode 100644 index 0000000..d3efbf5 --- /dev/null +++ b/SOURCES/SDL_config.h @@ -0,0 +1,79 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2021 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* + * This SDL_config.h is a wrapper include file for the original SDL_config.h, + * which has been renamed to SDL_config-.h. There are conflicts for the + * original SDL_config.h on multilib systems, which result from arch-specific + * configuration options. Please do not use the arch-specific file directly. + * + * Copyright (C) 2021 Neal Gompa + * Neal Gompa + */ + +#ifdef SDL_config_wrapper_h +#error "SDL_config_wrapper_h should not be defined!" +#endif +#define SDL_config_wrapper_h + +#if defined(__i386__) +#include "SDL_config-i386.h" +#elif defined(__ia64__) +#include "SDL_config-ia64.h" +#elif defined(__powerpc64__) +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#include "SDL_config-ppc64.h" +#else +#include "SDL_config-ppc64le.h" +#endif +#elif defined(__powerpc__) +#include "SDL_config-ppc.h" +#elif defined(__s390x__) +#include "SDL_config-s390x.h" +#elif defined(__s390__) +#include "SDL_config-s390.h" +#elif defined(__x86_64__) +#include "SDL_config-x86_64.h" +#elif defined(__arm__) +#include "SDL_config-arm.h" +#elif defined(__alpha__) +#include "SDL_config-alpha.h" +#elif defined(__sparc__) && defined (__arch64__) +#include "SDL_config-sparc64.h" +#elif defined(__sparc__) +#include "SDL_config-sparc.h" +#elif defined(__aarch64__) +#include "SDL_config-aarch64.h" +#elif defined(__mips64) && defined(__MIPSEL__) +#include "SDL_config-mips64el.h" +#elif defined(__mips64) +#include "SDL_config-mips64.h" +#elif defined(__mips) && defined(__MIPSEL__) +#include "SDL_config-mipsel.h" +#elif defined(__mips) +#include "SDL_config-mips.h" +#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64 +#include "SDL_config-riscv64.h" +#else +#error "The sdl12-compat-devel package is not usable with the architecture." +#endif + +#undef SDL_config_wrapper_h diff --git a/SOURCES/sdl12-compat-sdlconfig-multilib.patch b/SOURCES/sdl12-compat-sdlconfig-multilib.patch new file mode 100644 index 0000000..412796b --- /dev/null +++ b/SOURCES/sdl12-compat-sdlconfig-multilib.patch @@ -0,0 +1,43 @@ +From 3cfbf8e889b50d5d19795d6f81f66345c70ce4e0 Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Wed, 9 Jun 2021 06:57:51 -0400 +Subject: [PATCH] Remove libdir definition from sdl-config for multilib support + +If we export the library directory, then the contents of sdl-config +wind up differing across architectures, which will make sdl12-compat +not multilib-safe. + +Thus, strip out the libdir stuff so that this isn't a problem. +--- + sdl-config.in | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/sdl-config.in b/sdl-config.in +index 528a355..addabd8 100755 +--- a/sdl-config.in ++++ b/sdl-config.in +@@ -10,7 +10,6 @@ + prefix=@CMAKE_INSTALL_PREFIX@ + exec_prefix=${prefix} + exec_prefix_set=no +-libdir=@CMAKE_INSTALL_FULL_LIBDIR@ + includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + + @ENABLE_STATIC_FALSE@usage="\ +@@ -53,11 +52,11 @@ while test $# -gt 0; do + echo -I${includedir}/SDL @SDL_CFLAGS@ + ;; + @ENABLE_SHARED_TRUE@ --libs) +-@ENABLE_SHARED_TRUE@ echo -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ ++@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) +-@ENABLE_STATIC_TRUE@ echo -L${libdir} @SDL_LIBS@ @SDL_STATIC_LIBS@ ++@ENABLE_STATIC_TRUE@ echo @SDL_LIBS@ @SDL_STATIC_LIBS@ + @ENABLE_STATIC_TRUE@ ;; + *) + echo "${usage}" 1>&2 +-- +2.31.1 + diff --git a/SPECS/sdl12-compat.spec b/SPECS/sdl12-compat.spec new file mode 100644 index 0000000..59c2545 --- /dev/null +++ b/SPECS/sdl12-compat.spec @@ -0,0 +1,245 @@ +%global commit 4e4527a123fb99a1677055d89c5fc74323ddc4d8 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global commitdate 20211125 + +%if 0%{?rhel} +# Features disabled for RHEL +%bcond_with static +%else +%bcond_without static +%endif + +Name: sdl12-compat +Version: 0.0.1~git.%{commitdate}.%{shortcommit} +Release: 3%{?dist} +Summary: SDL 1.2 runtime compatibility library using SDL 2.0 +# mp3 decoder code is MIT-0/PD +# SDL_opengl.h is zlib and MIT +License: zlib and (Public Domain or MIT-0) and MIT +URL: https://github.com/libsdl-org/sdl12-compat +Source0: %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz +# Multilib aware-header stub +Source1: SDL_config.h + +# Backports from upstream (0001~0500) + +# Proposed patches (0501~1000) + +# Fedora specific patches (1001+) +Patch1001: sdl12-compat-sdlconfig-multilib.patch + +BuildRequires: cmake +BuildRequires: gcc +BuildRequires: git-core +BuildRequires: make +BuildRequires: SDL2-devel +BuildRequires: mesa-libGL-devel +BuildRequires: mesa-libGLU-devel +# This replaces SDL +Obsoletes: SDL < 1.2.15-49 +Conflicts: SDL < 1.2.50 +Provides: SDL = 1.2.50 +Provides: SDL%{?_isa} = 1.2.50 +# This dlopens SDL2 (?!), so manually depend on it +Requires: SDL2%{?_isa} >= 2.0.14 + +%description +Simple DirectMedia Layer (SDL) is a cross-platform multimedia library +designed to provide fast access to the graphics frame buffer and audio device. + +This code is a compatibility layer; it provides a binary-compatible API for +programs written against SDL 1.2, but it uses SDL 2.0 behind the scenes. + +If you are writing new code, please target SDL 2.0 directly and do not use +this layer. + +%package devel +Summary: Files to develop SDL 1.2 applications using SDL 2.0 +Requires: %{name}%{?_isa} = %{version}-%{release} +# This replaces SDL-devel +Obsoletes: SDL-devel < 1.2.15-49 +%if ! %{with static} +# We don't provide the static library, but we want to replace SDL-static anyway +Obsoletes: SDL-static < 1.2.15-49 +%endif +Conflicts: SDL-devel < 1.2.50 +Provides: SDL-devel = 1.2.50 +Provides: SDL-devel%{?_isa} = 1.2.50 +# Add deps required to compile SDL apps +## For SDL_opengl.h +Requires: pkgconfig(gl) +Requires: pkgconfig(glu) +## For SDL_syswm.h +Requires: pkgconfig(x11) +Requires: pkgconfig(xproto) + +%description devel +Simple DirectMedia Layer (SDL) is a cross-platform multimedia library +designed to provide fast access to the graphics frame buffer and audio device. + +This code is a compatibility layer; it provides a source-compatible API for +programs written against SDL 1.2, but it uses SDL 2.0 behind the scenes. + +If you are writing new code, please target SDL 2.0 directly and do not use +this layer. + + +%if %{with static} +%package static +Summary: Static library to develop SDL 1.2 applications using SDL 2.0 +Requires: %{name}-devel%{?_isa} = %{version}-%{release} +# This replaces SDL-static +Obsoletes: SDL-static < 1.2.15-49 +Conflicts: SDL-static < 1.2.50 +Provides: SDL-static = 1.2.50 +Provides: SDL-static%{?_isa} = 1.2.50 + +%description static +Simple DirectMedia Layer (SDL) is a cross-platform multimedia library +designed to provide fast access to the graphics frame buffer and audio device. + +This code is a compatibility layer; it provides a static link library for +programs written against SDL 1.2, but it uses SDL 2.0 behind the scenes. +Note that applications that use this library will need to declare SDL2 as +a dependency manually, as the library is dlopen()'d to preserve APIs between +SDL-1.2 and SDL-2.0. + +If you are writing new code, please target SDL 2.0 directly and do not use +this layer. +%endif + + +%prep +%autosetup -n %{name}-%{commit} -S git_am + + +%build +%cmake %{?with_static:-DSTATICDEVEL=ON} +%cmake_build + + +%install +%cmake_install + +# Rename SDL_config.h to SDL_config-.h to avoid file conflicts on +# multilib systems and install SDL_config.h wrapper +mv %{buildroot}/%{_includedir}/SDL/SDL_config.h %{buildroot}/%{_includedir}/SDL/SDL_config-%{_arch}.h +install -m644 %{SOURCE1} %{buildroot}/%{_includedir}/SDL/SDL_config.h + +%if ! %{with static} +# Delete leftover static files +rm -rf %{buildroot}%{_libdir}/*.a +%endif + + +%files +%license LICENSE.txt +%doc README.md BUGS.txt +%{_libdir}/libSDL-1.2.so.* + +%files devel +%{_bindir}/sdl-config +%{_datadir}/aclocal/sdl.m4 +%{_includedir}/SDL/ +%{_libdir}/libSDL-1.2.so +%{_libdir}/libSDL.so +%{_libdir}/pkgconfig/sdl12_compat.pc + +%if %{with static} +%files static +%{_libdir}/libSDL.a +%{_libdir}/libSDLmain.a +%endif + + +%changelog +* Tue Dec 07 2021 Wim Taymans - 0.0.1~git.20211125.4e4527a-3 +- Bump for rebuild after resync + +* Wed Dec 01 2021 Neal Gompa - 0.0.1~git.20211125.4e4527a-2 +- Obsolete the SDL package properly + +* Sat Nov 27 2021 Neal Gompa - 0.0.1~git.20211125.4e4527a-1 +- Update to new snapshot release + +* Sun Nov 07 2021 Neal Gompa - 0.0.1~git.20211107.a10d6b6-1 +- Update to new snapshot release + +* Sun Sep 26 2021 Neal Gompa - 0.0.1~git.20210926.c6cfc8f-1 +- Update to new snapshot release +- Ensure SDL2 dependency is arched + +* Sun Sep 12 2021 Neal Gompa - 0.0.1~git.20210909.a98590a-1 +- Update to new snapshot release + +* Thu Aug 26 2021 Neal Gompa - 0.0.1~git.20210825.b5f7170-1 +- Update to new snapshot release + +* Sun Aug 22 2021 Neal Gompa - 0.0.1~git.20210814.a3bfcb2-1 +- Update to new snapshot release + +* Sun Jul 25 2021 Neal Gompa - 0.0.1~git.20210719.aa9919b-1 +- Update to new snapshot release + +* Fri Jul 23 2021 Fedora Release Engineering - 0.0.1~git.20210709.51254e5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jul 09 2021 Neal Gompa - 0.0.1~git.20210709.51254e5-1 +- Update to new snapshot release + +* Tue Jun 29 2021 Neal Gompa - 0.0.1~git.20210628.cf47f88-1 +- Update to new snapshot release + +* Mon Jun 28 2021 Neal Gompa - 0.0.1~git.20210624.08b5def-1 +- Update to new snapshot release + +* Sun Jun 20 2021 Neal Gompa - 0.0.1~git.20210619.4ad7ba6-2 +- Update devel dependencies based on upstream feedback + +* Sun Jun 20 2021 Neal Gompa - 0.0.1~git.20210619.4ad7ba6-1 +- Update to new snapshot release + +* Sun Jun 20 2021 Neal Gompa - 0.0.1~git.20210618.f44f295-2 +- Add devel dependencies expected by SDL packages to devel subpackage + +* Fri Jun 18 2021 Neal Gompa - 0.0.1~git.20210618.f44f295-1 +- Update to new snapshot release + +* Sun Jun 13 2021 Neal Gompa - 0.0.1~git.20210612.44f299f-1 +- Update to new snapshot release +- Update license tag information + +* Sat Jun 12 2021 Neal Gompa - 0.0.1~git.20210612.c0504eb-1 +- Update to new snapshot release + +* Thu Jun 10 2021 Neal Gompa - 0.0.1~git.20210610.21830e8-1 +- Update to new snapshot release +- Add static link library for non-RHEL + +* Wed Jun 09 2021 Neal Gompa - 0.0.1~git.20210609.efe9791-1 +- Update to new snapshot release +- Refresh patch for multilib support + +* Thu Jun 03 2021 Neal Gompa - 0.0.1~git.20210602.cc5826a-3 +- Fix for multilib support + +* Thu Jun 03 2021 Neal Gompa - 0.0.1~git.20210602.cc5826a-2 +- Add missing SDL2 dependency and fix Obsoletes + +* Wed Jun 02 2021 Neal Gompa - 0.0.1~git.20210602.cc5826a-1 +- Update to new snapshot release + +* Sat May 29 2021 Neal Gompa - 0.0.1~git.20210528.646ecd7-0.1 +- Update to new snapshot release + +* Fri May 28 2021 Neal Gompa - 0.0.1~git.20210527.a915ff1-0.1 +- Update to new snapshot release + +* Wed May 26 2021 Neal Gompa - 0.0.1~git.20210526.848ad42-0.1 +- Update to new snapshot release + +* Mon May 24 2021 Neal Gompa - 0.0.1~git.20210524.cf71450-0.1 +- Update to new snapshot release + +* Sat May 15 2021 Neal Gompa - 0~git.20210515.9f2d88a-1 +- Initial package