xmake.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. package("gn")
  2. set_kind("binary")
  3. set_homepage("https://gn.googlesource.com/gn")
  4. set_description("GN is a meta-build system that generates build files for Ninja.")
  5. if is_host("windows") then
  6. if os.arch() == "x64" then
  7. add_urls("https://github.com/xmake-mirror/gn-releases/releases/download/v$(version)/gn-windows-amd64.zip")
  8. add_versions("20211117", "517cdbfc1cbcc349d92781cd88ea34fb294b2a7f7b24c10678582eee587ee5b6")
  9. end
  10. elseif is_host("linux") then
  11. if os.arch() == "x86_64" then
  12. add_urls("https://github.com/xmake-mirror/gn-releases/releases/download/v$(version)/gn-linux-amd64.zip")
  13. add_versions("20211117", "6cc2da268a8402c0ac4f933fb06e8ac656a2450e5a4b645586b0b6a8b3e2944f")
  14. end
  15. elseif is_host("macosx") then
  16. if os.arch() == "arm64" then
  17. add_urls("https://github.com/xmake-mirror/gn-releases/releases/download/v$(version)/gn-mac-arm64.zip")
  18. add_versions("20211117", "5954adcaaf6ed69ab4c5270897ea389ce94d0584c709040257428f8604400211")
  19. else
  20. add_urls("https://github.com/xmake-mirror/gn-releases/releases/download/v$(version)/gn-mac-amd64.zip")
  21. add_versions("20211117", "025d9d60da03e080603a78c94a885d5c864c859248a877b2684d808aa5987c86")
  22. end
  23. end
  24. on_install("@windows", "@linux", "@macosx", "@msys", function (package)
  25. os.cp("gn*", package:installdir("bin"))
  26. end)
  27. on_test(function (package)
  28. os.vrun("gn --version")
  29. end)