games-roguelike/FTL: add gog support

This commit is contained in:
Julian Ospald 2016-08-13 02:20:11 +02:00
parent 5722057479
commit e8f6aee4ab

View File

@ -4,13 +4,18 @@
require desktop-utils require desktop-utils
SUMMARY="Faster Than Light: A spaceship simulation real-time roguelike-like game" SUMMARY="Faster Than Light: A spaceship simulation real-time roguelike-like game"
HOMEPAGE="http://www.ftlgame.com/" HOMEPAGE="https://www.gog.com/game/faster_than_light"
DOWNLOADS="manual: FTL.${PV}.tar.gz" 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" LICENCES="all-rights-reserved Boost-1.0 free-noncomm MIT FTL LGPL-2.1 ZLIB libpng"
SLOT="0" SLOT="0"
PLATFORMS="-* ~amd64 ~x86" PLATFORMS="-* ~amd64 ~x86"
MYOPTIONS=" MYOPTIONS="
gog [[ description = [ Use the gog advanced edition version ] ]]
( platform: amd64 x86 ) ( platform: amd64 x86 )
" "
RESTRICT="fetch" RESTRICT="fetch"
@ -22,9 +27,11 @@ DEPENDENCIES="
media-libs/freetype:2 media-libs/freetype:2
sys-libs/zlib sys-libs/zlib
x11-dri/mesa x11-dri/mesa
build:
virtual/unzip
" "
WORK=${WORKBASE}/${PN} WORK="${WORKBASE}"
pkg_nofetch() { pkg_nofetch() {
einfo "Please buy & download ${DOWNLOADS} from:" einfo "Please buy & download ${DOWNLOADS} from:"
@ -37,17 +44,30 @@ pkg_setup() {
exdirectory --allow /opt exdirectory --allow /opt
} }
src_unpack() {
if optionq gog ; then
unzip -qo "${FETCHEDDIR}/${FTL_SH}"
[[ $? -le 1 ]] || die "unpacking ${FTL_SH} failed!"
else
default
fi
}
src_install() { src_install() {
local dir=/opt/${PN} local dir=/opt/${PN}
local arch=$(option platform:amd64 "amd64" "x86") local arch=$(option platform:amd64 "amd64" "x86")
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}" insinto "${dir}"
doins -r data/resources doins -r "${datadir}"/resources
exeinto "${dir}"/bin exeinto "${dir}"/bin
doexe data/${arch}/bin/${PN} doexe "${datadir}"/${arch}/bin/${PN}
exeinto "${dir}"/lib exeinto "${dir}"/lib
doexe data/${arch}/lib/*.so* doexe "${datadir}"/${arch}/lib/*.so*
herebin ${PN} << EOF herebin ${PN} << EOF
#!/bin/sh #!/bin/sh
@ -64,9 +84,9 @@ EOF
"Icon=/usr/share/pixmaps/FTL.bmp" "Icon=/usr/share/pixmaps/FTL.bmp"
insinto /usr/share/pixmaps insinto /usr/share/pixmaps
newins data/resources/exe_icon.bmp FTL.bmp newins "${datadir}"/resources/exe_icon.bmp FTL.bmp
insinto /usr/share/doc/${PNVR}/html insinto /usr/share/doc/${PNVR}/html
doins ${PN}_README.html doins "${htmldir}"/${PN}_README.html
} }