Package Details: python-ffsubsync-venv 0.4.25-4

Git Clone URL: https://aur.archlinux.org/python-ffsubsync-venv.git (read-only, click to copy)
Package Base: python-ffsubsync-venv
Description: Language-agnostic automatic synchronization of subtitles with video. (Installed inside a Python virtual environment)
Upstream URL: https://github.com/smacke/ffsubsync
Licenses: MIT
Conflicts: python-ffsubsync
Submitter: kugland
Maintainer: kugland (vej.kse)
Last Packager: vej.kse
Votes: 0
Popularity: 0.000000
First Submitted: 2022-09-10 02:23 (UTC)
Last Updated: 2024-01-16 14:59 (UTC)

Latest Comments

vej.kse commented on 2024-01-16 15:01 (UTC)

The latest version of this PKGBUILD now uses as much system packages as possible. Only auditok and ffsubsync are in the virtual environment.

vej.kse commented on 2024-01-09 13:54 (UTC) (edited on 2024-01-09 18:04 (UTC) by vej.kse)

I wanted to try this but https://aur.archlinux.org/packages/python-ffsubsync wouldn’t run due to wrong dependency versions and I couldn’t make this one. I managed to modify this PKGBUILD into a working one, inspired by this other one: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=octoprint

# Maintainer: André Kugland <kugland at gmail dot com>

#  This package is provided as a workaround because ffsubsync
#  doesn't work correctly with the most recent version of its
#  libraries. In this package, it is installed, together with
#  its dependencies as a Python virtual environment inside the
#  directory /usr/share/ffsubsync-venv.

_pkgname=ffsubsync-venv
pkgname=python-$_pkgname
pkgver=0.4.25
pkgrel=1
pkgdesc="Language-agnostic automatic synchronization of subtitles with video. (Installed inside a Python virtual environment)"
arch=(any)
url="https://github.com/smacke/ffsubsync"
license=('MIT')
source=('ffs.sh')
sha256sums=('547f73f58ab3d7217b0ea211517d7ea7d0c76cbc49a1655ccd7be774ab57b396')
depends=(
  'python'
  'python-chardet'
  'python-charset-normalizer'
  'python-faust-cchardet'
  'python-ffmpeg-python'
  'python-future'
  'python-numpy'
  'python-pysubs2'
  'python-rich'
  'python-six'
  'python-srt'
  'python-tqdm'
  'python-typing_extensions'
  'python-webrtcvad'
)
conflicts=('python-ffsubsync')
install=ffsubsync-venv.install

package() {
  mkdir -p "$pkgdir"/usr/{bin,share/ffsubsync-venv}
  install -m 755 -o 0 -g 0 ffs.sh "$pkgdir"/usr/bin/ffs
  install -m 755 -o 0 -g 0 ffs.sh "$pkgdir"/usr/bin/ffsubsync
  install -m 755 -o 0 -g 0 ffs.sh "$pkgdir"/usr/bin/subsync

  venv="$pkgdir/usr/share/ffsubsync-venv"
  python -m venv --system-site-packages --symlinks "$venv"
  . "$venv/bin/activate"

  pip install "ffsubsync==$pkgver"

  # Remove Python packages only needed to make this package, not to run it
  pip uninstall --yes pip setuptools
  # Remove $pkgdir path from the package (it is important to exclude binary
  # files otherwise .pyc files will be corrupted and ffs will crash)
  find "$venv" -type f \
    -exec grep --quiet --binary-files=without-match "$pkgdir" {} \; \
    -exec sed --in-place "s,$pkgdir,,g" {} \;
}

I’m not sure all changes are needed or good. (There is something that I didn’t fix: the sed command should not use $pkgdir as is, in case it contains regex reserved characters. This PKGBUILD could fail if the path of the build directory contains such characters.)