xmake.lua 1.3 KB

1234567891011121314151617181920212223242526
  1. package("epoll-shim")
  2. set_homepage("https://github.com/jiixyj/epoll-shim")
  3. set_description("small epoll implementation using kqueue; includes all features needed for libinput/libevdev")
  4. set_license("MIT")
  5. add_urls("https://github.com/jiixyj/epoll-shim/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/jiixyj/epoll-shim.git")
  7. add_versions("v0.0.20240608", "8f5125217e4a0eeb96ab01f9dfd56c38f85ac3e8f26ef2578e538e72e87862cb")
  8. add_deps("cmake")
  9. on_install("bsd", "macosx", function (package)
  10. io.replace("CMakeLists.txt", [[set(CMAKE_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/libepoll-shim")]], "", {plain = true})
  11. local configs = {}
  12. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  13. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  14. import("package.tools.cmake").install(package, configs)
  15. end)
  16. on_test(function (package)
  17. assert(package:has_cfuncs("epoll_create", {includes = "sys/epoll.h"}))
  18. assert(package:has_cfuncs("eventfd", {includes = "sys/eventfd.h"}))
  19. assert(package:has_cfuncs("signalfd", {includes = "sys/signalfd.h"}))
  20. assert(package:has_cfuncs("timerfd_create", {includes = "sys/timerfd.h"}))
  21. end)