Browse Source

libevent: remove limit plat (#4971)

* libevent: remove limit plat

* limit plat
star9029 1 year ago
parent
commit
f3c42b185c
1 changed files with 14 additions and 10 deletions
  1. 14 10
      packages/l/libevent/xmake.lua

+ 14 - 10
packages/l/libevent/xmake.lua

@@ -1,22 +1,22 @@
 package("libevent")
-
     set_homepage("https://libevent.org/")
-    set_description("libevent – an event notification library")
+    set_description("Event notification library")
     set_license("BSD-3-Clause")
 
-    add_urls("https://github.com/libevent/libevent/releases/download/release-$(version)-stable/libevent-$(version)-stable.tar.gz")
-    add_urls("https://github.com/libevent/libevent.git")
+    add_urls("https://github.com/libevent/libevent/releases/download/release-$(version)-stable/libevent-$(version)-stable.tar.gz",
+             "https://github.com/libevent/libevent.git")
+
     add_versions("2.1.12", "92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb")
 
     add_configs("openssl", {description = "Build with OpenSSL library.", default = false, type = "boolean"})
     add_configs("mbedtls", {description = "Build with mbedtls library.", default = false, type = "boolean"})
 
-    add_deps("cmake")
-
-    if is_plat("windows") then
+    if is_plat("windows", "mingw") then
         add_syslinks("ws2_32", "advapi32", "iphlpapi")
     end
 
+    add_deps("cmake")
+
     on_load(function (package)
         if package:config("openssl") then
             package:add("deps", "openssl3")
@@ -26,9 +26,9 @@ package("libevent")
         end
     end)
 
-    on_install("windows", "linux", "macosx", function (package)
+    on_install("!android and (!mingw or mingw|!i386)", function (package)
         io.replace("CMakeLists.txt", "advapi32", "advapi32 crypt32", {plain = true})
-        if package:version():eq("2.1.12") then
+        if package:gitref() or package:version():eq("2.1.12") then
             io.replace("cmake/LibeventConfig.cmake.in",
                 'get_filename_component(_INSTALL_PREFIX "${LIBEVENT_CMAKE_DIR}/../../.." ABSOLUTE)',
                 'get_filename_component(_INSTALL_PREFIX "${LIBEVENT_CMAKE_DIR}/../.." ABSOLUTE)',
@@ -36,7 +36,11 @@ package("libevent")
             io.replace("cmake/LibeventConfig.cmake.in", "NO_DEFAULT_PATH)", ")", {plain = true})
         end
 
-        local configs = {"-DEVENT__DISABLE_TESTS=ON", "-DEVENT__DISABLE_REGRESS=ON", "-DEVENT__DISABLE_SAMPLES=ON"}
+        local configs = {
+            "-DEVENT__DISABLE_TESTS=ON",
+            "-DEVENT__DISABLE_REGRESS=ON",
+            "-DEVENT__DISABLE_SAMPLES=ON",
+        }
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
         table.insert(configs, "-DEVENT__LIBRARY_TYPE=" .. (package:config("shared") and "SHARED" or "STATIC"))
         table.insert(configs, "-DEVENT__DISABLE_OPENSSL=" .. (package:config("openssl") and "OFF" or "ON"))