# Template file for 'inkstitch'
pkgname=inkstitch
version=3.2.2
revision=1
_fonts_rev=db267e31dd65355f1295f99ca7d4aa8bb69a295d
_depends="python3-pystitch inkscape wxPython python3-networkx python3-shapely
 python3-lxml python3-platformdirs python3-numpy python3-Jinja2 python3-requests
 python3-colormath2 python3-Flask python3-Flask-Cors fonttools python3-trimesh
 python3-diskcache"
hostmakedepends="gettext ${_depends}"
depends="${_depends}"
checkdepends="python3-pytest ${_depends}"
short_desc="Inkscape extension for machine embroidery design"
maintainer="classabbyamp <void@placeviolette.net>"
license="GPL-3.0-or-later AND CC-BY-SA-2.5 AND CC-BY-SA-4.0 AND CC-BY-ND-4.0 AND OFL-1.1"
homepage="https://inkstitch.org"
changelog="https://inkstitch.org/categories/#releases"
distfiles="https://github.com/inkstitch/inkstitch/archive/refs/tags/v${version}.tar.gz
 https://github.com/inkstitch/embroidery-fonts/archive/${_fonts_rev}.tar.gz>embroidery-fonts-${_fonts_rev}.tar.gz"
checksum="f329f00e6e73b7aa258db23f6b7bc5d870acc72fce51118b82e5c40cfbc52fd5
 e70fa292201d1509dc3a29093f7c9edb94beac6d939ed36ad37878c753636fe3"
skip_extraction="embroidery-fonts-${_fonts_rev}.tar.gz"
python_version=3

export GITHUB_REF="${version}"

post_extract() {
	vsrcextract -C fonts "embroidery-fonts-${_fonts_rev}.tar.gz"
}

post_patch() {
	rmdir pyembroidery
	chmod a+x inkstitch.py
}

do_build() {
	make manual
}

do_install() {
	vmkdir usr/share/inkscape/extensions/inkstitch
	vcopy '*' usr/share/inkscape/extensions/inkstitch
}
