void-packages/srcpkgs/openttd/template
2019-04-02 12:40:36 -03:00

60 lines
2 KiB
Bash

# Template file for 'openttd'
pkgname=openttd
version=1.9.0
revision=1
_gfxver=0.5.5
_sfxver=0.2.3
build_style=gnu-configure
hostmakedepends="pkg-config unzip"
makedepends="SDL-devel icu-devel fontconfig-devel libpng-devel lzo-devel liblzma-devel
libxdg-basedir-devel"
depends="openttd-data hicolor-icon-theme"
short_desc="Open Source version of Transport Tycoon Deluxe"
maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
license="GPL-2 Custom"
homepage="https://www.openttd.org/"
distfiles="https://proxy.binaries.openttd.org/openttd-releases/${version}/openttd-${version}-source.tar.xz
https://bundles.openttdcoop.org/opengfx/releases/${_gfxver}/opengfx-${_gfxver}.zip
https://bundles.openttdcoop.org/opensfx/releases/${_sfxver}/opensfx-${_sfxver}.zip"
checksum="45fded554d973328496f6e01b0769d7b8b64048a8fe2cf252242194c08ea7419
c648d56c41641f04e48873d83f13f089135909cc55342a91ed27c5c1683f0dfe
3574745ac0c138bae53b56972591db8d778ad9faffd51deae37a48a563e71662"
CXXFLAGS=' -DU_USING_ICU_NAMESPACE=1'
post_extract() {
cd ${XBPS_BUILDDIR}
tar xf opengfx-${_gfxver}.tar
rm opengfx-${_gfxver}.tar
}
do_configure() {
./configure --prefix-dir=/usr \
--cc-build=gcc \
--cxx-build=g++ \
--binary-dir=bin \
--data-dir=share/openttd \
--doc-dir=share/doc/openttd \
--with-lzo2=${XBPS_CROSS_BASE}/usr/lib \
--binary-name=openttd \
--install-dir=${DESTDIR} \
--menu-name=OpenTTD \
--with-xdg-basedir
}
openttd-data_package() {
short_desc+=" - data files"
archs=noarch
pkg_install() {
vmove usr/share/openttd
vmkdir usr/share/openttd/data
vcopy ${XBPS_BUILDDIR}/opengfx-${_gfxver}/*.grf usr/share/openttd/data
vcopy ${XBPS_BUILDDIR}/opengfx-${_gfxver}/*.obg usr/share/openttd/data
vcopy ${XBPS_BUILDDIR}/opensfx-${_sfxver}/opensfx.* usr/share/openttd/data
vlicense ${XBPS_BUILDDIR}/opengfx-${_gfxver}/license.txt LICENSE-gfx
vlicense ${XBPS_BUILDDIR}/opensfx-${_sfxver}/license.txt LICENSE-sfx
vdoc ${XBPS_BUILDDIR}/opengfx-${_gfxver}/readme.txt README-gfx
vdoc ${XBPS_BUILDDIR}/opensfx-${_sfxver}/readme.txt README-sfx
}
}