From 09103124cd976c2920f8ac99adf14bce08bd59c6 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Sat, 24 Aug 2013 13:14:16 +0400 Subject: [PATCH] Fix multilib issue Signed-off-by: Igor Gnatenko --- SDL2.spec | 13 +++++++++- SDL_config.h | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++ multilib.patch | 25 ++++++++++++++++++ 3 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 SDL_config.h create mode 100644 multilib.patch diff --git a/SDL2.spec b/SDL2.spec index c6879cb..82ab406 100644 --- a/SDL2.spec +++ b/SDL2.spec @@ -1,11 +1,13 @@ Name: SDL2 Version: 2.0.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A cross-platform multimedia library Group: System Environment/Libraries URL: http://www.libsdl.org/ License: zlib and MIT Source0: http://www.libsdl.org/tmp/release/%{name}-%{version}.tar.gz +Source1: SDL_config.h +Patch0: multilib.patch BuildRequires: alsa-lib-devel BuildRequires: audiofile-devel @@ -51,6 +53,7 @@ developing SDL applications. %prep %setup -q +%patch0 -p1 -b .multilib # Compilation without ESD sed -i -e 's/.*AM_PATH_ESD.*//' configure.in sed -i -e 's/\r//g' TODO.txt README.txt WhatsNew.txt BUGS.txt COPYING.txt CREDITS.txt README-SDL.txt @@ -69,6 +72,11 @@ make %{?_smp_mflags} %install %make_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}/SDL2/SDL_config-%{_arch}.h +install -p -m 644 %{SOURCE1} %{buildroot}%{_includedir}/SDL2/SDL_config.h + # remove libtool .la file rm -f %{buildroot}%{_libdir}/*.la # remove static .a file @@ -91,6 +99,9 @@ rm -f %{buildroot}%{_libdir}/*.a %{_datadir}/aclocal/* %changelog +* Sat Aug 24 2013 Igor Gnatenko - 2.0.0-3 +- Fix multilib issues + * Tue Aug 13 2013 Igor Gnatenko - 2.0.0-2 - SDL2 is released. Announce: - http://lists.libsdl.org/pipermail/sdl-libsdl.org/2013-August/089854.html diff --git a/SDL_config.h b/SDL_config.h new file mode 100644 index 0000000..2eb810f --- /dev/null +++ b/SDL_config.h @@ -0,0 +1,69 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 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) 2013 Igor Gnatenko + * Igor Gnatenko + */ + +/** + * \file SDL_config.h + */ + +#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__) +#include "SDL_config-ppc64.h" +#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" +#else +#error "The SDL2-devel package is not usable with the architecture." +#endif + +#undef SDL_config_wrapper_h diff --git a/multilib.patch b/multilib.patch new file mode 100644 index 0000000..955b398 --- /dev/null +++ b/multilib.patch @@ -0,0 +1,25 @@ +diff -uNr SDL2-2.0.0.orig/sdl2-config.in SDL2-2.0.0/sdl2-config.in +--- SDL2-2.0.0.orig/sdl2-config.in 2013-08-12 06:57:54.000000000 +0400 ++++ SDL2-2.0.0/sdl2-config.in 2013-08-24 12:50:01.630268642 +0400 +@@ -3,7 +3,6 @@ + prefix=@prefix@ + exec_prefix=@exec_prefix@ + exec_prefix_set=no +-libdir=@libdir@ + + @ENABLE_STATIC_FALSE@usage="\ + @ENABLE_STATIC_FALSE@Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]" +@@ -45,11 +44,11 @@ + echo -I@includedir@/SDL2 @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_RLD_FLAGS@ @SDL_STATIC_LIBS@ ++@ENABLE_STATIC_TRUE@ echo @SDL_RLD_FLAGS@ @SDL_STATIC_LIBS@ + @ENABLE_STATIC_TRUE@ ;; + *) + echo "${usage}" 1>&2