# Template file for 'gimp'
pkgname=gimp
version=3.2.4
revision=2
build_style=meson
build_helper="gir qemu"
configure_args="-Dcheck-update=no -Drevision=$revision -Denable-default-bin=enabled
 -Dbug-report-url=https://github.com/void-linux/void-packages/issues/new/choose"
hostmakedepends="pkg-config xdg-utils perl libxslt gjs LuaJIT desktop-file-utils
 AppStream gettext gi-docgen gobject-introspection yelp-tools librsvg-devel glib-devel"
makedepends="babl-devel gtk+3-devel gegl-devel libgexiv2-devel libgirepository-devel
 libmypaint-devel mypaint-brushes librsvg-devel glib-networking appstream-glib-devel
 libXmu-devel ghostscript-devel libmng-devel aalib-devel libXpm-devel libopenexr-devel
 libwebp-devel libheif-devel poppler-glib-devel libwmf-devel libopenjpeg2-devel
 libjxl-devel alsa-lib-devel cfitsio-devel python3-gobject-devel libgomp-devel
 libunwind-devel lua51-lgi AppStream-devel"
depends="desktop-file-utils hicolor-icon-theme iso-codes mypaint-brushes python3-gobject gjs"
checkdepends="xvfb-run dbus"
short_desc="GNU image manipulation program"
conf_files="/etc/gimp/${version%%.*}.0/*"
maintainer="classabbyamp <void@placeviolette.net>"
license="GPL-3.0-only"
homepage="https://www.gimp.org"
distfiles="https://download.gimp.org/gimp/v${version%.*}/gimp-${version/+rc/-RC}.tar.xz"
checksum=7312bc53e9c6d2d0056ca7b93f1c6b98707946dd934f714c21b8746ecb601588
lib32disabled=yes

if [ "$CROSS_BUILD" ]; then
	hostmakedepends+=" gimp"
	configure_args+=" -Dcan-crosscompile-gir=true -Dgi-docgen=disabled"
fi

if [ -n "$XBPS_CHECK_PKGS" ] && [ -z "$CROSS_BUILD" ]; then
	configure_args+=" -Dheadless-tests=enabled"
else
	configure_args+=" -Dheadless-tests=disabled"
fi

libgimp_package() {
	short_desc+=" - runtime libraries"
	pkg_install() {
		vmove "usr/lib/*.so.*"
	}
}

gimp-devel_package() {
	depends="libgimp>=${version}_${revision} gegl-devel gtk+3-devel libgexiv2-devel"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
		vmove usr/share/gir-1.0
		vmove usr/share/vala
		if [ -z "$CROSS_BUILD" ]; then
			vmove usr/share/doc
		fi
	}
}
