__init__.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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({'DEFINED LMDB_IDL_LOGN': Linkable(CFLAGS=["-DMDB_IDL_LOGN=${LMDB_IDL_LOGN}"])}))
  14. m.after("CFLAGS", Switch(OS_ANDROID=Linkable(CFLAGS=["-DMDB_USE_ROBUST=0"])))
  15. openldap = NixProject(
  16. arcdir="contrib/libs/openldap",
  17. nixattr="openldap",
  18. ignore_commands={"../../build/mkversion", "cat", "echo", "sed"},
  19. put={
  20. "ldap": ".",
  21. "lmdb": "libraries/liblmdb",
  22. "lber": "libraries/liblber",
  23. },
  24. platform_dispatchers=[
  25. "include/portable.h",
  26. ],
  27. addincl_global={".": {"./include"}},
  28. disable_includes=[
  29. "ac/regex.h",
  30. "asm/cachectl.h",
  31. "getopt-compat.h",
  32. "gnutls/",
  33. "libmalloc.h",
  34. "nspr/",
  35. "nss/",
  36. "ssl.h",
  37. "synch.h",
  38. "tklib.h",
  39. ],
  40. post_install=openldap_post_install,
  41. )