add cereal, libunistring, cmocka (#191)

* fix yaml-cpp msvc runtime

* update libiconv

* add cereal

* add libunistring

* add cmocka
pull/193/head
Hoildkv 4 years ago committed by GitHub
parent fcf6b12aa8
commit 568a0f57c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      packages/c/cereal/xmake.lua
  2. 19
      packages/c/cmocka/xmake.lua
  3. 10
      packages/l/libiconv/xmake.lua
  4. 26
      packages/l/libunistring/xmake.lua
  5. 2
      packages/y/yaml-cpp/xmake.lua

@ -0,0 +1,22 @@
package("cereal")
set_homepage("https://uscilab.github.io/cereal/index.html")
set_description("cereal is a header-only C++11 serialization library.")
set_license("BSD-3-Clause")
add_urls("https://github.com/USCiLab/cereal/archive/v$(version).tar.gz")
add_versions("1.3.0", "329ea3e3130b026c03a4acc50e168e7daff4e6e661bc6a7dfec0d77b570851d5")
on_install(function (package)
os.cp("include", package:installdir())
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <fstream>
void test() {
std::ofstream os("out.cereal", std::ios::binary);
cereal::BinaryOutputArchive archive( os );
}
]]}, {configs = {languages = "c++11"}, includes = "cereal/archives/binary.hpp"}))
end)

@ -0,0 +1,19 @@
package("cmocka")
set_homepage("https://cmocka.org/")
set_description("cmocka is an elegant unit testing framework for C with support for mock objects.")
set_license("Apache-2.0")
add_urls("https://cmocka.org/files/$(version).tar.xz", {version = function (version) return table.concat(table.slice(version:split('%.'), 1, 2), '.') .. "/cmocka-" .. version end})
add_versions("1.1.5", "f0ccd8242d55e2fd74b16ba518359151f6f8383ff8aef4976e48393f77bba8b6")
add_deps("cmake")
on_install("windows", "linux", "macosx", "mingw", function (package)
local configs = {"-DUNIT_TESTING=OFF", "-DWITH_EXAMPLES=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs("cmocka_set_test_filter", {includes = {"stdarg.h", "stddef.h", "setjmp.h", "stdint.h", "cmocka.h"}}))
end)

@ -5,6 +5,7 @@ package("libiconv")
set_urls("https://ftp.gnu.org/gnu/libiconv/libiconv-$(version).tar.gz",
"https://ftpmirror.gnu.org/libiconv/libiconv-$(version).tar.gz")
add_versions("1.16", "e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04")
add_versions("1.15", "ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178")
if is_plat("macosx") then
@ -17,12 +18,19 @@ package("libiconv")
end)
on_install("macosx", "linux", function (package)
local configs = {"--enable-static", "--enable-shared=no", "--disable-dependency-tracking", "--enable-extra-encodings"}
local configs = {"--disable-dependency-tracking", "--enable-extra-encodings"}
if package:debug() then
table.insert(configs, "--enable-debug")
else
table.insert(configs, "--disable-debug")
end
if package:config("shared") then
table.insert(configs, "--enable-shared=yes")
table.insert(configs, "--enable-static=no")
else
table.insert(configs, "--enable-static=yes")
table.insert(configs, "--enable-shared=no")
end
os.vrunv("make", {"-f", "Makefile.devel", "CFLAGS=" .. (package:config("cflags") or "")})
import("package.tools.autoconf").install(package, configs)
end)

@ -0,0 +1,26 @@
package("libunistring")
set_homepage("https://www.gnu.org/software/libunistring/")
set_description("This library provides functions for manipulating Unicode strings and for manipulating C strings according to the Unicode standard.")
set_license("GPL-3.0")
add_urls("https://ftp.gnu.org/gnu/libunistring/libunistring-$(version).tar.gz")
add_versions("0.9.10", "a82e5b333339a88ea4608e4635479a1cfb2e01aafb925e1290b65710d43f610b")
add_deps("libiconv")
on_install("linux", "macosx", function (package)
local configs = {"--disable-dependency-tracking", "--with-pic"}
if package:config("shared") then
table.insert(configs, "--enable-shared=yes")
table.insert(configs, "--enable-static=no")
else
table.insert(configs, "--enable-static=yes")
table.insert(configs, "--enable-shared=no")
end
import("package.tools.autoconf").install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs("u8_check", {includes = "unistr.h"}))
end)

@ -12,7 +12,7 @@ package("yaml-cpp")
local configs = {"-DYAML_CPP_BUILD_TESTS=OFF"}
table.insert(configs, "-DYAML_BUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
if package:is_plat("windows") then
table.insert(configs, "-DYAML_MSVC_SHARED_RT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
table.insert(configs, "-DYAML_MSVC_SHARED_RT=" .. (package:config("vs_runtime"):startswith("MT") and "OFF" or "ON"))
end
import("package.tools.cmake").install(package, configs, {buildir = os.tmpfile() .. ".dir"})
package:addenv("PATH", "bin")

Loading…
Cancel
Save