xmake.lua 1.1 KB

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