# Template file for 'azpainter'
pkgname=azpainter
version=3.0.12
revision=1
build_style=configure
hostmakedepends="pkg-config ninja"
makedepends="fontconfig-devel libXcursor-devel libXi-devel libXrender-devel libjpeg-turbo-devel libpng-devel libwebp-devel tiff-devel zlib-devel freetype-devel"
depends="desktop-file-utils hicolor-icon-theme"
short_desc="Painting software for illustrations and image editing"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-3.0-or-later"
homepage="https://azelpg.gitlab.io/azsky2"
changelog="https://gitlab.com/azelpg/azpainter/-/raw/master/ChangeLog"
distfiles="https://gitlab.com/azelpg/azpainter/-/archive/v${version}/azpainter-v${version}.tar.gz"
checksum=6685877960e3effeae8ca0d5169899e9cc98ab3ee5b957fa3c9f26490d49e080

post_patch() {
	vsed -e "s;\(-[IL]\)/usr/local;\1${XBPS_CROSS_BASE}/usr;g" -i configure.c
}

do_configure() {
	mkdir -p build
	"$CC_FOR_BUILD" -O2 configure.c -o configure
	./configure --prefix=/usr CC=$CC CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
}

do_build() {
	ninja -C build ${makejobs}
}

do_install() {
	DESTDIR=${DESTDIR} ninja -C build install
}
