Accepting request 70034 from home:ketheriel:UnknownHorizons

New package - FIFE Engine, a 2D game engine under active development. Dependency for "Unknown Horizons" soon to be provided.

OBS-URL: https://build.opensuse.org/request/show/70034
OBS-URL: https://build.opensuse.org/package/show/games/fife?expand=0&rev=1
This commit is contained in:
Pavol Rusnak 2011-05-11 13:33:53 +00:00 committed by Git OBS Bridge
commit 21cd8ee0ef
8 changed files with 380 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

3
fife-0.3.2.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:22c1be393b047f3bbcd2061e9ad20bf88391177217ab959410435857d3b16c4e
size 4728905

View File

@ -0,0 +1,70 @@
diff -urN fife-0.3.2.old//engine/core/vfs/vfsdirectory.cpp fife-0.3.2/engine/core/vfs/vfsdirectory.cpp
--- fife-0.3.2.old//engine/core/vfs/vfsdirectory.cpp 2010-02-11 04:18:42.000000000 +0000
+++ fife-0.3.2/engine/core/vfs/vfsdirectory.cpp 2011-05-09 17:59:03.878062479 +0100
@@ -25,6 +25,7 @@
// 3rd party library includes
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
+#include <boost/version.hpp>
// FIFE includes
// These includes are split up in two parts, separated by one empty line
@@ -37,6 +38,27 @@
#include "vfsdirectory.h"
namespace bfs = boost::filesystem;
+
+namespace
+{
+ // grab the major and minor version of boost,
+ // calculations taken from boost/version.hpp
+ #define BOOST_MAJOR_VERSION BOOST_VERSION / 100000
+ #define BOOST_MINOR_VERSION BOOST_VERSION / 100 % 1000
+
+#if (BOOST_MAJOR_VERSION >= 1 && BOOST_MINOR_VERSION >= 46)
+ // this define will tell us to use boost filesystem
+ // version 3 since this is the default version of the library
+ // starting in boost version 1.46 and above
+ #define USE_BOOST_FILESYSTEM_V3
+#elif (BOOST_MAJOR_VERSION >= 1 && BOOST_MINOR_VERSION >= 36)
+ // this define will tell us not to use the deprecated functions
+ // in boost filesystem version 2 library which were introduced
+ // in boost version 1.36 and above
+ #define USE_NON_DEPRECATED_BOOST_FILESYSTEM_V2
+#endif
+}
+
namespace FIFE {
static Logger _log(LM_VFS);
@@ -94,10 +116,26 @@
if (bfs::is_directory(*i) != directorys)
continue;
- // This only works with boost 1.34 and up
- // list.insert(i->path().leaf());
- // This one should be ok with both 1.33 and above
- list.insert(i->leaf());
+#if defined(USE_BOOST_FILESYSTEM_V3)
+ // boost version 1.46 and above uses
+ // boost filesystem version 3 as the default
+ // which has yet a different way of getting
+ // a filename string
+ bfs::path filenamePath = i->path().filename();
+ list.insert(filenamePath.string());
+#elif defined(USE_NON_DEPRECATED_BOOST_FILESYSTEM_V2)
+ // the new way in boost filesystem version 2
+ // to get a filename string
+ //(this is for boost version 1.36 and above)
+ list.insert(i->path().filename());
+#else
+ // the old way in boost filesystem version 2
+ // to get a filename string
+ //(this is for boost version 1.35 and below)
+ list.insert(i->leaf());
+#endif
+
+
}
}
catch (const bfs::filesystem_error& ex) {

View File

@ -0,0 +1,26 @@
diff -urN fife-0.3.2.old//build/linux2-config.py fife-0.3.2/build/linux2-config.py
--- fife-0.3.2.old//build/linux2-config.py 2010-11-09 15:46:04.000000000 +0000
+++ fife-0.3.2/build/linux2-config.py 2011-05-08 23:45:02.815939632 +0100
@@ -30,19 +30,15 @@
def initEnvironment(env):
rootpath = env.Dir('#.').srcnode().abspath
- extincludepath = os.path.join(rootpath, 'ext', 'install', 'include')
- extlibpath = os.path.join(rootpath, 'ext', 'install', 'lib')
env.Append(CPPPATH = [os.path.join('/', 'opt', 'include'),
os.path.join('/', 'usr', 'include', 'vorbis'),
os.path.join('/', 'usr', 'include', 'SDL'),
- os.path.join('/', 'usr', 'include', pythonversion),
- extincludepath])
+ os.path.join('/', 'usr', 'include', pythonversion)])
- env.Append(LIBPATH = [os.path.join('/', 'opt', 'lib'),
- extlibpath])
+ env.Append(LIBPATH = [os.path.join('/', 'opt', '%{_lib}')])
- env.AppendENVPath('LD_RUN_PATH', os.path.join('..', '..', '..', extlibpath))
+ env.AppendENVPath('LD_RUN_PATH', os.path.join('..', '..', '..'))
env.AppendUnique(CXXFLAGS=["-DPNG_SKIP_SETJMP_CHECK"])

