# Template file for 'cameractrls'
pkgname=cameractrls
version=0.6.10
revision=1
pycompile_dirs=/usr/lib/cameractrls
depends="python3 python3-gobject libjpeg-turbo SDL2 gtk4"
short_desc="Camera controls for Linux"
maintainer="Cass Spencer <casscardboard@gmail.com>"
license="LGPL-3.0-or-later"
homepage="https://github.com/soyersoyer/cameractrls"
changelog="https://raw.githubusercontent.com/soyersoyer/cameractrls/refs/heads/main/CHANGELOG.md"
distfiles="${homepage}/archive/refs/tags/v${version}.tar.gz"
checksum=6d3ab918e1d92e36131a8571f3bca995e87c3a2c49b4475969b9e6b9c23777c5
python_version=3

do_configure() {
	# Use gtk4 version
	vsed -e "/Exec=/cExec=cameractrlsgtk4" -i pkg/hu.irl.cameractrls.desktop
}

do_install() {
	vmkdir usr/bin
	vmkdir usr/share/icons/hicolor/scalable/apps

	for i in \
		cameractrls \
		cameractrlsd \
		cameractrlsgtk \
		cameractrlsgtk4 \
		cameraptzgame \
		cameraptzmidi \
		cameraptzspnav \
		cameraview
	do
		vinstall "${i}.py" 0755 usr/lib/cameractrls
		ln -sf "/usr/lib/cameractrls/${i}.py" "${DESTDIR}/usr/bin/${i}"
	done

	vinstall pkg/hu.irl.cameractrls.desktop 0644 usr/share/applications
	vinstall pkg/hu.irl.cameractrls.metainfo.xml 0644 usr/share/metainfo
	vinstall pkg/hu.irl.cameractrls.svg 0644 usr/lib/cameractrls/pkg
	ln -sf /usr/lib/cameractrls/pkg/hu.irl.cameractrls.svg "${DESTDIR}/usr/share/icons/hicolor/scalable/apps/"
}
