# Template file for 'python3-pillow-jxl'
pkgname=python3-pillow-jxl
version=1.3.6
revision=1
build_style=python3-pep517
build_helper=rust
hostmakedepends="cargo cmake maturin patchelf pkg-config python3-installer python3-wheel"
makedepends="python3 rust-std libjxl-devel"
depends="python3-Pillow python3-packaging"
short_desc="JPEG XL pillow plugin using Rust for bindings"
maintainer="zenobit <zen@osowoso.org>"
license="MIT"
homepage="https://github.com/Isotr0py/pillow-jpegxl-plugin"
changelog="https://github.com/Isotr0py/pillow-jpegxl-plugin/releases"
distfiles="https://github.com/Isotr0py/pillow-jpegxl-plugin/archive/refs/tags/v${version}.tar.gz"
checksum=1ffd776ed3026b14d2fac7dd8f3f9a18a0ad8dfb11396ab958a39e664edfeff1

pre_build() {
	if [ "$CROSS_BUILD" ]; then
		export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib/python${py3_ver}"
		export PYO3_CROSS_PYTHON_VERSION="${py3_ver}"
		export CARGO_BUILD_TARGET="${RUST_TARGET}"
	fi
}

post_install() {
	vlicense LICENSE
}
