From e2892d337a6633e02818bd497b4db94027ce3973 Mon Sep 17 00:00:00 2001 From: star9029 Date: Sun, 2 Feb 2025 23:07:48 +0800 Subject: [PATCH] Update xmake.lua --- packages/l/libfswatch/xmake.lua | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/l/libfswatch/xmake.lua b/packages/l/libfswatch/xmake.lua index 56e25cdb787..b282799c95d 100644 --- a/packages/l/libfswatch/xmake.lua +++ b/packages/l/libfswatch/xmake.lua @@ -5,6 +5,7 @@ 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") @@ -16,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)