# Template file for 'krita'
pkgname=krita
version=6.0.3
revision=1
build_style=cmake
configure_args="-DBUILD_TESTING=OFF -DENABLE_UPDATERS=OFF"
hostmakedepends="extra-cmake-modules gettext pkg-config python3
 qt5-qmake qt5-host-tools kcoreaddons python3-PyQt5
 python3-PyQt5-devel"
makedepends="karchive-devel kconfig-devel kwidgetsaddons-devel kcompletion-devel
 kcoreaddons-devel kguiaddons-devel ki18n-devel kitemviews-devel
 kwindowsystem-devel kio-devel kcrash-devel qt5-svg-devel qt5-multimedia-devel
 boost-headers gsl-devel tiff-devel libjpeg-turbo-devel libraw-devel fftw-devel
 opencolorio-devel eigen exiv2-devel libXi-devel libopenexr-devel libgomp-devel
 poppler-qt5-devel giflib-devel python3-devel python3-PyQt5
 python3-PyQt5-devel quazip-devel libheif-devel seexpr-krita-devel
 libopenjpeg2-devel qt5-plugin-mysql qt5-plugin-sqlite qt5-plugin-odbc
 qt5-plugin-pgsql qt5-plugin-tds libwebp-devel libmypaint-devel libjxl-devel
 libkdcraw5-devel immer zug lager libunibreak-devel mlt7-devel xsimd
 qt5-quickcontrols2-devel"
depends="qt5-plugin-sqlite python3-PyQt5"
short_desc="Painting and image editing program"
maintainer="John <me@johnnynator.dev>"
license="GPL-3.0-only"
homepage="https://krita.org/"
distfiles="${KDE_SITE}/krita/${version}/krita-${version}.tar.xz"
checksum=9716b8b9b58d5a7c4cc755380ae2a0ba2298086aed93c63c74f0d69edb63b032
python_version=3
replaces="calligra-krita>=0"
# FIXME
make_check=no

case "$XBPS_TARGET_MACHINE" in
	i686*|x86_64*) makedepends+=" vc";;
esac

pre_configure() {
	# CMake won't search in those directories because of CMAKE_FIND_ROOT_PATH
	if [ "$CROSS_BUILD" ]; then
		configure_args+=" -D_find_sip_py=$wrksrc/cmake/modules/FindSIP.py"
		configure_args+=" -D_find_pyqt5_py=$wrksrc/cmake/modules/FindPyQt5.py"
		configure_args+=" -DTIFF_CAN_WRITE_PSD_TAGS_EXITCODE=0"
	fi
}

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