2016-02-16 21:38:37 +00:00
|
|
|
# Copyright 2015-2016 Julian Ospald <hasufell@posteo.de>
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
MY_PN="t-engine4"
|
|
|
|
MY_PV="${PV/_/}"
|
|
|
|
MY_PV="${MY_PV/rc/RC}"
|
|
|
|
MY_P="${MY_PN}-src-${MY_PV}"
|
|
|
|
SUMMARY="Topdown tactical RPG roguelike game and game engine"
|
|
|
|
HOMEPAGE="http://te4.org"
|
|
|
|
DOWNLOADS="http://te4.org/dl/t-engine/${MY_P}.tar.bz2"
|
|
|
|
|
|
|
|
LICENCES="
|
|
|
|
GPL-3
|
|
|
|
shockbolt-tileset
|
|
|
|
Apache-2.0 [[ note = [ fonts license ] ]]
|
2016-02-17 01:53:28 +00:00
|
|
|
bitstream-font [[ note = [ fonts license ] ]]
|
2016-02-16 21:38:37 +00:00
|
|
|
"
|
|
|
|
SLOT="0"
|
|
|
|
PLATFORMS="~amd64 ~x86"
|
|
|
|
|
|
|
|
DEPENDENCIES="
|
|
|
|
build+run:
|
|
|
|
media-libs/libpng:=
|
|
|
|
media-libs/libvorbis
|
|
|
|
media-libs/openal
|
|
|
|
media-libs/SDL:2[X]
|
|
|
|
media-libs/SDL_image:2
|
|
|
|
media-libs/SDL_ttf:2
|
|
|
|
x11-dri/glu
|
|
|
|
x11-dri/mesa
|
|
|
|
build:
|
|
|
|
sys-devel/premake:4
|
|
|
|
"
|
|
|
|
|
|
|
|
WORK=${WORKBASE}/${MY_P}
|
|
|
|
|
|
|
|
src_prepare() {
|
2016-02-17 01:53:28 +00:00
|
|
|
# fix broken sdl2 detection
|
|
|
|
# http://forums.te4.org/viewtopic.php?f=42&t=38714
|
|
|
|
edo sed -i \
|
|
|
|
-e "s~/usr/lib32~/usr/$(exhost --target)/lib~" \
|
|
|
|
-e "s~/opt/SDL-2.0~/usr/$(exhost --target)~" \
|
|
|
|
premake4.lua
|
2016-02-16 21:38:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
2016-02-17 01:53:28 +00:00
|
|
|
local premake_options="--lua=default"
|
|
|
|
# Generate a "Makefile" with "premake4".
|
|
|
|
edo premake4 ${premake_options} gmake
|
2016-02-16 21:38:37 +00:00
|
|
|
|
2016-02-17 01:53:28 +00:00
|
|
|
# respect flags, remove misuse of $ARCH
|
|
|
|
# files are generated, cannot patch
|
|
|
|
edo sed -i \
|
|
|
|
-e 's~\(CFLAGS\s*+= \).*~\1-MMD -MP $(DEFINES) $(INCLUDES)~' \
|
|
|
|
-e 's~\(CXXFLAGS\s*+= \).*~\1-MMD -MP $(DEFINES) $(INCLUDES)~' \
|
|
|
|
-e '/LDFLAGS/s~-s~~' \
|
|
|
|
-e 's~$(ARCH) ~~' \
|
|
|
|
build/*.make
|
2016-02-16 21:38:37 +00:00
|
|
|
|
2016-02-17 01:53:28 +00:00
|
|
|
# respect LDFLAGS
|
|
|
|
# http://forums.te4.org/viewtopic.php?f=42&t=38715
|
|
|
|
edo sed -i \
|
|
|
|
-e 's~^[ \t]*LINKCMD[ \t]*=[ \t]*$(CC).*$~LINKCMD = $(CC) $(CFLAGS) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(LDFLAGS) $(LIBS)~' \
|
|
|
|
build/*.make
|
2016-02-16 21:38:37 +00:00
|
|
|
|
2016-02-17 01:53:28 +00:00
|
|
|
# FHS
|
|
|
|
# http://forums.te4.org/viewtopic.php?f=42&t=38716
|
|
|
|
edo sed -i \
|
|
|
|
-e "/PHYSFS_mount/s~game~/usr/share/${PN}/game~" \
|
|
|
|
src/main.c
|
2016-02-16 21:38:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
src_compile() {
|
2016-02-17 01:53:28 +00:00
|
|
|
# parallel make broken
|
|
|
|
# http://forums.te4.org/viewtopic.php?f=42&t=38713
|
|
|
|
config='release' emake -j1 verbose=1
|
2016-02-16 21:38:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
2016-02-17 01:53:28 +00:00
|
|
|
insinto "/usr/share/${PN}"
|
|
|
|
doins -r game
|
|
|
|
newbin t-engine ${PN}
|
2016-02-16 21:38:37 +00:00
|
|
|
|
|
|
|
insinto /usr/share/applications
|
|
|
|
hereins ${PN}.desktop <<EOF
|
|
|
|
[Desktop Entry]
|
|
|
|
Name=ToME4
|
|
|
|
Type=Application
|
2016-02-23 15:45:39 +00:00
|
|
|
Comment=${SUMMARY}
|
|
|
|
Exec=${PN}
|
|
|
|
TryExec=${PN}
|
|
|
|
Icon=${PN}
|
2016-02-16 21:38:37 +00:00
|
|
|
Categories=Game;RolePlaying;
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|