diff --git a/srcpkgs/photofilmstrip/patches/no-img2py.patch b/srcpkgs/photofilmstrip/patches/no-img2py.patch index 8f6014c2708..bce597efb4f 100644 --- a/srcpkgs/photofilmstrip/patches/no-img2py.patch +++ b/srcpkgs/photofilmstrip/patches/no-img2py.patch @@ -1,6 +1,6 @@ --- a/setup.py +++ b/setup.py -@@ -187,9 +187,7 @@ class pfs_build(build): +@@ -153,9 +153,7 @@ class pfs_build(build): build.run(self) def _make_resources(self): diff --git a/srcpkgs/photofilmstrip/patches/no-msgfmt.patch b/srcpkgs/photofilmstrip/patches/no-msgfmt.patch new file mode 100644 index 00000000000..ddc07d0d30e --- /dev/null +++ b/srcpkgs/photofilmstrip/patches/no-msgfmt.patch @@ -0,0 +1,34 @@ +--- a/setup.py ++++ b/setup.py +@@ -16,7 +16,6 @@ from setuptools import setup, Command + from setuptools.command.build import build + from setuptools.command.sdist import sdist + +-import pythongettext.msgfmt + + try: + from sphinx.application import Sphinx +@@ -243,22 +242,7 @@ class pfs_build(build): + resName=imgName) + + def _make_locale(self): +- for filename in os.listdir("po"): +- lang, ext = os.path.splitext(filename) +- if ext.lower() == ".po": +- moDir = os.path.join("build", "mo", lang, "LC_MESSAGES") +- moFile = os.path.join(moDir, "%s.mo" % Constants.APP_NAME) +- if not os.path.exists(moDir): +- os.makedirs(moDir) +- +- msgfmt = pythongettext.msgfmt.Msgfmt(os.path.join("po", filename)) +- with open(moFile, "wb") as moFd: +- moFd.write(msgfmt.getAsFile().getbuffer()) +- +- targetPath = os.path.join("share", "locale", lang, "LC_MESSAGES") +- self.distribution.data_files.append( +- (targetPath, (moFile,)) +- ) ++ pass + + + class pfs_exe(Command): diff --git a/srcpkgs/photofilmstrip/template b/srcpkgs/photofilmstrip/template index 5a3cb59ff5e..c4d59f6838a 100644 --- a/srcpkgs/photofilmstrip/template +++ b/srcpkgs/photofilmstrip/template @@ -1,9 +1,9 @@ # Template file for 'photofilmstrip' pkgname=photofilmstrip -version=4.0.0 -revision=4 +version=4.1.1 +revision=1 build_style=python3-module -hostmakedepends="python3-setuptools gst1-python3 python3-Sphinx gettext" +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" @@ -11,7 +11,7 @@ maintainer="Đoàn Trần Công Danh " 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=1e0ced0a25f752100a68286833d35fd976a59bafd927eb4eae54b837974578ee +checksum=78e58ae587f381439c2dd5337050f8715e9735f3e2a046413045800b822ee4f7 post_patch() { vsed -i -e 's/gstreamer1.0-libav/gst-libav/' \ @@ -22,3 +22,14 @@ post_patch() { 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 +}