hasufell-repository/packages/games-roguelike/FTL/FTL-1.5.13-r1.exheres-0

93 lines
2.2 KiB
Bash
Raw Normal View History

# Copyright 2016 Julian Ospald <hasufell@posteo.de>
# Distributed under the terms of the GNU General Public License v2
require desktop-utils
SUMMARY="Faster Than Light: A spaceship simulation real-time roguelike-like game"
2016-08-13 00:20:11 +00:00
HOMEPAGE="https://www.gog.com/game/faster_than_light"
FTL_SH="gog_ftl_advanced_edition_2.0.0.2.sh"
DOWNLOADS="
gog? ( manual: ${FTL_SH} )
!gog? ( manual: FTL.${PV}.tar.gz )
"
LICENCES="all-rights-reserved Boost-1.0 free-noncomm MIT FTL LGPL-2.1 ZLIB libpng"
SLOT="0"
PLATFORMS="-* ~amd64 ~x86"
MYOPTIONS="
2016-08-13 00:20:11 +00:00
gog [[ description = [ Use the gog advanced edition version ] ]]
( platform: amd64 x86 )
"
RESTRICT="fetch"
DEPENDENCIES="
run:
media-libs/DevIL
media-libs/SDL:0[X]
media-libs/freetype:2
sys-libs/zlib
x11-dri/mesa
2016-08-13 00:20:11 +00:00
build:
virtual/unzip
"
2016-08-13 00:20:11 +00:00
WORK="${WORKBASE}"
pkg_nofetch() {
einfo "Please buy & download ${DOWNLOADS} from:"
einfo " ${HOMEPAGE}"
einfo "and move it to ${FETCHEDDIR}"
einfo
}
pkg_setup() {
exdirectory --allow /opt
}
2016-08-13 00:20:11 +00:00
src_unpack() {
if optionq gog ; then
unzip -qo "${FETCHEDDIR}/${FTL_SH}"
[[ $? -le 1 ]] || die "unpacking ${FTL_SH} failed!"
else
default
fi
}
src_install() {
local dir=/opt/${PN}
local arch=$(option platform:amd64 "amd64" "x86")
2016-08-13 00:20:11 +00:00
local datadir=${WORKBASE}/${PN}/data
optionq gog && datadir=${WORKBASE}/data/noarch/game/data
local htmldir=${WORKBASE}/${PN}
optionq gog && htmldir=${WORKBASE}/data/noarch/docs
insinto "${dir}"
2016-08-13 00:20:11 +00:00
doins -r "${datadir}"/resources
exeinto "${dir}"/bin
2016-08-13 00:20:11 +00:00
doexe "${datadir}"/${arch}/bin/${PN}
exeinto "${dir}"/lib
2016-08-13 00:20:11 +00:00
doexe "${datadir}"/${arch}/lib/*.so*
herebin ${PN} << EOF
#!/bin/sh
cd "/opt/FTL"
if [ "\${LD_LIBRARY_PATH+set}" = "set" ] ; then
export LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:/opt/FTL/lib"
else
export LD_LIBRARY_PATH="/opt/FTL/lib"
fi
exec /opt/FTL/bin/FTL "$@"
EOF
install_desktop_entry "Name=Faster Than Light" \
"Icon=/usr/share/pixmaps/FTL.bmp"
insinto /usr/share/pixmaps
2016-08-13 00:20:11 +00:00
newins "${datadir}"/resources/exe_icon.bmp FTL.bmp
insinto /usr/share/doc/${PNVR}/html
2016-08-13 00:20:11 +00:00
doins "${htmldir}"/${PN}_README.html
}