__init__.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import os
  2. from devtools.yamaker.fileutil import re_sub_dir
  3. from devtools.yamaker.modules import Switch, Linkable
  4. from devtools.yamaker.project import NixProject
  5. def openldap_post_install(self):
  6. re_sub_dir(
  7. os.path.join(self.dstdir, "include"),
  8. r"/\* Generated from ./ldap_config.hin on .* \*/",
  9. "/* Generated from ./ldap_config.hin on */",
  10. )
  11. self.yamakes.make_recursive(recurse_from_modules=True)
  12. with self.yamakes["libraries/liblmdb"] as m:
  13. m.after("CFLAGS", Switch(OS_ANDROID=Linkable(CFLAGS=["-DMDB_USE_ROBUST=0"])))
  14. openldap = NixProject(
  15. arcdir="contrib/libs/openldap",
  16. nixattr="openldap",
  17. ignore_commands={"../../build/mkversion", "cat", "echo", "sed"},
  18. put={
  19. "ldap": ".",
  20. "lmdb": "libraries/liblmdb",
  21. "lber": "libraries/liblber",
  22. },
  23. platform_dispatchers=[
  24. "include/portable.h",
  25. ],
  26. addincl_global={".": {"./include"}},
  27. disable_includes=[
  28. "ac/regex.h",
  29. "asm/cachectl.h",
  30. "getopt-compat.h",
  31. "gnutls/",
  32. "libmalloc.h",
  33. "nspr/",
  34. "nss/",
  35. "ssl.h",
  36. "synch.h",
  37. "tklib.h",
  38. ],
  39. post_install=openldap_post_install,
  40. )