# Template file for 'proot'
pkgname=proot
version=5.2.0
revision=1
archs="x86_64* i686* aarch64* arm*"
build_wrksrc=src
build_style=gnu-makefile
make_use_env=yes
make_build_args="VERSION=${version}"
hostmakedepends="pkg-config python3-docutils python3-lxml"
makedepends="libarchive-devel talloc-devel"
short_desc="User-space implementation of chroot, mount --bind, and binfmt_misc"
maintainer="Piraty <mail@piraty.dev>"
license="GPL-2.0-or-later"
homepage="https://proot-me.github.io"
distfiles="https://github.com/proot-me/PRoot/archive/v${version}.tar.gz"
checksum=1f25f9ef147bc96c9d7cd23218b7a7229f149757d91c832482b1a865b52aa62e

if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
	makedepends+=" musl-legacy-compat"
fi

pre_build() {
	# Fix glibc ptrace.h specific constants for musl libc
	cp ${FILESDIR}/ptrace_compat.h .
}

do_install() {
	vbin proot
	make -C ../doc
	vman ../doc/proot/man.1 proot.1
}
