__init__.py 829 B

123456789101112131415161718192021222324252627282930
  1. from devtools.yamaker import fileutil
  2. from devtools.yamaker.modules import Linkable, Switch
  3. from devtools.yamaker.project import NixProject
  4. def post_build(self):
  5. fileutil.convert_to_utf8(f"{self.dstdir}/AUTHORS", from_="latin1")
  6. def post_install(self):
  7. with self.yamakes["."] as lcms:
  8. # reentrable variant of gmtime is gmtime_r on Unix, gmtime_s on Windows
  9. lcms.CFLAGS.remove("-DHAVE_GMTIME_R=1")
  10. lcms.after(
  11. "CFLAGS",
  12. Switch(
  13. OS_WINDOWS=Linkable(CFLAGS=["-DHAVE_GMTIME_S=1"]),
  14. default=Linkable(CFLAGS=["-DHAVE_GMTIME_R=1"]),
  15. ),
  16. )
  17. lcms2 = NixProject(
  18. owners=["shindo", "g:mds", "g:cpp-contrib"],
  19. arcdir="contrib/libs/lcms2",
  20. nixattr="lcms2",
  21. post_build=post_build,
  22. post_install=post_install,
  23. )