diff --git a/SDL_config.h b/SDL_config.h new file mode 100644 index 0000000000000000000000000000000000000000..d3efbf513478a09487efd7b04361b65ced3d6bc9 --- /dev/null +++ b/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/sdl12-compat-sdlconfig-multilib.patch b/sdl12-compat-sdlconfig-multilib.patch new file mode 100644 index 0000000000000000000000000000000000000000..412796bb356bb92c4f855fabb35518c21e53e7d7 --- /dev/null +++ b/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/sdl12-compat.spec b/sdl12-compat.spec index 5d50110401d257b1e86f97aca1fd82ae5561e9f5..68e56aa35ea8208c2ea2d8a0dfb80e0a8cabe9e4 100644 --- a/sdl12-compat.spec +++ b/sdl12-compat.spec @@ -1,14 +1,16 @@ -%define anolis_release 1 +%define anolis_release 2 Name: sdl12-compat -Version: 1.2.68 +Version: 1.2.68 Release: %{anolis_release}%{?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/release-%{version}/%{name}-%{version}.tar.gz +Source0: https://github.com/libsdl-org/sdl12-compat/archive/release-1.2.68/sdl12-compat-1.2.68.tar.gz +Source1: SDL_config.h +Patch1: sdl12-compat-sdlconfig-multilib.patch BuildRequires: cmake BuildRequires: gcc @@ -107,6 +109,8 @@ rm -rf %{buildroot}%{_libdir}/*.a %doc README.md BUGS.md COMPATIBILITY.md %changelog +* Mon Sep 29 2025 wenyuzifang - 1.2.68-2 +- Ensure sdl-config works across architectures by removing hardcoded library paths * Wed Feb 19 2025 Chang Gao - 1.2.68-1 - Update to 1.2.68 - Remove patches which already exist in upstream