summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 959d03c50cbd3b76444e9d4e98703f1b112bcafc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Maintainer: Lari Tikkanen <lartza@outlook.com>
# Maintainer: heavysink <winstonwu91 at gmail>

pkgname=youtube-dl-anime-git
_gitname="youtube-dl"
pkgver=2020.08.24m.r341.gca59f1f96
pkgrel=1
pkgdesc="A small command-line program to download videos from YouTube.com and a few more sites (added nicovideo and bilibili danmaku support and other features, git version)"
arch=('any')
url="http://github.com/animelover1984/youtube-dl"
license=('custom')
depends=('python-mutagen' 'python-dateutil' 'python-requests' 'python-websockets')
makedepends=('git' 'pandoc' 'python-setuptools')
optdepends=('ffmpeg: for video post-processing'
            'rtmpdump: for rtmp streams support'
            'atomicparsley: for embedding thumbnails into m4a files'
            'phantomjs: for some less common extractors to work')
provides=("youtube-dl")
conflicts=("youtube-dl")
source=('git+https://github.com/animelover1984/youtube-dl.git')
md5sums=('SKIP')

pkgver() {
  cd $_gitname
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd $_gitname
  sed -i 's|etc/bash_completion.d|share/bash-completion/completions|' setup.py
  sed -i 's|etc/fish/completions|share/fish/completions|' setup.py
}

build() {
  cd $_gitname
  make pypi-files zsh-completion
  python setup.py build
}

package() {
  cd $_gitname
  export PYTHONHASHSEED=0
  python setup.py install --root="${pkgdir}/" --optimize=1 --skip-build
  mv "${pkgdir}/usr/share/bash-completion/completions/youtube-dl.bash-completion" \
     "${pkgdir}/usr/share/bash-completion/completions/youtube-dl"
  install -Dm644 youtube-dl.zsh "${pkgdir}/usr/share/zsh/site-functions/_youtube-dl"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}