xmake.lua 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package("bazel")
  2. set_kind("binary")
  3. set_homepage("https://bazel.build/")
  4. set_description("A fast, scalable, multi-language and extensible build system")
  5. if is_host("windows") and os.arch() == "x64" then
  6. add_urls("https://github.com/bazelbuild/bazel/releases/download/$(version)/bazel-$(version)-windows-x86_64.exe")
  7. add_versions("5.0.0", "452217bcc4f8153c521fd985256316cd0bcad869fd192e1afd406dcb16f880d6")
  8. elseif is_host("macosx") and os.arch() == "x86_64" then
  9. add_urls("https://github.com/bazelbuild/bazel/releases/download/$(version)/bazel-$(version)-darwin-x86_64")
  10. add_versions("5.0.0", "60558f06b9410b15602d6f41a294cec2cb69436c6e64d72ea78f42056373b8b9")
  11. elseif is_host("macosx") and os.arch() == "arm64" then
  12. add_urls("https://github.com/bazelbuild/bazel/releases/download/$(version)/bazel-$(version)-darwin-x86_64")
  13. add_versions("5.0.0", "86ba0e31b61b675afdfe393bd3b02e12b8fe1196eb5ea045da86f067547fe90f")
  14. elseif is_host("linux") and os.arch() == "x86_64" then
  15. add_urls("https://github.com/bazelbuild/bazel/releases/download/$(version)/bazel-$(version)-linux-x86_64")
  16. add_versions("5.0.0", "399eedb225cff7a13f9f027f7ea2aad02ddb668a8eb89b1d975d222e4dc12ed9")
  17. elseif is_host("linux") and os.arch() == "arm64" then
  18. add_urls("https://github.com/bazelbuild/bazel/releases/download/$(version)/bazel-$(version)-linux-arm64")
  19. add_versions("5.0.0", "4a88b8f48cac3bf6fe657332631c36b4d255628c87bd77eb3159f4eb166f5e66")
  20. end
  21. on_install("@windows|x64", "@macosx", "@linux|x86_64", "@linux|arm64", function (package)
  22. if is_host("windows") then
  23. os.cp("../bazel-*.exe", path.join(package:installdir("bin"), "bazel.exe"))
  24. else
  25. os.cp("../bazel-*", path.join(package:installdir("bin"), "bazel"))
  26. end
  27. if is_host("linux") then
  28. os.vrunv("chmod", {"+x", path.join(package:installdir("bin"), "bazel")})
  29. end
  30. end)
  31. on_test(function (package)
  32. os.vrun("bazel version")
  33. end)