|
@@ -5,29 +5,42 @@ package("uvwasi")
|
|
|
|
|
|
add_urls("https://github.com/nodejs/uvwasi/archive/refs/tags/$(version).tar.gz",
|
|
|
"https://github.com/nodejs/uvwasi.git")
|
|
|
+
|
|
|
+ add_versions("v0.0.20", "417e5ecc40005d9c8008bad2b6a2034e109b2a0a1ebd108b231cb419cfbb980a")
|
|
|
add_versions("v0.0.12", "f310a628d2657b9ed523a19284f58e4a407466f2e17efb2250d2e58524d02c53")
|
|
|
|
|
|
+ add_patches("v0.0.20", path.join(os.scriptdir(), "patches", "0.0.20", "cmake.patch"), "50d70983aa498e63e02e66d71e3c7c78ed1c802c61063d1b085e8a12abbcf751")
|
|
|
+
|
|
|
+ add_includedirs("include", "include/uvwasi")
|
|
|
+
|
|
|
add_deps("cmake", "libuv")
|
|
|
|
|
|
on_install("linux", "windows", "macosx", function (package)
|
|
|
- local configs = {"-DWITH_SYSTEM_LIBUV=ON", "-DUVWASI_BUILD_TESTS=OFF"}
|
|
|
- table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
|
|
|
- table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
|
|
|
- if package:config("shared") then
|
|
|
- io.replace("CMakeLists.txt", "-fvisibility=hidden", "", {plain = true})
|
|
|
- end
|
|
|
- if package:is_plat("windows") then
|
|
|
- table.insert(configs, "-DLIBUV_LIBRARIES=uv_a.lib")
|
|
|
- end
|
|
|
- import("package.tools.cmake").install(package, configs, {buildir = "build", packagedeps = "libuv"})
|
|
|
- os.cp("include", package:installdir())
|
|
|
- if package:config("shared") then
|
|
|
- os.trycp("build/*.dll", package:installdir("bin"))
|
|
|
- os.trycp("build/*.so", package:installdir("lib"))
|
|
|
- os.trycp("build/*.dylib", package:installdir("lib"))
|
|
|
+ local configs = {"-DUVWASI_BUILD_TESTS=OFF"}
|
|
|
+ if package:version():ge("0.0.20") then
|
|
|
+ table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
|
|
|
+ table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
|
|
|
+ if package:is_plat("windows") and package:config("shared") then
|
|
|
+ table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON")
|
|
|
+ end
|
|
|
+ import("package.tools.cmake").install(package, configs, {packagedeps = "libuv"})
|
|
|
else
|
|
|
- os.trycp("build/*.a", package:installdir("lib"))
|
|
|
- os.trycp("build/*.lib", package:installdir("lib"))
|
|
|
+ table.insert(configs, "-DWITH_SYSTEM_LIBUV=ON")
|
|
|
+ table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
|
|
|
+ table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
|
|
|
+ if package:config("shared") then
|
|
|
+ io.replace("CMakeLists.txt", "-fvisibility=hidden", "", {plain = true})
|
|
|
+ end
|
|
|
+ import("package.tools.cmake").install(package, configs, {packagedeps = "libuv"})
|
|
|
+ os.cp("include", package:installdir())
|
|
|
+ if package:config("shared") then
|
|
|
+ os.trycp("build/*.dll", package:installdir("bin"))
|
|
|
+ os.trycp("build/*.so", package:installdir("lib"))
|
|
|
+ os.trycp("build/*.dylib", package:installdir("lib"))
|
|
|
+ else
|
|
|
+ os.trycp("build/*.a", package:installdir("lib"))
|
|
|
+ os.trycp("build/*.lib", package:installdir("lib"))
|
|
|
+ end
|
|
|
end
|
|
|
end)
|
|
|
|