dev-build/node-gyp - 13.0.2 (mndz)

Search

Install

Install this version:

emerge -a =dev-build/node-gyp-13.0.2

If this version is masked, you can unmask it using the autounmask tool or standard emerge options:

autounmask =dev-build/node-gyp-13.0.2

Or alternatively:

emerge --autounmask-write -a =dev-build/node-gyp-13.0.2

Package Information

Description:
Node.js native addon build tool
Homepage:
https://github.com/nodejs/node-gyp
License:
MIT

Ebuild Details

Version EAPI Keywords Slot
13.0.2 8 ~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x64-macos ~x86 0
View Raw Ebuild
# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DESCRIPTION="Node.js native addon build tool"
HOMEPAGE="https://github.com/nodejs/node-gyp"
SRC_URI="
	https://registry.npmjs.org/node-gyp/-/node-gyp-${PV}.tgz
		-> ${P}.tgz
	https://github.com/0x6d6e647a/mndz-overlay-assets/releases/download/node-gyp-${PV}/node-gyp-${PV}-deps.tar.xz
"
S="${WORKDIR}/package"

src_unpack() {
	default_src_unpack
	cd "${T}" || die "Could not cd to temporary directory"
	unpack ${P}-deps.tar.xz
}

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x64-macos ~x86"
IUSE="test"
RESTRICT="!test? ( test )"

RDEPEND="
	>=net-libs/nodejs-22.22.2[npm]
	dev-lang/python
"
BDEPEND="${RDEPEND}"

src_install() {
	npm \
		--offline \
		--verbose \
		--progress false \
		--foreground-scripts \
		--global \
		--prefix "${ED}/usr" \
		--cache "${T}/npm-cache" \
		install "${DISTDIR}/${P}.tgz" || die "npm install failed"

	local gyp_js
	gyp_js="$(find "${ED}/usr" -type f -path '*/node_modules/node-gyp/bin/node-gyp.js' -print -quit)" || die
	[[ -n ${gyp_js} ]] || die "node-gyp.js not found after npm install"
	local gyp_rel="${gyp_js#"${ED}"}"

	rm -f "${ED}/usr/bin/node-gyp" "${ED}/usr/sbin/node-gyp" || die
	cat > "${T}/node-gyp" <<-EOF || die
	#!/bin/sh
	[ -n "\${npm_config_nodedir}" ] || export npm_config_nodedir=/usr
	[ -n "\${npm_config_python}" ] || export npm_config_python=/usr/bin/python3
	[ -n "\${PYTHON}" ] || export PYTHON=/usr/bin/python3
	exec node ${gyp_rel} "\$@"
	EOF
	newbin "${T}/node-gyp" node-gyp
}

src_test() {
	local prefix="${T}/node-gyp-test-prefix"
	npm \
		--offline \
		--progress false \
		--global \
		--prefix "${prefix}/usr" \
		--cache "${T}/npm-cache" \
		install "${DISTDIR}/${P}.tgz" || die "npm install for tests failed"
	"${prefix}/usr/bin/node-gyp" --version || die "node-gyp --version failed"
}

USE Flags

Manage flags for this package: euse -i <flag> -p dev-build/node-gyp | euse -E <flag> -p dev-build/node-gyp | euse -D <flag> -p dev-build/node-gyp

Global/Standard Flags

Dependencies

RDEPEND

	>=net-libs/nodejs-22.22.2[npm]
	dev-lang/python

BDEPEND

	>=net-libs/nodejs-22.22.2[npm]
	dev-lang/python

Manifest for 13.0.2

Type File Size Source URLs
DIST node-gyp-13.0.2-deps.tar.xz 2220848 bytes https://github.com/0x6d6e647a/mndz-overlay-assets/releases/download/node-gyp-13.0.2/node-gyp-13.0.2-deps.tar.xz
DIST node-gyp-13.0.2.tgz 464110 bytes https://registry.npmjs.org/node-gyp/-/node-gyp-13.0.2.tgz