libs/srt: add new package v1.5.3
authorKoen Vandeputte <redacted>
Wed, 2 Oct 2024 14:22:17 +0000 (16:22 +0200)
committerRosen Penev <redacted>
Wed, 16 Oct 2024 17:47:26 +0000 (10:47 -0700)
This adds the Secure Reliable Transport (SRT) package.

SRT is used as a popular transfer protocol for video & audio
and can be used within gstreamer as both a sink or source.

It also supports stream encryptino by simply
setting a password on both ends of the link.

More details can be found here:
https://www.haivision.com/products/srt-secure-reliable-transport/

It is being actively developed on github:
https://github.com/Haivision/srt

Signed-off-by: Koen Vandeputte <redacted>
libs/srt/Config.in [new file with mode: 0644]
libs/srt/Makefile [new file with mode: 0644]

diff --git a/libs/srt/Config.in b/libs/srt/Config.in
new file mode 100644 (file)
index 0000000..905dca6
--- /dev/null
@@ -0,0 +1,33 @@
+if PACKAGE_srt
+
+comment "Encryption support"
+
+choice
+       prompt "Selected Encryption library"
+       default SRT_OPENSSL
+
+       config SRT_OPENSSL
+               bool "OpenSSL"
+
+       config SRT_MBEDTLS
+               bool "mbed TLS"
+
+       config SRT_GNUTLS
+               bool "GNUTLS"
+
+       config SRT_NOENCRYPTION
+               bool "No encryption support"
+
+endchoice
+
+comment "Options"
+
+config SRT_MONOTONIC_CLOCK
+       bool "Monotonic clock"
+       default y
+
+config SRT_BONDING
+       bool "Bonding"
+       default n
+
+endif
diff --git a/libs/srt/Makefile b/libs/srt/Makefile
new file mode 100644 (file)
index 0000000..aaee44a
--- /dev/null
@@ -0,0 +1,79 @@
+#
+# Copyright (C) 2024 Koen Vandeputte <koen.vandeputte@citymesh.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=srt
+PKG_VERSION:=1.5.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/haivision/srt/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=befaeb16f628c46387b898df02bc6fba84868e86a6f6d8294755375b9932d777
+PKG_MAINTAINER:=Koen Vandeputte <koen.vandeputte@citymesh.com>
+
+PKG_LICENSE:=MPL-2.0
+PKG_LICENSE_FILES:=LICENSE
+
+CMAKE_INSTALL:=1
+
+PKG_CONFIG_DEPENDS:= \
+  \
+  CONFIG_SRT_OPENSSL \
+  CONFIG_SRT_MBEDTLS \
+  CONFIG_SRT_GNUTLS \
+  CONFIG_SRT_NOENCRYPTION \
+  \
+  CONFIG_SRT_MONOTONIC_CLOCK \
+  CONFIG_SRT_BONDING
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/srt
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:= +libstdcpp +libatomic
+  DEPENDS += +SRT_OPENSSL:libopenssl +SRT_MBEDTLS:libmbedtls +SRT_GNUTLS:libgnutls
+  TITLE:=secure reliable transport
+  URL:=https://github.com/Haivision/srt
+  MENU:=1
+endef
+
+define Package/srt/description
+  This package provides the Secure Reliable Transport library which
+  is mostly used by the gstreamer srt sink plugin
+endef
+
+define Package/srt/config
+  source "$(SOURCE)/Config.in"
+endef
+
+TARGET_LDFLAGS += -Wl,--gc-sections
+
+CMAKE_OPTIONS += \
+       -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
+        -DENABLE_APPS=OFF \
+        -DENABLE_PKTINFO=OFF \
+        -DENABLE_SHARED=ON \
+        -DENABLE_STATIC=OFF \
+        -DENABLE_TESTING=OFF \
+        -DENABLE_UNITTESTS=OFF \
+        -DUSE_BUSY_WAITING=OFF \
+        -DENABLE_BONDING=$(if $(CONFIG_SRT_BONDING),ON,OFF) \
+        -DENABLE_MONOTONIC_CLOCK=$(if $(CONFIG_SRT_MONOTONIC_CLOCK),ON,OFF) \
+        -DENABLE_ENCRYPTION=$(if $(CONFIG_SRT_OPENSSL)$(CONFIG_SRT_MBEDTLS)$(CONFIG_SRT_GNUTLS),ON,OFF) \
+        $(if $(CONFIG_SRT_OPENSSL),-DUSE_ENCLIB=openssl-evp) \
+        $(if $(CONFIG_SRT_MBEDTLS),-DUSE_ENCLIB=mbedtls) \
+        $(if $(CONFIG_SRT_GNUTLS),-DUSE_ENCLIB=gnutls)
+
+define Package/srt/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsrt.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,srt))
git clone https://git.99rst.org/PROJECT