# Template file for 'exiv2'
pkgname=exiv2
version=0.28.8
revision=1
build_style=cmake
configure_args="-DEXIV2_BUILD_SAMPLES=OFF -DEXIV2_ENABLE_BMFF=ON"
makedepends="zlib-devel brotli-devel expat-devel inih-devel"
checkdepends="gtest-devel python3"
short_desc="Image metadata manipulation"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://exiv2.org"
changelog="https://exiv2.org/whatsnew.html"
distfiles="https://github.com/Exiv2/exiv2/archive/refs/tags/v${version}.tar.gz"
checksum=ea51b0609f58a9afa063b60daa1539948b62247721e154f4fff0ad3aec9f9756

if [ -n "$XBPS_CHECK_PKGS" ]; then
	configure_args+=" -DEXIV2_BUILD_UNIT_TESTS=ON"
fi

if [ -n "$XBPS_CCACHE" ]; then
	configure_args+=" -DBUILD_WITH_CCACHE=ON"
fi

pre_check() {
	# https://github.com/Exiv2/exiv2/issues/3052
	if [ "$XBPS_TARGET_MACHINE" = i686 ]; then
		rm tests/lens_tests/test_canon_lenses.py
	fi
}

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