# Description: A FOSS clone of Transport Tycoon Deluxe. # URL: http://www.openttd.org # Maintainer: Erich Eckner, crux at eckner dot net # Packager: Lennart Sauerbeck, devel at lennart dot sauerbeck dot org # Depends on: libsdl libpng fontconfig lzo name=openttd-git version=30221.c656633be gfxversion=0.5.4 sfxversion=0.2.3 msxversion=0.3.1 release=1 source=(http://bundles.openttdcoop.org/opengfx/releases/$gfxversion/opengfx-$gfxversion.zip http://bundles.openttdcoop.org/opensfx/releases/$sfxversion/opensfx-$sfxversion.zip http://bundles.openttdcoop.org/openmsx/releases/$msxversion/openmsx-$msxversion.zip # chunnel.patch # chunnel-signaltunnel-pre.patch # chunnel-underground-pre.patch signaltunnel.patch sloped-stations.patch underground.patch opntitle.dat https://github.com/OpenTTD/OpenTTD/archive/${version##*.}.tar.gz) build() { # cp chunnel.patch chunnel.pre.patch # patch -p1 -i chunnel-signaltunnel-pre.patch # patch -p1 -i chunnel-underground-pre.patch tar -xf opengfx-$gfxversion.tar cd OpenTTD-${version##*.}* ISODATE=$(find {src,bin} -type f -printf "%TY%Tm%Td\n" | sort -n | tail -n1) HASH=$(find {src,bin} -type f -exec sha512sum {} \; | sort | sha512sum - | cut -d' ' -f1) SHORTHASH=$(echo ${HASH} | cut -c1-8) printf '%s\t%s\t%s\t%s\t%s\t%s\n' \ "${ISODATE}-ewe-g${SHORTHASH}" \ "${ISODATE}" \ "0" \ "${HASH}" \ 0 \ 0 \ "${ISODATE:0:4}" \ > .ottdrev sed -i ' s,"\${CMAKE_SOURCE_DIR}/\.git","/dev/does/not/exist", ' cmake/scripts/FindVersion.cmake patch -p1 -i "$SRC/signaltunnel.patch" # patch -p1 -i "$SRC/sloped-stations.patch" # broken! patch -p1 -i "$SRC/underground.patch" # broken? # patch -p1 -i "$SRC/chunnel.pre.patch" # broken! mkdir build cd build cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DPERSONAL_DIR=.openttd \ .. make make DESTDIR=$PKG install # Install OpenGFX install -d $PKG/usr/share/games/openttd/data/opengfx-$gfxversion install -m 644 $SRC/opengfx-$gfxversion/* $PKG/usr/share/games/openttd/data/opengfx-$gfxversion chown -R root:root $PKG/usr/share/games/openttd/data/opengfx-$gfxversion # Install OpenSFX install -d $PKG/usr/share/games/openttd/data/opensfx-$sfxversion install -m 644 $SRC/opensfx-$sfxversion/* $PKG/usr/share/games/openttd/data/opensfx-$sfxversion chown -R root:root $PKG/usr/share/games/openttd/data/opensfx-$sfxversion # Install OpenMSX install -d $PKG/usr/share/games/openttd/gm install -m 644 $SRC/openmsx-$msxversion/* $PKG/usr/share/games/openttd/gm chown -R root:root $PKG/usr/share/games/openttd/gm/* # Remove unnecessary languages cp $PKG/usr/share/games/openttd/lang/{english,german}.lng $SRC rm $PKG/usr/share/games/openttd/lang/* install -m 644 $SRC/{english,german}.lng $PKG/usr/share/games/openttd/lang # Remove junk rm -rf $PKG/usr/share/games/doc rm -rf $PKG/usr/share/games/openttd/scripts rm $PKG/usr/share/games/openttd/data/opengfx-$gfxversion/{changelog,readme}.txt rm $PKG/usr/share/games/openttd/data/opensfx-$sfxversion/{changelog,readme}.txt rm $PKG/usr/share/games/openttd/gm/{changelog,readme}.txt }