__init__.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. from devtools.yamaker.fileutil import re_sub_dir
  2. from devtools.yamaker.project import GNUMakeNixProject
  3. from devtools.yamaker.modules import GLOBAL, Linkable, Switch
  4. def libxml2_post_install(self):
  5. re_sub_dir(self.dstdir + "/include", r"(# *include) <libxml/(.*)>", r'\1 "\2"')
  6. with self.yamakes["."] as m:
  7. m.NO_RUNTIME = False
  8. m.CFLAGS.append(GLOBAL("-DLIBXML_STATIC"))
  9. # flag disable arcadia encodings to reduce binary weight and remove UTIL dependency
  10. m.after(
  11. "SRCS",
  12. Switch(
  13. ARCADIA_LIBXML_DISABLE_EXTRA_ENCODINGS=Linkable(
  14. CFLAGS=["-DARCADIA_LIBXML_DISABLE_EXTRA_ENCODINGS"],
  15. NO_RUNTIME=True,
  16. ),
  17. default=Linkable(SRCS=["yencoding.cpp"], PEERDIR=["library/cpp/charset"]),
  18. ),
  19. )
  20. libxml = GNUMakeNixProject(
  21. owners=["g:cpp-contrib", "g:yandex_io"],
  22. arcdir="contrib/libs/libxml",
  23. nixattr="libxml2",
  24. flags=["--without-ftp", "--without-http"],
  25. install_targets=[
  26. "libxml2",
  27. "xmllint",
  28. ],
  29. put={
  30. "libxml2": ".",
  31. "xmllint": "xmllint",
  32. },
  33. use_full_libnames=True,
  34. addincl_global={".": ["./include"]},
  35. copy_sources=["Copyright"],
  36. copy_top_sources_except=[
  37. "ChangeLog",
  38. "INSTALL",
  39. "NEWS",
  40. "README",
  41. "README.tests",
  42. "README.zOS",
  43. ],
  44. platform_dispatchers=["config.h"],
  45. disable_includes=[
  46. "lzma.h",
  47. "kernel/image.h",
  48. "OS.h",
  49. "os2.h",
  50. "trio.h",
  51. # ifdef LIBXML_ICU_ENABLED
  52. "unicode/",
  53. # if defined(_WIN32_WCE)
  54. "win32config.h",
  55. "xzlib.h",
  56. ],
  57. keep_paths=[
  58. "yencoding.cpp",
  59. "yencoding.h",
  60. ],
  61. post_install=libxml2_post_install,
  62. )
  63. # DOCBparser.c is not used by our targets, do not copy it
  64. libxml.copy_top_sources_except.add("DOCBparser.c")