summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO19
-rw-r--r--.gitignore7
-rw-r--r--PKGBUILD43
-rw-r--r--autosubsync.conf30
-rw-r--r--mpv-autosubsync-git.install25
5 files changed, 124 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b51a888e6274
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = mpv-autosubsync-git
+ pkgdesc = Automatic subtitle synchronization script for mpv media player
+ pkgver = r100.ea6d616
+ pkgrel = 1
+ url = https://github.com/joaquintorres/autosubsync-mpv
+ install = mpv-autosubsync-git.install
+ arch = any
+ license = MIT
+ makedepends = git
+ depends = mpv>=0.33
+ depends = alass
+ optdepends = python-ffsubsync: yet another backend
+ provides = mpv-autosubsync
+ source = mpv-autosubsync::git+https://github.com/joaquintorres/autosubsync-mpv
+ source = autosubsync.conf
+ sha256sums = SKIP
+ sha256sums = 7703a53e75719afd51a98f3ba1eaaeef6243ce433ffba8be89dce401064d6161
+
+pkgname = mpv-autosubsync-git
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..8aad5446bbd9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+*
+
+!.gitignore
+!.SRCINFO
+!PKGBUILD
+!autosubsync.conf
+!mpv-autosubsync-git.install
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..6eddacf8f2bc
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer: Mogeko <zhengjunyi@live.com>
+
+pkgname=mpv-autosubsync-git
+_pkgname=${pkgname%-git}
+pkgver=r100.ea6d616
+pkgrel=1
+pkgdesc='Automatic subtitle synchronization script for mpv media player'
+arch=('any')
+url='https://github.com/joaquintorres/autosubsync-mpv'
+license=('MIT')
+depends=(
+ 'mpv>=0.33'
+ 'alass'
+)
+optdepends=('python-ffsubsync: yet another backend')
+makedepends=('git')
+provides=('mpv-autosubsync')
+source=(
+ "$_pkgname::git+$url"
+ 'autosubsync.conf'
+)
+install="$pkgname.install"
+sha256sums=(
+ 'SKIP'
+ '7703a53e75719afd51a98f3ba1eaaeef6243ce433ffba8be89dce401064d6161'
+)
+
+pkgver() {
+ cd "$_pkgname"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+package() {
+ cd "$_pkgname"
+ install -Dm644 autosubsync.lua \
+ -t "$pkgdir"/usr/share/mpv/scripts
+
+ install -Dm644 "$srcdir/${source[1]}" \
+ -t "$pkgdir"/usr/share/doc/mpv/script-opts/
+
+ install -Dm644 LICENSE \
+ -t "$pkgdir"/usr/share/licenses/"$pkgname"
+}
diff --git a/autosubsync.conf b/autosubsync.conf
new file mode 100644
index 000000000000..367da3b0479d
--- /dev/null
+++ b/autosubsync.conf
@@ -0,0 +1,30 @@
+# This user script also supports ffsubsync as a backend,
+# but we will not install it automatically.
+#
+# If you need ffsubsync, you can install it via pip:
+#
+# pip install ffsubsync
+#
+# Or through aur (python-ffsubsync).
+#
+
+
+# Absolute paths to the executables, if needed:
+# 1. ffmpeg
+ffmpeg_path=/usr/bin/ffmpeg
+# 2. alass
+alass_path=/usr/bin/alass
+# 3. ffsubsync (Optional)
+# Install via pip (ffsubsync) or aur (python-ffsubsync)
+#ffsubsync_path=/home/user/.local/bin/ffsubsync
+
+# Preferred retiming tool. Allowed options: 'ffsubsync', 'alass', 'ask'.
+# If set to 'ask', the add-on will ask to choose the tool every time:
+# 1. Preferred tool for syncing to audio.
+audio_subsync_tool=alass
+# 2. Preferred tool for syncing to another subtitle.
+altsub_subsync_tool=alass
+
+# Unload old subs (yes,no)
+# After retiming, tell mpv to forget the original subtitle track.
+#unload_old_sub=no
diff --git a/mpv-autosubsync-git.install b/mpv-autosubsync-git.install
new file mode 100644
index 000000000000..e50e7c52f8d2
--- /dev/null
+++ b/mpv-autosubsync-git.install
@@ -0,0 +1,25 @@
+post_install() {
+ cat << EOF
+ >>> To use this user script, please copy the
+ >>> sample configuration file to user's home directory:
+ >>>
+ >>> cp /usr/share/doc/mpv/script-opts/mpv-autosubsync-git.conf \\
+ >>> ~/.config/mpv/script-opts/autosubsync.conf
+ >>>
+ >>> And configure it as required.
+EOF
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+post_remove() {
+ cat << EOF
+ >>> Please remember to remove configuration file
+ >>> from your ~/.config/mpv/script-opts/ directory:
+ >>>
+ >>> rm ~/.config/mpv/script-opts/autosubsync.conf
+ >>>
+EOF
+} \ No newline at end of file