# Template file for 'coccinelle'
pkgname=coccinelle
version=1.3
revision=1
build_style=gnu-configure
configure_args="--without-pdflatex --enable-release
 --with-python=/usr/bin/python3"
hostmakedepends="python3 automake libtool ocaml"
makedepends="ocaml ocaml-findlib ocaml-num ocaml-stdcompat
 pcre-devel python3-devel"
checkdepends="python3"
short_desc="Program matching and transformation engine"
maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
license="GPL-2.0-only"
homepage="https://coccinelle.gitlabpages.inria.fr/website/"
# distfiles="https://github.com/coccinelle/coccinelle/archive/${_gitrev}.tar.gz"
_stdcompat=13aef7a2221d32493fc141e68ed6ba4a35288699
distfiles="https://coccinelle.gitlabpages.inria.fr/website/distrib/coccinelle-${version}.tar.gz
 https://github.com/thierry-martinez/stdcompat/archive/${_stdcompat}.tar.gz"
checksum="d214410c502951bb30b86f46ecd51c02ba5cfbcb2c1eee7268428a162b18f985
 6cb788ec6f274fd8ac060801557123018cb6695855e8fd27117c5cc681d40ed7"
disable_parallel_build=yes
nocross=yes
make_check=ci-skip # broken out of the box
skip_extraction="${_stdcompat}.tar.gz"

case "$XBPS_TARGET_MACHINE" in
	x86_64*|aarch64*|riscv64*) ;;
	*) broken="bundled mehir wants ocamlopt";;
esac

post_extract() {
	rm -rf bundles/stdcompat/stdcompat-current
	vsrcextract -C bundles/stdcompat/stdcompat-current "${_stdcompat}.tar.gz"
}

pre_configure() {
	autoreconf -fi
}
