# Template file for 'scryer-prolog'
pkgname=scryer-prolog
version=0.10.0
revision=1
build_style=cargo
hostmakedepends="pkg-config"
makedepends="openssl-devel"
short_desc="Modern Prolog implementation written mostly in Rust"
maintainer="Orphaned <orphan@voidlinux.org>"
license="BSD-3-Clause"
homepage="https://github.com/mthom/scryer-prolog"
distfiles="https://github.com/mthom/scryer-prolog/archive/refs/tags/v${version}.tar.gz"
checksum=353eca4eea539e0a0eedb1572736bfcc64c5fb6fd2da3b8737c513ad62f60f3b

case "$XBPS_TARGET_MACHINE" in
	x86_64*|arm*|aarch64*) ;;
	i686*)
		# rustc-LLVM ERROR: out of memory
		export CARGO_PROFILE_RELEASE_LTO=false
		;;
	*) broken="ftbfs in ring" ;;
esac

pre_check() {
	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
		# musl doesn't expose non-POSIX btime/crtime field via standard stat call
		vsed -e '/file_creation_time/d; /length/s/3/2/' -i tests-pl/issue_file_time.pl
	fi
}

post_install() {
	vlicense LICENSE
}
