# Template file for 'photofilmstrip'
pkgname=photofilmstrip
version=4.1.1
revision=2
build_style=python3-module
hostmakedepends="python3-setuptools gst1-python3 gettext"
depends="python3 gst1-python3 gst1-editing-services python3-Pillow wxPython"
checkdepends="$depends"
short_desc="Slideshow creator with Ken Burns effect"
maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
license="GPL-2.0-or-later"
homepage="https://www.photofilmstrip.org/"
distfiles="https://github.com/PhotoFilmStrip/PFS/archive/refs/tags/v${version}.tar.gz"
checksum=78e58ae587f381439c2dd5337050f8715e9735f3e2a046413045800b822ee4f7

post_patch() {
	vsed -i -e 's/gstreamer1.0-libav/gst-libav/' \
		-e 's/gstreamer1.0-plugins-base/gst-plugins-base1/' \
		-e 's/gstreamer1.0-plugins-good/gst-plugins-good1/' \
		-e 's/gstreamer1.0-plugins-bad/gst-plugins-bad1/' \
		-e 's/gstreamer1.0-plugins-ugly/gst-plugins-ugly1/' \
		photofilmstrip/core/renderer/GStreamerRenderer.py \
		po/*.po
}

post_install() {
	local _file _lang
	for _file in po/*.po; do
		_lang="${_file##*/}"
		_lang="${_lang%.po}"
		vmkdir "usr/share/locale/${_lang}/LC_MESSAGES"
		msgfmt "$_file" \
			-o "${DESTDIR}/usr/share/locale/${_lang}/LC_MESSAGES/PhotoFilmStrip.mo"
	done
}
