Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions libs/libdatachannel/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=libdatachannel
PKG_VERSION:=0.23.2
PKG_RELEASE:=1

PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_SOURCE_URL=https://github.com/paullouisageneau/libdatachannel.git
PKG_MIRROR_HASH:=7246e54391ecc3835995a7721dac4af7d33ac06895ad539b27c7e5fc1e250ad1

PKG_LICENSE:=MPL-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Biao Zhu <[email protected]>

PKG_BUILD_PARALLEL:=1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is default as I was told by @1715173329 if you are using cmake. So it can be dropped.


include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

define Package/libdatachannel/config
choice
prompt "SSL backend for libdatachannel"
default LIBDATACHANNEL_SSL_OPENSSL

config LIBDATACHANNEL_SSL_OPENSSL
bool "OpenSSL"

config LIBDATACHANNEL_SSL_GNUTLS
bool "GnuTLS"

config LIBDATACHANNEL_SSL_MBEDTLS
bool "MbedTLS"
endchoice
endef

SSL_DEPENDS:=+libopenssl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think that we need to have custom SSL variable. You might want to look how it is done in other Makefiles in this repo.


ifeq ($(CONFIG_LIBDATACHANNEL_SSL_GNUTLS),y)
SSL_DEPENDS:=+libgnutls
CMAKE_OPTIONS+= -DUSE_GNUTLS=ON
endif

ifeq ($(CONFIG_LIBDATACHANNEL_SSL_MBEDTLS),y)
SSL_DEPENDS:=+libmbedtls
CMAKE_OPTIONS+= -DUSE_MBEDTLS=ON
endif

define Package/libdatachannel
SECTION:=libs
CATEGORY:=Libraries
TITLE:=libdatachannel
URL:=https://libdatachannel.org/
DEPENDS:=+libstdcpp +libsrtp2 $(SSL_DEPENDS)
endef

define Package/libdatachannel/description
libdatachannel is a standalone implementation of WebRTC Data Channels,
WebRTC Media Transport, and WebSockets in C++ with C bindings for
multiple platforms, including GNU/Linux, Android, FreeBSD, Apple macOS,
iOS, and Microsoft Windows. WebRTC is a W3C and IETF standard enabling
real-time peer-to-peer data and media exchange between two devices.
endef

CMAKE_OPTIONS+= \
-DNO_EXAMPLES=ON \
-DUSE_NICE=0 \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_SYSTEM_SRTP=ON

define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/rtc $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libdatachannel.so* $(1)/usr/lib/
endef

define Package/libdatachannel/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libdatachannel.so.* $(1)/usr/lib/
endef

$(eval $(call BuildPackage,libdatachannel))