# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=cyclone-stage0
pkgver=0.36.0
pkgrel=1
pkgdesc="Cyclone version used to initially bootstrap the Cyclone compiler"
url="https://justinethier.github.io/cyclone/"
# s390x, riscv64: ck on s390x does not have ck_pr_cas_8 (used by cyclone)
arch="all !s390x !riscv64"
license="MIT"
depends="!cyclone"
makedepends="ck-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/justinethier/cyclone-bootstrap/archive/refs/tags/v$pkgver.tar.gz
	0001-Fix-open_memstream-fmemopen-feature-detection-with-G.patch
	"
builddir="$srcdir/cyclone-bootstrap-$pkgver"

# Provide cyclone-bootstrap for community/cyclone.
# See the comment in community/cyclone for more information.
provides="cyclone-bootstrap=$pkgver"
provider_priority=1 # lowest

export PREFIX=/usr
export DATADIR=$PREFIX/lib/cyclone
export CFLAGS="$CFLAGS -Wno-int-conversion"

build() {
	make
}

check() {
	make test
}

package() {
	DESTDIR="$pkgdir" make install
}

sha512sums="
477534602baa4acbae0450e664617ad70302a79c552005741080c4e4d2993805ff1d25703bd2c43c82764a477a4b26fb4b88c8787a82e99fa5a6fc88d9f914f2  cyclone-stage0-0.36.0.tar.gz
48cc70456eb01527af9170da72519b2fc0636cee071b997af973e99195aa97941dac8fae560d88722e6f991dd3188f1887a2bba8bdd0b5ab5f314af93e95f2d7  0001-Fix-open_memstream-fmemopen-feature-detection-with-G.patch
"
