__init__.py 936 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import os.path as P
  2. import shutil
  3. from devtools.yamaker.modules import GLOBAL, Switch, Linkable
  4. from devtools.yamaker.project import GNUMakeNixProject
  5. def post_build(self):
  6. for name in "expat.h", "expat_external.h":
  7. shutil.move(P.join(self.dstdir, "lib", name), P.join(self.dstdir, name))
  8. with self.yamakes["."] as expat:
  9. expat.CFLAGS.remove("-DXML_ENABLE_VISIBILITY=1")
  10. expat.after(
  11. "CFLAGS",
  12. Switch(
  13. OS_WINDOWS=Linkable(CFLAGS=[GLOBAL("-DXML_STATIC")]),
  14. ),
  15. )
  16. expat = GNUMakeNixProject(
  17. arcdir="contrib/libs/expat",
  18. nixattr="expat",
  19. makeflags=["-C", "lib", "libexpat.la"],
  20. disable_includes=[
  21. "watcomconfig.h",
  22. "bsd/stdlib.h",
  23. "proto/expat.h",
  24. ],
  25. copy_sources=[
  26. "Changes",
  27. "lib/winconfig.h",
  28. ],
  29. install_targets=[
  30. "expat",
  31. ],
  32. post_build=post_build,
  33. )