Skip to contentSkip to conversation

package/libdatachannel: new package

PATCH Superseded Maksim Kiselev 2 participants 2 messages Apr 26, 2023 – May 8, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libdatachannel: new package

This patch adds a new package for libdatachannel.

libdatachannel is an open-source software library implementing WebRTC Data Channels, WebRTC Media Transport, and WebSockets. It is written in C++17 and offers C bindings.

---
 package/Config.in                          |  1 +
 package/libdatachannel/Config.in           |  7 +++++
 package/libdatachannel/libdatachannel.hash |  3 ++
 package/libdatachannel/libdatachannel.mk   | 32 ++++++++++++++++++++++
 4 files changed, 43 insertions(+)
 create mode 100644 package/libdatachannel/Config.in
 create mode 100644 package/libdatachannel/libdatachannel.hash
 create mode 100644 package/libdatachannel/libdatachannel.mk
package/Config.in +1 -0
index eaac32a01a..c323409e37 100644
@@ -1408,6 +1408,7 @@ menu "Audio/Sound"
 	source "package/libcodec2/Config.in"
 	source "package/libcue/Config.in"
 	source "package/libcuefile/Config.in"
+	source "package/libdatachannel/Config.in"
 	source "package/libebur128/Config.in"
 	source "package/libg7221/Config.in"
 	source "package/libgsm/Config.in"
package/libdatachannel/Config.in new file +7 -0
new file mode 100644
index 0000000000..84ade9a879
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_LIBDATACHANNEL
+	bool "libdatachannel"
+	help
+	  C/C++ WebRTC network library featuring Data Channels,
+	  Media Transport, and WebSockets.
+
+	  https://github.com/paullouisageneau/libdatachannel
package/libdatachannel/libdatachannel.hash new file +3 -0
new file mode 100644
index 0000000000..fd1112acf7
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  cecd359c6c261676bde42ab8b912c851d13d73759b16eb03496903833fdf4306  libdatachannel-v0.18.3-br1.tar.gz
+sha256  fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85  LICENSE
package/libdatachannel/libdatachannel.mk new file +32 -0
new file mode 100644
index 0000000000..d86eed9bef
@@ -0,0 +1,32 @@
+################################################################################
+#
+# libdatachannel
+#
+################################################################################
+
+LIBDATACHANNEL_VERSION = v0.18.3
+LIBDATACHANNEL_SITE_METHOD = git
+LIBDATACHANNEL_SITE = https://github.com/paullouisageneau/libdatachannel
+LIBDATACHANNEL_GIT_SUBMODULES = YES
+LIBDATACHANNEL_INSTALL_STAGING = YES
+LIBDATACHANNEL_LICENSE = MPL-2.0
+LIBDATACHANNEL_LICENSE_FILES = LICENSE
+
+LIBDATACHANNEL_CONF_OPTS = -DPREFER_SYSTEM_LIB=1
+
+ifeq ($(BR2_PACKAGE_JSON_FOR_MODERN_CPP),y)
+LIBDATACHANNEL_CONF_OPTS += -DUSE_SYSTEM_JSON=1
+LIBDATACHANNEL_DEPENDENCIES += json-for-modern-cpp
+endif
+
+ifeq ($(BR2_PACKAGE_LIBNICE),y)
+LIBDATACHANNEL_CONF_OPTS += -DUSE_NICE=1
+LIBDATACHANNEL_DEPENDENCIES += libnice
+endif
+
+ifeq ($(BR2_PACKAGE_LIBSRTP),y)
+LIBDATACHANNEL_CONF_OPTS += -DUSE_SYSTEM_SRTP=1
+LIBDATACHANNEL_DEPENDENCIES += libsrtp
+endif
+
+$(eval $(cmake-package))
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Maxim, All,

On 2023-04-26 19:14 +0300, Maksim Kiselev spake thusly:

Quoted 7 lines

This patch adds a new package for libdatachannel.

libdatachannel is an open-source software library implementing WebRTC Data Channels, WebRTC Media Transport, and WebSockets. It is written in C++17 and offers C bindings.

Thanks for this new package. Please see below for a quick review...

[--SNIP--]

package/Config.in menu "Audio/Sound" · line 1411

Quoted 9 lines
package/Config.in +1 -0
index eaac32a01a..c323409e37 100644
@@ -1408,6 +1408,7 @@ menu "Audio/Sound"
 	source "package/libcodec2/Config.in"
 	source "package/libcue/Config.in"
 	source "package/libcuefile/Config.in"
+	source "package/libdatachannel/Config.in"

I would have added that in the network category, rather than the audio/sound one.

[--SNIP--]

Quoted 11 lines
package/libdatachannel/libdatachannel.mk new file +5 -0
new file mode 100644
index 0000000000..d86eed9bef
@@ -0,0 +1,32 @@
+################################################################################
+#
+# libdatachannel
+#
+################################################################################

package/libdatachannel/libdatachannel.mk line 15

Quoted 10 lines
package/libdatachannel/libdatachannel.mk new file +10 -0
+
+LIBDATACHANNEL_VERSION = v0.18.3
+LIBDATACHANNEL_SITE_METHOD = git
+LIBDATACHANNEL_SITE = https://github.com/paullouisageneau/libdatachannel
+LIBDATACHANNEL_GIT_SUBMODULES = YES
+LIBDATACHANNEL_INSTALL_STAGING = YES
+LIBDATACHANNEL_LICENSE = MPL-2.0
+LIBDATACHANNEL_LICENSE_FILES = LICENSE
+
+LIBDATACHANNEL_CONF_OPTS = -DPREFER_SYSTEM_LIB=1

I think I understand what this means, but please explain it the commit log why we need to do so. Also, as the name if "prefer", what happens if a system dependency is not present? Does it fallback to the bundled one?

So, it would be better to explicitly disable all options that use bundled dependencies (e.g. juice, et al.).

Bulding tests is not necessary either, so they should be disable (-DNO_TESTS=1)

package/libdatachannel/libdatachannel.mk line 20

Quoted 4 lines
package/libdatachannel/libdatachannel.mk new file +4 -0
+ifeq ($(BR2_PACKAGE_JSON_FOR_MODERN_CPP),y)
+LIBDATACHANNEL_CONF_OPTS += -DUSE_SYSTEM_JSON=1
+LIBDATACHANNEL_DEPENDENCIES += json-for-modern-cpp
+endif

Unlesss this is not supported by the package buildsystem, we want to pass explicit disabling of options:

    ifeq ($(BR2_PACKAGE_JSON_FOR_MODERN_CPP),y)
    LIBDATACHANNEL_CONF_OPTS += -DUSE_SYSTEM_JSON=1
    LIBDATACHANNEL_DEPENDENCIES += json-for-modern-cpp
    else
    LIBDATACHANNEL_CONF_OPTS += -DUSE_SYSTEM_JSON=0
    endif

(and so on for the other two).

Care to fix and respin, please?

Regards,
Yann E. MORIN.

Quoted 18 lines
package/libdatachannel/libdatachannel.mk new file +11 -0
+ifeq ($(BR2_PACKAGE_LIBNICE),y)
+LIBDATACHANNEL_CONF_OPTS += -DUSE_NICE=1
+LIBDATACHANNEL_DEPENDENCIES += libnice
+endif
+
+ifeq ($(BR2_PACKAGE_LIBSRTP),y)
+LIBDATACHANNEL_CONF_OPTS += -DUSE_SYSTEM_SRTP=1
+LIBDATACHANNEL_DEPENDENCIES += libsrtp
+endif
+
+$(eval $(cmake-package))
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot