xmake.lua 1.1 KB

123456789101112131415161718192021222324252627
  1. package("libnet")
  2. set_homepage("https://codedocs.xyz/libnet/libnet/")
  3. set_description("A portable framework for low-level network packet construction")
  4. add_urls("https://github.com/libnet/libnet/releases/download/$(version).tar.gz", {version = function (version)
  5. return version .. "/libnet-" .. (version:gsub("v", ""))
  6. end})
  7. add_urls("https://github.com/libnet/libnet.git")
  8. add_versions("v1.3", "ad1e2dd9b500c58ee462acd839d0a0ea9a2b9248a1287840bc601e774fb6b28f")
  9. on_load(function (package)
  10. if package:gitref() then
  11. package:add("deps", "automake", "autoconf", "libtool")
  12. end
  13. end)
  14. on_install("linux", "macosx", "bsd", function (package)
  15. local configs = {}
  16. table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
  17. table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
  18. import("package.tools.autoconf").install(package, configs)
  19. end)
  20. on_test(function (package)
  21. assert(package:has_cfuncs("libnet_init", {includes = "libnet.h"}))
  22. end)