commit:     759e08c72e11e3e0ba55dbc0e7bbf6a5a627b407
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 24 04:28:34 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=759e08c7

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 <AT> gentoo.org>

 dev-lang/deno-bin/Manifest              |  2 ++
 dev-lang/deno-bin/deno-bin-2.5.4.ebuild | 59 +++++++++++++++++++++++++++++++++
 dev-lang/deno-bin/metadata.xml          | 12 +++++++
 profiles/features/musl/package.mask     |  1 +
 4 files changed, 74 insertions(+)

diff --git a/dev-lang/deno-bin/Manifest b/dev-lang/deno-bin/Manifest
new file mode 100644
index 000000000000..2536cc79f865
--- /dev/null
+++ b/dev-lang/deno-bin/Manifest
@@ -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

diff --git a/dev-lang/deno-bin/deno-bin-2.5.4.ebuild 
b/dev-lang/deno-bin/deno-bin-2.5.4.ebuild
new file mode 100644
index 000000000000..43f3df3b747f
--- /dev/null
+++ b/dev-lang/deno-bin/deno-bin-2.5.4.ebuild
@@ -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
+}

diff --git a/dev-lang/deno-bin/metadata.xml b/dev-lang/deno-bin/metadata.xml
new file mode 100644
index 000000000000..9b7526c34359
--- /dev/null
+++ b/dev-lang/deno-bin/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>
+       <upstream>
+               <doc>https://docs.deno.com/runtime/</doc>
+               <remote-id type="github">denoland/deno</remote-id>
+       </upstream>
+</pkgmetadata>

diff --git a/profiles/features/musl/package.mask 
b/profiles/features/musl/package.mask
index 6801e3502803..ea7883896c46 100644
--- a/profiles/features/musl/package.mask
+++ b/profiles/features/musl/package.mask
@@ -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

Reply via email to