Browse Source

Auto-update libfswatch to 1.18.2 (#6268)

* Update libfswatch to 1.18.2

* Update xmake.lua

---------

Co-authored-by: star9029 <[email protected]>
ruki 6 tháng trước cách đây
mục cha
commit
47b0a321b3
1 tập tin đã thay đổi với 17 bổ sung3 xóa
  1. 17 3
      packages/l/libfswatch/xmake.lua

+ 17 - 3
packages/l/libfswatch/xmake.lua

@@ -5,6 +5,8 @@ package("libfswatch")
 
     add_urls("https://github.com/emcrisostomo/fswatch/archive/refs/tags/$(version).tar.gz",
              "https://github.com/emcrisostomo/fswatch.git")
+
+    add_versions("1.18.2", "698f21fe5489311dabe9e90463fb9d40796780abac8d207b857e86ade7345d86")
     add_versions("1.17.1", "bd492b6e203b10b30857778f4dd26f688426cd352937bd7779ee245139bafa2b")
 
     add_deps("cmake")
@@ -15,12 +17,24 @@ package("libfswatch")
         add_syslinks("pthread", "dl")
     end
 
+    if on_check then
+        on_check(function (package)
+            if package:version() and package:version():eq("1.18.2") then
+                if package:is_plat("bsd") then
+                    -- libfswatch/src/libfswatch/c++/kqueue_monitor.cpp:134:29: error: unknown type name '__darwin_time_t'; did you mean '__sbintime_t'
+                    raise("package(libfswatch 1.18.2) unsupported current platform")
+                end
+            end
+        end)
+    end
+
     on_install("linux", "bsd", "macosx", function (package)
-        local configs = {"-DUSE_NLS=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"))
         io.replace("CMakeLists.txt", "add_subdirectory(test/src)", "", {plain = true})
         io.replace("CMakeLists.txt", "add_subdirectory(fswatch/src)", "", {plain = true})
+
+        local configs = {"-DUSE_NLS=OFF"}
+        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"))
         import("package.tools.cmake").install(package, configs)
     end)