-
Hi, I would like to make a package for nodejs, but I can't get it to work package("node")
set_homepage("https://github.com/nodejs/node.git")
set_description("nodejs")
add_urls("https://github.com/nodejs/node.git")
add_versions("21.6.2", "3eccdd1ae61777a381a7ac3bc0ea62443dbb50b8")
if is_plat("windows") then
add_syslinks("winmm", "dbghelp", "ole32", "iphlpapi", "psapi", "shell32", "userenv", "uuid", "ws2_32", "gdi32", "advapi32", "crypt32", "user32")
end
on_install("linux", "windows", function (package)
import("core.base.global")
import("package.tools.msbuild")
local build = package:debug() and "debug" or "release"
if package:is_plat("windows") then
local vc_configs = { "nobuild" }
table.insert(vc_configs, package:is_arch("x86") and "x86" or "x64")
table.insert(vc_configs, package:config("shared") and "dll" or "static")
table.insert(vc_configs, package:debug() and "debug" or "release")
table.insert(vc_configs, "no-cctest")
table.insert(vc_configs, "openssl-no-asm")
os.vrunv("vcbuild.bat", vc_configs, { })
local msbn_configs = { "node.sln" }
table.insert(msbn_configs, "/t:node")
table.insert(msbn_configs, "/m:2")
table.insert(msbn_configs, "/p:Configuration=" .. (package:debug() and "Debug" or "Release"))
table.insert(msbn_configs, "/p:Platform=" .. (package:is_arch("x64") and "x64" or "Win32"))
table.insert(msbn_configs, "/clp:NoItemAndPropertyList;Verbosity=minimal")
table.insert(msbn_configs, "/nologo")
table.insert(msbn_configs, "/p:UseMultiToolTask=True")
table.insert(msbn_configs, "/p:EnforceProcessCountAcrossBuilds=True")
table.insert(msbn_configs, "/p:MultiProcMaxCount=16")
import("package.tools.msbuild").build(package, msbn_configs)
end
os.trycp(path.join("out/", build, "*.dll"), package:installdir("dll"))
os.trycp(path.join("out/", build, "lib/*.a"), package:installdir("lib"))
os.trycp(path.join("out/", build, "lib/*.lib"), package:installdir("lib"))
os.cp("src/.", package:installdir("include"))
os.cp("deps/uv/include/.", package:installdir("include"))
os.cp("deps/openssl/openssl/include/.", package:installdir("include"))
os.cp("deps/v8/include/.", package:installdir("include"))
os.cp("deps/zlib/.", package:installdir("include"))
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
void test() {
node::MultiIsolatePlatform::MultiIsolatePlatform::Create(4);
}
]]}, {configs = {languages = "c++20"}, includes = "node.h"}))
end) Error says:
Also, this error happens too if it's being built with NASM enabled (openssl-no-asm arg removed):
|
Beta Was this translation helpful? Give feedback.
Answered by
Lyuu17
Feb 29, 2024
Replies: 1 comment
-
nevermind, it seems it needed the "node_snapshot.cc", which was generated during the building within the node project (exe) so I made a xmake target with it |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Lyuu17
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nevermind, it seems it needed the "node_snapshot.cc", which was generated during the building within the node project (exe) so I made a xmake target with it