aports/community/yt-dlp/APKBUILD
2025-05-22 13:56:34 +00:00

92 lines
2.1 KiB
Text

# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Timo Teräs <timo.teras@iki.fi>
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Contributor: Sodface <sod@sodface.com>
# Maintainer: lauren n. liberda <lauren@selfisekai.rocks>
pkgname=yt-dlp
pkgver=2025.05.22
pkgrel=0
pkgdesc="Command-line program to download videos from YouTube"
url="https://github.com/yt-dlp/yt-dlp"
arch="noarch"
license="Unlicense"
depends="python3"
_extradeps="
attr
ca-certificates
ffmpeg
py3-brotli
py3-mutagen
py3-pycryptodomex
py3-secretstorage
py3-websockets
"
makedepends="$_extradeps py3-gpep517 py3-hatchling"
checkdepends="
py3-flake8
py3-nose
py3-pytest-xdist
py3-requests
"
subpackages="
$pkgname-core-pyc
$pkgname-core
$pkgname-doc
$pkgname-zsh-completion
$pkgname-bash-completion
$pkgname-fish-completion
"
[ "$CARCH" != 'riscv64' ] || options="!check"
source="$pkgname-$pkgver.tar.gz::https://github.com/yt-dlp/yt-dlp/releases/download/$pkgver/yt-dlp.tar.gz
"
builddir="$srcdir/$pkgname"
# secfixes:
# 2024.07.01-r0:
# - CVE-2024-38519
# 2023.11.14-r0:
# - CVE-2023-46121
# 2023.07.06-r0:
# - CVE-2023-35934
# 0-r0:
# - CVE-2023-40581
# - CVE-2024-22423
build() {
gpep517 build-wheel \
--wheel-dir .dist \
--output-fd 3 3>&1 >&2
}
check() {
python3 -m venv --clear --without-pip --system-site-packages .testenv
.testenv/bin/python3 -m installer .dist/*.whl
# last 2 are flaky in upstream, failing more often than not here
.testenv/bin/python3 -m pytest -k 'not download and not verify_cert and not mtls' -n logical
}
package() {
depends="
$_extradeps
yt-dlp-core=$pkgver-r$pkgrel
"
python3 -m installer -d "$pkgdir" \
.dist/*.whl
ln -sfv yt-dlp "$pkgdir"/usr/bin/youtube-dl
}
core() {
# provide compat for removed old youtube-dl
provides="youtube-dl=$pkgver-r$pkgrel"
replaces="youtube-dl"
amove usr/lib/python3*/site-packages/
amove usr/bin
}
sha512sums="
2507617245b280d5038d23766d787b4ad8ab854789f6d1f459b4643c1b4cfa902685f8cbb9fb3dbe2dad4a7e74c34e943cb06c4a7974a52245f2e74cec15b423 yt-dlp-2025.05.22.tar.gz
"