commit: 6d6479beaee9bd2e046992e19466c03500da16f7 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org> AuthorDate: Wed Sep 24 08:44:39 2025 +0000 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org> CommitDate: Wed Oct 22 08:35:27 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d6479be
dev-python/yt-dlp-ejs: new package, add 0.1.0 This has very little python, its purpose is to provide the .js files generated by deno and then the minimal python code just feeds these files as a string to yt-dlp. Given tests are not wired (may never be, they use deno and have not managed to get them to run at all yet), and that this is allarches, went ahead and self-copied yt-dlp keywords. Note would be meaningless to run tests for PYTHON_COMPAT given they do not use python at all. yt-dlp currently only allows specific sha512sum for the .js files meaning that this will need to be kept pinned with yt-dlp versions. Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org> dev-python/yt-dlp-ejs/Manifest | 2 ++ dev-python/yt-dlp-ejs/metadata.xml | 12 +++++++++ dev-python/yt-dlp-ejs/yt-dlp-ejs-0.1.0.ebuild | 37 +++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/dev-python/yt-dlp-ejs/Manifest b/dev-python/yt-dlp-ejs/Manifest new file mode 100644 index 000000000000..6842220e5d2c --- /dev/null +++ b/dev-python/yt-dlp-ejs/Manifest @@ -0,0 +1,2 @@ +DIST yt_dlp_ejs-0.1.0-py3-none-any.whl.zip 52940 BLAKE2B 70f64f63442d26c710bc9f25c8a114378310f64bb81290f5fc34fd6f4e1b3cd5ade9fd7cdfd7aaa87765e88e22b999f59aa63b4b3d3f47d8d522b5c9e36348b2 SHA512 d1dff46683a0bb6c170d970de58309abd527000f3c2f9ed6fbc6ff4625171568fe0e0031483b288a60f1454963a272bb9040cf2374fddac78cb54d9707025f99 +DIST yt_dlp_ejs-0.1.0.tar.gz 11675 BLAKE2B 23bdf9673d197648604132efe077893adc471963bc88cc715d961ca2d97bfcff9c23277982897d624eeaead8316919a5ffbd65706681be2847df062c07afaf96 SHA512 f9d2c6faa8384f2d62e7cf9ac2a6e7367aa11c723334fd5863c890c56c4915ea0cbe2a9d2ea1418175a0979f357574836ff6a6e1799837f231c4ba8fb5460c5d diff --git a/dev-python/yt-dlp-ejs/metadata.xml b/dev-python/yt-dlp-ejs/metadata.xml new file mode 100644 index 000000000000..d097fd1b1b55 --- /dev/null +++ b/dev-python/yt-dlp-ejs/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>[email protected]</email> + <name>Ionen Wolkens</name> + </maintainer> + <stabilize-allarches/> + <upstream> + <remote-id type="github">yt-dlp/ejs</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-python/yt-dlp-ejs/yt-dlp-ejs-0.1.0.ebuild b/dev-python/yt-dlp-ejs/yt-dlp-ejs-0.1.0.ebuild new file mode 100644 index 000000000000..fe8383a5435a --- /dev/null +++ b/dev-python/yt-dlp-ejs/yt-dlp-ejs-0.1.0.ebuild @@ -0,0 +1,37 @@ +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=hatchling +PYTHON_COMPAT=( pypy3_11 python3_{11..14} ) +inherit distutils-r1 pypi + +DESCRIPTION="External JavaScript for yt-dlp supporting many runtimes" +HOMEPAGE="https://github.com/yt-dlp/ejs/" +SRC_URI+=" $(pypi_wheel_url --unpack)" + +LICENSE="Unlicense" +LICENSE+=" ISC MIT" # .js dependencies +SLOT="0" +# in-sync with yt-dlp and always straight-to-stable like yt-dlp itself +KEYWORDS="amd64 arm arm64 ~hppa ppc ppc64 ~riscv x86 ~arm64-macos ~x64-macos" +# tests do not use python and are troublesome due to javascript, if in +# doubt try downloading a youtube video with yt-dlp as a basic test +RESTRICT="test" + +BDEPEND=" + app-arch/unzip + dev-python/hatch-vcs[${PYTHON_USEDEP}] +" + +src_prepare() { + distutils-r1_src_prepare + + # drop deno/npm calls and use the pre-generated .js from the .whl + # instead, this both prevent network use and ensures no hash + # mismatch given yt-dlp checks the sha512sum of the .js files + # (makes generating our own meaningless given can't be patched) + sed -i '/wheel.hooks.custom/d' pyproject.toml || die + mv ../yt_dlp_ejs/yt/solver/*.js yt_dlp_ejs/yt/solver/ || die +}
