* add handy

* fix archlinux

* limit platforms
pull/1608/head
ruki 2 years ago committed by GitHub
parent 20d29bbc3c
commit 4b194ee9e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .github/workflows/archlinux.yml
  2. 38
      packages/h/handy/xmake.lua

@ -21,6 +21,7 @@ jobs:
steps:
- name: Installation
run: |
pacman -Syu --noconfirm --needed openssl
pacman -Sy --noconfirm --needed glibc git base-devel perl make unzip
pacman -Sy --noconfirm --needed mesa gcc-fortran glu
git config --global --add safe.directory /__w/xmake/xmake

@ -0,0 +1,38 @@
package("handy")
set_homepage("https://github.com/yedf2/handy")
set_description("A simple C++11 network server framework")
add_urls("https://github.com/yedf2/handy/archive/refs/tags/$(version).tar.gz",
"https://github.com/yedf2/handy.git")
add_versions("0.2.0", "831d9e7cdf94d19fbc8438e75dc6c63fa75777ff2f83ac48df981c22e924a2d1")
add_deps("cmake")
if is_plat("linux") then
add_syslinks("pthread")
end
on_install("linux", "macosx", "iphoneos", function (package)
local configs = {}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_HANDY_SHARED_LIBRARY=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DBUILD_HANDY_STATIC_LIBRARY=" .. (package:config("shared") and "OFF" or "ON"))
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <handy/handy.h>
using namespace handy;
void test() {
EventBase base;
Signal::signal(SIGINT, [&]{ base.exit(); });
TcpServerPtr svr = TcpServer::startServer(&base, "", 2099);
exitif(svr == NULL, "start tcp server failed");
svr->onConnRead([](const TcpConnPtr& con) {
con->send(con->getInput());
});
base.loop();
}
]]}, {configs = {languages = "c++11"}}))
end)
Loading…
Cancel
Save