From 4838b93927599503214eabcae091a14b34592cdc Mon Sep 17 00:00:00 2001 From: star9029 Date: Thu, 27 Jul 2023 08:42:54 +0800 Subject: [PATCH] osmanip: add package (#2363) * osmanip: add package * osmanip: use latest version * osmanip: disable test --- packages/o/osmanip/xmake.lua | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 packages/o/osmanip/xmake.lua diff --git a/packages/o/osmanip/xmake.lua b/packages/o/osmanip/xmake.lua new file mode 100644 index 000000000..4bd4dbeaa --- /dev/null +++ b/packages/o/osmanip/xmake.lua @@ -0,0 +1,34 @@ +package("osmanip") + set_homepage("https://github.com/JustWhit3/osmanip") + set_description("A cross-platform library for output stream manipulation using ANSI escape sequences.") + set_license("MIT") + + add_urls("https://github.com/JustWhit3/osmanip/archive/refs/tags/$(version).tar.gz", + "https://github.com/JustWhit3/osmanip.git") + add_versions("v4.6.1", "5454cb0caced1fb9af90666001f2874786a33e6830024cb41c99a5b4ab966f1c") + + add_configs("shared", {description = "Build shared binaries.", default = false, type = "boolean", readonly = true}) + + if is_plat("linux") then + add_syslinks("pthread") + end + + add_deps("cmake") + + on_install(function (package) + local configs = {"-DOSMANIP_TESTS=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")) + io.replace("CMakeLists.txt", "add_subdirectory( deps )", "", {plain = true}) + io.replace("CMakeLists.txt", "add_subdirectory( examples )", "", {plain = true}) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + osm::OPTION(osm::CURSOR::OFF); + } + ]]}, {configs = {languages = "c++17"}})) + end)