SUMMARY="A port of the 2048 puzzle game to the libretro architecture"
DESCRIPTION="2048 is a puzzle game by Gabriele Cirulli, based on 1024 by \
Veewo Studio and conceptually similar to Threes by Asher Vollmer. This is \
a port of 2048 to the libretro API."
HOMEPAGE="https://gabrielecirulli.github.io/2048/"
COPYRIGHT="2014-2018 Gabriele Cirulli, the libretro team"
LICENSE="Public Domain"
REVISION="1"
srcGitRev="20051e140346fb56376b59f41f28ef40f8ad7fb8"
SOURCE_URI="https://github.com/libretro/libretro-2048/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="6cccc6ddefcd065b13aa01881ad82966eb5377657a97757c172c4e82f955780f"
SOURCE_FILENAME="libretro-2048-$portVersion-$srcGitRev.tar.gz"
SOURCE_DIR="libretro-2048-$srcGitRev"
ADDITIONAL_FILES="2048_libretro.info.in"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	2048_libretro$secondaryArchSuffix = $portVersion
	addon:2048_libretro$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	retroarch$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	sed -e "s/@DISPLAY_VERSION@/v${portVersion/_/-}/" \
		$portDir/additional-files/2048_libretro.info.in \
		> 2048_libretro.info
	make -f Makefile.libretro $jobArgs
}

INSTALL()
{
	install -m 0755 -d "$docDir"
	install -m 0644 -t "$docDir" README.md
	install -m 0755 -d "$addOnsDir"/libretro
	install -m 0644 -t "$addOnsDir"/libretro \
		2048_libretro.info \
		2048_libretro.so
}
