# Template file for 'PrusaSlicer'
pkgname=PrusaSlicer
version=2.4.0
revision=2
wrksrc="PrusaSlicer-version_${version}"
build_style=cmake
build_helper="qemu"
configure_args="-DSLIC3R_WX_STABLE=1 -DSLIC3R_FHS=1 -DSLIC3R_GTK=3"
hostmakedepends="pkg-config"
makedepends=" boost-devel cereal cgal-devel dbus-devel eigen glew-devel
 glu-devel gmpxx-devel gtest-devel gtk+3-devel libcurl-devel libglib-devel
 libpng-devel nlopt-devel openvdb-devel tbb-devel wxWidgets-devel
 wxWidgets-gtk3-devel"
short_desc="G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)"
maintainer="Jasper Chan <jasperchan515@gmail.com>"
license="GPL-3.0-or-later"
homepage="https://www.prusa3d.com/prusaslicer/"
distfiles="https://github.com/prusa3d/Prusaslicer/archive/version_${version}.tar.gz"
checksum=906d0acf0d0e064ae3cbaa16ba1a2e24dd9c32ceb2121464cb4d5951c09e66c2
nocross="https://build.voidlinux.org/builders/armv7l_builder/builds/25230/steps/shell_3/logs/stdio"

post_extract() {
	# this test suite fails on musl
	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
		vsed -i tests/CMakeLists.txt -e "/add_subdirectory(libslic3r)/d"
	fi
}

Slic3rPE_package() {
	build_style=meta
	depends="${sourcepkg}>=${version}_${revision}"
}

post_install() {
	vinstall ${FILESDIR}/prusa-slicer.desktop 644 usr/share/applications
}
