summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 470c8480a1fea9edef50eef535b170510aa9fe05 (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
# Maintainer: Lari Tikkanen <lartza@outlook.com>

pkgname=youtube-dl-git
_gitname="youtube-dl"
pkgver=2021.02.22.r6.g1631fca1e
pkgrel=1
pkgdesc="A small command-line program to download videos from YouTube.com and a few more sites (git version)"
arch=('any')
url="http://ytdl-org.github.io/youtube-dl/"
license=('custom')
depends=('python')
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/ytdl-org/youtube-dl.git')
md5sums=('SKIP')

pkgver() {
  cd $_gitname
  git describe --long | 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"
}