2
fife-rpmlintrc Normal file
View File

@ -0,0 +1,2 @@
# Nevertheless, useful comments...
addFilter("macro-in-comment")

13
fife-soname-fix.patch Normal file
View File

@ -0,0 +1,13 @@
diff -urN fife-0.3.2.old//engine/SConscript fife-0.3.2/engine/SConscript
--- fife-0.3.2.old//engine/SConscript 2010-07-05 20:36:41.000000000 +0100
+++ fife-0.3.2/engine/SConscript 2011-05-09 01:15:23.731939633 +0100
@@ -128,7 +128,8 @@
SHLIBEMITTER = '')
else:
sharedlib = env.SharedLibrary(target = fife_tgt,
- source = compilefiles)
+ source = compilefiles,
+ LINKFLAGS=['-Wl,-soname,libfife.so.SONAME'])
#**************************************************************************
#python library target

25
fife.changes Normal file
View File

@ -0,0 +1,25 @@
-------------------------------------------------------------------
Tue May 10 00:23:58 UTC 2011 - nmarques@opensuse.org
- Add necessary changes to enable Fedora builds.
+ Replaced %py_requires macro (uncool for Fedora builds);
+ Minor cleanups.
-------------------------------------------------------------------
Mon May 9 16:12:10 UTC 2011 - nmarques@opensuse.org
- Add patches:
+ fife-opensuse-packaging-fixes.patch: removes 'ext' (bundled
libraries), we build with system shared libraries;
+ fife-changeset_r3592.patch: cherry picked from git, fixes some
build issues with boost.
+ fife-soname-fix.patch: Adds soname to package.
- Add rpmlintrc: currently used to supress 'macro-in-comments'.
- Spec changes: several tweaks.
-------------------------------------------------------------------
Mon May 9 03:22:18 UTC 2011 - nmarques@opensuse.org
- Initial package from version 0.3.2
+ Parallel builds disable, don't work for this package.

218
fife.spec Normal file
View File

@ -0,0 +1,218 @@
#
# spec file for fife (Version 0.3.2)
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
%global soname 0
# Release sources: http://sourceforge.net/projects/fife/files/active/src/%{name}-%{version}.tar.gz/download
# The sources were recompressed as: %{name}-%{version}.tar.bz2 for this package.
# Not building the documentation for this package, anyone wants docs?
Name: fife
# Quick workaround for a fast library package
%define _name libfife
Version: 0.3.2
Release: 1
License: LGPLv2+
Summary: A powerful 2D game engine
Url: http://www.fifengine.de
Group: Amusements/Games/Other
Source: %{name}-%{version}.tar.bz2
# Currently: "macro-in-comment"
Source99: %{name}-rpmlintrc
# PATCH-FIX-OPENSUSE - fife-opensuse-packaging-fixes.patch nmarques@opensuse.org -- Remove 'ext' so we use system shared libraries
Patch0: %{name}-opensuse-packaging-fixes.patch
# PATCH-FIX-UPSTREAM - fife-changeset_r3592.patch nmarques@opensuse.org -- Cherry picked from git, fixes some issues with boost on vfsdirectory.cpp
Patch1: %{name}-changeset_r3592.patch
# PATCH-FIX-UPSTREAM - fife-soname-fix.patch -- Modified for openSUSE from existing Fedora patch
Patch2: %{name}-soname-fix.patch
BuildRequires: boost-devel
BuildRequires: freeglut-devel
BuildRequires: gcc-c++
BuildRequires: guichan-devel
BuildRequires: libpng-devel
BuildRequires: libstdc++-devel
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(openal)
BuildRequires: pkgconfig(sdl)
BuildRequires: pkgconfig(vorbis)
BuildRequires: python-devel
# Required for a quick rpath workaround
BuildRequires: chrpath
BuildRequires: scons
BuildRequires: swig
BuildRequires: zlib-devel
# openSUSE/Fedora specific BRs. Unfortunatly no pkgconfig() present!
%if 0%{?suse_version}
BuildRequires: libSDL_image-devel
BuildRequires: libSDL_ttf-devel
BuildRequires: pkg-config
%endif
%if 0%{?fedora_version}
BuildRequires: SDL_image-devel
BuildRequires: SDL_ttf-devel
BuildRequires: libXcursor-devel
BuildRequires: pkgconfig
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
FIFE stands for Flexible Isometric Free Engine and is a cross platform
game creation framework. It provides you with the ability to create a
game using Python interfaces.
You can make just about any 2D game with FIFE but it is more geared
toward a RTS or RPG in just about any view style (isometric ortop-down).
For more information on FIFE's capabilities visit the Features page.
---
http://www.fifengine.de
http://wiki.fifengine.net/Features
%package -n %{_name}%{soname}
Summary: System shared libraries for fife engine games
Group: Amusements/Games/Other
%description -n %{_name}%{soname}
FIFE stands for Flexible Isometric Free Engine and is a cross platform
game creation framework. It provides you with the ability to create a
game using Python interfaces.
This package provides the shared libraries.
---
http://www.fifengine.de
http://wiki.fifengine.net/Features
%package -n python-%{name}
Summary: Python extensions for the fife engine
Group: Amusements/Games/Other
Requires: python
%description -n python-%{name}
FIFE stands for Flexible Isometric Free Engine and is a cross platform
game creation framework. It provides you with the ability to create a
game using Python interfaces.
This package provides the python extensions.
---
http://www.fifengine.de
http://wiki.fifengine.net/Features
%package devel
Summary: Development files for %{name} engine
Group: Development/Libraries/Other
Requires: %{_name}%{soname} = %{version}
Requires: python-%{name} = %{version}
%if 0%{?suse_version}
Requires: pkg-config
%endif
%if 0%{?fedora_version}
Requires: pkgconfig
%endif
%description devel
FIFE stands for Flexible Isometric Free Engine and is a cross platform
game creation framework. It provides you with the ability to create a
game using Python interfaces.
This package provides the development files.
---
http://www.fifengine.de
http://wiki.fifengine.net/Features
%prep
%setup -q
%patch0 -p1
%patch1 -p1
# Add soname to generated library
%patch2 -p1
sed -i "s|SONAME|%{soname}|g" \
engine/SConscript
# Use libdir instead of lib (for 64bit systems)
for l in ./engine/SConscript ./build/linux2-config.py
do
sed -i "s|'lib'|'%{_lib}'|g" $l
done
# UTF-8 friendly fix - upstream pinged!
for f in AUTHORS CHANGES COPYING README
do
iconv -f iso-8859-1 -t utf-8 $f |sed 's|\r||g' > $f.utf8
touch -c -r $f $f.utf8
mv $f.utf8 $f
done
%build
# Parallel builds will break the package - upstream pinged
scons \
CXXFLAGS='%{optflags}' \
--prefix=%{_prefix} \
--python-prefix=%{python_sitelib} \
--enable-rend-camzone \
--enable-rend-grid \
%{name}-shared \
%{name}-python \
%{name}-swig
%install
# Parallel builds will break the package - upstream pinged
scons \
CXXFLAGS='%{optflags}' \
DESTDIR=%{buildroot} \
install-shared \
install-python \
install-dev \
--prefix=%{_prefix} \
--python-prefix=%{python_sitelib}
# rpath workaround
find %{buildroot} -name '*.so' -print -type f -exec chrpath --delete {} \;
# playing a little bit with soname
mv %{buildroot}/%{_libdir}/%{_name}.so %{buildroot}/%{_libdir}/%{_name}.so.%{version}
pushd %{buildroot}%{_libdir}
ln -s %{_name}.so.%{version} %{_name}.so.%{soname}
ln -s %{_name}.so.%{version} %{_name}.so
popd
# We use system shared libraries, not static
find %{buildroot}%{_libdir} -name '*.a' -type f -delete -print
%clean
%{?buildroot:%__rm -rf "%{buildroot}"}
%post -n %{_name}%{soname} -p /sbin/ldconfig
%postun -n %{_name}%{soname} -p /sbin/ldconfig
%files -n %{_name}%{soname}
%defattr(-,root,root)
%doc AUTHORS COPYING README
%{_libdir}/*.so.*
%files -n python-%{name}
%defattr(-,root,root)
%{python_sitelib}/fife/
%files devel
%defattr(-,root,root)
%doc CHANGES
%{_includedir}/fife/
%{_libdir}/*.so
%changelog