xmake.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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")
  14. elseif is_plat("linux", "bsd") then
  15. add_deps("m4")
  16. end
  17. on_load(function (package)
  18. if package:is_plat("windows") then
  19. -- handled by winflexbison
  20. return
  21. end
  22. package:addenv("PATH", "bin")
  23. end)
  24. on_install(function (package)
  25. if package:is_plat("windows") then
  26. -- handled by winflexbison
  27. return
  28. end
  29. import("package.tools.autoconf").install(package)
  30. os.rm(package:installdir("share", "doc"))
  31. end)
  32. on_test(function (package)
  33. os.vrun("bison -h")
  34. end)