# Template file for 'libbytesize'
pkgname=libbytesize
version=2.10
revision=3
build_style=gnu-configure
hostmakedepends="pkg-config gettext python3"
makedepends="mpfr-devel pcre2-devel"
checkdepends="python3-six"
short_desc="Library for operations with sizes in bytes"
maintainer="Orphaned <orphan@voidlinux.org>"
license="LGPL-2.1-or-later"
homepage="https://github.com/storaged-project/libbytesize"
changelog="https://raw.githubusercontent.com/storaged-project/libbytesize/master/NEWS.rst"
distfiles="https://github.com/storaged-project/libbytesize/releases/download/${version}/libbytesize-${version}.tar.gz"
checksum=1d1ce3be8ac59fd59511d0794c7327d5cf33f1e83496837b17e19ac49400cad1

pre_check() {
	# Requires python3-pocketlint, which is not packaged yet.
	vsed -e 's/canary_tests.sh$//g' -i tests/Makefile
}

libbytesize-devel_package() {
	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove "usr/lib/*.so"
		vmove usr/lib/pkgconfig
	}
}

libbytesize-python3_package() {
	depends="python3-six ${sourcepkg}>=${version}_${revision}"
	short_desc+=" - Python3 bindings"
	pkg_install() {
		vmove "usr/lib/python3*"
		# Requires the Python module.
		vmove usr/bin/bscalc
		vmove usr/share/man/man1/bscalc.1
	}
}
