xmake.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package("bison")
  2. set_kind("binary")
  3. set_homepage("https://www.gnu.org/software/bison/")
  4. set_description("A general-purpose parser generator.")
  5. set_license("GPL-3.0")
  6. if not is_plat("windows") then
  7. add_urls("http://ftp.gnu.org/gnu/bison/bison-$(version).tar.gz")
  8. end
  9. add_versions("3.7.4", "fbabc7359ccd8b4b36d47bfe37ebbce44805c052526d5558b95eda125d1677e2")
  10. add_versions("3.7.6", "69dc0bb46ea8fc307d4ca1e0b61c8c355eb207d0b0c69f4f8462328e74d7b9ea")
  11. add_versions("3.8.2", "06c9e13bdf7eb24d4ceb6b59205a4f67c2c7e7213119644430fe82fbd14a0abb")
  12. if is_plat("windows") then
  13. add_deps("winflexbison", {private = true})
  14. elseif is_plat("linux", "bsd") then
  15. add_deps("m4")
  16. end
  17. on_load("macosx", "linux", "bsd", "windows", function (package)
  18. -- we always set it, because flex may be modified as library
  19. -- by add_deps("bison", {kind = "library"})
  20. package:addenv("PATH", "bin")
  21. end)
  22. on_install(function (package)
  23. if package:is_plat("windows") then
  24. os.cp(path.join(package:dep("winflexbison"):installdir(), "*"), package:installdir())
  25. os.rm(path.join(package:installdir(), "bin", "flex.exe"))
  26. os.rm(path.join(package:installdir(), "include", "FlexLexer.h"))
  27. else
  28. import("package.tools.autoconf").install(package)
  29. os.rm(package:installdir("share", "doc"))
  30. end
  31. end)
  32. on_test(function (package)
  33. os.vrun("bison -h")
  34. end)