Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 843926
Collapse All | Expand All

(-)a/net-libs/nodejs/nodejs-14.19.0-r1.ebuild (+227 lines)
Line 0 Link Here
1
# Copyright 1999-2022 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
3
4
EAPI=7
5
6
PYTHON_COMPAT=( python3_{8..10} )
7
PYTHON_REQ_USE="threads(+)"
8
9
inherit bash-completion-r1 flag-o-matic pax-utils python-any-r1 toolchain-funcs xdg-utils
10
11
DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
12
HOMEPAGE="https://nodejs.org/"
13
LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
14
15
if [[ ${PV} == *9999 ]]; then
16
	inherit git-r3
17
	EGIT_REPO_URI="https://github.com/nodejs/node"
18
	SLOT="0"
19
else
20
	SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz"
21
	SLOT="0/$(ver_cut 1)"
22
	KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 -riscv ~x86 ~amd64-linux ~x64-macos"
23
	S="${WORKDIR}/node-v${PV}"
24
fi
25
26
IUSE="cpu_flags_x86_sse2 debug doc +icu inspector lto +npm pax-kernel +snapshot +ssl +system-icu +system-ssl systemtap test"
27
REQUIRED_USE="inspector? ( icu ssl )
28
	npm? ( ssl )
29
	system-icu? ( icu )
30
	system-ssl? ( ssl )"
31
32
RESTRICT="!test? ( test )"
33
34
RDEPEND=">=app-arch/brotli-1.0.9:=
35
	>=dev-libs/libuv-1.40.0:=
36
	>=net-dns/c-ares-1.17.2:=
37
	>=net-libs/nghttp2-1.41.0:=
38
	sys-libs/zlib
39
	system-icu? ( >=dev-libs/icu-67:= )
40
	system-ssl? (
41
		>=dev-libs/openssl-1.1.1:0=
42
		<dev-libs/openssl-3.0.0_beta1:0=
43
	)"
44
BDEPEND="${PYTHON_DEPS}
45
	sys-apps/coreutils
46
	virtual/pkgconfig
47
	systemtap? ( dev-util/systemtap )
48
	test? ( net-misc/curl )
49
	pax-kernel? ( sys-apps/elfix )"
50
DEPEND="${RDEPEND}"
51
52
PATCHES=(
53
	"${FILESDIR}"/${PN}-12.22.5-shared_c-ares_nameser_h.patch
54
	"${FILESDIR}"/${PN}-14.15.0-fix_ppc64_crashes.patch
55
	"${FILESDIR}"/${P}-global-npm-config.patch
56
)
57
58
pkg_pretend() {
59
	(use x86 && ! use cpu_flags_x86_sse2) && \
60
		die "Your CPU doesn't support the required SSE2 instruction."
61
}
62
63
src_prepare() {
64
	tc-export AR CC CXX PKG_CONFIG
65
	export V=1
66
	export BUILDTYPE=Release
67
68
	# fix compilation on Darwin
69
	# https://code.google.com/p/gyp/issues/detail?id=260
70
	sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
71
72
	# less verbose install output (stating the same as portage, basically)
73
	sed -i -e "/print/d" tools/install.py || die
74
75
	# proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
76
	local LIBDIR=$(get_libdir)
77
	sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
78
	sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die
79
80
	# Avoid writing a depfile, not useful
81
	sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die
82
83
	sed -i -e "/'-O3'/d" common.gypi node.gypi || die
84
85
	# debug builds. change install path, remove optimisations and override buildtype
86
	if use debug; then
87
		sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
88
		BUILDTYPE=Debug
89
	fi
90
91
	# We need to disable mprotect on two files when it builds Bug 694100.
92
	use pax-kernel && PATCHES+=( "${FILESDIR}"/${PN}-13.8.0-paxmarking.patch )
93
94
	# All this test does is check if the npm CLI produces warnings of any sort,
95
	# failing if it does. Overkill, much? Especially given one possible warning
96
	# is that there is a newer version of npm available upstream (yes, it does
97
	# use the network if available), thus making it a real possibility for this
98
	# test to begin failing one day even though it was fine before.
99
	rm -f test/parallel/test-release-npm.js
100
101
	default
102
}
103
104
src_configure() {
105
	xdg_environment_reset
106
107
	# LTO compiler flags are handled by configure.py itself
108
	filter-flags '-flto*'
109
110
	local myconf=(
111
		--shared-brotli
112
		--shared-cares
113
		--shared-libuv
114
		--shared-nghttp2
115
		--shared-zlib
116
	)
117
	use debug && myconf+=( --debug )
118
	use lto && myconf+=( --enable-lto )
119
	if use system-icu; then
120
		myconf+=( --with-intl=system-icu )
121
	elif use icu; then
122
		myconf+=( --with-intl=full-icu )
123
	else
124
		myconf+=( --with-intl=none )
125
	fi
126
	use inspector || myconf+=( --without-inspector )
127
	use npm || myconf+=( --without-npm )
128
	use snapshot || myconf+=( --without-node-snapshot )
129
	if use ssl; then
130
		use system-ssl && myconf+=( --shared-openssl --openssl-use-def-ca-store )
131
	else
132
		myconf+=( --without-ssl )
133
	fi
134
135
	local myarch=""
136
	case ${ABI} in
137
		amd64) myarch="x64";;
