xmake.lua 1.2 KB

1234567891011121314151617181920212223242526272829
  1. package("npcap_sdk")
  2. set_homepage("https://npcap.com/")
  3. set_description("Npcap is the Nmap Project's packet capture (and sending) library for Microsoft Windows.")
  4. set_urls("https://npcap.com/dist/npcap-sdk-$(version).zip")
  5. add_versions("1.13", "dad1f2bf1b02b787be08ca4862f99e39a876c1f274bac4ac0cedc9bbc58f94fd")
  6. add_versions("1.12", "24c4862723f61d28048a24e10eb31d2269b2152a5762410dd1caffc041871337")
  7. set_policy("package.precompiled", false)
  8. on_install("windows", "mingw", "msys", function (package)
  9. if package:is_plat("mingw") and package:version():eq("1.13") then
  10. io.replace("Include/Packet32.h", "_Post_invalid_", "", {plain = true})
  11. end
  12. os.cp("Include/*", package:installdir("include"))
  13. if package:is_arch("arm64") then
  14. os.cp("Lib/ARM64/*", package:installdir("lib"))
  15. elseif package:is_arch("x86") or package:is_arch("i386") then
  16. os.cp("Lib/*.lib", package:installdir("lib"))
  17. else
  18. os.cp("Lib/x64/*.lib", package:installdir("lib"))
  19. end
  20. end)
  21. on_test(function (package)
  22. assert(package:has_cfuncs("PacketGetVersion", {includes = "Packet32.h"}))
  23. end)