__init__.py 688 B

1234567891011121314151617181920212223242526
  1. import os
  2. from devtools.yamaker.project import GNUMakeNixProject
  3. def post_install(self):
  4. with self.yamakes["."] as lz4:
  5. # Unbundle xxhash.
  6. lz4.PEERDIR.add("contrib/libs/xxhash")
  7. lz4.ADDINCL.add("contrib/libs/xxhash")
  8. lz4.SRCS.remove("xxhash.c")
  9. lz4.CFLAGS = [x for x in lz4.CFLAGS if x != "-DXXH_NAMESPACE=LZ4_"]
  10. os.remove(f"{self.dstdir}/xxhash.h")
  11. os.remove(f"{self.dstdir}/xxhash.c")
  12. # Ensure no warnings.
  13. lz4.NO_COMPILER_WARNINGS = False
  14. lz4 = GNUMakeNixProject(
  15. arcdir="contrib/libs/lz4",
  16. nixattr="lz4",
  17. nixsrcdir="source/lib",
  18. makeflags=["liblz4.a"],
  19. post_install=post_install,
  20. )