# Maintainer: jc_gargma # Maintainer (AUR): Harms # Contributor (AUR): Pascal Grossé # # I maintain this because: # AUR version uses /opt # AUR version uses http # AUR version uses debug build # AUR version does not use -O3 # AUR version lacks offline patch # AUR version lacks DLC pkgname=tome4 pkgver=1.6.4 pkgrel=1 _offlinever=1.6 _ashesver=1.0.8 _orcsver=1.1.3 _cultsver=1.0.4 pkgdesc="An open-source, single-player, role-playing roguelike game set in the world of Eyal." pkgdesc+="Includes DLC and offline patch." arch=('i686' 'x86_64' 'aarch64') url="https://te4.org/" license=('custom' 'GPL3') depends=(glu openal libvorbis sdl2_ttf sdl2_image) makedepends=(premake zip unzip) options=(emptydirs) source=("${url}dl/t-engine/t-engine4-src-${pkgver}.tar.bz2" sdl2-path-fix.patch O3-support.patch offline-donator_${_offlinever}.patch ashes-urhrok_${_ashesver}.teaac orcs_${_orcsver}.teaac cults_${_cultsver}.teaac tome4 tome4.desktop) conflicts=('tome4-beta' 'tome4-git' 'tome4-nomusic') sha512sums=('9eb730f8cff3deb12bd42c6f4033ebca5d22764a0aac2fa777520bd1f854b6b5c6a16e798a910a7a400b7094271f9eb5d4894c4335bade58d23f986d90555ad7' '9d4533581e6dea76a68ed8feb5aded7d02562ce3303c5c8a59f041a2b52f49bb3aa215d3f2ba3e31af85c62655ba1494d1e0f626bcbb618a90f053fd1f364a48' '790dce2ee4f42f0bdb536eed464f2f9849039852249deb1de06f2e71e2938cb70380ad6b617900b4b159f60060a4163a37583e3c1639578b090cc77621243477' '9f19607d542bfed80570875f22211e9cda3576c62e1cdd426576b8d3832e7b9af2e86135ee0c25942772fbe1f10bdb63d62cd37a59f31a424518cdfd9097d536' 'bee86ba7013bdeeb9d58a1d851222c704c4ce82ffa1388f1c50b0f496522ec5c8f066f1ea97b5009e3456dcdc39e8c823bd18f536d92f7f33b53bc006ac95485' 'd29967c621d9f73702fb68afa00d808cbb017c55d68d4d085f75ee13f343c2086c72c375476f991e8552b30331c37ead6700e9e602da5550319827198438b6a0' 'd1863a765bd0c1be65c2a74280e22d42f6f4c397646428bf9892b4f3d45665de66d6956de73f7d075cc452f9a732da5630344250d02e1a63bb927bad967f677f' '521e99b07082d6379606541f625f68fa666610e1c3f27e5e4803cc44bc16e60f28824792d1b13e477a08176f609288e693be3d92ba60cb4fea343f11854fe466' '94ed400247d4137fc4f6e770e724a47a028a2fafff15c38ba952d828db4d3890e13ae2c51b8cf9e070b545ba07e5c183b44c15886480b1e06d3c94a2826e5c73') ############################################################################### # 1. Patch the game. ############################################################################### prepare() { cd t-engine4-src-${pkgver} patch -p1 -i "${srcdir}/sdl2-path-fix.patch" patch -p1 -i "${srcdir}/O3-support.patch" patch -p1 -i "${srcdir}/offline-donator_${_offlinever}.patch" cp "${srcdir}/ashes-urhrok_${_ashesver}.teaac" "${srcdir}/t-engine4-src-${pkgver}/game/addons/ashes-urhrok.teaac" cp "${srcdir}/orcs_${_orcsver}.teaac" "${srcdir}/t-engine4-src-${pkgver}/game/addons/orcs.teaac" cp "${srcdir}/cults_${_cultsver}.teaac" "${srcdir}/t-engine4-src-${pkgver}/game/addons/cults.teaac" } ############################################################################### # 2. Build the game engine from source. ############################################################################### build() { cd t-engine4-src-${pkgver} premake4 gmake export CFLAGS="$CFLAGS -fstack-protector-all -fPIE" export CXXFLAGS="$CXXFLAGS -fstack-protector-all -fPIE" export LDFLAGS="$LDFLAGS,-pie" make config=release } ############################################################################### # 3. Create the package. Copy all that shall be installed into the package dir. ############################################################################### package() { # Extract and install the icon. unzip -oj -qq "${srcdir}/t-engine4-src-${pkgver}/game/engines/te4-${pkgver}.teae" "data/gfx/te4-icon.png" -d "${srcdir}" install -Dm644 "${srcdir}/te4-icon.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png" # Install the documents. install -Dm644 "${srcdir}/t-engine4-src-${pkgver}/CONTRIBUTING" "${pkgdir}/usr/share/doc/${pkgname}/CONTRIBUTING" install -Dm644 "${srcdir}/t-engine4-src-${pkgver}/CREDITS" "${pkgdir}/usr/share/doc/${pkgname}/CREDITS" # Install the custom license into standard location. install -Dm644 "${srcdir}/t-engine4-src-${pkgver}/COPYING" "${pkgdir}/usr/share/licenses/${pkgname}/COPYING" install -Dm644 "${srcdir}/t-engine4-src-${pkgver}/COPYING-MEDIA" "${pkgdir}/usr/share/licenses/${pkgname}/COPYING-MEDIA" # Install the game executable, and the launcher. install -Dm755 "${srcdir}/t-engine4-src-${pkgver}/t-engine" "${pkgdir}/usr/lib/${pkgname}/t-engine" install -Dm755 "${srcdir}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}" install -Dm644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop" # Install the game data. cp -r "${srcdir}/t-engine4-src-${pkgver}/bootstrap" "${pkgdir}/usr/lib/${pkgname}/" cp -r "${srcdir}/t-engine4-src-${pkgver}/game" "${pkgdir}/usr/lib/${pkgname}/" }