template.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. pkgname = "nodejs"
  2. pkgver = "18.15.0"
  3. pkgrel = 0
  4. build_style = "configure"
  5. configure_args = [
  6. "--shared-zlib", "--shared-openssl", "--shared-libuv", "--shared-nghttp2",
  7. "--shared-cares", "--shared-brotli", "--with-intl=system-icu",
  8. "--openssl-use-def-ca-store", "--ninja", "--prefix=/usr",
  9. ]
  10. make_cmd = "gmake"
  11. make_check_target = "test-only"
  12. hostmakedepends = [
  13. "pkgconf", "ninja", "python", "gmake", "python-jinja2",
  14. ]
  15. makedepends = [
  16. "zlib-devel", "icu-devel", "openssl-devel", "libuv-devel",
  17. "nghttp2-devel", "c-ares-devel", "brotli-devel", "linux-headers",
  18. ]
  19. checkdepends = ["procps", "iana-etc"]
  20. pkgdesc = "JavaScript runtime based on V8"
  21. maintainer = "q66 <q66@chimera-linux.org>"
  22. license = "MIT"
  23. url = "https://nodejs.org"
  24. source = f"{url}/dist/v{pkgver}/node-v{pkgver}.tar.gz"
  25. sha256 = "d65c4c3ef3c8815bccda9502081a29458c7c80797db0763f8752f270a824ac2b"
  26. debug_level = 1 # allow LTO build to not run out of mem
  27. hardening = ["!cfi"] # TODO
  28. options = ["!cross"]
  29. match self.profile().arch:
  30. case "ppc64le" | "ppc64" | "riscv64":
  31. # trap in add_label_offset() in assembler-ppc.cc
  32. # also crashes on riscv64
  33. hardening += ["!int"]
  34. def post_extract(self):
  35. self.mv("deps/openssl/nodejs-openssl.cnf", ".")
  36. for f in [
  37. "deps/brotli", "deps/cares", "deps/openssl", "deps/zlib",
  38. "deps/v8/third_party/jinja2", "tools/inspector_protocol/jinja2",
  39. ]:
  40. self.rm(f, recursive = True)
  41. self.mkdir("deps/openssl")
  42. self.mv("nodejs-openssl.cnf", "deps/openssl")
  43. def post_install(self):
  44. self.install_license("LICENSE")
  45. # real test suite requires network acccess
  46. def do_check(self):
  47. npath = self.chroot_cwd / "out/Release"
  48. nexe = npath / "node"
  49. self.do(nexe, "-e", "console.log('test')", wrksrc = "out/Release")
  50. self.do(
  51. nexe, "-e",
  52. f"require('assert').equal(process.versions.node, '{pkgver}')",
  53. wrksrc = "out/Release"
  54. )
  55. @subpackage("nodejs-devel")
  56. def _devel(self):
  57. return self.default_devel()