diff options
author | FabioLolix | 2025-02-16 19:34:45 +0100 |
---|---|---|
committer | FabioLolix | 2025-02-16 19:34:45 +0100 |
commit | a513c039d7244e315fc9c4209eb3717dab4319c7 (patch) | |
tree | dfb1a83906cd397349fafcc2753a16e6048a447c /PKGBUILD | |
download | aur-openloco-git.tar.gz |
init
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..1112e2b17da1 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,67 @@ +# Maintainer: Fabio 'Lolix' Loli <fabio.loli@disroot.org> -> https://github.com/FabioLolix + +pkgname=openloco-git +pkgver=25.01.r2.gea4cb00e5 +pkgrel=1 +pkgdesc="An open source re-implementation of Chris Sawyer's Locomotion" +arch=(x86_64 i686) +url="https://github.com/OpenLoco/OpenLoco" +license=(MIT) +depends=(sdl2 libpng openal) +depends_x86_64+=(lib32-glibc lib32-gcc-libs lib32-sdl2 lib32-libpng lib32-openal) +makedepends=(cmake yaml-cpp git gtest fmt) +makedepends_x86_64+=(lib32-gtest lib32-yaml-cpp lib32-fmt) +optdepends_x86_64=( + 'lib32-libpipewire: audio output' + 'lib32-libpulse: audio output' +) +optdepends_i686=( + 'libpipewire: audio output' + 'libpulse: audio output' +) +provides=(openloco) +conflicts=(openloco) +options=(!lto) +source=("git+https://github.com/openloco/openloco.git" ) +sha256sums=('SKIP') + +pkgver() { + cd openloco + git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' +} + +build() { + + # -Dfmt_DIR:PATH=/usr/lib/cmake/fmt -> pointless; want lib32-fmt + # -Dsfl_DIR:PATH=/usr/include/sfl -> pointless; want to checkout it, no system version + + + local _flags=( + -DFETCHCONTENT_QUIET:BOOL=OFF + #-DFETCHCONTENT_FULLY_DISCONNECTED:BOOL=ON + #-Dfmt_DIR:PATH=/usr/lib/cmake/fmt + #-Dsfl_DIR:PATH=/usr/include/sfl + #-Dyaml-cpp_DIR:PATH=/usr/lib/cmake/yaml-cpp + ) + + export CXXFLAGS="$CXXFLAGS -m32 -Wno-error=null-dereference" + cmake -G "Unix Makefiles" -B build -S "openloco" -Wno-dev \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr \ + "${_flags[@]}" + + cmake --build build +} + +check() { + ctest --test-dir build --output-on-failure +} + +package() { + DESTDIR="${pkgdir}" cmake --install build + ln -s /usr/bin/OpenLoco "${pkgdir}/usr/bin/openloco" + install -D "openloco/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}" + + #remove bundled sfl from package + rm -rf "${pkgdir}/usr/include/sfl" +} |