makedeb


mpv-sponsorblock-minimal-git 0.r1.ca2844b-1


A minimal script to skip sponsored segments of YouTube videos

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for mpv-sponsorblock-minimal-git.

# Maintainer: exponential <echo ZXhwb25lbnRpYWxtYXRyaXhAcHJvdG9ubWFpbC5jb20K | base64 -d>
# Contributor: lmartinez-mirror (AUR)
# OFF by default
#_DEFAULTON=0
pkgname=mpv-sponsorblock-minimal-git
_pkgname=${pkgname%-git}
pkgver=0.r1.ca2844b
pkgrel=1
pkgdesc="A minimal script to skip sponsored segments of YouTube videos"
arch=('all')
url="https://codeberg.org/jouni/mpv_sponsorblock_minimal"
license=('GPL3')
depends=('mpv' 'curl' 'coreutils')
makedepends=('git')
provides=('mpv-sponsorblock' "${pkgname%-git}")
conflicts=('mpv-sponsorblock')
source=("${_pkgname}::git+$url")
b2sums=('SKIP')

pkgver() {
  cd "${_pkgname}"
  printf "0.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "${_pkgname}"
  # Use sha256sum on video id
  sed -i 's!hash = ""!hash = "true"!' "sponsorblock_minimal.lua"
  # ON by default
  [ -z "$_DEFAULTON" ] &&  sed -i 's!local ON = false!local ON = true!' "sponsorblock_minimal.lua" || :
}

package() {
  cd "${_pkgname}"
  # Script installation
  install -Dm644 sponsorblock_minimal.lua -t "$pkgdir/usr/share/mpv/scripts/"
  # Script loaded by default
  install -dm755 "${pkgdir}/etc/mpv/scripts/"
  ln -s "/usr/share/mpv/scripts/sponsorblock_minimal.lua" "$pkgdir/etc/mpv/scripts/"
  # Doc
  install -Dm644 README -t "$pkgdir/usr/share/doc/$_pkgname"
  _license_path="/usr/share/common-licenses/GPL-3"
  install -dm755 "${pkgdir}/usr/share/doc/$_pkgname"
  ln -s "$_license_path" "${pkgdir}/usr/share/doc/$_pkgname/"
}