| 4 |
4 |
EAPI=8
|
| 5 |
5 |
|
| 6 |
6 |
CONFIG_CHECK="~ADVISE_SYSCALLS"
|
| 7 |
|
PYTHON_COMPAT=( python3_{11..12} )
|
|
7 |
PYTHON_COMPAT=( python3_{11..14} )
|
| 8 |
8 |
PYTHON_REQ_USE="threads(+)"
|
| 9 |
9 |
|
| 10 |
10 |
inherit bash-completion-r1 check-reqs flag-o-matic linux-info ninja-utils pax-utils python-any-r1 toolchain-funcs xdg-utils
|
| 11 |
11 |
|
| 12 |
12 |
DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
|
| 13 |
13 |
HOMEPAGE="https://nodejs.org/"
|
| 14 |
|
LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
|
|
14 |
LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT npm? ( Artistic-2 )"
|
| 15 |
15 |
|
| 16 |
16 |
if [[ ${PV} == *9999 ]]; then
|
| 17 |
17 |
inherit git-r3
|
| ... | ... | |
| 20 |
20 |
else
|
| 21 |
21 |
SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz"
|
| 22 |
22 |
SLOT="0/$(ver_cut 1)"
|
| 23 |
|
KEYWORDS="amd64 arm arm64 ~loong ppc64 ~riscv x86 ~amd64-linux ~x64-macos"
|
|
23 |
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86 ~amd64-linux ~x64-macos"
|
| 24 |
24 |
S="${WORKDIR}/node-v${PV}"
|
| 25 |
25 |
fi
|
| 26 |
26 |
|
| 27 |
|
IUSE="corepack cpu_flags_x86_sse2 debug doc +icu inspector lto npm pax-kernel +snapshot +ssl +system-icu +system-ssl test"
|
|
27 |
IUSE="corepack cpu_flags_x86_sse2 debug doc +icu +inspector lto npm pax-kernel +snapshot +ssl +system-icu +system-ssl test"
|
| 28 |
28 |
REQUIRED_USE="inspector? ( icu ssl )
|
| 29 |
29 |
npm? ( ssl )
|
| 30 |
30 |
system-icu? ( icu )
|
| ... | ... | |
| 33 |
33 |
|
| 34 |
34 |
RESTRICT="!test? ( test )"
|
| 35 |
35 |
|
| 36 |
|
RDEPEND=">=app-arch/brotli-1.0.9:=
|
| 37 |
|
>=dev-libs/libuv-1.46.0:=
|
| 38 |
|
>=net-dns/c-ares-1.18.1:=
|
| 39 |
|
>=net-libs/nghttp2-1.41.0:=
|
| 40 |
|
>=net-libs/ngtcp2-1.1.0:=
|
|
36 |
RDEPEND=">=app-arch/brotli-1.1.0:=
|
|
37 |
dev-db/sqlite:3
|
|
38 |
>=dev-libs/libuv-1.51.0:=
|
|
39 |
>=dev-libs/simdjson-3.10.1:=
|
|
40 |
>=net-dns/c-ares-1.34.4:=
|
|
41 |
>=net-libs/nghttp2-1.64.0:=
|
|
42 |
>=net-libs/nghttp3-1.7.0:=
|
| 41 |
43 |
virtual/zlib:=
|
| 42 |
44 |
corepack? ( !sys-apps/yarn )
|
| 43 |
45 |
system-icu? ( >=dev-libs/icu-73:= )
|
| 44 |
|
system-ssl? ( >=dev-libs/openssl-1.1.1:0= )
|
| 45 |
|
sys-devel/gcc:*"
|
|
46 |
system-ssl? (
|
|
47 |
>=net-libs/ngtcp2-1.9.1:=
|
|
48 |
>=dev-libs/openssl-1.1.1:0=
|
|
49 |
)
|
|
50 |
!system-ssl? ( >=net-libs/ngtcp2-1.9.1:=[-gnutls] )
|
|
51 |
|| (
|
|
52 |
sys-devel/gcc:*
|
|
53 |
llvm-runtimes/libatomic-stub
|
|
54 |
)"
|
| 46 |
55 |
BDEPEND="${PYTHON_DEPS}
|
| 47 |
56 |
app-alternatives/ninja
|
| 48 |
57 |
sys-apps/coreutils
|
| ... | ... | |
| 101 |
110 |
fi
|
| 102 |
111 |
|
| 103 |
112 |
# We need to disable mprotect on two files when it builds Bug 694100.
|
| 104 |
|
use pax-kernel && PATCHES+=( "${FILESDIR}"/${PN}-20.6.0-paxmarking.patch )
|
|
113 |
use pax-kernel && PATCHES+=( "${FILESDIR}"/${PN}-24.1.0-paxmarking.patch )
|
| 105 |
114 |
|
| 106 |
115 |
default
|
| 107 |
116 |
}
|
| ... | ... | |
| 111 |
120 |
|
| 112 |
121 |
# LTO compiler flags are handled by configure.py itself
|
| 113 |
122 |
filter-lto
|
| 114 |
|
# nodejs unconditionally links to libatomic #869992
|
| 115 |
|
# specifically it requires __atomic_is_lock_free which
|
| 116 |
|
# is not yet implemented by llvm-runtimes/compiler-rt (see
|
| 117 |
|
# https://reviews.llvm.org/D85044?id=287068), therefore
|
| 118 |
|
# we depend on gcc and force using libgcc as the support lib
|
| 119 |
|
tc-is-clang && append-ldflags "--rtlib=libgcc --unwindlib=libgcc"
|
|
123 |
# The warnings are *so* noisy and make build.logs massive
|
|
124 |
append-cxxflags $(test-flags-CXX -Wno-template-id-cdtor)
|
|
125 |
# https://bugs.gentoo.org/931514
|
|
126 |
use arm64 && append-flags $(test-flags-CXX -mbranch-protection=none)
|
| 120 |
127 |
|
| 121 |
128 |
local myconf=(
|
| 122 |
129 |
--ninja
|
|
130 |
# ada is not packaged yet
|
|
131 |
# https://github.com/ada-url/ada
|
|
132 |
# --shared-ada
|
| 123 |
133 |
--shared-brotli
|
| 124 |
134 |
--shared-cares
|
| 125 |
135 |
--shared-libuv
|
| 126 |
136 |
--shared-nghttp2
|
|
137 |
--shared-nghttp3
|
| 127 |
138 |
--shared-ngtcp2
|
|
139 |
--shared-simdjson
|
|
140 |
# sindutf is not packaged yet
|
|
141 |
# https://github.com/simdutf/simdutf
|
|
142 |
# --shared-simdutf
|
|
143 |
--shared-sqlite
|
| 128 |
144 |
--shared-zlib
|
| 129 |
145 |
)
|
| 130 |
146 |
use debug && myconf+=( --debug )
|
| ... | ... | |
| 205 |
221 |
|
| 206 |
222 |
# Clean up
|
| 207 |
223 |
rm -f "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile}
|
| 208 |
|
rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man}
|
| 209 |
224 |
|
| 210 |
225 |
local find_exp="-or -name"
|
| 211 |
226 |
local find_name=()
|
| 212 |
227 |
for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
|
| 213 |
228 |
".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
|
| 214 |
|
"*.md" "*.markdown" "*.bat" "*.cmd"; do
|
|
229 |
"*.bat" "*.cmd"; do
|
| 215 |
230 |
find_name+=( ${find_exp} "${match}" )
|
| 216 |
231 |
done
|
| 217 |
232 |
|
| ... | ... | |
| 235 |
250 |
test/parallel/test-dns.js
|
| 236 |
251 |
test/parallel/test-dns-resolveany-bad-ancount.js
|
| 237 |
252 |
test/parallel/test-dns-setserver-when-querying.js
|
|
253 |
test/parallel/test-dotenv.js
|
| 238 |
254 |
test/parallel/test-fs-mkdir.js
|
| 239 |
255 |
test/parallel/test-fs-read-stream.js
|
| 240 |
256 |
test/parallel/test-fs-utimes-y2K38.js
|
| 241 |
257 |
test/parallel/test-fs-watch-recursive-add-file.js
|
| 242 |
|
test/parallel/test-inspector-emit-protocol-event.js
|
| 243 |
|
test/parallel/test-inspector-network-domain.js
|
|
258 |
test/parallel/test-http2-client-set-priority.js
|
|
259 |
test/parallel/test-http2-priority-event.js
|
| 244 |
260 |
test/parallel/test-process-euid-egid.js
|
| 245 |
261 |
test/parallel/test-process-get-builtin.mjs
|
| 246 |
262 |
test/parallel/test-process-initgroups.js
|
| ... | ... | |
| 249 |
265 |
test/parallel/test-release-npm.js
|
| 250 |
266 |
test/parallel/test-socket-write-after-fin-error.js
|
| 251 |
267 |
test/parallel/test-strace-openat-openssl.js
|
| 252 |
|
test/parallel/test-tls-cert-regression.js
|
| 253 |
|
test/parallel/test-tls-client-getephemeralkeyinfo.js
|
| 254 |
|
test/parallel/test-tls-getcipher.js
|
| 255 |
|
test/parallel/test-tls-set-ciphers.js
|
| 256 |
|
test/parallel/test-tls-junk-closes-server.js
|
| 257 |
|
test/parallel/test-util-styletext.js
|
|
268 |
test/sequential/test-tls-session-timeout.js
|
| 258 |
269 |
test/sequential/test-util-debug.js
|
| 259 |
270 |
)
|
| 260 |
|
use inspector || drop_tests+=( test/sequential/test-watch-mode.mjs )
|
|
271 |
use inspector ||
|
|
272 |
drop_tests+=(
|
|
273 |
test/parallel/test-inspector-emit-protocol-event.js
|
|
274 |
test/parallel/test-inspector-network-arbitrary-data.js
|
|
275 |
test/parallel/test-inspector-network-domain.js
|
|
276 |
test/parallel/test-inspector-network-fetch.js
|
|
277 |
test/parallel/test-inspector-network-http.js
|
|
278 |
test/sequential/test-watch-mode.mjs
|
|
279 |
)
|
| 261 |
280 |
rm -f "${drop_tests[@]}" || die "disabling tests failed"
|
| 262 |
281 |
|
| 263 |
282 |
out/${BUILDTYPE}/cctest || die
|
| ... | ... | |
| 267 |
286 |
pkg_postinst() {
|
| 268 |
287 |
if use npm; then
|
| 269 |
288 |
ewarn "remember to run: source /etc/profile if you plan to use nodejs"
|
| 270 |
|
ewarn " in your current shell"
|
|
289 |
ewarn " in your current shell"
|
| 271 |
290 |
fi
|
| 272 |
291 |
}
|