add log4cplus & libarchive (#315)
* add log4cplus * add libarchive * update libuv and protobuf-cpp * compatibility fix * fix incorrect libuv sha256pull/316/head
parent
f561100038
commit
9742532a0a
7 changed files with 71 additions and 3 deletions
@ -0,0 +1,21 @@ |
||||
package("libarchive") |
||||
|
||||
set_homepage("https://libarchive.org/") |
||||
set_description("Multi-format archive and compression library") |
||||
set_license("BSD-2-Clause") |
||||
|
||||
add_urls("https://libarchive.org/downloads/libarchive-$(version).tar.gz") |
||||
add_versions("3.5.1", "9015d109ec00bb9ae1a384b172bf2fc1dff41e2c66e5a9eeddf933af9db37f5a") |
||||
|
||||
add_deps("cmake") |
||||
add_deps("zlib", "bzip2", "lz4") |
||||
on_install("windows", "linux", "macosx", function (package) |
||||
local configs = {"-DENABLE_TEST=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")) |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("archive_version_number", {includes = "archive.h"})) |
||||
end) |
@ -0,0 +1,43 @@ |
||||
package("log4cplus") |
||||
|
||||
set_homepage("https://sourceforge.net/projects/log4cplus/") |
||||
set_description("log4cplus is a simple to use C++ logging API providing thread-safe, flexible, and arbitrarily granular control over log management and configuration.") |
||||
set_license("BSD-2-Clause") |
||||
|
||||
add_urls("https://github.com/log4cplus/log4cplus/releases/download/REL_$(version).tar.gz", {version = function (version) return version:gsub("%.", "_") .. "/log4cplus-" .. version end}) |
||||
add_versions("2.0.6", "5fb26433b0f200ebfc2e6effb7e2e5131185862a2ea9a621a8e7f3f725a72b08") |
||||
|
||||
add_configs("unicode", {description = "Use unicode charset.", default = true, type = "boolean"}) |
||||
|
||||
add_deps("cmake", {kind = "binary"}) |
||||
if is_plat("windows") then |
||||
add_syslinks("advapi32", "ws2_32") |
||||
elseif is_plat("linux") then |
||||
add_syslinks("pthread") |
||||
end |
||||
|
||||
on_load("windows", "linux", "macosx", function (package) |
||||
if package:config("unicode") then |
||||
package:add("defines", "UNICODE") |
||||
end |
||||
end) |
||||
|
||||
on_install("windows", "linux", "macosx", function (package) |
||||
local configs = {"-DLOG4CPLUS_BUILD_TESTING=OFF"} |
||||
table.insert(configs, "-DUNICODE=" .. (package:config("unicode") and "ON" or "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")) |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
void test() { |
||||
log4cplus::Initializer initializer; |
||||
log4cplus::BasicConfigurator config; |
||||
config.configure(); |
||||
log4cplus::Logger logger = log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("main")); |
||||
LOG4CPLUS_WARN(logger, LOG4CPLUS_TEXT("Hello, World!")); |
||||
} |
||||
]]}, {configs = {languages = "c++17"}, includes = "log4cplus/log4cplus.h"})) |
||||
end) |
Loading…
Reference in new issue