xmake.lua 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package("lunzip")
  2. set_kind("binary")
  3. set_homepage("https://www.nongnu.org/lzip/lunzip.html")
  4. set_description("Lunzip is a decompressor for the lzip format written in C.")
  5. set_license("GPL-2.0-or-later")
  6. add_urls("https://download.nus.edu.sg/mirror/gentoo/distfiles/f7/lunzip-$(version).tar.gz",
  7. "https://debian.netcologne.de/savannah/lzip/lunzip/lunzip-$(version).tar.gz",
  8. "https://download.savannah.gnu.org/releases/lzip/lunzip/lunzip-$(version).tar.gz", {alias="archive"})
  9. add_versions("archive:1.15", "fdb930b87672a238a54c4b86d63df1c86038ff577d512adbc8e2c754c046d8f2")
  10. if not is_subhost("windows") then
  11. add_deps("autotools")
  12. end
  13. on_check(function(package)
  14. if is_host("windows") and os.arch() == "arm64" then
  15. raise("package(lunzip) does not support host Windows arch arm64.")
  16. end
  17. end)
  18. on_load(function(package)
  19. if is_subhost("windows") then
  20. local msystem = "MINGW" .. (package:is_arch64() and "64" or "32")
  21. if package:is_arch64() then
  22. package:add("deps", "msys2", {configs = {msystem = msystem, base_devel = true, mingw64_toolchain = true, make = true}})
  23. else
  24. package:add("deps", "msys2", {configs = {msystem = msystem, base_devel = true, mingw32_toolchain = true, make = true}})
  25. end
  26. end
  27. end)
  28. on_install(function (package)
  29. local configs = {}
  30. if is_subhost("windows") then
  31. table.insert(configs, "CC=cc")
  32. end
  33. import("package.tools.autoconf").install(package, configs)
  34. end)
  35. on_test(function (package)
  36. os.vrun("lunzip -h")
  37. end)