瀏覽代碼

add node_api_headers package (#4634)

* add node_api_headers package

* improve node-api-headers test

* fix attempt node-api-headers test

* Update xmake.lua

---------

Co-authored-by: ruki <[email protected]>
Enzo Einhorn 1 年之前
父節點
當前提交
41fe34936a
共有 1 個文件被更改,包括 17 次插入0 次删除
  1. 17 0
      packages/n/node-api-headers/xmake.lua

+ 17 - 0
packages/n/node-api-headers/xmake.lua

@@ -0,0 +1,17 @@
+package("node-api-headers")
+    set_kind("library", {headeronly = true})
+    set_homepage("https://github.com/nodejs/node-api-headers")
+    set_description("C-based Node-API headers")
+    set_license("MIT")
+
+    set_urls("https://github.com/nodejs/node-api-headers/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/nodejs/node-api-headers.git")
+    add_versions("v1.1.0", "70608bc1e6dddce280285f3462f18a106f687c0720a4b90893e1ecd86e5a8bbf")
+
+    on_install(function(package)
+        os.cp("include/*.h", package:installdir("include"))
+    end)
+
+    on_test(function (package)
+        assert(package:has_cfuncs("napi_async_init", {includes = "node_api.h"}))
+    end)