Install this version:
emerge -a =net-libs/bun-bin-1.3.14
If this version is masked, you can unmask it using the autounmask tool or standard emerge options:
autounmask =net-libs/bun-bin-1.3.14
Or alternatively:
emerge --autounmask-write -a =net-libs/bun-bin-1.3.14
# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DESCRIPTION="All-in-one JavaScript runtime, bundler and package manager (binary)"
HOMEPAGE="https://bun.sh https://github.com/oven-sh/bun"
SRC_URI="
amd64? (
cpu_flags_x86_avx2? (
https://github.com/oven-sh/bun/releases/download/bun-v${PV}/bun-linux-x64.zip
-> ${P}-linux-x64.zip
)
!cpu_flags_x86_avx2? (
https://github.com/oven-sh/bun/releases/download/bun-v${PV}/bun-linux-x64-baseline.zip
-> ${P}-linux-x64-baseline.zip
)
)
arm64? (
https://github.com/oven-sh/bun/releases/download/bun-v${PV}/bun-linux-aarch64.zip
-> ${P}-linux-aarch64.zip
)
"
S="${WORKDIR}"
# Bun (MIT) bundles JavaScriptCore (LGPL-2.1+ / BSD-2 / BSD), Zig (MIT),
# zlib (ZLIB), and many MIT/Apache-2.0 dependencies.
LICENSE="MIT BSD BSD-2 LGPL-2.1+ ZLIB Apache-2.0"
SLOT="0"
KEYWORDS="-* ~amd64 ~arm64"
IUSE="cpu_flags_x86_avx2"
RESTRICT="bindist mirror strip"
QA_PREBUILT="opt/${PN}/bin/bun"
BDEPEND="app-arch/unzip"
src_install() {
local bun_dir
if use amd64; then
if use cpu_flags_x86_avx2; then
bun_dir="bun-linux-x64"
else
bun_dir="bun-linux-x64-baseline"
fi
elif use arm64; then
bun_dir="bun-linux-aarch64"
else
die "Unsupported architecture"
fi
[[ -x "${WORKDIR}/${bun_dir}/bun" ]] \
|| die "bun binary not found at ${WORKDIR}/${bun_dir}/bun"
exeinto /opt/${PN}/bin
doexe "${WORKDIR}/${bun_dir}/bun"
# bunx is just an alias for `bun x`
dosym bun /opt/${PN}/bin/bunx
# Expose binaries via /opt/bin (in PATH on bentoo/Gentoo profiles).
dodir /opt/bin
dosym ../${PN}/bin/bun /opt/bin/bun
dosym ../${PN}/bin/bunx /opt/bin/bunx
}
pkg_postinst() {
elog "Bun installed at /opt/${PN}/bin/bun"
elog "Run with: bun (also available as 'bunx' for 'bun x')."
if use amd64 && ! use cpu_flags_x86_avx2; then
elog ""
elog "Installed the AVX2-less 'baseline' variant for older CPUs."
fi
}
Manage flags for this package:
euse -i <flag> -p net-libs/bun-bin |
euse -E <flag> -p net-libs/bun-bin |
euse -D <flag> -p net-libs/bun-bin
| Type | File | Size | Source URLs |
|---|---|---|---|
| DIST | bun-bin-1.3.14-linux-aarch64.zip | 35700603 bytes | https://github.com/oven-sh/bun/releases/download/bun-v1.3.14/bun-linux-aarch64.zip |
| DIST | bun-bin-1.3.14-linux-x64-baseline.zip | 35595658 bytes | https://github.com/oven-sh/bun/releases/download/bun-v1.3.14/bun-linux-x64-baseline.zip |
| DIST | bun-bin-1.3.14-linux-x64.zip | 35969274 bytes | https://github.com/oven-sh/bun/releases/download/bun-v1.3.14/bun-linux-x64.zip |