# Contributor: David Demelier <markand@malikania.fr>
# Maintainer: David Demelier <markand@malikania.fr>
pkgname=libretro-freechaf
pkgver=0_git20220730
pkgrel=0
_commit="4d1d5cb83b93728a63f03454e472a23055d9bbfc"
_commit_common="fedb955ff18465d879b8bb02c7e6fc17188780b1"
pkgdesc="Fairchild ChannelF / Video Entertainment System emulator for libretro"
url="https://github.com/libretro/FreeChaf"
arch="all"
license="GPL-3.0-or-later"
source="$pkgname-$_commit.tar.gz::https://github.com/libretro/FreeChaF/archive/$_commit.tar.gz
	$pkgname-libretro-common.tar.gz::https://github.com/libretro/libretro-common/archive/$_commit_common.tar.gz
	"
builddir="$srcdir/FreeChaF-$_commit"
options="!check" # No tests

prepare() {
	default_prepare
	rm -rf src/deps/libretro-common
	mv "$srcdir/libretro-common-$_commit_common" src/deps/libretro-common
}

build() {
	make
}

package() {
	install -Dm644 freechaf_libretro.so "$pkgdir"/usr/lib/libretro/freechaf_libretro.so
}

sha512sums="
f77aef90751ad268e63fc219314cb0ec4f6840e088205b5e38dda2d3d53939b861bc2fbb971a3ea4345f33c84ae9584730a10291a8dfe41a0e9ebbecd49451a9  libretro-freechaf-4d1d5cb83b93728a63f03454e472a23055d9bbfc.tar.gz
a47d4d4cbe2b6e515a2e12bbeecf997864bed792d434a599ad2e3bff50c8ac550f2b6e37441016e4cdd43a75be83e4f952e50708c7a8bd3015002fcacf37edbf  libretro-freechaf-libretro-common.tar.gz
"
