# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= nodejs VERSION= 21.6.2 KEYWORDS= www lang VARIANTS= standard SDESC[standard]= Evented I/O for V8 JavaScript HOMEPAGE= https://nodejs.org/ CONTACT= nobody DOWNLOAD_GROUPS= main SITES[main]= https://nodejs.org/dist/v21.6.2/ DISTFILE[1]= node-v21.6.2.tar.gz:main DF_INDEX= 1 SPKGS[standard]= complete primary dev man docs OPTIONS_AVAILABLE= SYSTEM SMALL_EMBED NO_SUPPORT OPTIONS_STANDARD= SYSTEM SMALL_EMBED NO_SUPPORT OPTGROUP_RADIO= ICU_OPTIONS OPTDESCR[ICU_OPTIONS]= Support for Unicode OPTGROUP[ICU_OPTIONS]= SYSTEM SMALL_EMBED NO_SUPPORT OPT_ON[freebsd]= SMALL_EMBED OPT_ON[sunos]= SMALL_EMBED OPT_ON[linux]= SMALL_EMBED OPT_ON[netbsd]= NO_SUPPORT OPT_ON[dragonfly]= SMALL_EMBED OPT_ON[midnightbsd]= SMALL_EMBED BROKEN[sunos]= The ld.sun linker does not support required options BUILD_DEPENDS= libnghttp2:dev:standard libuv:dev:standard BUILDRUN_DEPENDS= libuv:primary:standard libnghttp2:primary:standard USES= execinfo gmake pkgconfig shebangfix cpe zlib python:v11,build c++:primary DISTNAME= node-v21.6.2 LICENSE= MIT:primary LICENSE_FILE= MIT:{{WRKSRC}}/LICENSE LICENSE_SCHEME= solo CPE_PRODUCT= node.js CPE_VENDOR= nodejs FPC_EQUIVALENT= www/node SHEBANG_FILES= tools/specialize_node_d.py MUST_CONFIGURE= yes CONFIGURE_ARGS= --prefix={{PREFIX}} --without-npm --shared-libuv --shared-zlib --shared-nghttp2 MAKE_ENV= CC.host={{CC}} CXX.host={{CXX}} LINK.host={{CXX}} LINK.target={{CXX}} INSTALL_REQ_TOOLCHAIN= yes VAR_OPSYS[netbsd]= CONFIGURE_ARGS=--dest-os=netbsd CONFIGURE_ARGS=--experimental-enable-pointer-compression VAR_OPSYS[midnightbsd]= CONFIGURE_ARGS=--dest-os=freebsd [SYSTEM].DESCRIPTION= Link with installed ICU library [SYSTEM].BUILDRUN_DEPENDS_ON= icu:primary:standard [SYSTEM].BUILD_DEPENDS_ON= icu:dev:standard [SYSTEM].CONFIGURE_ARGS_ON= --with-intl=system-icu [NO_SUPPORT].DESCRIPTION= Build node without ICU support [NO_SUPPORT].CONFIGURE_ARGS_ON= --with-intl=none [SMALL_EMBED].DESCRIPTION= Embed a limited set of ICU data [SMALL_EMBED].CONFIGURE_ARGS_ON= --with-intl=small-icu post-configure-netbsd: # Fixes "Fatal process OOM in Failed to reserve virtual memory for CodeRange" error # in addition to enable-pointer-compression option ${REINPLACE_CMD} -E 's|(call do_cmd,link\))|\1\n\t${PAXCTL} +m $$@|'\ ${WRKSRC}/out/tools/v8_gypfiles/mksnapshot.target.mk \ ${WRKSRC}/out/node_mksnapshot.target.mk pre-configure-netbsd: # hack to avoid undefined reference to 'engine_load_devcrypto_int' ${REINPLACE_CMD} -e 's/ifndef OPENSSL_NO_DEVCRYPTOENG/if 0/' \ ${WRKSRC}/deps/openssl/openssl/crypto/init.c ${REINPLACE_CMD} -e 's/=="freebsd"/=="netbsd"/g' \ ${WRKSRC}/deps/openssl/*.gypi post-install: ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/node ${CHOWN} ${MANMODE} ${STAGEDIR}${PREFIX}/share/man/man1/node.1 pre-configure: ${GREP} -rl "/usr/local" ${WRKSRC} | \ ${XARGS} ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' # So many different ways to run python. Fix them all. ${REINPLACE_CMD} -e 's|/usr/bin/env python|${PYTHON_CMD}|' \ ${WRKSRC}/configure ${FIND} ${WRKSRC} -type f -name '*.gyp*' -print0 | \ ${XARGS} -0 ${REINPLACE_CMD} \ -e "s|'python'|'${PYTHON_CMD}'|" \ -e 's| "BSD-sparc64" } ], [ 'ia64-.*-.*bsd.*', { target => "BSD-ia64" } ], [ 'x86_64-.*-dragonfly.*', { target => "BSD-x86_64" } ], + [ 'x86_64-.*-*bsd.*', { target => "BSD-x86_64" } ], [ 'amd64-.*-.*bsd.*', { target => "BSD-x86_64" } ], [ 'arm64-.*-.*bsd.*', { target => "BSD-aarch64" } ], [ '.*86.*-.*-.*bsd.*', [FILE:426:patches/patch-deps_uv_common.gypi] --- deps/uv/common.gypi.orig 2024-01-22 12:13:22 UTC +++ deps/uv/common.gypi @@ -135,7 +135,7 @@ }] ] }], - ['OS in "freebsd dragonflybsd linux openbsd solaris android aix os400"', { + ['OS in "freebsd dragonflybsd linux openbsd netbsd solaris android aix os400"', { 'cflags': [ '-Wall' ], 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ], 'target_conditions': [ [FILE:478:patches/patch-deps_v8_src_base_platform_condition-variable.cc] --- deps/v8/src/base/platform/condition-variable.cc.orig 2024-01-22 12:13:22 UTC +++ deps/v8/src/base/platform/condition-variable.cc @@ -20,6 +20,7 @@ namespace base { ConditionVariable::ConditionVariable() { #if (V8_OS_FREEBSD || V8_OS_NETBSD || V8_OS_OPENBSD || \ + V8_OS_DRAGONFLYBSD || \ (V8_OS_LINUX && V8_LIBC_GLIBC)) // On Free/Net/OpenBSD and Linux with glibc we can change the time // source for pthread_cond_timedwait() to use the monotonic clock. [FILE:596:patches/patch-deps_v8_src_base_platform_memory.h] --- deps/v8/src/base/platform/memory.h.orig 2024-01-22 12:13:22 UTC +++ deps/v8/src/base/platform/memory.h @@ -20,10 +20,12 @@ #if V8_OS_DARWIN #include #else // !V8_OS_DARWIN +# if !V8_OS_FREEBSD && !V8_OS_DRAGONFLYBSD #include +# endif #endif // !V8_OS_DARWIN -#if (V8_OS_POSIX && !V8_OS_AIX && !V8_OS_SOLARIS) || V8_OS_WIN +#if (V8_OS_POSIX && !V8_OS_AIX && !V8_OS_SOLARIS && !V8_OS_DRAGONFLYBSD && !V8_OS_FREEBSD && !V8_OS_NETBSD) || V8_OS_WIN #define V8_HAS_MALLOC_USABLE_SIZE 1 #endif // (V8_OS_POSIX && !V8_OS_AIX && !V8_OS_SOLARIS) || V8_OS_WIN [FILE:1134:patches/patch-deps_v8_src_base_platform_platform-freebsd.cc] --- deps/v8/src/base/platform/platform-freebsd.cc.orig 2024-01-22 12:13:22 UTC +++ deps/v8/src/base/platform/platform-freebsd.cc @@ -48,7 +48,10 @@ static unsigned StringToLong(char* buffe } std::vector OS::GetSharedLibraryAddresses() { - std::vector result; +#ifdef __DragonFly__ + return std::vector(); +#else + std::vector address_result; int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_VMMAP, getpid()}; size_t miblen = sizeof(mib) / sizeof(mib[0]); size_t buffer_size; @@ -81,7 +84,7 @@ std::vector OS } else { lib_name = std::string(path); } - result.push_back(SharedLibraryAddress( + address_result.push_back(SharedLibraryAddress( lib_name, reinterpret_cast(map->kve_start), reinterpret_cast(map->kve_end))); } @@ -90,7 +93,8 @@ std::vector OS } } } - return result; + return address_result; +#endif } void OS::SignalCodeMovingGC() {} [FILE:3678:patches/patch-deps_v8_src_base_platform_platform-posix.cc] --- deps/v8/src/base/platform/platform-posix.cc.orig 2024-01-22 12:13:22 UTC +++ deps/v8/src/base/platform/platform-posix.cc @@ -56,7 +56,9 @@ #include #include #else +# if !V8_OS_FREEBSD && !V8_OS_DRAGONFLYBSD #include +# endif #endif #if V8_OS_LINUX @@ -73,17 +75,10 @@ #include #endif -#if V8_OS_FREEBSD || V8_OS_DARWIN || V8_OS_OPENBSD || V8_OS_SOLARIS +#if V8_OS_FREEBSD || V8_OS_DARWIN || V8_OS_OPENBSD || V8_OS_SOLARIS || V8_OS_DRAGONFLYBSD #define MAP_ANONYMOUS MAP_ANON #endif -#if defined(V8_OS_SOLARIS) -#if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__) -extern "C" int madvise(caddr_t, size_t, int); -#else -extern int madvise(caddr_t, size_t, int); -#endif -#endif #ifndef MADV_FREE #define MADV_FREE MADV_DONTNEED @@ -135,7 +130,7 @@ int GetFlagsForMemoryPermission(OS::Memo int flags = MAP_ANONYMOUS; flags |= (page_type == PageType::kShared) ? MAP_SHARED : MAP_PRIVATE; if (access == OS::MemoryPermission::kNoAccess) { -#if !V8_OS_AIX && !V8_OS_FREEBSD && !V8_OS_QNX +#if !V8_OS_AIX && !V8_OS_FREEBSD && !V8_OS_QNX && !V8_OS_DRAGONFLYBSD flags |= MAP_NORESERVE; #endif // !V8_OS_AIX && !V8_OS_FREEBSD && !V8_OS_QNX #if V8_OS_QNX @@ -399,6 +394,13 @@ void* OS::GetRandomMmapAddr() { #endif #endif #endif +#if V8_OS_NETBSD + /* + * Avoid using a random hint, some low numbers cause spurious ENOMEM on netbsd + * (PR port-arm/55533) + */ + raw_addr = 0; +#endif return reinterpret_cast(raw_addr); } @@ -565,14 +567,11 @@ bool OS::DiscardSystemPages(void* addres // MADV_FREE_REUSABLE sometimes fails, so fall back to MADV_DONTNEED. ret = madvise(address, size, MADV_DONTNEED); } -#elif defined(_AIX) || defined(V8_OS_SOLARIS) - int ret = madvise(reinterpret_cast(address), size, MADV_FREE); +#elif defined(POSIX_MADV_DONTNEED) + int ret = posix_madvise(address, size, POSIX_MADV_DONTNEED); if (ret != 0 && errno == ENOSYS) { return true; // madvise is not available on all systems. } - if (ret != 0 && errno == EINVAL) { - ret = madvise(reinterpret_cast(address), size, MADV_DONTNEED); - } #else int ret = madvise(address, size, MADV_DONTNEED); #endif @@ -1091,7 +1090,11 @@ Thread::Thread(const Options& options) stack_size_(options.stack_size()), priority_(options.priority()), start_semaphore_(nullptr) { +#if V8_OS_NETBSD + const int min_stack_size = sysconf(_SC_THREAD_STACK_MIN); +#else const int min_stack_size = static_cast(PTHREAD_STACK_MIN); +#endif if (stack_size_ > 0) stack_size_ = std::max(stack_size_, min_stack_size); set_name(options.name()); } @@ -1106,7 +1109,7 @@ static void SetThreadName(const char* na pthread_set_name_np(pthread_self(), name); #elif V8_OS_NETBSD static_assert(Thread::kMaxThreadNameLength <= PTHREAD_MAX_NAMELEN_NP); - pthread_setname_np(pthread_self(), "%s", name); + pthread_setname_np(pthread_self(), "%s", (void *)name); #elif V8_OS_DARWIN // pthread_setname_np is only available in 10.6 or later, so test // for it at runtime. @@ -1282,6 +1285,7 @@ void Thread::SetThreadLocal(LocalStorage // support it. MacOS and FreeBSD are different here. #if !defined(V8_OS_FREEBSD) && !defined(V8_OS_DARWIN) && !defined(_AIX) && \ !defined(V8_OS_SOLARIS) +#if !defined(V8_OS_DRAGONFLYBSD) namespace { #if DEBUG @@ -1331,6 +1335,7 @@ Stack::StackSlot Stack::ObtainCurrentThr return stack_start; } +#endif // !defined(V8_OS_DRAGONFLYBSD) #endif // !defined(V8_OS_FREEBSD) && !defined(V8_OS_DARWIN) && // !defined(_AIX) && !defined(V8_OS_SOLARIS) [FILE:296:patches/patch-deps_v8_src_base_strings.h] --- deps/v8/src/base/strings.h.orig 2024-01-22 12:13:22 UTC +++ deps/v8/src/base/strings.h @@ -5,6 +5,7 @@ #ifndef V8_BASE_STRINGS_H_ #define V8_BASE_STRINGS_H_ +#include // for va_list #include "src/base/base-export.h" #include "src/base/macros.h" #include "src/base/vector.h" [FILE:598:patches/patch-deps_v8_src_base_utils_random-number-generator.cc] --- deps/v8/src/base/utils/random-number-generator.cc.orig 2024-01-22 12:13:22 UTC +++ deps/v8/src/base/utils/random-number-generator.cc @@ -56,7 +56,7 @@ RandomNumberGenerator::RandomNumberGener DCHECK_EQ(0, result); USE(result); SetSeed((static_cast(first_half) << 32) + second_half); -#elif V8_OS_DARWIN || V8_OS_FREEBSD || V8_OS_OPENBSD +#elif V8_OS_DARWIN || V8_OS_FREEBSD || V8_OS_OPENBSD || V8_OS_DRAGONFLYBSD // Despite its prefix suggests it is not RC4 algorithm anymore. // It always succeeds while having decent performance and // no file descriptor involved. [FILE:451:patches/patch-deps_v8_src_d8_d8-posix.cc] --- deps/v8/src/d8/d8-posix.cc.orig 2024-01-22 12:13:23 UTC +++ deps/v8/src/d8/d8-posix.cc @@ -339,7 +339,7 @@ static Local GetStdout(Isolate* i // See http://code.google.com/p/v8/issues/detail?id=401. #if defined(WNOWAIT) && !defined(ANDROID) && !defined(__APPLE__) && \ !defined(__NetBSD__) && !defined(__Fuchsia__) -#if !defined(__FreeBSD__) +#if !defined(__FreeBSD__) && !defined(__DragonFly__) #define HAS_WAITID 1 #endif #endif [FILE:484:patches/patch-deps_v8_src_libsampler_sampler.cc] --- deps/v8/src/libsampler/sampler.cc.orig 2024-01-22 12:13:23 UTC +++ deps/v8/src/libsampler/sampler.cc @@ -500,7 +500,7 @@ void SignalHandler::FillRegisterState(vo state->fp = reinterpret_cast(arm_thread_state64_get_fp(mcontext->__ss)); #endif // V8_HOST_ARCH_* -#elif V8_OS_FREEBSD +#elif V8_OS_FREEBSD || V8_OS_DRAGONFLYBSD #if V8_HOST_ARCH_IA32 state->pc = reinterpret_cast(mcontext.mc_eip); state->sp = reinterpret_cast(mcontext.mc_esp); [FILE:669:patches/patch-deps_v8_src_trap-handler_handler-inside-posix.cc] --- deps/v8/src/trap-handler/handler-inside-posix.cc.orig 2024-01-22 12:13:23 UTC +++ deps/v8/src/trap-handler/handler-inside-posix.cc @@ -27,7 +27,7 @@ #include -#if defined(V8_OS_LINUX) || defined(V8_OS_FREEBSD) +#if V8_OS_LINUX || V8_OS_FREEBSD || V8_OS_DRAGONFLYBSD #include #elif V8_OS_DARWIN #include @@ -59,6 +59,8 @@ namespace trap_handler { #define CONTEXT_REG(reg, REG) &uc->uc_mcontext->__ss.__##reg #elif V8_OS_FREEBSD #define CONTEXT_REG(reg, REG) &uc->uc_mcontext.mc_##reg +#elif V8_OS_DRAGONFLYBSD +#define CONTEXT_REG(reg, REG) &uc->uc_mcontext.mc_##reg #else #error "Unsupported platform." #endif [FILE:426:patches/patch-deps_v8_src_trap-handler_handler-inside-posix.h] --- deps/v8/src/trap-handler/handler-inside-posix.h.orig 2024-01-22 12:13:23 UTC +++ deps/v8/src/trap-handler/handler-inside-posix.h @@ -13,7 +13,7 @@ namespace v8 { namespace internal { namespace trap_handler { -#if V8_OS_LINUX || V8_OS_FREEBSD +#if defined(V8_OS_LINUX) || defined(V8_OS_FREEBSD) || defined(V8_OS_DRAGONFLYBSD) constexpr int kOobSignal = SIGSEGV; #elif V8_OS_DARWIN constexpr int kOobSignal = SIGBUS; [FILE:482:patches/patch-deps_v8_src_trap-handler_trap-handler.h] --- deps/v8/src/trap-handler/trap-handler.h.orig 2024-01-22 12:13:23 UTC +++ deps/v8/src/trap-handler/trap-handler.h @@ -20,6 +20,7 @@ namespace trap_handler { // X64 on Linux, Windows, MacOS, FreeBSD. #if V8_HOST_ARCH_X64 && V8_TARGET_ARCH_X64 && \ ((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_WIN || V8_OS_DARWIN || \ + V8_OS_DRAGONFLYBSD || \ V8_OS_FREEBSD) #define V8_TRAP_HANDLER_SUPPORTED true // Arm64 (non-simulator) on Mac and Linux. [FILE:216:patches/patch-node.gypi] --- node.gypi.orig 2024-01-22 12:13:24 UTC +++ node.gypi @@ -270,6 +270,7 @@ [ 'OS=="solaris"', { 'libraries': [ '-lkstat', + '-lsocket', '-lumem', ], 'defines!': [ [FILE:640:patches/patch-src_inspector__agent.cc] --- src/inspector_agent.cc.orig 2024-01-22 12:13:25 UTC +++ src/inspector_agent.cc @@ -96,7 +96,7 @@ static int StartDebugSignalHandler() { CHECK_EQ(0, uv_sem_init(&start_io_thread_semaphore, 0)); pthread_attr_t attr; CHECK_EQ(0, pthread_attr_init(&attr)); -#if defined(PTHREAD_STACK_MIN) && !defined(__FreeBSD__) +#if defined(PTHREAD_STACK_MIN) && !defined(__FreeBSD__) && !defined(__NetBSD__) // PTHREAD_STACK_MIN is 2 KiB with musl libc, which is too small to safely // receive signals. PTHREAD_STACK_MIN + MINSIGSTKSZ is 8 KiB on arm64, which // is the musl architecture with the biggest MINSIGSTKSZ so let's use that [FILE:600:patches/patch-src_node__postmortem__metadata.cc] --- src/node_postmortem_metadata.cc.orig 2024-01-22 12:13:25 UTC +++ src/node_postmortem_metadata.cc @@ -13,6 +13,10 @@ #define NODEDBG_OFFSET(Class, Member, Type) \ NODEDBG_SYMBOL(offset_ ## Class ## __ ## Member ## __ ## Type) +// Some systems provide macros for the types as well, which get expanded +// by the nested macros here. +#undef uintptr_t + // These are the constants describing Node internal structures. Every constant // should use the format described above. These constants are declared as // global integers so that they'll be present in the generated node binary. They [FILE:511:patches/patch-tools_gyp_pylib_gyp_generator_make.py] --- tools/gyp/pylib/gyp/generator/make.py.orig 2024-01-22 12:13:25 UTC +++ tools/gyp/pylib/gyp/generator/make.py @@ -2518,7 +2518,7 @@ def GenerateOutput(target_list, target_d "flock_index": 2, } ) - elif flavor == "freebsd": + elif flavor == "freebsd" or flavor == 'dragonflybsd' or flavor == 'netbsd': # Note: OpenBSD has sysutils/flock. lockf seems to be FreeBSD specific. header_params.update({"flock": "lockf"}) elif flavor == "openbsd": [FILE:980:patches/patch-tools_gyp_pylib_gyp_xcode__emulation.py] --- tools/gyp/pylib/gyp/xcode_emulation.py.orig 2024-01-22 12:13:25 UTC +++ tools/gyp/pylib/gyp/xcode_emulation.py @@ -607,7 +607,7 @@ class XcodeSettings: self._Appendf(cflags, "GCC_OPTIMIZATION_LEVEL", "-O%s", default="s") - if self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="YES"): + if self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="NO"): dbg_format = self._Settings().get("DEBUG_INFORMATION_FORMAT", "dwarf") if dbg_format == "dwarf": cflags.append("-gdwarf-2") @@ -1096,7 +1096,7 @@ class XcodeSettings: # For static libraries, no dSYMs are created. result = [] if ( - self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="YES") + self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="NO") and self._Test( "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym", default="dwarf" ) [FILE:424:patches/patch-tools_install.py] --- tools/install.py.orig 2024-01-22 12:13:26 UTC +++ tools/install.py @@ -181,7 +181,7 @@ def files(action): action(['deps/v8/tools/gdbinit'], 'share/doc/node/') action(['deps/v8/tools/lldb_commands.py'], 'share/doc/node/') - if 'freebsd' in sys.platform or 'openbsd' in sys.platform: + if 'skipme' in sys.platform: action(['doc/node.1'], 'man/man1/') else: action(['doc/node.1'], 'share/man/man1/')