libcamera.mk 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. ################################################################################
  2. #
  3. # libcamera
  4. #
  5. ################################################################################
  6. LIBCAMERA_SITE = https://git.linuxtv.org/libcamera.git
  7. LIBCAMERA_VERSION = v0.2.0
  8. LIBCAMERA_SITE_METHOD = git
  9. LIBCAMERA_DEPENDENCIES = \
  10. host-openssl \
  11. host-pkgconf \
  12. host-python-jinja2 \
  13. host-python-ply \
  14. host-python-pyyaml \
  15. libyaml \
  16. gnutls
  17. LIBCAMERA_CONF_OPTS = \
  18. -Dandroid=disabled \
  19. -Ddocumentation=disabled \
  20. -Dtest=false \
  21. -Dpycamera=disabled \
  22. -Dwerror=false
  23. LIBCAMERA_INSTALL_STAGING = YES
  24. LIBCAMERA_LICENSE = \
  25. LGPL-2.1+ (library), \
  26. GPL-2.0+ (utils), \
  27. MIT (qcam/assets/feathericons), \
  28. BSD-2-Clause (raspberrypi), \
  29. GPL-2.0 with Linux-syscall-note or BSD-3-Clause (linux kernel headers), \
  30. CC0-1.0 (meson build system), \
  31. CC-BY-SA-4.0 (doc)
  32. LIBCAMERA_LICENSE_FILES = \
  33. LICENSES/LGPL-2.1-or-later.txt \
  34. LICENSES/GPL-2.0-or-later.txt \
  35. LICENSES/MIT.txt \
  36. LICENSES/BSD-2-Clause.txt \
  37. LICENSES/GPL-2.0-only.txt \
  38. LICENSES/Linux-syscall-note.txt \
  39. LICENSES/BSD-3-Clause.txt \
  40. LICENSES/CC0-1.0.txt \
  41. LICENSES/CC-BY-SA-4.0.txt
  42. ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_7),y)
  43. LIBCAMERA_CXXFLAGS = -faligned-new
  44. endif
  45. ifeq ($(BR2_PACKAGE_LIBCAMERA_V4L2),y)
  46. LIBCAMERA_CONF_OPTS += -Dv4l2=true
  47. else
  48. LIBCAMERA_CONF_OPTS += -Dv4l2=false
  49. endif
  50. LIBCAMERA_PIPELINES-$(BR2_PACKAGE_LIBCAMERA_PIPELINE_IMX8_ISI) += imx8-isi
  51. LIBCAMERA_PIPELINES-$(BR2_PACKAGE_LIBCAMERA_PIPELINE_IPU3) += ipu3
  52. LIBCAMERA_PIPELINES-$(BR2_PACKAGE_LIBCAMERA_PIPELINE_RKISP1) += rkisp1
  53. ifeq ($(BR2_PACKAGE_LIBCAMERA_PIPELINE_RPI_VC4),y)
  54. LIBCAMERA_PIPELINES-y += rpi/vc4
  55. LIBCAMERA_DEPENDENCIES += boost
  56. endif
  57. LIBCAMERA_PIPELINES-$(BR2_PACKAGE_LIBCAMERA_PIPELINE_SIMPLE) += simple
  58. LIBCAMERA_PIPELINES-$(BR2_PACKAGE_LIBCAMERA_PIPELINE_UVCVIDEO) += uvcvideo
  59. LIBCAMERA_PIPELINES-$(BR2_PACKAGE_LIBCAMERA_PIPELINE_VIMC) += vimc
  60. LIBCAMERA_CONF_OPTS += -Dpipelines=$(subst $(space),$(comma),$(LIBCAMERA_PIPELINES-y))
  61. ifeq ($(BR2_PACKAGE_LIBCAMERA_COMPLIANCE),y)
  62. LIBCAMERA_DEPENDENCIES += gtest libevent
  63. LIBCAMERA_CONF_OPTS += -Dlc-compliance=enabled
  64. else
  65. LIBCAMERA_CONF_OPTS += -Dlc-compliance=disabled
  66. endif
  67. # gstreamer-video-1.0, gstreamer-allocators-1.0
  68. ifeq ($(BR2_PACKAGE_GSTREAMER1)$(BR2_PACKAGE_GST1_PLUGINS_BASE),yy)
  69. LIBCAMERA_CONF_OPTS += -Dgstreamer=enabled
  70. LIBCAMERA_DEPENDENCIES += gstreamer1 gst1-plugins-base
  71. endif
  72. ifeq ($(BR2_PACKAGE_QT5BASE_WIDGETS),y)
  73. LIBCAMERA_CONF_OPTS += -Dqcam=enabled
  74. LIBCAMERA_DEPENDENCIES += qt5base
  75. ifeq ($(BR2_PACKAGE_QT5TOOLS_LINGUIST_TOOLS),y)
  76. LIBCAMERA_DEPENDENCIES += qt5tools
  77. endif
  78. else
  79. LIBCAMERA_CONF_OPTS += -Dqcam=disabled
  80. endif
  81. ifeq ($(BR2_PACKAGE_LIBEVENT),y)
  82. LIBCAMERA_CONF_OPTS += -Dcam=enabled
  83. LIBCAMERA_DEPENDENCIES += libevent
  84. else
  85. LIBCAMERA_CONF_OPTS += -Dcam=disabled
  86. endif
  87. ifeq ($(BR2_PACKAGE_TIFF),y)
  88. LIBCAMERA_DEPENDENCIES += tiff
  89. endif
  90. ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
  91. LIBCAMERA_CONF_OPTS += -Dudev=enabled
  92. LIBCAMERA_DEPENDENCIES += udev
  93. else
  94. LIBCAMERA_CONF_OPTS += -Dudev=disabled
  95. endif
  96. ifeq ($(BR2_PACKAGE_LTTNG_LIBUST),y)
  97. LIBCAMERA_CONF_OPTS += -Dtracing=enabled
  98. LIBCAMERA_DEPENDENCIES += lttng-libust
  99. else
  100. LIBCAMERA_CONF_OPTS += -Dtracing=disabled
  101. endif
  102. ifeq ($(BR2_PACKAGE_LIBEXECINFO),y)
  103. LIBCAMERA_DEPENDENCIES += libexecinfo
  104. LIBCAMERA_LDFLAGS = $(TARGET_LDFLAGS) -lexecinfo
  105. endif
  106. # Open-Source IPA shlibs need to be signed in order to be runnable within the
  107. # same process, otherwise they are deemed Closed-Source and run in another
  108. # process and communicate over IPC.
  109. # Buildroot sanitizes RPATH in a post build process. meson gets rid of rpath
  110. # while installing so we don't need to do it manually here.
  111. # Buildroot may strip symbols, so we need to do the same before signing
  112. # otherwise the signature won't match the shlib on the rootfs. Since meson
  113. # install target is signing the shlibs, we need to strip them before.
  114. LIBCAMERA_STRIP_FIND_CMD = \
  115. find $(@D)/build/src/ipa \
  116. $(if $(call qstrip,$(BR2_STRIP_EXCLUDE_FILES)), \
  117. -not \( $(call findfileclauses,$(call qstrip,$(BR2_STRIP_EXCLUDE_FILES))) \) ) \
  118. -type f -name 'ipa_*.so' -print0
  119. define LIBCAMERA_BUILD_STRIP_IPA_SO
  120. $(LIBCAMERA_STRIP_FIND_CMD) | xargs --no-run-if-empty -0 $(STRIPCMD)
  121. endef
  122. LIBCAMERA_POST_BUILD_HOOKS += LIBCAMERA_BUILD_STRIP_IPA_SO
  123. $(eval $(meson-package))