summaryrefslogtreecommitdiff
path: root/user/youtube-dl/APKBUILD
blob: ed99fcb7b01ffe7bccc1176a9945876521048824 (plain) (blame)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Max Rees <maxcrees@me.com>
pkgname=youtube-dl
pkgver=2020.03.08
pkgrel=0
pkgdesc="Command-line program to download videos from YouTube and many other sites"
url="https://youtube-dl.org"
arch="noarch"
options="!check"  # Takes way too long, and uses network
license="Unlicense AND Public-Domain"
depends="ffmpeg python3"
makedepends=""
subpackages="$pkgname-doc
	$pkgname-zsh-completion:zshcomp
	$pkgname-bash-completion:bashcomp
	$pkgname-fish-completion:fishcomp"
source="https://github.com/rg3/$pkgname/releases/download/$pkgver/$pkgname-$pkgver.tar.gz
	tumblr.patch
	"
builddir="$srcdir/$pkgname"

prepare() {
	default_prepare
	sed -i \
		-e 's|etc/bash_completion.d|share/bash-completion/completions|' \
		-e 's|etc/fish/completions|share/fish/completions|' \
		"$builddir/setup.py"
}

check() {
	python3 -m unittest discover
}

package() {
	python3 setup.py install --root="$pkgdir/" --optimize=1
}

zshcomp() {
	pkgdesc="Zsh completions for $pkgname"
	depends=""
	install_if="$pkgname=$pkgver-r$pkgrel zsh"

	install -Dm644 "$builddir/$pkgname.zsh" \
		"$subpkgdir/usr/share/zsh/site-functions/_$pkgname"
}

bashcomp() {
	pkgdesc="Bash completions for $pkgname"
	depends=""
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	mkdir -p "$subpkgdir/usr/share/bash-completion/completions/"
	mv "$pkgdir/usr/share/bash-completion/completions/$pkgname.bash-completion" \
		"$subpkgdir/usr/share/bash-completion/completions/$pkgname"
}

fishcomp() {
	pkgdesc="Fish completions for $pkgname"
	depends=""
	install_if="$pkgname=$pkgver-r$pkgrel fish"

	mkdir -p "$subpkgdir/usr/share/fish/completions/"
	mv "$pkgdir/usr/share/fish/completions/$pkgname.fish" \
		"$subpkgdir/usr/share/fish/completions/"
}

sha512sums="09636e3ec526dbcb043cf61ed4dda5c5c00fac2ecd741bf3cb338ca8de72d1395a95a6189bccced140ca1c37eb3f693332e757ff01eb1a25279b100ccdf39b65  youtube-dl-2020.03.08.tar.gz
5760d06e6bbc1eee2c6be2d1f580f86b3cfa5f4bc44a62fb8145ce1cd41352ecf2f65d65d79a2d7f1ec129a34c28a7ec3d0d328c907e743bfcea54c65c71285d  tumblr.patch"