diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-07-10 12:25:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-07-10 12:25:06 +0100 |
commit | e810ac4a0e6af9f763f4433863042b34609075a7 (patch) | |
tree | 6fe0b3ff24f3b875be1564e273049c1e301d205b /net-libs | |
parent | c218398bbbe70a616790cf146c28c1066b9284bf (diff) |
gentoo auto-resync : 10:07:2024 - 12:25:06
Diffstat (limited to 'net-libs')
-rw-r--r-- | net-libs/Manifest.gz | bin | 30988 -> 30992 bytes | |||
-rw-r--r-- | net-libs/grpc/Manifest | 5 | ||||
-rw-r--r-- | net-libs/grpc/files/grpc-1.65.0-system-gtest.patch | 86 | ||||
-rw-r--r-- | net-libs/grpc/grpc-1.62.1.ebuild | 16 | ||||
-rw-r--r-- | net-libs/grpc/grpc-1.65.0.ebuild | 209 | ||||
-rw-r--r-- | net-libs/nodejs/Manifest | 6 | ||||
-rw-r--r-- | net-libs/nodejs/nodejs-18.20.4.ebuild | 256 | ||||
-rw-r--r-- | net-libs/nodejs/nodejs-20.15.1.ebuild | 261 | ||||
-rw-r--r-- | net-libs/nodejs/nodejs-22.4.1.ebuild | 276 |
9 files changed, 1105 insertions, 10 deletions
diff --git a/net-libs/Manifest.gz b/net-libs/Manifest.gz Binary files differindex 3712531ae1b4..672f9be4313c 100644 --- a/net-libs/Manifest.gz +++ b/net-libs/Manifest.gz diff --git a/net-libs/grpc/Manifest b/net-libs/grpc/Manifest index b8e78bb80472..15d66700a1e8 100644 --- a/net-libs/grpc/Manifest +++ b/net-libs/grpc/Manifest @@ -1,15 +1,18 @@ AUX grpc-1.57.0-fix-cmake.patch 1098 BLAKE2B f288979afb891ead497a40b05357166d15bc8577da093a44b33c4d973fcef9116c2aad8a1933eb38b154e162e9bde87d536e55bfc8b9381c285ae73d1ef55c8d SHA512 a83baf405c191056a01ad4d84f1c3d51aeec3e932776ba8444f9f2f4853401751b8b1087d2675ec4f7d1155a4b6a1d05584510a8e6f3ee268eef534516ddd602 AUX grpc-1.62.1-system-gtest.patch 2608 BLAKE2B 1052d71fe8d6e7fc31f5c3dab35426129d3c1b0c5ef3ac1061dc471eab420487c6df5e862640bade4238e0f01a520a5049b5912cb8638cc650bfcfebbe1f92bb SHA512 079d8ae837654a5229ff823689cc69b67a6bc32e05e564b2a5ee19a259ca7af6806f625806c79f6afa5b30f00e4251a042372b56f00df212aa0e925389a24a44 +AUX grpc-1.65.0-system-gtest.patch 2604 BLAKE2B 5d14fc1a22c71e09a6b66fcca6401bacfc9a30717b2f5159d3b812e75979ab959a30a7747a6f6a67f2599ed0ac2824980ca26275fd57f3bd7b2a9ab34e6612ad SHA512 9686fc7de316de5582226829b8430f60323fc2dc0d94df9706c885cb43fbba8be90866e0242d1b54aeafd6770b648d4bf5c009ad52279f12f85aefd3ab9185c4 DIST grpc-1.52.1.tar.gz 8686340 BLAKE2B 0076ddd4a2840892f4ad11885e18f782b6a645337224974522c5f828d0226d6a1e19aaaf0f30ea3225d56118e0cfc251d45b8d5e6811c2d1a84e274ff037bb53 SHA512 06c69fb817af75b2610761a3a193178b749755eb7bed58875aa251def7c0c253cdaf02cf834c31c8b2cae7b01a6081e2aece4b131a162f64bd45ff0aff4d7758 DIST grpc-1.55.1.tar.gz 9272441 BLAKE2B b2788d8deeb9791f04073294caa82c10e2cfe6376d09f396b51508a52f809e7f9f48d50ad5a62b2add652633b5c2d3b1ba07857b81111fa810202106251f440d SHA512 ecfa3a5affe33f160032f2ce42a9b44344d217359f68ee99305162ccabc911f44bc22512401183de74347e86add2ce20ec89da87ba6c14ab69874eb0835145d1 DIST grpc-1.56.1.tar.gz 11750628 BLAKE2B 52ea088d3d19fa7c1d1dc44899cd67bfd0132df2fd37690d855194d3196e4c26cfdd6fe589b5e4f802cdf88e70aad6c33b3ee98c1bd1bc47356d0dee9cdc706d SHA512 2bf9619edb60a6cec4cdaa89ee3c470c52b9745ea954bfe205aef6eb29bb55949de02e8c2afc7352eacdcd33fe4000861fd16fda9e5f66c87222674b17d6322a DIST grpc-1.57.0.tar.gz 17337863 BLAKE2B 10c6fb35f606806aeb25cd55dd993d9af168eb8b1db64b4515830e2144dc44f35ce8f8329316a38d933b8032a0eff386591a0ddb87f2e405c5deaba012db2824 SHA512 b323de7c1f35b9de3fb7bf02ff4db6993abb0eee6860bbf2082818dda405fbe3a19fad91c5b48565cb65c6318de739bb91e47b5095801c078c6cbf3e8c73600c DIST grpc-1.60.0.tar.gz 17442762 BLAKE2B 35cc0ea938deb848ca91e3d5f8879b85b80f94ac09b582600f05fee1f55c162ae98f2f744480f69d78e78da0c0f2d9e198f812101daaa1f1959869f26ba7d97a SHA512 91c2406ed4198509ac0d5360b3da6898fa4f40f459eb6fff541faa44cc238eed98fd7489e7ef7a80a6f4a318bc5b9130eaa0ba1beaa358d1c074fc82825648ff DIST grpc-1.62.1.tar.gz 22384671 BLAKE2B 134e40732e784e52d518cde6e518e4c08e2f67a025754d88b92a9a314f86e53bee33ee793395b9e225c0895c6ac8b9c036892c82c19d0fddf69909a22eac4b78 SHA512 3224ad2617c18156f90c54c1ebf1f2015e405a6f12546e8709e0c905f52508c9f1a13b4d5a6cc7a35abf58b429985b5b504c9062f50c0d3d6aa163180a61047a +DIST grpc-1.65.0.tar.gz 22537894 BLAKE2B 08b53b515b6e80c19aae6b9d3af969f79cc0f25413bc60106276030cd45df677bc67a94327da1439a2c469d49ed71043cf852f38e7fa5a36c2cb875a71bd3aa5 SHA512 18fbce2f77caca6bd21374db2234411ec37d27e5b171b1008aac6810f1a98e3f51826b9dc5e8bd29a746e4f2f31b2a87d6f1bbf988e72e321ca81e7b14f1a4b5 EBUILD grpc-1.52.1.ebuild 2815 BLAKE2B ac0c2cedb3c4cc1f9a2cb6e090172ea7cac5bca2f93f178383367498b51724fc81dfe69752de1f6952c0d7ea32be25793db480efdabeea7b5ff03d1341be7b4c SHA512 f7feb1a7e0b3c4afc55e581425feb3ca584298a43a06d623067ce4d4acd815e780198025b180635851449427b88218c682323e2205aa3ce155b2769a55ad2819 EBUILD grpc-1.55.1.ebuild 2815 BLAKE2B cf51f13634413558b287a47bff342c6fe35a7071e4ee5e2282e65c90b217127066b5abe93f96d74141489988db30defa9a219b19573ede90e5ef34612120f432 SHA512 45ad6402ea36c980fd076fd7d9728d9cea32d1441a1af6a96a1ddde3971ca1e449f3861b9366045bec00524e4b1261acd6dbf1a42351ee5457da162a54eda01d EBUILD grpc-1.56.1.ebuild 2817 BLAKE2B ae411c8ea15067f2c3e8562b5f5b67580d203db2327994d9b7f34606f676308d7a13031920c2639575ad9c13c0802c0f99dbb60f1343c3f48f56c58b8864dbf8 SHA512 c0ccfd6b0af3d81d6966a45a238d02d5f733b7a51a2550dff9d98f592b93d28dc89769b13164f4ab22345bbd2cb80be9dbf429894aeea98bdcd26d4c1f728026 EBUILD grpc-1.57.0-r1.ebuild 2971 BLAKE2B 24cb8f5def17951a7fb02739c5201df84885ae8212010b6745dcb1b51939812954e20ef4b361310e1367bcf7b7d19717073f8d394144fee668deff3dd82e33c4 SHA512 fb936428bdc91a58e0722967026b782782c2b21dd62a144d6550fd2ebb6a4621802a8aefc0e32d823245e6a9301c5445e7d61db68e15b56cc51f7701b6f89ca5 EBUILD grpc-1.60.0.ebuild 2927 BLAKE2B 80ae3abc33b3d734d65e6691ac3cc21ed608fabc1fd69549819dd9e3e8333b04c7e40f41d42ae948f5732d65addf596116d56d72b8032679be95d01e8ec36400 SHA512 b32ec9075252f44fa3200bedae368d40373b64b234657cad93b03fe727a3efe05399079f93f2653ce80a597a68bed01eecfb488ed25fd062bc40e5a866cb5c52 -EBUILD grpc-1.62.1.ebuild 6461 BLAKE2B 373439f0a87eed2ec4fde054ab8c789047062410f5639fdee8e744a9b7d89a071ed0979694017e2b3971ec227ab66fd91a0d228e734f9feed708485b98d0bc80 SHA512 0e3b6ebc2956838a756a6e0be625447070141477851d1f78920cb2829183497ae1a3773f32651514246ef32ea395962ee59da2dfc6ff58739cda1aa8e314db94 +EBUILD grpc-1.62.1.ebuild 6435 BLAKE2B a88a4f4c63a00114a1376dc895f2ba92e79eb8d0d914658513db3ffdf6e1cd7a78029d95458c77b6a855f66834c5777c4398ada623d65f718722e124ab4d960d SHA512 5e90f37e970c1c3cbb2d1bea2c8df5cf0cf627b48dbbcc89781b251bb8663a62b7e1af858fb754366bc21dc65ef32b11ff203e164b975d60eaa8c8df1c131ced +EBUILD grpc-1.65.0.ebuild 6456 BLAKE2B 2e5c865c728defb427c6135bc3adbf332f23dbc5b68b4fb3179a3be04591e0b03e141719a980c6e228ebb0fd5de41239477231b68a8e838b0d874c62410448a7 SHA512 a7d289af0a457dbb9dd32228b253e0f56f36206439fb23b1452ec03f277dbbb32dc488b14b1d1d8f031f5cfc2c0676cc7cfebbfc3d429dfeb9382912b0e2ee38 MISC metadata.xml 452 BLAKE2B 03fbf9312276176e8a4b61851a2b19a2e3b9bd07e64dd0ed8962c9f5bc11182c8ab125dcb8b1fdfbc09c5a5346ec5a23de9b4eb925b423a1db93117ff973a273 SHA512 0285f13b57c1f06a3c561d04ee876d3f161c39e5115858b83858973cb1e233a60b01289fd312c0034b3ec270b6cc42b6a5a97e64f45144b63c9d45b0dee55bb1 diff --git a/net-libs/grpc/files/grpc-1.65.0-system-gtest.patch b/net-libs/grpc/files/grpc-1.65.0-system-gtest.patch new file mode 100644 index 000000000000..47be90892893 --- /dev/null +++ b/net-libs/grpc/files/grpc-1.65.0-system-gtest.patch @@ -0,0 +1,86 @@ +https://bugs.gentoo.org/927403 + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7a55616fb6..ee62502267 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3442,79 +3442,6 @@ if(gRPC_INSTALL) + ) + endif() + +-if(gRPC_BUILD_TESTS) +- +-add_library(gtest +- third_party/googletest/googlemock/src/gmock-cardinalities.cc +- third_party/googletest/googlemock/src/gmock-internal-utils.cc +- third_party/googletest/googlemock/src/gmock-matchers.cc +- third_party/googletest/googlemock/src/gmock-spec-builders.cc +- third_party/googletest/googlemock/src/gmock.cc +- third_party/googletest/googletest/src/gtest-assertion-result.cc +- third_party/googletest/googletest/src/gtest-death-test.cc +- third_party/googletest/googletest/src/gtest-filepath.cc +- third_party/googletest/googletest/src/gtest-matchers.cc +- third_party/googletest/googletest/src/gtest-port.cc +- third_party/googletest/googletest/src/gtest-printers.cc +- third_party/googletest/googletest/src/gtest-test-part.cc +- third_party/googletest/googletest/src/gtest-typed-test.cc +- third_party/googletest/googletest/src/gtest.cc +-) +- +-target_compile_features(gtest PUBLIC cxx_std_14) +- +-set_target_properties(gtest PROPERTIES +- VERSION ${gRPC_CORE_VERSION} +- SOVERSION ${gRPC_CORE_SOVERSION} +-) +- +-if(WIN32 AND MSVC) +- set_target_properties(gtest PROPERTIES COMPILE_PDB_NAME "gtest" +- COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" +- ) +- if(gRPC_INSTALL) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gtest.pdb +- DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL +- ) +- endif() +-endif() +- +-target_include_directories(gtest +- PUBLIC $<INSTALL_INTERFACE:${gRPC_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> +- PRIVATE +- ${CMAKE_CURRENT_SOURCE_DIR} +- ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} +- ${_gRPC_RE2_INCLUDE_DIR} +- ${_gRPC_SSL_INCLUDE_DIR} +- ${_gRPC_UPB_GENERATED_DIR} +- ${_gRPC_UPB_GRPC_GENERATED_DIR} +- ${_gRPC_UPB_INCLUDE_DIR} +- ${_gRPC_XXHASH_INCLUDE_DIR} +- ${_gRPC_ZLIB_INCLUDE_DIR} +- third_party/googletest/googletest/include +- third_party/googletest/googletest +- third_party/googletest/googlemock/include +- third_party/googletest/googlemock +-) +-target_link_libraries(gtest +- ${_gRPC_ALLTARGETS_LIBRARIES} +- ${_gRPC_RE2_LIBRARIES} +- absl::flat_hash_set +- absl::failure_signal_handler +- absl::stacktrace +- absl::symbolize +- absl::flags +- absl::flags_parse +- absl::flags_reflection +- absl::flags_usage +- absl::strings +- absl::any +- absl::optional +- absl::variant +-) +- +- +-endif() + + add_library(upb_base_lib + third_party/upb/upb/base/status.c diff --git a/net-libs/grpc/grpc-1.62.1.ebuild b/net-libs/grpc/grpc-1.62.1.ebuild index f8449433e9f8..868f18efcae3 100644 --- a/net-libs/grpc/grpc-1.62.1.ebuild +++ b/net-libs/grpc/grpc-1.62.1.ebuild @@ -4,7 +4,7 @@ EAPI=8 CMAKE_IN_SOURCE_BUILD=1 -PYTHON_COMPAT=( python3_{10,12} ) +PYTHON_COMPAT=( python3_{10..12} ) inherit cmake flag-o-matic python-any-r1 MY_PV="${PV//_pre/-pre}" @@ -57,14 +57,12 @@ BDEPEND=" PATCHES=( "${FILESDIR}/${PN}-1.62.1-system-gtest.patch" ) python_check_deps() { - python_has_version -b "dev-python/twisted[${PYTHON_USEDEP}]" && - python_has_version -b "dev-python/pyyaml[${PYTHON_USEDEP}]" && - python_has_version -b "dev-python/cffi[${PYTHON_USEDEP}]" && - python_has_version -b "dev-python/six[${PYTHON_USEDEP}]" -} - -pkg_setup() { - use test && python-any-r1_pkg_setup + if use test; then + python_has_version -b "dev-python/twisted[${PYTHON_USEDEP}]" && + python_has_version -b "dev-python/pyyaml[${PYTHON_USEDEP}]" && + python_has_version -b "dev-python/cffi[${PYTHON_USEDEP}]" && + python_has_version -b "dev-python/six[${PYTHON_USEDEP}]" + fi } soversion_check() { diff --git a/net-libs/grpc/grpc-1.65.0.ebuild b/net-libs/grpc/grpc-1.65.0.ebuild new file mode 100644 index 000000000000..b5a31691fd7d --- /dev/null +++ b/net-libs/grpc/grpc-1.65.0.ebuild @@ -0,0 +1,209 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CMAKE_IN_SOURCE_BUILD=1 +PYTHON_COMPAT=( python3_{10..12} ) +inherit cmake flag-o-matic python-any-r1 + +MY_PV="${PV//_pre/-pre}" + +DESCRIPTION="Modern open source high performance RPC framework" +HOMEPAGE="https://www.grpc.io" +SRC_URI="https://github.com/${PN}/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz" + +S="${WORKDIR}/${PN}-${MY_PV}" +LICENSE="Apache-2.0" +# format is 0/${CORE_SOVERSION//./}.${CPP_SOVERSION//./} , check top level CMakeLists.txt +SLOT="0/42.165" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86" +IUSE="doc examples test systemd" +RESTRICT="!test? ( test )" + +# look for submodule versions in third_party dir +RDEPEND=" + >=dev-cpp/abseil-cpp-20240116:= + >=dev-libs/re2-0.2022.04.01:= + >=dev-libs/openssl-1.1.1:0=[-bindist(-)] + >=dev-libs/protobuf-27.0:= + dev-libs/xxhash + >=net-dns/c-ares-1.19.1:= + sys-libs/zlib:= + systemd? ( sys-apps/systemd:= ) +" +DEPEND=" + ${RDEPEND} + test? ( + dev-cpp/benchmark + dev-cpp/gflags + dev-cpp/gtest + ) +" +BDEPEND=" + ${RDEPEND} + virtual/pkgconfig + test? ( + net-misc/curl + $(python_gen_any_dep ' + dev-python/twisted[${PYTHON_USEDEP}] + dev-python/pyyaml[${PYTHON_USEDEP}] + dev-python/cffi[${PYTHON_USEDEP}] + dev-python/six[${PYTHON_USEDEP}] + ') + ) +" + +PATCHES=( "${FILESDIR}/${PN}-1.65.0-system-gtest.patch" ) + +python_check_deps() { + if use test; then + python_has_version -b "dev-python/twisted[${PYTHON_USEDEP}]" && + python_has_version -b "dev-python/pyyaml[${PYTHON_USEDEP}]" && + python_has_version -b "dev-python/cffi[${PYTHON_USEDEP}]" && + python_has_version -b "dev-python/six[${PYTHON_USEDEP}]" + fi +} + +soversion_check() { + local core_sover cpp_sover + # extract quoted number. line we check looks like this: 'set(gRPC_CPP_SOVERSION "1.37")' + core_sover="$(grep 'set(gRPC_CORE_SOVERSION ' CMakeLists.txt | sed '/.*\"\(.*\)\".*/ s//\1/')" + cpp_sover="$(grep 'set(gRPC_CPP_SOVERSION ' CMakeLists.txt | sed '/.*\"\(.*\)\".*/ s//\1/')" + # remove dots, e.g. 1.37 -> 137 + core_sover="${core_sover//./}" + cpp_sover="${cpp_sover//./}" + [[ ${core_sover} -eq $(ver_cut 2 ${SLOT}) ]] || die "fix core sublot! should be ${core_sover}" + [[ ${cpp_sover} -eq $(ver_cut 3 ${SLOT}) ]] || die "fix cpp sublot! should be ${cpp_sover}" +} + +src_prepare() { + # These extra libs are defined as dependencies of the vendored gtest, + # which is a dependency of the unit tests, therefore they are normally + # implicitly picked up and linked to the test binaries. However removing + # the vendored gtest to use the system one also removes these dependencies, + # so we have to redeclare them as dependencies of the test binaries individually. + local extra_libs=("gtest" + "gmock" + "\${_gRPC_RE2_LIBRARIES}" + "absl::flat_hash_set" + "absl::failure_signal_handler" + "absl::stacktrace" + "absl::symbolize" + "absl::flags" + "absl::flags_parse" + "absl::flags_reflection" + "absl::flags_usage" + "absl::strings" + "absl::any" + "absl::optional" + "absl::variant") + : "$(echo "${extra_libs[@]}" | "${EPYTHON}" -c 'import sys;print("\\n\\1".join(sys.stdin.read().split()))')" + local rstring="${_}" + sed -i -E "s/( +)gtest/\1${rstring}/g" "CMakeLists.txt" || die + + # Integrate tests with ctest rather than the custom test framework. + # Formatted with dev-python/black. + "${EPYTHON}" - <<-EOF | tee -a "CMakeLists.txt" + import json, pathlib + + print("if(gRPC_BUILD_TESTS)") + print(" ENABLE_TESTING()") + for line in [ + json.dumps([t["name"], "./" + t["name"], *t["args"]]).translate( + str.maketrans(dict.fromkeys("[],", None)) + ) + for t in json.loads( + pathlib.Path("tools/run_tests/generated/tests.json").read_text() + ) + if "linux" in t["platforms"] and not t["flaky"] and not t.get("boringssl", False) + ]: + print(f" add_test({line})") + print("endif()") + EOF + + # Weird path issue. All tests except these two assume they are running from top-level src + sed -i -E "s/lslash != nullptr/false/" "test/core/http/httpcli_test_util.cc" || die + + # Called via system() by some of the C++ sources, respect EPYTHON + sed -i -E "s#for p in #for p in \"${EPYTHON}\"#" "tools/distrib/python_wrapper.sh" || die + + # Respect EPYTHON when testing, don't touch installed files otherwise + use test && python_fix_shebang --force "${S}" + + cmake_src_prepare + + # un-hardcode libdir + sed -i "s@/lib@/$(get_libdir)@" cmake/pkg-config-template.pc.in || die + + # suppress network access, package builds fine without the submodules + mkdir "${S}/third_party/opencensus-proto/src" || die + + soversion_check +} + +src_configure() { + # https://github.com/grpc/grpc/issues/29652 + filter-lto + + local mycmakeargs=( + -DgRPC_INSTALL=ON + -DgRPC_ABSL_PROVIDER=package + -DgRPC_CARES_PROVIDER=package + -DgRPC_INSTALL_CMAKEDIR="$(get_libdir)/cmake/${PN}" + -DgRPC_INSTALL_LIBDIR="$(get_libdir)" + -DgRPC_PROTOBUF_PROVIDER=package + -DgRPC_RE2_PROVIDER=package + -DgRPC_SSL_PROVIDER=package + -DgRPC_ZLIB_PROVIDER=package + -DgRPC_BUILD_TESTS=$(usex test) + -DCMAKE_CXX_STANDARD=17 + -DCMAKE_DISABLE_FIND_PACKAGE_systemd=$(usex !systemd) + $(usex test '-DgRPC_BENCHMARK_PROVIDER=package' '') + ) + cmake_src_configure +} + +src_test() { + # This is normally done with start_port_server.py, but this forks and exits, + # while we need to capture the pid, so run it ourselves + "${EPYTHON}" "tools/run_tests/python_utils/port_server.py" \ + -p 32766 -l "${T}/port_server.log" & + local port_server_pid="${!}" + + # Reimplementation of what start_port_server.py does with curl + curl --retry 9999 --retry-all-errors --retry-max-time 120 \ + --fail --silent --output /dev/null "http://localhost:32766/get" || die + + CMAKE_SKIP_TESTS=( + no_logging_test # hangs everywhere, no output + grpc_tool_test # fails everywhere + examine_stack_test # fails on amd64 only + stack_tracer_test # fails on amd64 only + endpoint_pair_test # fails on alpha + event_poller_posix_test # fails on alpha + tcp_posix_test # fails on alpha + ) + + # BUG this should be nonfatal and we kill the server even when tests fail + cmake_src_test + + kill "${port_server_pid}" || die +} + +src_install() { + cmake_src_install + + if use examples; then + find examples -name '.gitignore' -delete || die + dodoc -r examples + docompress -x /usr/share/doc/${PF}/examples + fi + + if use doc; then + find doc -name '.gitignore' -delete || die + local DOCS=( AUTHORS CONCEPTS.md README.md TROUBLESHOOTING.md doc/. ) + fi + + einstalldocs +} diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest index 5fdfbef316ae..311f5323de00 100644 --- a/net-libs/nodejs/Manifest +++ b/net-libs/nodejs/Manifest @@ -4,17 +4,23 @@ AUX nodejs-20.6.0-paxmarking.patch 3143 BLAKE2B 34b93f63481177f1b70d26bdbdb27674 AUX nodejs-22.2.0-riscv.patch 1760 BLAKE2B f5f033dd589637481d2a2f3e67cdbb7a6052bdb187d2666b145a76f23da6e36adeddfe2b6e1718ae4412df914f8517bec2cdc5c15b18eb9dca5dad7a6668cc04 SHA512 f2ff6da8cf5dcc994a7a20342e2928dc1821fbbf42891009a6234b6051277e0200d7e3fbba63b9a2773887591d0ad5ceb1bb3d25e5efeb557f6d00109a80253c DIST node-v18.20.1.tar.xz 40434200 BLAKE2B 560e04d5da8c2f3f4ef82e67b483f2c5d9a59b0646108a1dfc0bd80b410b60b15ee517be7d720834232fc49ed5d94785ebd64282c9abd3c10bdcb883a6960a38 SHA512 08864a164cfde08e369653abd17f6fe549db014697bd36abd07233d5ae746417ef18ea80e3d3f3630503a21110bb5e0ebd0073b4f2885b00c2d46e6f31c386a3 DIST node-v18.20.3.tar.xz 40610412 BLAKE2B 7f1cb88cd4bf51ca8933344a11f710c8748b88a9cfa38f6960b8f12f0b78afbecd0fae86608b81fcaca44d98042aae5807924bb09e2088491831d6eb08615ca2 SHA512 0f518e8f3985274d5b0f48eb574675fa0a1ade6f5e59a9de706b2ade3f8a82dbea1557611a6353422090a95846b5ed107ea2476f78bee787ef4f0db8c07bc999 +DIST node-v18.20.4.tar.xz 40445740 BLAKE2B 0675f2aba1d9a9cd9aeb665ecb3a0f61b9caf39daeb6154941f84b9c423caa7a658c14b8c2c5e12d94424b2470748ec7fad28ecb10390d37f92eb7e50f8adc26 SHA512 1ccef99ebee3906f5bad3c1582f9551ced9bed15e6a047d59d1a23c6110004fb46ea4bebcf9899748c64109f78788d7365ee956444e645eaf397dabbcddda21e DIST node-v20.12.1.tar.xz 41743360 BLAKE2B 1e2819724051720321a429bb18967a12608e8f93ef1760c520a40c9130e6138f95ab4e87f1acbaa72142bdd801ec3050bc42d7e4fae8d6a62192c3511b922e0a SHA512 c51c4aa37cc80f3fe34381f2cdf431053124ec6b83fc8490573502adfab48601c382448132c9962ab135bebaffc257a9d5b63334ba8ff480db57b5706bbfed67 DIST node-v20.14.0.tar.xz 41795876 BLAKE2B 588c380751c12f05ccc95146f6e7f9c3eadfc77e769d836cdca1832a7739a40723fd9a7a4e59a2ab4ad087a2b2def5da76ec28077996b59ae0a6d5b2bd15d2c6 SHA512 b6148c705b2152b20c6567a9bbcbbb3925972d17273e126613b350d1d117600e2d895a93d70f793523cb903337ace9527c541a38cb10137eb81ba992778ed243 DIST node-v20.15.0.tar.xz 41868532 BLAKE2B 07049df11e18b90ee3ebc72fdd953a64a4a925f234fcf7bfb26c472d841bd3f6f34233670d1cc67ba592eeaa714de74c6a7b89ac5a9f62a321764023a86760de SHA512 2b041ee368ca27fa1f92ec8a43237423b7e2f81dabf525e20df7b9b200a46e6d9a8c4b82beb33ec58a9351e0eea865eadfadac3d9e4d3733b1d699f0b5d4bbf3 +DIST node-v20.15.1.tar.xz 41880412 BLAKE2B f113856db03a3306d50a659e21d11f585e9e78b85ce7ad9926cc778837f905c618ac762faf56e03caaa862ab0a38c5f34770cd2bfb0854d79650ee9d9b9e2bfe SHA512 2a2935490c4c629f47cc67819094904a1b91eaf0b75cbb8ebe92f5eb34b0929230932fa456bf1bec00213155ea8b6337b2e02e946fc18606543c8c71082615b9 DIST node-v22.3.0.tar.xz 44517412 BLAKE2B 38ed4e6de9be48fb252b809a0174420f0f201f583ef5fb46a446d74168a25b39e1fa95ede44bfee8e7099dfe5636b3fb2bcd1ba3d626d7dfcac01dec0bd84d0a SHA512 70d1508bb576d98ef138db5618a5b07ca4412ec8a2aa35c8ff1d76fc93221bff6d7b418ff60b9194c420ad810523d5aeb0ffa662d2fa99f9cecf299317698710 DIST node-v22.4.0.tar.xz 46116620 BLAKE2B 262fc22bfe8bab2158a9e9fa274b03bb1ffd875814144fbd6cee45bf2641813363061affa5ebb9b657066899722616d41486046be11425d1a2005fa1261796e3 SHA512 6f7907021ec8c0b16d737da68ae9efa1e424aa38964456e01eb10a3f0111a6d6ceff31ba0f8876cd9df19d92de202e17cccf528b844242e5c66ff1f6b1867f55 +DIST node-v22.4.1.tar.xz 46125104 BLAKE2B 7e54a7e01f821d752abbec03212c5be838b2e12fdb10c50cfe05b0ec25ddbe71eaa3187ba25d99efb258ab14d31927216e6816aacdfa29efdb1dc70a06e9b135 SHA512 840423e9738cad9f6024e9b51b683893eab16487ba18183251a189b5d4acf9b4168e9245623092705b014bff2058174127d5d7ecb31c1a8b324961074cb8ca54 EBUILD nodejs-18.20.1.ebuild 7433 BLAKE2B e366853288364eddb38a0a598db70f83e5188a489ac2c5970eb21f9c993abd4807d87826536d0a1ea12315603edd5f0a714876d95d2aae1ef8e1ded8ee3e7030 SHA512 0a20a965b9c25f7319bc5dfca87e0ddf9f78f603a4dc334c68e750b847d5687b0e636fa199f089a004e72536435b334309ad042753a95f93800fb65515d77402 EBUILD nodejs-18.20.3.ebuild 7435 BLAKE2B 39bec2924b1aa7fc0ee0670bfcb5b51cff9dbc82942512d615465d788e5e952fd1899f293e3e3e23e45b6d65691b5c33b0127ff1e41dfd4874e755281bd7c785 SHA512 2c0f6652acf55b924790dbed8bdcec2103f7752de31b69b32a82862fb646cb9411d8bcd5f3233b6352f9e7c1c0e5ac439f9b41c9704eee25c53ac89e4faaf72a +EBUILD nodejs-18.20.4.ebuild 7438 BLAKE2B 01ae53dc6df6fd3d4aa59863166a34bf63b160999edac2f35af6a80a303aab1aace6e6cf263a79d46c2e50da261d341d781c873de326b36b275d8763561f669e SHA512 74abca48c2161d19c24c49cc172b55b953c396f1173c4228916cf4226aa857fd91f16ccb422c5debf292571239cda34ac98d216d0cfa899d496b4c2ddb95124b EBUILD nodejs-20.12.1.ebuild 7599 BLAKE2B 10339e186e827ab88b9830fbd76bab4a12a181fab9d6a6ce054948d8e1e64c32e54491bcc29ef6304827da39352f25ad73b01122c872c2667ee9d945f43368ca SHA512 cac02959f6cdfc3d99dbf918b910453a8175b2fce0a8dcaeebc64a21e4cb4186b19d5f4ce46b237de52c7e66e8f9a9dc4a353b9c12969f7370c82d91ef281b02 EBUILD nodejs-20.14.0.ebuild 7564 BLAKE2B 2ea907259a8a6be81ef34562eeabcb7da8daf8fdff565dfaef87177c3cdff02d8c111e7748c59e3e59e041484485c997b8438ecabccca21f9e5215bed296bcb7 SHA512 6505abdde39cd07d2925c98597e2ccdb29db66631a0330b1b7c2dd00ad0e5995c47102fb351f5067b50d03e350fc0317b51c1799e84ac352d5086d33986dfe74 EBUILD nodejs-20.15.0.ebuild 7567 BLAKE2B f91ca9f6bc88e927ae20a5af0f74a8fad87c995610eda2132a55ddbe9ab2df279d0f717dcc8e3e660358d6609de50dbb3fd76c6d4715c8e4d0e8b4016b7c65c0 SHA512 730eac7fa64742cda816d710720ca30d42a1a95db9b60e85282c7895115c437bb4e27986ff713657199a6947bb0b0cda8a2fc94912c8f7f0c032155eafe9509b +EBUILD nodejs-20.15.1.ebuild 7567 BLAKE2B f08c1d0563aea5b69af83fd2370924b7788ef12fac7753c7b4a75a5b7560d06c673abbde373ac40bb59f6a7cab3d0e3ca02a7406642d95dca847e3ff56ca10f3 SHA512 1cc8b260a495873039dc983c65e936b886566a72628782cd630797fb23177025036cc2d142223decc88edd269f6a03aee5164282f4a9f16865b2c8555b04e04d EBUILD nodejs-22.3.0.ebuild 7858 BLAKE2B 60f8887f76550810e2deb1742cf159c345d4d268919d357f3c7933dcf4bf5aa0cf2292477b067c60a25a3bb25a4377ddff8e514451540536ccf554ca146fc9e2 SHA512 cd7dcb08cd265757c685a6aa2e32774659c45494b6abd965ef2f98a1ef76dfb02037b3b1c817f0c2b6665175a856abdb8ea7d0a399a897fe503a6b4e6b8e3e6a EBUILD nodejs-22.4.0.ebuild 7978 BLAKE2B f968fa307c403cc20fc812046ec953a153f407ffba0351eee2cdd924b335c6a9378805ee9f0decc63774d6f5ce53e98f7becea87dbb1b7fc7ce252422994f083 SHA512 589320bdd3e57c887b44ea2dd14b2d1988db201ab3c6296de3ee1ff743f6dd33f69352086da25c2e7b7b63a744f13975d631bb05d96421a6577ef8b797fb1908 +EBUILD nodejs-22.4.1.ebuild 7978 BLAKE2B e1be01e6aefaeca03122a27ff9d69b85321e54fcb958644ca8f31d29df762d36659c75a557dea041a7bdbaf96c674d4ad9b167fd52dbbd672010a03f49703cff SHA512 7856ac2d9a6ccfc786b56f72a53b60d03afd3ab530e7cbf3e35a09f25362ae029f2cea7e5b866ba2a300afd7a6a61fc122319db434fccfc3407198712fab5476 EBUILD nodejs-99999999.ebuild 7406 BLAKE2B 71b0f9acf3a3cdf3181c7f1dc3ca2a290c5fefce6be6ab017483750a31f7bf3c996984b91f03e1144b2b6bf3cb852529b9f620974ab0484928d6a390890cf2dc SHA512 bc0b7c5171f11b9b2d29915e03614272653baba609d505885e4aaf5d51ed40291e82c5970bb7e914e41604dcb3788ecb85a0d5e8a9770aea73f77136f6915d1e MISC metadata.xml 983 BLAKE2B 7e455047a955185d1e53797b2b0592c5242b7eb849617cf39366acbab41e4fd066d36d723dbc32760f591c933f068e643475fc1b58a2873a2f1221e1c5d44b71 SHA512 5e08a76e2704000aa83a2c63f6e821e83c302939c1a729c4ac73774cc85189da4eccc1a19b700babfe87c8f07327865171526550ddf16a4fc25fed834f4bf7a6 diff --git a/net-libs/nodejs/nodejs-18.20.4.ebuild b/net-libs/nodejs/nodejs-18.20.4.ebuild new file mode 100644 index 000000000000..c54ae0a037e6 --- /dev/null +++ b/net-libs/nodejs/nodejs-18.20.4.ebuild @@ -0,0 +1,256 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CONFIG_CHECK="~ADVISE_SYSCALLS" +PYTHON_COMPAT=( python3_{10..12} ) +PYTHON_REQ_USE="threads(+)" + +inherit bash-completion-r1 check-reqs flag-o-matic linux-info pax-utils python-any-r1 toolchain-funcs xdg-utils + +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" +HOMEPAGE="https://nodejs.org/" +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" + +if [[ ${PV} == *9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/nodejs/node" + SLOT="0" +else + SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" + SLOT="0/$(ver_cut 1)" + KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86 ~amd64-linux ~x64-macos" + S="${WORKDIR}/node-v${PV}" +fi + +IUSE="corepack cpu_flags_x86_sse2 debug doc +icu inspector lto +npm pax-kernel +snapshot +ssl +system-icu +system-ssl systemtap test" +REQUIRED_USE="inspector? ( icu ssl ) + npm? ( ssl ) + system-icu? ( icu ) + system-ssl? ( ssl )" + +RESTRICT="!test? ( test )" + +RDEPEND=">=app-arch/brotli-1.0.9:= + >=dev-libs/libuv-1.44.0:= + >=net-dns/c-ares-1.18.1:= + >=net-libs/nghttp2-1.41.0:= + sys-libs/zlib + corepack? ( !sys-apps/yarn ) + system-icu? ( >=dev-libs/icu-73:= ) + system-ssl? ( >=dev-libs/openssl-1.1.1:0= ) + sys-devel/gcc:*" +BDEPEND="${PYTHON_DEPS} + sys-apps/coreutils + virtual/pkgconfig + systemtap? ( dev-debug/systemtap ) + test? ( net-misc/curl ) + pax-kernel? ( sys-apps/elfix )" +DEPEND="${RDEPEND}" + +# These are measured on a loong machine with -ggdb on, and only checked +# if debugging flags are present in CFLAGS. +# +# The final link consumed a little more than 7GiB alone, so 8GiB is the lower +# limit for memory usage. Disk usage was 19.1GiB for the build directory and +# 1.2GiB for the installed image, so we leave some room for architectures with +# fatter binaries and set the disk requirement to 22GiB. +CHECKREQS_MEMORY="8G" +CHECKREQS_DISK_BUILD="22G" + +pkg_pretend() { + (use x86 && ! use cpu_flags_x86_sse2) && \ + die "Your CPU doesn't support the required SSE2 instruction." + + if [[ ${MERGE_TYPE} != "binary" ]]; then + if is-flagq "-g*" && ! is-flagq "-g*0" ; then + einfo "Checking for sufficient disk space and memory to build ${PN} with debugging CFLAGS" + check-reqs_pkg_pretend + fi + fi +} + +pkg_setup() { + python-any-r1_pkg_setup + linux-info_pkg_setup +} + +src_prepare() { + tc-export AR CC CXX PKG_CONFIG + export V=1 + export BUILDTYPE=Release + + # fix compilation on Darwin + # https://code.google.com/p/gyp/issues/detail?id=260 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die + + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504 + local LIBDIR=$(get_libdir) + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die + sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die + + # Avoid writing a depfile, not useful + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die + + sed -i -e "/'-O3'/d" common.gypi node.gypi || die + + # debug builds. change install path, remove optimisations and override buildtype + if use debug; then + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die + BUILDTYPE=Debug + fi + + # We need to disable mprotect on two files when it builds Bug 694100. + use pax-kernel && PATCHES+=( "${FILESDIR}"/${PN}-18.16.0-paxmarking.patch ) + + default +} + +src_configure() { + xdg_environment_reset + + # LTO compiler flags are handled by configure.py itself + filter-lto + # nodejs unconditionally links to libatomic #869992 + # specifically it requires __atomic_is_lock_free which + # is not yet implemented by sys-libs/compiler-rt (see + # https://reviews.llvm.org/D85044?id=287068), therefore + # we depend on gcc and force using libgcc as the support lib + tc-is-clang && append-ldflags "--rtlib=libgcc --unwindlib=libgcc" + + local myconf=( + --shared-brotli + --shared-cares + --shared-libuv + --shared-nghttp2 + --shared-zlib + ) + use debug && myconf+=( --debug ) + use lto && myconf+=( --enable-lto ) + if use system-icu; then + myconf+=( --with-intl=system-icu ) + elif use icu; then + myconf+=( --with-intl=full-icu ) + else + myconf+=( --with-intl=none ) + fi + use corepack || myconf+=( --without-corepack ) + use inspector || myconf+=( --without-inspector ) + use npm || myconf+=( --without-npm ) + use snapshot || myconf+=( --without-node-snapshot ) + if use ssl; then + use system-ssl && myconf+=( --shared-openssl --openssl-use-def-ca-store ) + else + myconf+=( --without-ssl ) + fi + + local myarch="" + case "${ARCH}:${ABI}" in + *:amd64) myarch="x64";; + *:arm) myarch="arm";; + *:arm64) myarch="arm64";; + loong:lp64*) myarch="loong64";; + riscv:lp64*) myarch="riscv64";; + *:ppc64) myarch="ppc64";; + *:x32) myarch="x32";; + *:x86) myarch="ia32";; + *) myarch="${ABI}";; + esac + + GYP_DEFINES="linux_use_gold_flags=0 + linux_use_bundled_binutils=0 + linux_use_bundled_gold=0" \ + "${EPYTHON}" configure.py \ + --prefix="${EPREFIX}"/usr \ + --dest-cpu=${myarch} \ + $(use_with systemtap dtrace) \ + "${myconf[@]}" || die +} + +src_compile() { + emake -C out -Onone +} + +src_install() { + local LIBDIR="${ED}/usr/$(get_libdir)" + default + + pax-mark -m "${ED}"/usr/bin/node + + # set up a symlink structure that node-gyp expects.. + dodir /usr/include/node/deps/{v8,uv} + dosym . /usr/include/node/src + for var in deps/{uv,v8}/include; do + dosym ../.. /usr/include/node/${var} + done + + if use doc; then + docinto html + dodoc -r "${S}"/doc/* + fi + + if use npm; then + keepdir /etc/npm + echo "NPM_CONFIG_GLOBALCONFIG=${EPREFIX}/etc/npm/npmrc" > "${T}"/50npm + doenvd "${T}"/50npm + + # Install bash completion for `npm` + local tmp_npm_completion_file="$(TMPDIR="${T}" mktemp -t npm.XXXXXXXXXX)" + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" + newbashcomp "${tmp_npm_completion_file}" npm + + # Move man pages + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* + + # Clean up + rm -f "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} + + local find_exp="-or -name" + local find_name=() + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ + "*.md" "*.markdown" "*.bat" "*.cmd"; do + find_name+=( ${find_exp} "${match}" ) + done + + # Remove various development and/or inappropriate files and + # useless docs of dependend packages. + find "${LIBDIR}"/node_modules \ + \( -type d -name examples \) -or \( -type f \( \ + -iname "LICEN?E*" \ + "${find_name[@]}" \ + \) \) -exec rm -rf "{}" \; + fi + + use corepack && + "${D}"/usr/bin/corepack enable --install-directory "${D}"/usr/bin + + mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die +} + +src_test() { + local drop_tests=( + test/parallel/test-dns-resolveany.js + test/parallel/test-dns-resolveany-bad-ancount.js + test/parallel/test-dns-setserver-when-querying.js + test/parallel/test-fs-mkdir.js + test/parallel/test-fs-utimes-y2K38.js + test/parallel/test-release-npm.js + test/parallel/test-socket-write-after-fin-error.js + test/parallel/test-strace-openat-openssl.js + test/sequential/test-util-debug.js + ) + rm -f "${drop_tests[@]}" || die "disabling tests failed" + + out/${BUILDTYPE}/cctest || die + "${EPYTHON}" tools/test.py --mode=${BUILDTYPE,,} --flaky-tests=dontcare -J message parallel sequential || die +} + +pkg_postinst() { + if use npm; then + ewarn "remember to run: source /etc/profile if you plan to use nodejs" + ewarn " in your current shell" + fi +} diff --git a/net-libs/nodejs/nodejs-20.15.1.ebuild b/net-libs/nodejs/nodejs-20.15.1.ebuild new file mode 100644 index 000000000000..2221af69417b --- /dev/null +++ b/net-libs/nodejs/nodejs-20.15.1.ebuild @@ -0,0 +1,261 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CONFIG_CHECK="~ADVISE_SYSCALLS" +PYTHON_COMPAT=( python3_{9..12} ) +PYTHON_REQ_USE="threads(+)" + +inherit bash-completion-r1 check-reqs flag-o-matic linux-info pax-utils python-any-r1 toolchain-funcs xdg-utils + +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" +HOMEPAGE="https://nodejs.org/" +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" + +if [[ ${PV} == *9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/nodejs/node" + SLOT="0" +else + SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" + SLOT="0/$(ver_cut 1)" + KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86 ~amd64-linux ~x64-macos" + S="${WORKDIR}/node-v${PV}" +fi + +IUSE="corepack cpu_flags_x86_sse2 debug doc +icu inspector lto +npm pax-kernel +snapshot +ssl +system-icu +system-ssl test" +REQUIRED_USE="inspector? ( icu ssl ) + npm? ( ssl ) + system-icu? ( icu ) + system-ssl? ( ssl ) + x86? ( cpu_flags_x86_sse2 )" + +RESTRICT="!test? ( test )" + +RDEPEND=">=app-arch/brotli-1.0.9:= + >=dev-libs/libuv-1.46.0:= + >=net-dns/c-ares-1.18.1:= + >=net-libs/nghttp2-1.41.0:= + >=net-libs/ngtcp2-1.1.0:= + sys-libs/zlib + corepack? ( !sys-apps/yarn ) + system-icu? ( >=dev-libs/icu-73:= ) + system-ssl? ( >=dev-libs/openssl-1.1.1:0= ) + sys-devel/gcc:*" +BDEPEND="${PYTHON_DEPS} + app-alternatives/ninja + sys-apps/coreutils + virtual/pkgconfig + test? ( net-misc/curl ) + pax-kernel? ( sys-apps/elfix )" +DEPEND="${RDEPEND}" + +# These are measured on a loong machine with -ggdb on, and only checked +# if debugging flags are present in CFLAGS. +# +# The final link consumed a little more than 7GiB alone, so 8GiB is the lower +# limit for memory usage. Disk usage was 19.1GiB for the build directory and +# 1.2GiB for the installed image, so we leave some room for architectures with +# fatter binaries and set the disk requirement to 22GiB. +CHECKREQS_MEMORY="8G" +CHECKREQS_DISK_BUILD="22G" + +pkg_pretend() { + if [[ ${MERGE_TYPE} != "binary" ]]; then + if is-flagq "-g*" && ! is-flagq "-g*0" ; then + einfo "Checking for sufficient disk space and memory to build ${PN} with debugging CFLAGS" + check-reqs_pkg_pretend + fi + fi +} + +pkg_setup() { + python-any-r1_pkg_setup + linux-info_pkg_setup +} + +src_prepare() { + tc-export AR CC CXX PKG_CONFIG + export V=1 + export BUILDTYPE=Release + + # fix compilation on Darwin + # https://code.google.com/p/gyp/issues/detail?id=260 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die + + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504 + local LIBDIR=$(get_libdir) + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die + sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die + + # Avoid writing a depfile, not useful + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die + + sed -i -e "/'-O3'/d" common.gypi node.gypi || die + + # debug builds. change install path, remove optimisations and override buildtype + if use debug; then + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die + BUILDTYPE=Debug + fi + + # We need to disable mprotect on two files when it builds Bug 694100. + use pax-kernel && PATCHES+=( "${FILESDIR}"/${PN}-20.6.0-paxmarking.patch ) + + default +} + +src_configure() { + xdg_environment_reset + + # LTO compiler flags are handled by configure.py itself + filter-lto + # nodejs unconditionally links to libatomic #869992 + # specifically it requires __atomic_is_lock_free which + # is not yet implemented by sys-libs/compiler-rt (see + # https://reviews.llvm.org/D85044?id=287068), therefore + # we depend on gcc and force using libgcc as the support lib + tc-is-clang && append-ldflags "--rtlib=libgcc --unwindlib=libgcc" + + local myconf=( + --ninja + --shared-brotli + --shared-cares + --shared-libuv + --shared-nghttp2 + --shared-ngtcp2 + --shared-zlib + ) + use debug && myconf+=( --debug ) + use lto && myconf+=( --enable-lto ) + if use system-icu; then + myconf+=( --with-intl=system-icu ) + elif use icu; then + myconf+=( --with-intl=full-icu ) + else + myconf+=( --with-intl=none ) + fi + use corepack || myconf+=( --without-corepack ) + use inspector || myconf+=( --without-inspector ) + use npm || myconf+=( --without-npm ) + use snapshot || myconf+=( --without-node-snapshot ) + if use ssl; then + use system-ssl && myconf+=( --shared-openssl --openssl-use-def-ca-store ) + else + myconf+=( --without-ssl ) + fi + + local myarch="" + case "${ARCH}:${ABI}" in + *:amd64) myarch="x64";; + *:arm) myarch="arm";; + *:arm64) myarch="arm64";; + loong:lp64*) myarch="loong64";; + riscv:lp64*) myarch="riscv64";; + *:ppc64) myarch="ppc64";; + *:x32) myarch="x32";; + *:x86) myarch="ia32";; + *) myarch="${ABI}";; + esac + + GYP_DEFINES="linux_use_gold_flags=0 + linux_use_bundled_binutils=0 + linux_use_bundled_gold=0" \ + "${EPYTHON}" configure.py \ + --prefix="${EPREFIX}"/usr \ + --dest-cpu=${myarch} \ + "${myconf[@]}" || die +} + +src_compile() { + emake -Onone +} + +src_install() { + local LIBDIR="${ED}/usr/$(get_libdir)" + default + + pax-mark -m "${ED}"/usr/bin/node + + # set up a symlink structure that node-gyp expects.. + dodir /usr/include/node/deps/{v8,uv} + dosym . /usr/include/node/src + for var in deps/{uv,v8}/include; do + dosym ../.. /usr/include/node/${var} + done + + if use doc; then + docinto html + dodoc -r "${S}"/doc/* + fi + + if use npm; then + keepdir /etc/npm + echo "NPM_CONFIG_GLOBALCONFIG=${EPREFIX}/etc/npm/npmrc" > "${T}"/50npm + doenvd "${T}"/50npm + + # Install bash completion for `npm` + local tmp_npm_completion_file="$(TMPDIR="${T}" mktemp -t npm.XXXXXXXXXX)" + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" + newbashcomp "${tmp_npm_completion_file}" npm + + # Move man pages + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* + + # Clean up + rm -f "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} + + local find_exp="-or -name" + local find_name=() + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ + "*.md" "*.markdown" "*.bat" "*.cmd"; do + find_name+=( ${find_exp} "${match}" ) + done + + # Remove various development and/or inappropriate files and + # useless docs of dependend packages. + find "${LIBDIR}"/node_modules \ + \( -type d -name examples \) -or \( -type f \( \ + -iname "LICEN?E*" \ + "${find_name[@]}" \ + \) \) -exec rm -rf "{}" \; + fi + + use corepack && + "${D}"/usr/bin/corepack enable --install-directory "${D}"/usr/bin + + mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die +} + +src_test() { + local drop_tests=( + test/parallel/test-dns-resolveany-bad-ancount.js + test/parallel/test-dns-setserver-when-querying.js + test/parallel/test-fs-mkdir.js + test/parallel/test-fs-read-stream.js + test/parallel/test-fs-utimes-y2K38.js + test/parallel/test-fs-watch-recursive-add-file.js + test/parallel/test-process-euid-egid.js + test/parallel/test-process-initgroups.js + test/parallel/test-process-setgroups.js + test/parallel/test-process-uid-gid.js + test/parallel/test-release-npm.js + test/parallel/test-socket-write-after-fin-error.js + test/parallel/test-strace-openat-openssl.js + test/sequential/test-util-debug.js + ) + rm -f "${drop_tests[@]}" || die "disabling tests failed" + + out/${BUILDTYPE}/cctest || die + "${EPYTHON}" tools/test.py --mode=${BUILDTYPE,,} --flaky-tests=dontcare -J message parallel sequential || die +} + +pkg_postinst() { + if use npm; then + ewarn "remember to run: source /etc/profile if you plan to use nodejs" + ewarn " in your current shell" + fi +} diff --git a/net-libs/nodejs/nodejs-22.4.1.ebuild b/net-libs/nodejs/nodejs-22.4.1.ebuild new file mode 100644 index 000000000000..7b81449c1431 --- /dev/null +++ b/net-libs/nodejs/nodejs-22.4.1.ebuild @@ -0,0 +1,276 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CONFIG_CHECK="~ADVISE_SYSCALLS" +PYTHON_COMPAT=( python3_{9..12} ) +PYTHON_REQ_USE="threads(+)" + +inherit bash-completion-r1 check-reqs flag-o-matic linux-info pax-utils python-any-r1 toolchain-funcs xdg-utils + +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" +HOMEPAGE="https://nodejs.org/" +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" + +if [[ ${PV} == *9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/nodejs/node" + SLOT="0" +else + SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" + SLOT="0/$(ver_cut 1)" + KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86 ~amd64-linux ~x64-macos" + S="${WORKDIR}/node-v${PV}" +fi + +IUSE="corepack cpu_flags_x86_sse2 debug doc +icu inspector lto +npm pax-kernel +snapshot +ssl +system-icu +system-ssl test" +REQUIRED_USE="inspector? ( icu ssl ) + npm? ( ssl ) + system-icu? ( icu ) + system-ssl? ( ssl ) + x86? ( cpu_flags_x86_sse2 )" + +RESTRICT="!test? ( test )" + +RDEPEND=">=app-arch/brotli-1.0.9:= + dev-db/sqlite:3 + >=dev-libs/libuv-1.46.0:= + >=dev-libs/simdjson-3.9.1:= + >=net-dns/c-ares-1.18.1:= + >=net-libs/nghttp2-1.61.0:= + >=net-libs/ngtcp2-1.3.0:= + sys-libs/zlib + corepack? ( !sys-apps/yarn ) + system-icu? ( >=dev-libs/icu-73:= ) + system-ssl? ( >=dev-libs/openssl-1.1.1:0= ) + sys-devel/gcc:*" +BDEPEND="${PYTHON_DEPS} + app-alternatives/ninja + sys-apps/coreutils + virtual/pkgconfig + test? ( net-misc/curl ) + pax-kernel? ( sys-apps/elfix )" +DEPEND="${RDEPEND}" + +# These are measured on a loong machine with -ggdb on, and only checked +# if debugging flags are present in CFLAGS. +# +# The final link consumed a little more than 7GiB alone, so 8GiB is the lower +# limit for memory usage. Disk usage was 19.1GiB for the build directory and +# 1.2GiB for the installed image, so we leave some room for architectures with +# fatter binaries and set the disk requirement to 22GiB. +CHECKREQS_MEMORY="8G" +CHECKREQS_DISK_BUILD="22G" + +pkg_pretend() { + if [[ ${MERGE_TYPE} != "binary" ]]; then + if is-flagq "-g*" && ! is-flagq "-g*0" ; then + einfo "Checking for sufficient disk space and memory to build ${PN} with debugging CFLAGS" + check-reqs_pkg_pretend + fi + fi +} + +pkg_setup() { + python-any-r1_pkg_setup + linux-info_pkg_setup +} + +src_prepare() { + tc-export AR CC CXX PKG_CONFIG + export V=1 + export BUILDTYPE=Release + + # fix compilation on Darwin + # https://code.google.com/p/gyp/issues/detail?id=260 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die + + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504 + local LIBDIR=$(get_libdir) + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die + sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die + + # Avoid writing a depfile, not useful + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die + + sed -i -e "/'-O3'/d" common.gypi node.gypi || die + + # debug builds. change install path, remove optimisations and override buildtype + if use debug; then + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die + BUILDTYPE=Debug + fi + + # We need to disable mprotect on two files when it builds Bug 694100. + use pax-kernel && PATCHES+=( "${FILESDIR}"/${PN}-20.6.0-paxmarking.patch ) + + # bug 931256 + use riscv && PATCHES+=( "${FILESDIR}"/${PN}-22.2.0-riscv.patch ) + + default +} + +src_configure() { + xdg_environment_reset + + # LTO compiler flags are handled by configure.py itself + filter-lto + # nodejs unconditionally links to libatomic #869992 + # specifically it requires __atomic_is_lock_free which + # is not yet implemented by sys-libs/compiler-rt (see + # https://reviews.llvm.org/D85044?id=287068), therefore + # we depend on gcc and force using libgcc as the support lib + tc-is-clang && append-ldflags "--rtlib=libgcc --unwindlib=libgcc" + + local myconf=( + --ninja + # ada is not packaged yet + # https://github.com/ada-url/ada + # --shared-ada + --shared-brotli + --shared-cares + --shared-libuv + --shared-nghttp2 + --shared-ngtcp2 + --shared-simdjson + # sindutf is not packaged yet + # https://github.com/simdutf/simdutf + # --shared-simdutf + --shared-sqlite + --shared-zlib + ) + use debug && myconf+=( --debug ) + use lto && myconf+=( --enable-lto ) + if use system-icu; then + myconf+=( --with-intl=system-icu ) + elif use icu; then + myconf+=( --with-intl=full-icu ) + else + myconf+=( --with-intl=none ) + fi + use corepack || myconf+=( --without-corepack ) + use inspector || myconf+=( --without-inspector ) + use npm || myconf+=( --without-npm ) + use snapshot || myconf+=( --without-node-snapshot ) + if use ssl; then + use system-ssl && myconf+=( --shared-openssl --openssl-use-def-ca-store ) + else + myconf+=( --without-ssl ) + fi + + local myarch="" + case "${ARCH}:${ABI}" in + *:amd64) myarch="x64";; + *:arm) myarch="arm";; + *:arm64) myarch="arm64";; + loong:lp64*) myarch="loong64";; + riscv:lp64*) myarch="riscv64";; + *:ppc64) myarch="ppc64";; + *:x32) myarch="x32";; + *:x86) myarch="ia32";; + *) myarch="${ABI}";; + esac + + GYP_DEFINES="linux_use_gold_flags=0 + linux_use_bundled_binutils=0 + linux_use_bundled_gold=0" \ + "${EPYTHON}" configure.py \ + --prefix="${EPREFIX}"/usr \ + --dest-cpu=${myarch} \ + "${myconf[@]}" || die +} + +src_compile() { + emake -Onone +} + +src_install() { + local LIBDIR="${ED}/usr/$(get_libdir)" + default + + pax-mark -m "${ED}"/usr/bin/node + + # set up a symlink structure that node-gyp expects.. + dodir /usr/include/node/deps/{v8,uv} + dosym . /usr/include/node/src + for var in deps/{uv,v8}/include; do + dosym ../.. /usr/include/node/${var} + done + + if use doc; then + docinto html + dodoc -r "${S}"/doc/* + fi + + if use npm; then + keepdir /etc/npm + echo "NPM_CONFIG_GLOBALCONFIG=${EPREFIX}/etc/npm/npmrc" > "${T}"/50npm + doenvd "${T}"/50npm + + # Install bash completion for `npm` + local tmp_npm_completion_file="$(TMPDIR="${T}" mktemp -t npm.XXXXXXXXXX)" + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" + newbashcomp "${tmp_npm_completion_file}" npm + + # Move man pages + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* + + # Clean up + rm -f "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} + + local find_exp="-or -name" + local find_name=() + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ + "*.md" "*.markdown" "*.bat" "*.cmd"; do + find_name+=( ${find_exp} "${match}" ) + done + + # Remove various development and/or inappropriate files and + # useless docs of dependend packages. + find "${LIBDIR}"/node_modules \ + \( -type d -name examples \) -or \( -type f \( \ + -iname "LICEN?E*" \ + "${find_name[@]}" \ + \) \) -exec rm -rf "{}" \; + fi + + use corepack && + "${D}"/usr/bin/corepack enable --install-directory "${D}"/usr/bin + + mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die +} + +src_test() { + local drop_tests=( + test/parallel/test-dns.js + test/parallel/test-dns-resolveany-bad-ancount.js + test/parallel/test-dns-setserver-when-querying.js + test/parallel/test-fs-mkdir.js + test/parallel/test-fs-read-stream.js + test/parallel/test-fs-utimes-y2K38.js + test/parallel/test-fs-watch-recursive-add-file.js + test/parallel/test-process-euid-egid.js + test/parallel/test-process-get-builtin.mjs + test/parallel/test-process-initgroups.js + test/parallel/test-process-setgroups.js + test/parallel/test-process-uid-gid.js + test/parallel/test-release-npm.js + test/parallel/test-socket-write-after-fin-error.js + test/parallel/test-strace-openat-openssl.js + test/sequential/test-util-debug.js + ) + rm -f "${drop_tests[@]}" || die "disabling tests failed" + + out/${BUILDTYPE}/cctest || die + "${EPYTHON}" tools/test.py --mode=${BUILDTYPE,,} --flaky-tests=dontcare -J message parallel sequential || die +} + +pkg_postinst() { + if use npm; then + ewarn "remember to run: source /etc/profile if you plan to use nodejs" + ewarn " in your current shell" + fi +} |