__init__.py 997 B

123456789101112131415161718192021222324252627282930
  1. from devtools.yamaker.modules import join_srcs
  2. from devtools.yamaker.project import NixProject
  3. def ragel6_post_install(self):
  4. m = self.yamakes["."]
  5. m.prebuilt = "build/prebuilt/contrib/tools/ragel6/ya.make.prebuilt"
  6. # Rename ragel to ragel6.
  7. m.PROGRAM = ["ragel6"]
  8. # aapl in ragel 5 and 6 is the same.
  9. m.PEERDIR += ["contrib/tools/ragel5/aapl"]
  10. # Join sources to reduce compilation utime.
  11. srcs = m.SRCS
  12. m.SRCS = {src for src in srcs if src.startswith("rl")}
  13. srcs -= m.SRCS
  14. for prefix in "cd", "cs", "fs", "go", "ml", "r":
  15. group = {src for src in srcs if src.startswith(prefix)}
  16. srcs -= group
  17. m.after("SRCS", join_srcs(f"all_{prefix}.cpp", group))
  18. m.after("SRCS", join_srcs("all_other.cpp", srcs))
  19. ragel6 = NixProject(
  20. owners=["pg", "g:cpp-contrib"],
  21. arcdir="contrib/tools/ragel6",
  22. nixattr="ragel",
  23. install_subdir="ragel",
  24. copy_sources=["*.rl", "*.kl", "*.kh"],
  25. post_install=ragel6_post_install,
  26. )