summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitris Zlatanidis <d.zlatanidis@gmail.com>2014-04-29 08:33:24 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-04-29 08:33:24 +0700
commit37959ea0d26335ee02acb4ca873c40563068e5fe (patch)
tree1cef379acdb2ca2d32b95ce897722f012eed66b6
parent52a216c1b26b08a84a7dea0e0ef3559111f35490 (diff)
downloadslackbuilds-37959ea0d26335ee02acb4ca873c40563068e5fe.tar.gz
games/tome4: Script cleanup.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--games/tome4/TEngine_sdl.patch20
-rw-r--r--games/tome4/doinst.sh6
-rw-r--r--games/tome4/physfs_sdl.patch20
-rw-r--r--games/tome4/premake4_sdl.patch11
-rw-r--r--games/tome4/tome4.SlackBuild27
-rw-r--r--games/tome4/tome4.desktop2
-rw-r--r--games/tome4/tome4.sh2
7 files changed, 33 insertions, 55 deletions
diff --git a/games/tome4/TEngine_sdl.patch b/games/tome4/TEngine_sdl.patch
deleted file mode 100644
index 2013d89b3a..0000000000
--- a/games/tome4/TEngine_sdl.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- t-engine4-src-1.1.5/build/TEngine.make.original 2014-03-17 11:45:51.098815414 +0200
-+++ t-engine4-src-1.1.5/build/TEngine.make 2014-03-17 11:46:28.742344806 +0200
-@@ -32,7 +32,7 @@
- TARGETDIR = ../bin/Debug
- TARGET = $(TARGETDIR)/t-engine
- DEFINES += -DGLEW_STATIC -D_DEFAULT_VIDEOMODE_FLAGS_='SDL_HWSURFACE|SDL_DOUBLEBUF' -DTENGINE_HOME_PATH='".t-engine"' -DTE4CORE_VERSION=17 -DSELFEXE_LINUX
-- INCLUDES += -I../src -I../src/luasocket -I../src/fov -I../src/expat -I../src/lxp -I../src/libtcod_import -I../src/physfs -I../src/zlib -I../src/bzip2 -I/opt/SDL-2.0/include/SDL2 -I/usr/include/GL -I../src/luajit2/src -I../src/luajit2/dynasm
-+ INCLUDES += -I../src -I../src/luasocket -I../src/fov -I../src/expat -I../src/lxp -I../src/libtcod_import -I../src/physfs -I../src/zlib -I../src/bzip2 -I/usr/include/SDL2 -I/usr/include/GL -I../src/luajit2/src -I../src/luajit2/dynasm
- CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
- CFLAGS += $(CPPFLAGS) $(ARCH) -g -ggdb -O3
- CXXFLAGS += $(CFLAGS)
-@@ -56,7 +56,7 @@
- TARGETDIR = ../bin/Release
- TARGET = $(TARGETDIR)/t-engine
- DEFINES += -DGLEW_STATIC -DNDEBUG=1 -D_DEFAULT_VIDEOMODE_FLAGS_='SDL_HWSURFACE|SDL_DOUBLEBUF' -DTENGINE_HOME_PATH='".t-engine"' -DTE4CORE_VERSION=17 -DSELFEXE_LINUX
-- INCLUDES += -I../src -I../src/luasocket -I../src/fov -I../src/expat -I../src/lxp -I../src/libtcod_import -I../src/physfs -I../src/zlib -I../src/bzip2 -I/opt/SDL-2.0/include/SDL2 -I/usr/include/GL -I../src/luajit2/src -I../src/luajit2/dynasm
-+ INCLUDES += -I../src -I../src/luasocket -I../src/fov -I../src/expat -I../src/lxp -I../src/libtcod_import -I../src/physfs -I../src/zlib -I../src/bzip2 -I/usr/include/SDL2 -I/usr/include/GL -I../src/luajit2/src -I../src/luajit2/dynasm
- CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
- CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -fomit-frame-pointer -O2
- CXXFLAGS += $(CFLAGS)
diff --git a/games/tome4/doinst.sh b/games/tome4/doinst.sh
index 8542d1c18e..5fb28930db 100644
--- a/games/tome4/doinst.sh
+++ b/games/tome4/doinst.sh
@@ -1,5 +1,3 @@
-if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
- if [ -x /usr/bin/gtk-update-icon-cache ]; then
- /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
- fi
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
diff --git a/games/tome4/physfs_sdl.patch b/games/tome4/physfs_sdl.patch
deleted file mode 100644
index 75e2a9085d..0000000000
--- a/games/tome4/physfs_sdl.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- t-engine4-src-1.1.5/build/physfs.make.original 2014-03-17 11:20:03.904158009 +0200
-+++ t-engine4-src-1.1.5/build/physfs.make 2014-03-17 11:20:43.826658909 +0200
-@@ -32,7 +32,7 @@
- TARGETDIR = ../bin/Debug
- TARGET = $(TARGETDIR)/libphysfs.a
- DEFINES += -DGLEW_STATIC -DPHYSFS_SUPPORTS_ZIP
-- INCLUDES += -I../src -I../src/luasocket -I../src/fov -I../src/expat -I../src/lxp -I../src/libtcod_import -I../src/physfs -I../src/zlib -I../src/bzip2 -I/opt/SDL-2.0/include/SDL2 -I/usr/include/GL -I../src/luajit2/src -I../src/luajit2/dynasm
-+ INCLUDES += -I../src -I../src/luasocket -I../src/fov -I../src/expat -I../src/lxp -I../src/libtcod_import -I../src/physfs -I../src/zlib -I../src/bzip2 -I/usr/include/SDL2 -I/usr/include/GL -I../src/luajit2/src -I../src/luajit2/dynasm
- CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
- CFLAGS += $(CPPFLAGS) $(ARCH) -g -ggdb -O3
- CXXFLAGS += $(CFLAGS)
-@@ -54,7 +54,7 @@
- TARGETDIR = ../bin/Release
- TARGET = $(TARGETDIR)/libphysfs.a
- DEFINES += -DGLEW_STATIC -DNDEBUG=1 -DPHYSFS_SUPPORTS_ZIP
-- INCLUDES += -I../src -I../src/luasocket -I../src/fov -I../src/expat -I../src/lxp -I../src/libtcod_import -I../src/physfs -I../src/zlib -I../src/bzip2 -I/opt/SDL-2.0/include/SDL2 -I/usr/include/GL -I../src/luajit2/src -I../src/luajit2/dynasm
-+ INCLUDES += -I../src -I../src/luasocket -I../src/fov -I../src/expat -I../src/lxp -I../src/libtcod_import -I../src/physfs -I../src/zlib -I../src/bzip2 -I/usr/include/SDL2 -I/usr/include/GL -I../src/luajit2/src -I../src/luajit2/dynasm
- CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
- CFLAGS += $(CPPFLAGS) $(ARCH) -O2 -fomit-frame-pointer -O2
- CXXFLAGS += $(CFLAGS)
diff --git a/games/tome4/premake4_sdl.patch b/games/tome4/premake4_sdl.patch
new file mode 100644
index 0000000000..405523772c
--- /dev/null
+++ b/games/tome4/premake4_sdl.patch
@@ -0,0 +1,11 @@
+--- t-engine4-src-1.1.5/premake4.original.lua 2014-04-29 02:40:07.535906248 +0300
++++ t-engine4-src-1.1.5/premake4.lua 2014-04-29 02:40:46.953413461 +0300
+@@ -17,7 +17,7 @@
+ "src/physfs",
+ "src/zlib",
+ "src/bzip2",
+- "/opt/SDL-2.0/include/SDL2",
++ "/usr/include/SDL2",
+ "/usr/include/GL",
+ }
+ if _OPTIONS.lua == "default" then includedirs{"src/lua"}
diff --git a/games/tome4/tome4.SlackBuild b/games/tome4/tome4.SlackBuild
index 01eaa59250..09d09b26e6 100644
--- a/games/tome4/tome4.SlackBuild
+++ b/games/tome4/tome4.SlackBuild
@@ -25,7 +25,7 @@
PRGNAM=tome4
SRCNAM=t-engine4-src
VERSION=${VERSION:-1.1.5}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -63,6 +63,8 @@ cd $TMP
rm -rf $SRCNAM-$VERSION
tar xvf $CWD/$SRCNAM-$VERSION.tar.bz2
cd $SRCNAM-$VERSION
+# extract icons
+unzip -oj -qq game/engines/te4-1.1.5.teae -d icons
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -70,25 +72,32 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+# correction of SDL2 headers directory
+patch -p1 < $CWD/premake4_sdl.patch
+
+# build game
premake4 gmake
-patch -p1 < $CWD/physfs_sdl.patch build/physfs.make
-patch -p1 < $CWD/TEngine_sdl.patch build/TEngine.make
make
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-mkdir -p $PKG/usr/share/games/$PRGNAM-$VERSION
-cp -rf game $PKG/usr/share/games/$PRGNAM-$VERSION
-cp -rf bootstrap $PKG/usr/share/games/$PRGNAM-$VERSION
-install -m 0755 t-engine $PKG/usr/share/games/$PRGNAM-$VERSION
-install -m 0755 $CWD/$PRGNAM.sh $PKG/usr/share/games/$PRGNAM-$VERSION
+# copy the data game
+mkdir -p $PKG/usr/share/games/$PRGNAM $PKG/usr/bin
+cp -rf game $PKG/usr/share/games/$PRGNAM
+cp -rf bootstrap $PKG/usr/share/games/$PRGNAM
+
+# install the game executable and the launcher
+install -D -m0755 t-engine $PKG/usr/share/games/$PRGNAM
+install -D -m0755 $CWD/$PRGNAM.sh $PKG/usr/bin/$PRGNAM
+# install .desktop
mkdir -p $PKG/usr/share/applications
install -D -m644 $CWD/$PRGNAM.desktop $PKG/usr/share/applications/$PRGNAM.desktop
+# install icon game
mkdir -p $PKG/usr/share/pixmaps/
-install -D -m644 $CWD/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.svg
+install -D -m644 icons/te4-icon.png $PKG/usr/share/pixmaps/$PRGNAM.png
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a CONTRIBUTING COPYING* CREDITS $PKG/usr/doc/$PRGNAM-$VERSION
diff --git a/games/tome4/tome4.desktop b/games/tome4/tome4.desktop
index 22c99f107d..f98a52e184 100644
--- a/games/tome4/tome4.desktop
+++ b/games/tome4/tome4.desktop
@@ -2,7 +2,7 @@
Name= ToME (RPG)
Name[he]= ToME
Comment= Tales of Maj’Eyal - Action Role-Playing Game
-Exec=/usr/share/games/tome4-1.1.5/./tome4.sh
+Exec=tome4
Icon=tome4
Terminal=false
Type=Application
diff --git a/games/tome4/tome4.sh b/games/tome4/tome4.sh
index 93fe9144d3..ce184a21e6 100644
--- a/games/tome4/tome4.sh
+++ b/games/tome4/tome4.sh
@@ -1,3 +1,3 @@
#!/bin/sh
-cd /usr/share/games/tome4-1.1.5
+cd /usr/share/games/tome4
./t-engine