Added FreeOrion (from the CCR and Arch Linux)

parent b38da634
# This package source is based on https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/freeorion
pkgname=freeorion
pkgver=0.4.2
pkgrel=1
pkgdesc='Turn-based galactic conquest game inspired by Master of Orion'
arch=('x86_64')
url='http://www.freeorion.org/'
license=('GPL2' 'CCPL-by-sa')
depends=('bullet' 'freealut' 'libvorbis' 'python2' 'gigi' 'desktop-file-utils' 'nvidia-cg-toolkit' 'libgl')
makedepends=('boost' 'ogre=1.8.1-1' 'sdl' 'gigi=0.8.0-8' 'graphviz' 'libgl'
'desktop-file-utils' 'setconf' 'cmake' 'gendesk' 'subversion' 'libogg')
options=('!strip' '!emptydirs')
install=install.sh
source=("$pkgname.sh::https://projects.archlinux.org/svntogit/community.git/plain/trunk/freeorion.sh?h=packages/freeorion"
"$pkgname.png::https://a.fsdn.com/con/icons/fr/freeorion@sf.net/FO_Icon_256x256.png"
"cmake_python.patch::https://projects.archlinux.org/svntogit/community.git/plain/trunk/cmake_python.patch?h=packages/freeorion")
sha256sums=('111532e460aec847ff455ee67dd64f46e2fa5ceba39a0349d25a84b69c646eaf'
'a6a253eed31b77b00bf4f721f4b1c6bbd95505b9e4b38b736101e551dd12ff5f'
'3dbe8df9c3a4a0d6451f42727ebf9bcb21fed41a08d1181d1cf77ef4ab5ee81a')
_svnrepo='https://freeorion.svn.sourceforge.net/svnroot/freeorion/trunk/FreeOrion/'
_pyversion=2.7
_revision=5771
build() {
cd "$srcdir"
gendesk -n
msg2 "Checking out svn revision $_revision..."
if [[ -d "$pkgname/.svn" ]]; then
(cd "$pkgname" && svn up -r "$_revision")
else
svn co "$_svnrepo" --config-dir ./ -r "$_revision" "$pkgname"
fi
msg2 'Setting up build directory...'
rm -rf "$srcdir/$pkgname-build"
cp -r "$srcdir/$pkgname" "$srcdir/$pkgname-build"
cd "$srcdir/$pkgname-build"
msg2 'CMake/Python fix...'
patch -N -p1 -i "$srcdir/cmake_python.patch"
msg2 'Generating makefiles...'
cmake \
-DPYTHON_INCLUDE_DIR:PATH="/usr/include/python$_pyversion" \
-DPYTHON_LIBRARY:FILEPATH="/usr/lib/libpython$_pyversion.so" \
-G "Unix Makefiles"
msg2 'GLU fix...'
setconf CMakeCache.txt CMAKE_CXX_FLAGS:STRING \
"'-march=native -mtune=generic -O2 -fno-var-tracking -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -lGL -lGLU -rpath=/usr/lib '"
msg2 'Compiling...'
make -j1
msg2 'OGRE fix...'
sed -i 's:PluginFolder=.:PluginFolder=/usr/lib/OGRE/:g' \
"$srcdir/$pkgname-build/ogre_plugins.cfg"
}
package() {
cd "$srcdir/$pkgname-build"
msg2 'Packaging documentation...'
install -Dm644 loki_setup/README.txt \
"$pkgdir/usr/share/doc/$pkgname/README.txt"
msg2 'Packaging binaries...'
install -Dm 755 "$srcdir/$pkgname.sh" "$pkgdir/usr/bin/freeorion"
install -Dm 755 freeorion "$pkgdir/usr/bin/freeorion.elf"
install -Dm 755 freeorionca "$pkgdir/usr/bin/freeorionca"
install -Dm 755 freeoriond "$pkgdir/usr/bin/freeoriond"
msg2 'Packaging data...'
mkdir -p "$pkgdir/usr/share/$pkgname" "$pkgdir/usr/lib/$pkgname"
cp -r default "$pkgdir/usr/share/$pkgname"
install -Dm 644 OISInput.cfg "$pkgdir/usr/share/$pkgname/OISInput.cfg"
msg2 'Packaging license...'
install -Dm 644 default/COPYING \
"$pkgdir/usr/share/licenses/$pkgname/COPYING"
cd "$srcdir"
msg2 'Packaging icon and shortcut...'
install -Dm 644 "$pkgname.png" \
"$pkgdir/usr/share/pixmaps/freeorion.png"
install -Dm 644 "$pkgname.desktop" \
"$pkgdir/usr/share/applications/freeorion.desktop"
msg2 'Packaging OGRE plugins configuration...'
install -Dm 644 "$srcdir/$pkgname-build/ogre_plugins.cfg" \
"$pkgdir/usr/share/freeorion/ogre_plugins.cfg"
msg2 'Cleaning up...'
find "$pkgdir" -name ".svn" -print0 | xargs -0 rm -rf
}
post_upgrade() {
update-desktop-database -q
}
post_install() {
post_upgrade
}
post_remove() {
post_upgrade
}
# This package source comes from Arch Linux: https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/gigi
pkgname=gigi
pkgver=0.8.0
pkgrel=8
_fixedrevision=5780 #5407
pkgdesc='Small, efficient and feature rich GUI for OpenGL and C++ (freeorion fork)'
#url='http://gigi.sourceforge.net/'
url='http://freeorion.svn.sourceforge.net/viewvc/freeorion/trunk/FreeOrion/GG/'
arch=('x86_64')
license=('LGPL')
depends=('boost' 'libpng' 'libtiff' 'ogre' 'sdl' 'python')
makedepends=('subversion' 'cmake' 'setconf' 'doxygen' 'libgl')
build() {
cd "$srcdir"
msg2 'Fetching files...'
if [ -d gigi/.svn ]; then
(cd gigi && svn up -r "$_fixedrevision")
else
#svn co https://gigi.svn.sourceforge.net/svnroot/gigi/trunk/GG/ \
svn co https://freeorion.svn.sourceforge.net/svnroot/freeorion/trunk/FreeOrion/GG/ \
--config-dir ./ -r "$_fixedrevision" gigi
fi
rm -rf gigi-build
svn export gigi gigi-build
cd gigi-build
msg2 'Configuring...'
setconf cmake/GiGiOgre.pc.in prefix /usr
setconf cmake/GiGi.pc.in prefix /usr
setconf cmake/GiGiSDL.pc.in prefix /usr
# It would be better if CMAKE_INSTALL_PREFIX or the resulting Makefiles
# could be re-configured in the package() function, but this works too.
cmake \
-D CMAKE_INSTALL_PREFIX="$srcdir/pkg/usr" \
-D BUILD_TUTORIALS=OFF \
-D CPACK_GENERATOR=GiGiDevel \
-D CMAKE_C_FLAGS_RELEASE='-DNDEBUG' \
.
msg2 'Building documentation...'
cd doc
doxygen
cd ..
msg2 'Compiling...'
make -j1
}
package() {
cd "$srcdir/gigi-build"
msg2 'Packaging files...'
make install
msg2 'Moving files to the right location...'
mv -v "$srcdir/pkg/usr" "$pkgdir/"
msg2 'Fixing documentation...'
mkdir -p "$pkgdir/usr/share/doc"
mv "$pkgdir/usr/doc" "$pkgdir/usr/share/doc/$pkgname"
for f in `find "$pkgdir/usr/share/doc" -name "dir_*.html"`; do
sed -i "s:$srcdir:/:g" "$f"
done
msg2 'Python 3 fix...'
for f in `find "$pkgdir/usr" -name "*.py"`; do
sed -i "s:/env python:/python3:g" "$f"
done
msg2 'Packaging license...'
install -Dm644 COPYING \
"$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment