dev-lang/deno-bin: new package, add 2.5.4

Will (likely) be newly needed by net-misc/yt-dlp to solve YouTube's
JS challenges among other future things, and also been requested
in bug #927139.

I've formerly tried to package the source version, but do not think
I want to be dealing with that after closer inspection. Needs a huge
amount of crates (936+ vendor-filtered, otherwise 1600+) for one,
but the biggest issue is the V8 crate that tries to download various
tools mid-build (or a prebuilt V8 if do not set V8_FROM_SOURCE=1)
and uses Gn to build. Did manage to prevent clang+gn+ninja without
patching but version 2.5.x has an extra hurdle with the rust
toolchain that it downloads and no easy switch to disable it. May
be possible to patch + copy what the chromium ebuild does but it's
all sort of fragile and will be a difficult to maintain across
versions of both deno and the system's toolchain. We *could* use
the same downloaded toolchain through SRC_URI, but then it wouldn't
support anything but amd64+glibc (sounds arm64 would be complicated
too, unless use prebuilt V8... and if using prebuilt may as well use
deno-bin).

In case someone else gets the source build to work for 2.5+, using
"deno-bin" to avoid name clashing with a future package. Either way
we'll likely want to keep -bin given it's a slow build and users
likely won't want to build it just to download youtube videos.

Note that for users that really want to avoid prebuilts or are on an
unsupported profile (e.g. musl), nodejs is technically usable with
yt-dlp but upstream disables it by default due to security concerns
with running untrusted code with it.

Straight to stable and self-keywording for arm64 (without hardware)
given this just dobin a single (~100MB, stripped) file with no tests.

Closes: https://bugs.gentoo.org/927139
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
This commit is contained in:
Ionen Wolkens
2025-09-24 00:28:34 -04:00
parent 361c80f39b
commit 759e08c72e
4 changed files with 74 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
DIST deno-bin-2.5.4-amd64.zip 45663234 BLAKE2B a50492f33245a3f3dca71a6c56beaf5664d960908f48ee5b0456f7cd0a470ef31e34da26a26c701cb6d4e67ec556592d6dd28eef2af9298b8cd8c252b6233526 SHA512 be39278813e37f2d2403e1a5b3ee6ea524e94ed6aa4da9f777a2a10ad1d3821e7f9367ef10619feae870addad2a5ff5fd0d149a5b4d4b7bf5a7bc22ced5e3ab8
DIST deno-bin-2.5.4-arm64.zip 43820162 BLAKE2B ddc22393ea01155403d578523b67397a0ccba127275d252cd55a2fa00c5e243d9e29381d5503d4204b470341f74ca7dd5cb7965bfe88c049f112930ae9fb90a0 SHA512 ee928b71580eb5ef482b36852156bab6c23ead164da19a8a7779487d23bb934efa6f3aaa7f0b954621b1dabe5ebbc87274637457b3b0be838da5ca405fbb8f2d

View File

@@ -0,0 +1,59 @@
# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit shell-completion toolchain-funcs
DESCRIPTION="Modern runtime for JavaScript and TypeScript"
HOMEPAGE="https://deno.com/"
SRC_URI="
amd64? (
https://github.com/denoland/deno/releases/download/v${PV}/deno-x86_64-unknown-linux-gnu.zip
-> ${P}-amd64.zip
)
arm64? (
https://github.com/denoland/deno/releases/download/v${PV}/deno-aarch64-unknown-linux-gnu.zip
-> ${P}-arm64.zip
)
"
S=${WORKDIR}
LICENSE="MIT"
LICENSE+="
Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD CC0-1.0 ISC MIT
MPL-2.0 openssl Unicode-3.0 Unicode-DFS-2016 ZLIB
" # crates
SLOT="0"
KEYWORDS="-* amd64 arm64"
RDEPEND="
|| (
llvm-runtimes/libgcc
sys-devel/gcc:*
)
sys-libs/glibc
"
BDEPEND="app-arch/unzip"
QA_PREBUILT="usr/bin/deno"
src_compile() {
if ! tc-is-cross-compiler; then
./deno completions bash > "${T}"/deno || die
./deno completions fish > "${T}"/deno.fish || die
./deno completions zsh > "${T}"/_deno || die
else
ewarn "shell completion files were skipped due to cross-compilation"
fi
}
src_install() {
dobin deno
if ! tc-is-cross-compiler; then
dobashcomp "${T}"/deno
dofishcomp "${T}"/deno.fish
dozshcomp "${T}"/_deno
fi
}

View File

@@ -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>ionen@gentoo.org</email>
<name>Ionen Wolkens</name>
</maintainer>
<upstream>
<doc>https://docs.deno.com/runtime/</doc>
<remote-id type="github">denoland/deno</remote-id>
</upstream>
</pkgmetadata>

View File

@@ -309,6 +309,7 @@ dev-games/ps2-packer
dev-java/openjdk-bin
dev-java/openjdk-jre-bin
dev-lang/dafny-bin
dev-lang/deno-bin
dev-libs/luise
dev-libs/nwjs
dev-perl/Lab-Zhinst