138
		arm) myarch="arm";;
139
		arm64) myarch="arm64";;
140
		ppc64) myarch="ppc64";;
141
		x32) myarch="x32";;
142
		x86) myarch="ia32";;
143
		*) myarch="${ABI}";;
144
	esac
145
146
	GYP_DEFINES="linux_use_gold_flags=0
147
		linux_use_bundled_binutils=0
148
		linux_use_bundled_gold=0" \
149
	"${EPYTHON}" configure.py \
150
		--prefix="${EPREFIX}"/usr \
151
		--dest-cpu=${myarch} \
152
		$(use_with systemtap dtrace) \
153
		"${myconf[@]}" || die
154
}
155
156
src_compile() {
157
	emake -C out
158
}
159
160
src_install() {
161
	local LIBDIR="${ED}/usr/$(get_libdir)"
162
	default
163
164
	pax-mark -m "${ED}"/usr/bin/node
165
166
	# set up a symlink structure that node-gyp expects..
167
	dodir /usr/include/node/deps/{v8,uv}
168
	dosym . /usr/include/node/src
169
	for var in deps/{uv,v8}/include; do
170
		dosym ../.. /usr/include/node/${var}
171
	done
172
173
	if use doc; then
174
		docinto html
175
		dodoc -r "${S}"/doc/*
176
	fi
177
178
	if use npm; then
179
		dodir /etc/npm
180
181
		# Install bash completion for `npm`
182
		# We need to temporarily replace default config path since
183
		# npm otherwise tries to write outside of the sandbox
184
		local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js"
185
		sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die
186
		local tmp_npm_completion_file="$(TMPDIR="${T}" mktemp -t npm.XXXXXXXXXX)"
187
		"${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
188
		newbashcomp "${tmp_npm_completion_file}" npm
189
		sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die
190
191
		# Move man pages
192
		doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
193
194
		# Clean up
195
		rm -f "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile}
196
		rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man}
197
198
		local find_exp="-or -name"
199
		local find_name=()
200
		for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
201
			".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
202
			"*.md" "*.markdown" "*.bat" "*.cmd"; do
203
			find_name+=( ${find_exp} "${match}" )
204
		done
205
206
		# Remove various development and/or inappropriate files and
207
		# useless docs of dependend packages.
208
		find "${LIBDIR}"/node_modules \
209
			\( -type d -name examples \) -or \( -type f \( \
210
				-iname "LICEN?E*" \
211
				"${find_name[@]}" \
212
			\) \) -exec rm -rf "{}" \;
213
	fi
214
215
	mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die
216
}
217
218
src_test() {
219
	if has usersandbox ${FEATURES}; then
220
		rm -f "${S}"/test/parallel/test-fs-mkdir.js
221
		ewarn "You are emerging ${PN} with 'usersandbox' enabled. Excluding tests known to fail in this mode." \
222
			"For full test coverage, emerge =${CATEGORY}/${PF} with 'FEATURES=-usersandbox'."
223
	fi
224
225
	out/${BUILDTYPE}/cctest || die
226
	"${EPYTHON}" tools/test.py --mode=${BUILDTYPE,,} --flaky-tests=dontcare -J message parallel sequential || die
227
}
(-)a/net-libs/nodejs/nodejs-16.14.2-r1.ebuild (+219 lines)
Line 0 Link Here
1
# Copyright 1999-2022 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
3
4
EAPI=8
5
6
PYTHON_COMPAT=( python3_{8..10} )
7
PYTHON_REQ_USE="threads(+)"
8
9
inherit bash-completion-r1 flag-o-matic pax-utils python-any-r1 toolchain-funcs xdg-utils
10
11
DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
12
HOMEPAGE="https://nodejs.org/"
13
LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
14
15
if [[ ${PV} == *9999 ]]; then
16
	inherit git-r3
17
	EGIT_REPO_URI="https://github.com/nodejs/node"
18
	SLOT="0"
19
else
20
	SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz"
21
	SLOT="0/$(ver_cut 1)"
22
	KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86 ~amd64-linux ~x64-macos"
23
	S="${WORKDIR}/node-v${PV}"
24
fi
25
26
IUSE="cpu_flags_x86_sse2 debug doc +icu inspector lto +npm pax-kernel +snapshot +ssl +system-icu +system-ssl systemtap test"
27
REQUIRED_USE="inspector? ( icu ssl )
28
	npm? ( ssl )
29
	system-icu? ( icu )
30
	system-ssl? ( ssl )"
31
32
RESTRICT="!test? ( test )"
33
34
RDEPEND=">=app-arch/brotli-1.0.9:=
35
	>=dev-libs/libuv-1.40.0:=
36
	>=net-dns/c-ares-1.17.2:=
37
	>=net-libs/nghttp2-1.41.0:=
38
	sys-libs/zlib
39
	system-icu? ( >=dev-libs/icu-67:= )
40
	system-ssl? ( >=dev-libs/openssl-1.1.1:0= )"
41
BDEPEND="${PYTHON_DEPS}
42
	sys-apps/coreutils
43
	virtual/pkgconfig
44
	systemtap? ( dev-util/systemtap )
45
	test? ( net-misc/curl )
46
	pax-kernel? ( sys-apps/elfix )"
47
DEPEND="${RDEPEND}"
48
49
PATCHES=(
50
	"${FILESDIR}"/${PN}-12.22.5-shared_c-ares_nameser_h.patch
51
	"${FILESDIR}"/${PN}-15.2.0-global-npm-config.patch
52
)
53
54
pkg_pretend() {
55
	(use x86 && ! use cpu_flags_x86_sse2) && \
56
		die "Your CPU doesn't support the required SSE2 instruction."
57
}
58
59
src_prepare() {
60
	tc-export AR CC CXX PKG_CONFIG
61
	export V=1
62
	export BUILDTYPE=Release
63
64
	# fix compilation on Darwin
65
	# https://code.google.com/p/gyp/issues/detail?id=260
66
	sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
67
68
	# less verbose install output (stating the same as portage, basically)
69
	sed -i -e "/print/d" tools/install.py || die
70
71
	# proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
72
	local LIBDIR=$(get_libdir)
73
	sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
74
	sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die
75
76
	# Avoid writing a depfile, not useful
77
	sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die
78
79
	sed -i -e "/'-O3'/d" common.gypi node.gypi || die
80
81
	# debug builds. change install path, remove optimisations and override buildtype
82
	if use debug; then
83
		sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
84
		BUILDTYPE=Debug
85
	fi
86
87
	# We need to disable mprotect on two files when it builds Bug 694100.
88
	use pax-kernel && PATCHES+=( "${FILESDIR}"/${PN}-16.4.2-paxmarking.patch )
89
90
	# All this test does is check if the npm CLI produces warnings of any sort,
91
	# failing if it does. Overkill, much? Especially given one possible warning
92
	# is that there is a newer version of npm available upstream (yes, it does
93
	# use the network if available), thus making it a real possibility for this
94
	# test to begin failing one day even though it was fine before.
95
	rm -f test/parallel/test-release-npm.js
96
97
	default
98
}
99
100
src_configure() {
101
	xdg_environment_reset
102
103
	# LTO compiler flags are handled by configure.py itself
104
	filter-flags '-flto*'
105
106
	local myconf=(
107
		--shared-brotli
108
		--shared-cares
109
		--shared-libuv
110
		--shared-nghttp2
111
		--shared-zlib
112
	)
113
	use debug && myconf+=( --debug )
114
	use lto && myconf+=( --enable-lto )
115
	if use system-icu; then
116
		myconf+=( --with-intl=system-icu )
117
	elif use icu; then
118
		myconf+=( --with-intl=full-icu )
119
	else
120
		myconf+=( --with-intl=none )
121
	fi
122
	use inspector || myconf+=( --without-inspector )
123
	use npm || myconf+=( --without-npm )
124
	use snapshot || myconf+=( --without-node-snapshot )
125
	if use ssl; then
126
		use system-ssl && myconf+=( --shared-openssl --openssl-use-def-ca-store )
127
	else
128
		myconf+=( --without-ssl )
129
	fi
130
131
	local myarch=""
132
	case ${ABI} in
133
		amd64) myarch="x64";;
134
		arm) myarch="arm";;
135
		arm64) myarch="arm64";;
136
		lp64*) myarch="riscv64";;
137
		ppc64) myarch="ppc64";;
138
		x32) myarch="x32";;
139
		x86) myarch="ia32";;
140
		*) myarch="${ABI}";;
141
	esac
142
143
	GYP_DEFINES="linux_use_gold_flags=0
144
		linux_use_bundled_binutils=0
145
		linux_use_bundled_gold=0" \
146
	"${EPYTHON}" configure.py \
147
		--prefix="${EPREFIX}"/usr \
148
		--dest-cpu=${myarch} \
149
		$(use_with systemtap dtrace) \
150
		"${myconf[@]}" || die
151
}
152
153
src_compile() {
154
	emake -C out
155
}
156
157
src_install() {
158
	local LIBDIR="${ED}/usr/$(get_libdir)"
159
	default
160
161
	pax-mark -m "${ED}"/usr/bin/node
162
163
	# set up a symlink structure that node-gyp expects..
164
	dodir /usr/include/node/deps/{v8,uv}
165
	dosym . /usr/include/node/src
166
	for var in deps/{uv,v8}/include; do
167
		dosym ../.. /usr/include/node/${var}
168
	done
169
170
	if use doc; then
171
		docinto html
172
		dodoc -r "${S}"/doc/*
173
	fi
174
175
	if use npm; then
176
		keepdir /etc/npm
177
178
		# Install bash completion for `npm`
179
		local tmp_npm_completion_file="$(TMPDIR="${T}" mktemp -t npm.XXXXXXXXXX)"
180
		"${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
181
		newbashcomp "${tmp_npm_completion_file}" npm
182
183
		# Move man pages
184
		doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
185
186
		# Clean up
187
		rm -f "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile}
188
		rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man}
189
190
		local find_exp="-or -name"
191
		local find_name=()
192
		for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
193
			".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
194
			"*.md" "*.markdown" "*.bat" "*.cmd"; do
195
			find_name+=( ${find_exp} "${match}" )
196
		done
197
198
		# Remove various development and/or inappropriate files and
199
		# useless docs of dependend packages.
200
		find "${LIBDIR}"/node_modules \
201
			\( -type d -name examples \) -or \( -type f \( \
202
				-iname "LICEN?E*" \
203
				"${find_name[@]}" \
204
			\) \) -exec rm -rf "{}" \;
205
	fi
206
207
	mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die
208
}
209
210
src_test() {
211
	if has usersandbox ${FEATURES}; then
212
		rm -f "${S}"/test/parallel/test-fs-mkdir.js
213
		ewarn "You are emerging ${PN} with 'usersandbox' enabled. Excluding tests known to fail in this mode." \
214
			"For full test coverage, emerge =${CATEGORY}/${PF} with 'FEATURES=-usersandbox'."
215
	fi
216
217
	out/${BUILDTYPE}/cctest || die
218
	"${EPYTHON}" tools/test.py --mode=${BUILDTYPE,,} --flaky-tests=dontcare -J message parallel sequential || die
219
}
(-)a/net-libs/nodejs/nodejs-18.1.0-r1.ebuild (+219 lines)
Line 0 Link Here
1
# Copyright 1999-2022 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
3
4
EAPI=8
5
6
PYTHON_COMPAT=( python3_{8..10} )
7
PYTHON_REQ_USE="threads(+)"
8
9
inherit bash-completion-r1 flag-o-matic pax-utils python-any-r1 toolchain-funcs xdg-utils
10
11
DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
12
HOMEPAGE="https://nodejs.org/"
13
LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
14
15
if [[ ${PV} == *9999 ]]; then
16
	inherit git-r3
17
	EGIT_REPO_URI="https://github.com/nodejs/node"
18
	SLOT="0"
19
else
20
	SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz"
21
	SLOT="0/$(ver_cut 1)"
22
	KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86 ~amd64-linux ~x64-macos"
23
	S="${WORKDIR}/node-v${PV}"
24
fi
25
26
IUSE="cpu_flags_x86_sse2 debug doc +icu inspector lto +npm pax-kernel +snapshot +ssl +system-icu +system-ssl systemtap test"
27
REQUIRED_USE="inspector? ( icu ssl )
28
	npm? ( ssl )
29
	system-icu? ( icu )
30
	system-ssl? ( ssl )"
31
32
RESTRICT="!test? ( test )"
33
34
RDEPEND=">=app-arch/brotli-1.0.9:=
35
	>=dev-libs/libuv-1.40.0:=
36
	>=net-dns/c-ares-1.17.2:=
37
	>=net-libs/nghttp2-1.41.0:=
38
	sys-libs/zlib
39
	system-icu? ( >=dev-libs/icu-67:= )
40
	system-ssl? ( >=dev-libs/openssl-1.1.1:0= )"
41
BDEPEND="${PYTHON_DEPS}
42
	sys-apps/coreutils
43
	virtual/pkgconfig
44
	systemtap? ( dev-util/systemtap )
45
	test? ( net-misc/curl )
46
	pax-kernel? ( sys-apps/elfix )"
47
DEPEND="${RDEPEND}"
48
49
PATCHES=(
50
	"${FILESDIR}"/${PN}-12.22.5-shared_c-ares_nameser_h.patch
51
	"${FILESDIR}"/${PN}-15.2.0-global-npm-config.patch
52
)
53
54
pkg_pretend() {
55
	(use x86 && ! use cpu_flags_x86_sse2) && \
56
		die "Your CPU doesn't support the required SSE2 instruction."
57
}
58
59
src_prepare() {
60
	tc-export AR CC CXX PKG_CONFIG
61
	export V=1
62
	export BUILDTYPE=Release
63
64
	# fix compilation on Darwin
65
	# https://code.google.com/p/gyp/issues/detail?id=260
66
	sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
67
68
	# less verbose install output (stating the same as portage, basically)
69
	sed -i -e "/print/d" tools/install.py || die
70
71
	# proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
72
	local LIBDIR=$(get_libdir)
73
	sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
74
	sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die
75
76
	# Avoid writing a depfile, not useful
77
	sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die
78
79
	sed -i -e "/'-O3'/d" common.gypi node.gypi || die
80
81
	# debug builds. change install path, remove optimisations and override buildtype
82
	if use debug; then
83
		sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
84
		BUILDTYPE=Debug
85
	fi
86
87
	# We need to disable mprotect on two files when it builds Bug 694100.
88
	use pax-kernel && PATCHES+=( "${FILESDIR}"/${PN}-18.0.0-paxmarking.patch )
89
90
	# All this test does is check if the npm CLI produces warnings of any sort,
91
	# failing if it does. Overkill, much? Especially given one possible warning
92
	# is that there is a newer version of npm available upstream (yes, it does
93
	# use the network if available), thus making it a real possibility for this
94
	# test to begin failing one day even though it was fine before.
95
	rm -f test/parallel/test-release-npm.js
96
97
	default
98
}
99
100
src_configure() {
101
	xdg_environment_reset
102
103
	# LTO compiler flags are handled by configure.py itself
104
	filter-flags '-flto*'
105
106
	local myconf=(
107
		--shared-brotli
108
		--shared-cares
109
		--shared-libuv
110
		--shared-nghttp2
111
		--shared-zlib
112
	)
113
	use debug && myconf+=( --debug )
114
	use lto && myconf+=( --enable-lto )
115
	if use system-icu; then
116
		myconf+=( --with-intl=system-icu )
117
	elif use icu; then
118
		myconf+=( --with-intl=full-icu )
119
	else
120
		myconf+=( --with-intl=none )
121
	fi
122
	use inspector || myconf+=( --without-inspector )
123
	use npm || myconf+=( --without-npm )
124
	use snapshot || myconf+=( --without-node-snapshot )
125
	if use ssl; then
126
		use system-ssl && myconf+=( --shared-openssl --openssl-use-def-ca-store )
127
	else
128
		myconf+=( --without-ssl )
129
	fi
130
131
	local myarch=""
132
	case ${ABI} in
133
		amd64) myarch="x64";;
134
		arm) myarch="arm";;
135
		arm64) myarch="arm64";;
136
		lp64*) myarch="riscv64";;
137
		ppc64) myarch="ppc64";;
138
		x32) myarch="x32";;
139
		x86) myarch="ia32";;
140
		*) myarch="${ABI}";;
141
	esac
142
143
	GYP_DEFINES="linux_use_gold_flags=0
144
		linux_use_bundled_binutils=0
145
		linux_use_bundled_gold=0" \
146
	"${EPYTHON}" configure.py \
147
		--prefix="${EPREFIX}"/usr \
148
		--dest-cpu=${myarch} \
149
		$(use_with systemtap dtrace) \
150
		"${myconf[@]}" || die
151
}
152
153
src_compile() {
154
	emake -C out
155
}
156
157
src_install() {
158
	local LIBDIR="${ED}/usr/$(get_libdir)"
159
	default
160
161
	pax-mark -m "${ED}"/usr/bin/node
162
163
	# set up a symlink structure that node-gyp expects..
164
	dodir /usr/include/node/deps/{v8,uv}
165
	dosym . /usr/include/node/src
166
	for var in deps/{uv,v8}/include; do
167
		dosym ../.. /usr/include/node/${var}
168
	done
169
170
	if use doc; then
171
		docinto html
172
		dodoc -r "${S}"/doc/*
173
	fi
174
175
	if use npm; then
176
		keepdir /etc/npm
177
178
		# Install bash completion for `npm`
179
		local tmp_npm_completion_file="$(TMPDIR="${T}" mktemp -t npm.XXXXXXXXXX)"
180
		"${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
181
		newbashcomp "${tmp_npm_completion_file}" npm
182
183
		# Move man pages
184
		doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
185
186
		# Clean up
187
		rm -f "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile}
188
		rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man}
189
190
		local find_exp="-or -name"
191
		local find_name=()
192
		for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
193
			".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
194
			"*.md" "*.markdown" "*.bat" "*.cmd"; do
195
			find_name+=( ${find_exp} "${match}" )
196
		done
197
198
		# Remove various development and/or inappropriate files and
199
		# useless docs of dependend packages.
200
		find "${LIBDIR}"/node_modules \
201
			\( -type d -name examples \) -or \( -type f \( \
202
				-iname "LICEN?E*" \
203
				"${find_name[@]}" \
204
			\) \) -exec rm -rf "{}" \;
205
	fi
206
207
	mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die
208
}
209
210
src_test() {
211
	if has usersandbox ${FEATURES}; then
212
		rm -f "${S}"/test/parallel/test-fs-mkdir.js
213
		ewarn "You are emerging ${PN} with 'usersandbox' enabled. Excluding tests known to fail in this mode." \
214
			"For full test coverage, emerge =${CATEGORY}/${PF} with 'FEATURES=-usersandbox'."
215
	fi
216
217
	out/${BUILDTYPE}/cctest || die
218
	"${EPYTHON}" tools/test.py --mode=${BUILDTYPE,,} --flaky-tests=dontcare -J message parallel sequential || die
219
}
(-)a/net-libs/nodejs/nodejs-99999999.ebuild (-12 / +1 lines)
Lines 1-4 Link Here
1
# Copyright 1999-2021 Gentoo Authors
1
# Copyright 1999-2022 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
3
4
EAPI=7
4
EAPI=7
Lines 53-69 PATCHES=( Link Here
53
pkg_pretend() {
53
pkg_pretend() {
54
	(use x86 && ! use cpu_flags_x86_sse2) && \
54
	(use x86 && ! use cpu_flags_x86_sse2) && \
55
		die "Your CPU doesn't support the required SSE2 instruction."
55
		die "Your CPU doesn't support the required SSE2 instruction."
56
57
	if [[ ${MERGE_TYPE} != "binary" ]]; then
58
		if use lto; then
59
			if tc-is-gcc; then
60
				if [[ $(gcc-major-version) -ge 11 ]]; then
61
					# Bug #787158
62
					die "LTO builds of ${PN} using gcc-11+ currently fail tests and produce runtime errors. Either switch to gcc-10 or unset USE=lto for this ebuild"
63
				fi
64
			fi
65
		fi
66
	fi
67
}
56
}
68
57
69
src_prepare() {
58
src_prepare() {

Return to bug 843926