add cereal, libunistring, cmocka (#191)
* fix yaml-cpp msvc runtime * update libiconv * add cereal * add libunistring * add cmockapull/193/head
parent
fcf6b12aa8
commit
568a0f57c5
5 changed files with 77 additions and 2 deletions
@ -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) |
@ -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) |
Loading…
Reference in new issue