# Maintainer: gardenapple # Contributor: kleintux pkgname=open-hexagon-git pkgver=2.0.6.r468.g1e2cba71 _assetsver=1 pkgrel=1 epoch=1 pkgdesc='Challenging rhythm-based arcade game inspired by Super Hexagon' url='https://openhexagon.org/' arch=('any') license=('custom:AFL-3.0' 'custom:non-free') depends=('zenity' # for 'launcher' interface 'freetype2' 'glew' 'libsndfile' 'libx11' 'libxcursor' 'libxrandr' 'openal') makedepends=('git' 'cmake' 'mesa') optdepends=('steam: integration for those who own the game on Steam' 'discord: Discord Rich Presence support') provides=('open-hexagon') conflicts=('open-hexagon') source=('git+https://github.com/SuperV1234/SSVOpenHexagon.git' "open-hexagon-git-assets-$_assetsver.zip::https://github.com/SuperV1234/SSVOpenHexagonAssets/archive/master.zip" 'open-hexagon-git.install' 'open-hexagon' 'open-hexagon.desktop') install="$pkgname.install" sha512sums=('SKIP' '5733647987d84887ce65717f8787629a4a4cf2de1af4ef15a06158988aa706e5392cae7b1ff3fd29e9387b9dc7dd1b35c6da059360a508c3e4746b66217631d2' '445788e067bdc5e73f804189952495a4f086ac662e4e213528fc0e48dfee7ebb3200f51989100b1c1a3b29378c91a0b540300f17cd6ec087427973223919f0a4' '79cdfbfe7a5a7963c7c21e8bf5815475afb8348c53b464d51bcc9ac14b8135d0c3608078a9db42046fbb8fab77d1341967821732b532b1e6ba2528e7ac066644' 'bc7d1e1a420a439283b4fcf2f06a8a50ca06d3934b79f6a93ff4ad4d269d6b246eb6a1824381c36bbb73fc7d24e9883281ab66eab05b2cc2fdbac3ed14a775d5') _reponame="SSVOpenHexagon" _assetsname="SSVOpenHexagonAssets-master" pkgver() { # Use the most recent un-annotated tag cd "$srcdir/$_reponame" git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' } build() { cd "$srcdir/$_reponame" # Instructions from # https://github.com/vittorioromeo/SSVOpenHexagon/wiki/Building-Instructions#arch-based git submodule init git submodule update cd buildlx/ cmake .. ( # patch for latest GCC cd _deps/sfml-src/include/SFML/ sed -i '1i #include ' System/Utf.hpp System/String.hpp Network/Packet.hpp ) make mv SSVOpenHexagon ../_RELEASE # Copy assets without overwriting ( yes n | cp -r -i "$srcdir/$_assetsname/_RELEASE/" "$srcdir/$_reponame/" 2> /dev/null ) || echo "Assets merged." } package() { mkdir -p "$pkgdir/usr/lib" cd "$srcdir/$_reponame" cp -r "_RELEASE" "$pkgdir/usr/lib/open-hexagon" install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/open-hexagon/" # Install CMake-pulled dependencies mkdir -p "$pkgdir/usr/lib/open-hexagon/_deps" find buildlx/_deps/*-build/ \( -name '*.so.*' -o -name '*.so' \) \ -execdir mv -- '{}' "$pkgdir/usr/lib/open-hexagon/_deps" \; cd "$pkgdir/usr/lib/open-hexagon" # Move libraries to separate dir rm -f *.bat *.dll *.lib mv *.so _deps/ rm _deps/libz.so* # Dirty hack to allow writing data to shared /var/ directory rather than current directory # (also see .install file) rm -rf Profiles Replays mkdir -p "$pkgdir/var/lib/open-hexagon" for i in config.json log.txt Profiles Replays; do ln -sf "../../../var/lib/open-hexagon/$i" done # Misc. cleanup mv "Assets/Open Hexagon Assets License.txt" "$pkgdir/usr/share/licenses/open-hexagon/" install -Dm644 "luadocs.md" -t "$pkgdir/usr/share/doc/open-hexagon/" rm luadocs.md *.sh users.json scores.json # Executables install -Dm755 "$srcdir/open-hexagon" -t "$pkgdir/usr/bin" install -Dm644 "$srcdir/open-hexagon.desktop" -t "$pkgdir/usr/share/applications" install -Dm644 "$srcdir/$_reponame/_RELEASE/Assets/icon.png" "$pkgdir/usr/share/pixmaps/open-hexagon.png" }