# Template file for 'hyperrogue'
pkgname=hyperrogue
version=13.0x
revision=1
build_style=gnu-makefile
hostmakedepends="pkg-config"
makedepends="glew-devel libpng-devel sdl12-compat-devel SDL_gfx-devel
 SDL_mixer-devel SDL_ttf-devel zlib-devel fontconfig-devel"
depends="dejavu-fonts-ttf"
short_desc="SDL rogue-like in a non-euclidean world"
maintainer="tranzystorekk <tranzystorek.io@protonmail.com>"
license="GPL-2.0-or-later"
homepage="https://www.roguetemple.com/z/hyper/"
changelog="https://raw.githubusercontent.com/zenorogue/hyperrogue/master/changelog.txt"
distfiles="https://github.com/zenorogue/hyperrogue/archive/refs/tags/v${version}.tar.gz"
checksum=5ad0808c753a22df336993b99dbd1fbe0fcd10b326d215ca93d2a62fb7def4be
nocross="Generates code from build output that must run on host"

# SDL_gfx-devel headers require that SDL.h be under the header search paths,
# which are not set correctly by upstream.
CXXFLAGS+=" -I/usr/include/SDL -DHYPERPATH='\"/usr/share/hyperrogue/\"'"

case "$XBPS_TARGET_MACHINE" in
	ppc64*) ;;
	ppc*) nodebug=yes;; # build runs out of memory
esac

export HYPERROGUE_USE_GLEW=1
export HYPERROGUE_USE_PNG=1
export FONTCONFIG=1

do_install() {
	vbin hyperrogue
	vdoc README.md
	vinstall contrib/hyperrogue.desktop 644 usr/share/applications
	vinstall hyperrogue-music.txt 644 usr/share/hyperrogue
	vinstall hyperroid/app/src/main/res/drawable-ldpi/icon.png 644 usr/share/icons/hicolor/36x36/apps hyperrogue.png
	vinstall hyperroid/app/src/main/res/drawable-mdpi/icon.png 644 usr/share/icons/hicolor/48x48/apps hyperrogue.png
	vinstall hyperroid/app/src/main/res/drawable-hdpi/icon.png 644 usr/share/icons/hicolor/72x72/apps hyperrogue.png
	vinstall hyperroid/app/src/main/res/drawable-xhdpi/icon.png 644 usr/share/icons/hicolor/96x96/apps hyperrogue.png
	vinstall hyperroid/app/src/main/res/drawable-xxhdpi/icon.png 644 usr/share/icons/hicolor/144x144/apps hyperrogue.png
	vinstall hyperroid/app/src/main/res/drawable-xxxhdpi/icon.png 644 usr/share/icons/hicolor/192x192/apps hyperrogue.png

	vcopy music usr/share/hyperrogue
	vcopy sounds usr/share/hyperrogue
}
