# Template file for 'joker'
pkgname=joker
version=1.4.0
revision=2
build_style=go
go_import_path=github.com/candid82/joker
short_desc="Interpreted dialect of Clojure written in Go and Clojure(Script) linter"
maintainer="icp <pangolin@vivaldi.net>"
license="EPL-1.0"
homepage="https://joker-lang.org/"
changelog="https://github.com/candid82/joker/releases"
distfiles="https://github.com/candid82/joker/archive/refs/tags/v${version}.tar.gz"
checksum=8744e077e420a40a78c215fe9c61adad2aa59e8a985ec5d59aeb75f93b2706f3

if [ "$CROSS_BUILD" ]; then
	if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
		broken="https://github.com/candid82/joker#cross-platform-builds"
	fi
	hostmakedepends+=" joker"
fi

pre_build() {
	JOKER="joker"
	CGO_ENABLED=0 GOARCH= go generate ./...

	if [ -z "$CROSS_BUILD" ]; then
		JOKER="../joker"
		go build
	fi

	(cd std; "$JOKER" --hashmap-threshold 8192 generate-std.joke)
}
