__init__.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. from devtools.yamaker.modules import GLOBAL, Linkable, Switch
  2. from devtools.yamaker.project import CMakeNinjaNixProject
  3. def post_install(self):
  4. with self.yamakes["."] as openjpeg:
  5. openjpeg.CFLAGS.remove("-DMUTEX_pthread")
  6. openjpeg.after(
  7. "CFLAGS",
  8. Switch(
  9. OS_WINDOWS=Linkable(
  10. CFLAGS=[
  11. GLOBAL("/DOPJ_STATIC"),
  12. "/DMUTEX_win32",
  13. ]
  14. ),
  15. default=Linkable(
  16. CFLAGS=[
  17. "-DMUTEX_pthread",
  18. ]
  19. ),
  20. ),
  21. )
  22. openjpeg = CMakeNinjaNixProject(
  23. owners=["g:cpp-contrib"],
  24. arcdir="contrib/libs/openjpeg",
  25. nixattr="openjpeg",
  26. flags=["-DBUILD_CODEC=OFF", "-DBUILD_MJ2=OFF", "-DBUILD_TESTING=OFF"],
  27. disable_includes=["cidx_manager.h", "indexbox_manager.h", "openjpwl/jpwl.h"],
  28. build_targets=["openjp2"],
  29. install_subdir="src/lib/openjp2",
  30. inclink={
  31. "include": [
  32. "opj_config.h",
  33. "openjpeg.h",
  34. ],
  35. },
  36. platform_dispatchers=["opj_config_private.h"],
  37. post_install=post_install,
  38. )