Skip to content

Commit

Permalink
try to build poco inside openhd
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelscholle committed Oct 12, 2024
1 parent 8aff562 commit b430416
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 12 deletions.
4 changes: 1 addition & 3 deletions external/buildroot/package/openhd/Config.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
config BR2_PACKAGE_OPENHD
bool "openhd"
select BR2_PACKAGE_LIBPCAP
select BR2_PACKAGE_POCO
select BR2_PACKAGE_LIBSODIUM
select BR2_PACKAGE_GSTREAMER1
select BR2_PACKAGE_GST1_PLUGINS_BASE
select BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_APP
depends on BR2_PACKAGE_POCO_VERSION_1_13_2
help
OpenHD package
OpenHD is an open-source platform for low-latency, high-definition digital video transmission.
66 changes: 57 additions & 9 deletions external/buildroot/package/openhd/openhd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,65 @@ OPENHD_SUBDIR = OpenHD
OPENHD_INSTALL_STAGING = YES
OPENHD_INSTALL_TARGET = YES

# List of dependencies that must be built before OpenHD
OPENHD_DEPENDENCIES = poco libsodium gstreamer1 gst1-plugins-base libpcap host-pkgconf
# Dependencies that are needed by OpenHD
OPENHD_DEPENDENCIES = libsodium gstreamer1 gst1-plugins-base libpcap host-pkgconf

# Additional configuration options for the CMake build
# Poco version to build from source
POCO_VERSION = 1.13.2
POCO_SITE = https://github.com/pocoproject/poco/archive/refs/tags/poco-$(POCO_VERSION)-release.tar.gz

# Define the steps for downloading and extracting poco
define OPENHD_EXTRACT_POCO
$(call step_start,extract)
$(call host-wget,$(POCO_SITE),$(BUILD_DIR))
tar -xvf $(BUILD_DIR)/poco-$(POCO_VERSION)-release.tar.gz -C $(BUILD_DIR)
$(call step_end,extract)
endef

# Define the steps to configure poco with CMake
define OPENHD_CONFIGURE_POCO
$(call step_start,configure)
cd $(BUILD_DIR)/poco-poco-$(POCO_VERSION)-release && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$(STAGING_DIR)/usr \
-DCMAKE_SYSROOT=$(STAGING_DIR) \
-DPOCO_UNBUNDLED=ON \
-DENABLE_TESTS=OFF
$(call step_end,configure)
endef

# Define the steps to build poco
define OPENHD_BUILD_POCO
$(call step_start,build)
cd $(BUILD_DIR)/poco-poco-$(POCO_VERSION)-release && \
$(MAKE)
$(call step_end,build)
endef

# Define the steps to install poco
define OPENHD_INSTALL_POCO
$(call step_start,install)
cd $(BUILD_DIR)/poco-poco-$(POCO_VERSION)-release && \
$(MAKE) install
$(call step_end,install)
endef

# Integrate poco's steps into the OpenHD package build process
OPENHD_POST_EXTRACT_HOOKS += OPENHD_EXTRACT_POCO
OPENHD_POST_CONFIGURE_HOOKS += OPENHD_CONFIGURE_POCO
OPENHD_POST_BUILD_HOOKS += OPENHD_BUILD_POCO
OPENHD_POST_INSTALL_TARGET_HOOKS += OPENHD_INSTALL_POCO

# Additional configuration options for the CMake build of OpenHD
OPENHD_CONF_OPTS = \
-DENABLE_USB_CAMERAS=OFF \
-DCMAKE_TOOLCHAIN_FILE=$(BR2_TOOLCHAIN_FILE) \
-DCMAKE_SYSROOT=$(STAGING_DIR) \
-DCMAKE_PREFIX_PATH=$(STAGING_DIR)/usr \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
-DENABLE_USB_CAMERAS=OFF \
-DCMAKE_TOOLCHAIN_FILE=$(BR2_TOOLCHAIN_FILE) \
-DCMAKE_SYSROOT=$(STAGING_DIR) \
-DCMAKE_PREFIX_PATH=$(STAGING_DIR)/usr \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DPOCO_DIR=$(STAGING_DIR)/usr/lib/cmake/Poco

# Use Buildroot's CMake package infrastructure to handle the build
$(eval $(cmake-package))

0 comments on commit b430416

Please sign in to comment.