91 lines
2.3 KiB
Python
91 lines
2.3 KiB
Python
from lib.make import *
|
|
from lib import cpp
|
|
|
|
|
|
version("26.13.1")
|
|
description("A free, open-source and cross-platform JavaScript runtime environment.")
|
|
maintainer("sisungo <[email protected]>")
|
|
source_url("https://nodejs.org/dist/v26.13.1/node-v26.13.1.tar.gz")
|
|
|
|
builddep("shortcut/c++")
|
|
builddep("pkgconf @target")
|
|
builddep("ninja @target")
|
|
builddep("libsqlite-dev @target")
|
|
builddep("libuv-dev @target")
|
|
builddep("libnghttp2-dev @target")
|
|
builddep("libz-dev @target")
|
|
builddep("libbrotli-dev @target")
|
|
builddep("libcares-dev @target")
|
|
builddep("libzstd-dev @target")
|
|
builddep("libicu4c-dev (~78) @target")
|
|
builddep("libngtcp2-dev @target")
|
|
builddep("libnghttp3-dev @target")
|
|
builddep("python (>=3.14.0, <=3.14.9999) @target")
|
|
builddep("linux-dev @target")
|
|
builddep("gnu-make")
|
|
builddep("gnu-sed")
|
|
builddep("grep")
|
|
|
|
|
|
def build():
|
|
if in_atomic():
|
|
with open(f"/lib/{current_target()}/libatomic.a", "wt+"):
|
|
pass
|
|
cpp.configure([
|
|
f"--prefix={get_prefix('node')}",
|
|
"--use_clang",
|
|
"--enable-lto",
|
|
"--openssl-use-def-ca-store",
|
|
"--openssl-system-ca-path", "/var/config/ssl/ca-certificates.crt",
|
|
"--shared-libuv",
|
|
"--shared-nghttp2",
|
|
"--shared-zlib",
|
|
"--shared-brotli",
|
|
"--shared-cares",
|
|
#"--shared-sqlite",
|
|
"--shared-zstd",
|
|
"--shared-ngtcp2",
|
|
"--shared-nghttp3",
|
|
#"--shared-openssl",
|
|
"--with-intl", "system-icu",
|
|
])
|
|
cpp.make()
|
|
cpp.make_install()
|
|
|
|
on_build(build)
|
|
|
|
|
|
def pack(composer):
|
|
composer.makedir("bin")
|
|
composer.add("bin/node")
|
|
|
|
def pack_npm(composer):
|
|
composer.add("lib")
|
|
composer.makedir("bin")
|
|
for i in ["npm", "npx"]:
|
|
with open(f"bin/{i}") as fd:
|
|
file = fd.read()
|
|
file = file.replace("#!/usr/bin/env node", "#!/bin/node")
|
|
with open(f"bin/{i}", "wt") as fd:
|
|
fd.write(file)
|
|
composer.add(f"bin/{i}")
|
|
|
|
package("node")
|
|
dep("semi-libc @same-arch")
|
|
dep("libcxx @same-arch")
|
|
dep("libz @same-arch")
|
|
dep("libuv @same-arch")
|
|
dep("libbrotli @same-arch")
|
|
dep("libcares @same-arch")
|
|
dep("libnghttp2 @same-arch")
|
|
dep("libnghttp3 @same-arch")
|
|
dep("libngtcp2 @same-arch")
|
|
dep("libzstd @same-arch")
|
|
dep("libicu4c (~78) @same-arch")
|
|
on_pack(pack)
|
|
|
|
package("npm")
|
|
dep("node")
|
|
arch_any()
|
|
on_pack(pack_npm)
|