libevent: remove limit plat (#4971)

* libevent: remove limit plat

* limit plat
pull/4974/head
star9029 3 months ago committed by GitHub
parent c07fe14c70
commit f3c42b185c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 24
      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"))

Loading…
Cancel
Save