浏览代码

add log4cplus & libarchive (#315)

* add log4cplus

* add libarchive

* update libuv and protobuf-cpp

* compatibility fix

* fix incorrect libuv sha256
Hoildkv 4 年之前
父节点
当前提交
9742532a0a

+ 1 - 1
packages/i/icu4c/xmake.lua

@@ -56,7 +56,7 @@ package("icu4c")
         end
 
         local envs = {}
-        if package:is_plat("linux") and not package:config("shared") then
+        if package:is_plat("linux") and package:config("pic") ~= false then
             envs = autoconf.buildenvs(package, {cxflags = "-fPIC"})
         else
             envs = autoconf.buildenvs(package)

+ 21 - 0
packages/l/libarchive/xmake.lua

@@ -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)

+ 1 - 1
packages/l/libuv/xmake.lua

@@ -5,7 +5,7 @@ package("libuv")
 
     set_urls("https://github.com/libuv/libuv/archive/$(version).zip",
              "https://github.com/libuv/libuv.git")
-
+    add_versions("v1.41.0", "cb89a8b9f686c5ccf7ed09a9e0ece151a73ebebc17af3813159c335b02181794")
     add_versions("v1.40.0", "61366e30d8484197dc9e4a94dbd98a0ba52fb55cb6c6d991af1f3701b10f322b")
     add_versions("v1.28.0", "e7b3caea3388a02f2f99e61f9a71ed3e3cbb88bbb4b0b630d609544099b40674")
     add_versions("v1.27.0", "02d4a643d5de555168f2377961aff844c3037b44c9d46eb2019113af62b3cf0a")

+ 43 - 0
packages/l/log4cplus/xmake.lua

@@ -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)

+ 3 - 0
packages/l/lz4/xmake.lua

@@ -22,6 +22,9 @@ package("lz4")
         if package:config("shared") then
             configs.kind = "shared"
         end
+        if package:is_plat("linux") and package:config("pic") ~= false then
+            configs.cxflags = "-fPIC"
+        end
         import("package.tools.xmake").install(package, configs)
     end)
 

+ 1 - 1
packages/m/mpfr/xmake.lua

@@ -18,7 +18,7 @@ package("mpfr")
             table.insert(configs, "--enable-static=yes")
             table.insert(configs, "--enable-shared=no")
         end
-        if package:config("pic") then
+        if package:config("pic") ~= false then
             table.insert(configs, "--with-pic")
         end
         import("package.tools.autoconf").install(package, configs)

+ 1 - 0
packages/p/protobuf-cpp/xmake.lua

@@ -8,6 +8,7 @@ package("protobuf-cpp")
     add_versions("3.12.3", "74da289e0d0c24b2cb097f30fdc09fa30754175fd5ebb34fae4032c6d95d4ce3")
     add_versions("3.13.0", "f7b99f47822b0363175a6751ab59ccaa4ee980bf1198f11a4c3cef162698dde3")
     add_versions("3.14.0", "87d6e96166cf5cafc16f2bcfa91c0b54f48bab38538285bee1b9331d992569fa")
+    add_versions("3.15.5", "cdd7d3925240af541a95a4361ab100b703bee3a9df0d7e9e05c069cf2c76a039")
 
     if is_plat("windows") then
         add_deps("cmake")