Fix multilib issue

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
This commit is contained in:
Igor Gnatenko 2013-08-24 13:14:16 +04:00
parent 0717ad6b7c
commit 09103124cd
3 changed files with 106 additions and 1 deletions

View File

@ -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-<arch>.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 <i.gnatenko.brain@gmail.com> - 2.0.0-3
- Fix multilib issues
* Tue Aug 13 2013 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 2.0.0-2
- SDL2 is released. Announce:
- http://lists.libsdl.org/pipermail/sdl-libsdl.org/2013-August/089854.html

69
SDL_config.h Normal file
View File

@ -0,0 +1,69 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
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-<arch>.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 <i.gnatenko.brain@gmail.com>
*/
/**
* \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

25
multilib.patch Normal file
View File

@ -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