xmake.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package("zziplib")
  2. set_homepage("http://zziplib.sourceforge.net/")
  3. set_description("The zziplib library is intentionally lightweight, it offers the ability to easily extract data from files archived in a single zip file.")
  4. set_license("GPL-2.0")
  5. add_urls("https://github.com/gdraheim/zziplib/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/gdraheim/zziplib.git")
  7. add_versions("v0.13.80", "21f40d111c0f7a398cfee3b0a30b20c5d92124b08ea4290055fbfe7bdd53a22c")
  8. add_versions("v0.13.79", "ed6f3017bb353b4a8f730c31a2fa065adb2d264c00d922aada48a5893eda26e4")
  9. add_versions("v0.13.78", "feaeee7c34f18aa27bd3da643cc6a47d04d2c41753a59369d09102d79b9b0a31")
  10. add_versions("v0.13.77", "50e166e6a879c2bd723e60e482a91ec793a7362fa2d9c5fe556fb0e025810477")
  11. add_versions("v0.13.76", "08b0e300126329c928a41b6d68e397379fad02469e34a0855d361929968ea4c0")
  12. add_versions("v0.13.74", "319093aa98d39453f3ea2486a86d8a2fab2d5632f6633a2665318723a908eecf")
  13. add_versions("v0.13.72", "93ef44bf1f1ea24fc66080426a469df82fa631d13ca3b2e4abaeab89538518dc")
  14. add_versions("v0.13.73", "2aa9d317f70060101064863e4e8fe698c32301e2d293d2b4964608cf2d5b2d8b")
  15. add_deps("cmake", "zlib")
  16. on_install("windows", "macosx", "linux", function (package)
  17. io.replace("zzip/CMakeLists.txt", "include ( CodeCoverage )", "", {plain = true})
  18. local configs = {"-DZZIPTEST=OFF", "-DZZIPDOCS=OFF", "-DZZIPWRAP=OFF", "-DZZIPSDL=OFF", "-DZZIPMMAPPED=OFF", "-DZZIPFSEEKO=OFF", "-DZZIPBINS=OFF"}
  19. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  20. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  21. table.insert(configs, "-DBUILD_STATIC_LIBS=" .. (package:config("shared") and "OFF" or "ON"))
  22. if package:is_plat("windows") then
  23. table.insert(configs, "-DMSVC_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
  24. end
  25. if package:config("pic") ~= false then
  26. table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
  27. end
  28. import("package.tools.cmake").install(package, configs)
  29. end)
  30. on_test(function (package)
  31. assert(package:has_cfuncs("zzip_open", {includes = "zzip/zzip.h"}))
  32. end)