Skip to contentSkip to conversation

package/ustreamer: new package

PATCH New Kadambini Nema 2 participants 3 messages Feb 12, 2024 – May 11, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/ustreamer: new package

Lightweight and fast MJPEG-HTTP streamer
(https://github.com/pikvm/ustreamer/tree/master#%C2%B5streamer)

---
Changes v1 -> v2:
- Fix 'make legal-info' with ustreamer package enabled.

---
 DEVELOPERS                       |  3 +++
 package/Config.in                |  1 +
 package/ustreamer/Config.in      | 17 +++++++++++++++++
 package/ustreamer/ustreamer.hash |  3 +++
 package/ustreamer/ustreamer.mk   | 23 +++++++++++++++++++++++
 5 files changed, 47 insertions(+)
 create mode 100644 package/ustreamer/Config.in
 create mode 100644 package/ustreamer/ustreamer.hash
 create mode 100644 package/ustreamer/ustreamer.mk
DEVELOPERS +3 -0
index 0d12c3abcb..a6182777c0 100644
@@ -1875,6 +1875,9 @@ F:	package/easy-rsa/
 N:	Justin Maggard <[email protected]>
 F:	package/dtach/
 
+N:	Kadambini Nema <[email protected]>
+F:	package/ustreamer/
+
 N:	Kamel Bouhara <[email protected]>
 F:	package/libodb-boost/
 F:	package/libodb-mysql/
package/Config.in +1 -0
index bf0fe078b9..479c8b6657 100644
@@ -2595,6 +2595,7 @@ endif
 	source "package/uredir/Config.in"
 	source "package/ushare/Config.in"
 	source "package/ussp-push/Config.in"
+	source "package/ustreamer/Config.in"
 	source "package/vde2/Config.in"
 	source "package/vdr/Config.in"
 	source "package/vdr-plugin-vnsiserver/Config.in"
package/ustreamer/Config.in new file +17 -0
new file mode 100644
index 0000000000..52c511e22d
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_USTREAMER
+	bool "ustreamer"
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16 # V4L2_EVENT_SOURCE_CHANGE
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_TOOLCHAIN_HAS_ATOMIC
+	select BR2_PACKAGE_JPEG
+	select BR2_PACKAGE_LIBEVENT
+	select BR2_PACKAGE_LIBBSD
+	select BR2_PACKAGE_LIBGPIOD
+	help
+	  Lightweight and fast MJPEG-HTTP streamer
+
+	  https://github.com/pikvm/ustreamer
+
+comment "ustreamer needs a toolchain w/ threads, headers >= 3.16, dynamic library"
package/ustreamer/ustreamer.hash new file +3 -0
new file mode 100644
index 0000000000..b7a85ca2d5
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  198283aaea5e7aa51da54426eb79ea436641ffb9b431e9ebace8fe5a76dfb105  ustreamer-b2ebcf99c8c51f97c44eccb6c768f5e824ecf952.tar.gz
+sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  LICENSE
package/ustreamer/ustreamer.mk new file +23 -0
new file mode 100644
index 0000000000..fbc30527bc
@@ -0,0 +1,23 @@
+################################################################################
+#
+# ustreamer
+#
+################################################################################
+
+USTREAMER_VERSION = b2ebcf99c8c51f97c44eccb6c768f5e824ecf952
+USTREAMER_SITE = $(call github,pikvm,ustreamer,$(USTREAMER_VERSION))
+USTREAMER_LICENSE = GPL-3.0-or-later
+USTREAMER_LICENSE_FILES = LICENSE
+USTREAMER_DEPENDENCIES = jpeg libevent libbsd libgpiod
+USTREAMER_CONF_ENV = "CFLAGS=$(TARGET_CFLAGS)"
+
+define USTREAMER_BUILD_CMDS
+	$(MAKE)  $(if $(BR2_PACKAGE_SYSTEMD),WITH_SYSTEMD=1, ) WITH_PTHREAD_NP=1  WITH_SETPROCTITLE=1 HAS_PDEATHSIG=1 $(TARGET_CONFIGURE_OPTS) -C $(@D)
+endef
+
+define USTREAMER_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/ustreamer $(TARGET_DIR)/usr/bin/ustreamer
+	$(INSTALL) -D -m 0755 $(@D)/ustreamer-dump $(TARGET_DIR)/usr/bin/ustreamer-dump
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
2.25.1

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

PATCH 1/1 package/ustreamer: new package

Lightweight and fast MJPEG-HTTP streamer
(https://github.com/pikvm/ustreamer/tree/master#%C2%B5streamer)

---
Changes v1 -> v2:
- Fix 'make legal-info' with ustreamer package enabled.
Changes v2 -> v3:
- Fix a build failure with uclibc. (https://github.com/pikvm/ustreamer/commit/13af11a3a64cf9f08014e89f35e52e001fb10cad)
- Upgrade to the latest version - 5.51
---

$ ./utils/test-pkg -k -c ustreamer.config  -p ustreamer
                    bootlin-armv5-uclibc [1/6]: OK
                     bootlin-armv7-glibc [2/6]: OK
                   bootlin-armv7m-uclibc [3/6]: SKIPPED
                     bootlin-x86-64-musl [4/6]: OK
                      br-arm-full-static [5/6]: SKIPPED
                            sourcery-arm [6/6]: SKIPPED
6 builds, 3 skipped, 0 build failed, 0 legal-info failed, 0 show-info failed
---
---
 DEVELOPERS                       |  3 +++
 package/Config.in                |  1 +
 package/ustreamer/Config.in      | 17 +++++++++++++++++
 package/ustreamer/ustreamer.hash |  3 +++
 package/ustreamer/ustreamer.mk   | 25 +++++++++++++++++++++++++
 5 files changed, 49 insertions(+)
 create mode 100644 package/ustreamer/Config.in
 create mode 100644 package/ustreamer/ustreamer.hash
 create mode 100644 package/ustreamer/ustreamer.mk
DEVELOPERS +3 -0
index 0d12c3abcb..a6182777c0 100644
@@ -1875,6 +1875,9 @@ F:	package/easy-rsa/
 N:	Justin Maggard <[email protected]>
 F:	package/dtach/
 
+N:	Kadambini Nema <[email protected]>
+F:	package/ustreamer/
+
 N:	Kamel Bouhara <[email protected]>
 F:	package/libodb-boost/
 F:	package/libodb-mysql/
package/Config.in +1 -0
index bf0fe078b9..479c8b6657 100644
@@ -2595,6 +2595,7 @@ endif
 	source "package/uredir/Config.in"
 	source "package/ushare/Config.in"
 	source "package/ussp-push/Config.in"
+	source "package/ustreamer/Config.in"
 	source "package/vde2/Config.in"
 	source "package/vdr/Config.in"
 	source "package/vdr-plugin-vnsiserver/Config.in"
package/ustreamer/Config.in new file +17 -0
new file mode 100644
index 0000000000..52c511e22d
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_USTREAMER
+	bool "ustreamer"
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16 # V4L2_EVENT_SOURCE_CHANGE
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_TOOLCHAIN_HAS_ATOMIC
+	select BR2_PACKAGE_JPEG
+	select BR2_PACKAGE_LIBEVENT
+	select BR2_PACKAGE_LIBBSD
+	select BR2_PACKAGE_LIBGPIOD
+	help
+	  Lightweight and fast MJPEG-HTTP streamer
+
+	  https://github.com/pikvm/ustreamer
+
+comment "ustreamer needs a toolchain w/ threads, headers >= 3.16, dynamic library"
package/ustreamer/ustreamer.hash new file +3 -0
new file mode 100644
index 0000000000..a8cb1695e5
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  88f107e02a0b5c6493d55ed1bce0c85f66ce83d2bc0271ff6319ad593c6584bc  v5.51.tar.gz
+sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  LICENSE
package/ustreamer/ustreamer.mk new file +25 -0
new file mode 100644
index 0000000000..71de097a22
@@ -0,0 +1,25 @@
+################################################################################
+#
+# ustreamer
+#
+################################################################################
+
+USTREAMER_VERSION = 5.51
+USTREAMER_SITE = $(call github,pikvm,ustreamer,refs/tags)
+USTREAMER_SOURCE = v$(USTREAMER_VERSION).tar.gz
+USTREAMER_SUBDIR = ustreamer
+USTREAMER_LICENSE = GPL-3.0-or-later
+USTREAMER_LICENSE_FILES = LICENSE
+USTREAMER_DEPENDENCIES = jpeg libevent libbsd libgpiod
+USTREAMER_CONF_ENV = "CFLAGS=$(TARGET_CFLAGS)"
+
+define USTREAMER_BUILD_CMDS
+	$(MAKE)  $(if $(BR2_PACKAGE_SYSTEMD),WITH_SYSTEMD=1, ) WITH_PTHREAD_NP=1  WITH_SETPROCTITLE=1 HAS_PDEATHSIG=1 $(TARGET_CONFIGURE_OPTS) -C $(@D)
+endef
+
+define USTREAMER_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/ustreamer $(TARGET_DIR)/usr/bin/ustreamer
+	$(INSTALL) -D -m 0755 $(@D)/ustreamer-dump $(TARGET_DIR)/usr/bin/ustreamer-dump
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
2.25.1

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

Hello Kadambini,

Thanks, I applied your patch, with a number of changes, see below.

package/ustreamer/Config.in line 7

Quoted 13 lines · On Mon, 19 Feb 2024 13:34:02 -0800 Kadambini Nema <[email protected]>…
package/ustreamer/Config.in new file +7 -0
new file mode 100644
index 0000000000..52c511e22d
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_USTREAMER
+	bool "ustreamer"
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16 # V4L2_EVENT_SOURCE_CHANGE
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_TOOLCHAIN_HAS_ATOMIC

I'm not sure why this dependency was needed. It built fine for sparc, which normally causes problems with libatomic.

package/ustreamer/Config.in line 11

Quoted 4 lines
package/ustreamer/Config.in new file +4 -0
+	select BR2_PACKAGE_JPEG
+	select BR2_PACKAGE_LIBEVENT
+	select BR2_PACKAGE_LIBBSD
+	select BR2_PACKAGE_LIBGPIOD

libgpiod is not a mandatory dependency, so I dropped this. And in fact, with a select BR2_PACKAGE_LIBGPIOD, you should have added a depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8, which is inherited from libgpiod.

The BR2_USE_WCHAR dependency from libbsd was missing.

Overall, the result is:

+ bool "ustreamer"
+ depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16 # V4L2_EVENT_SOURC
E_CHANGE

+       depends on BR2_TOOLCHAIN_HAS_THREADS # libbsd
+       depends on !BR2_STATIC_LIBS # libbsd
+       depends on BR2_PACKAGE_LIBBSD_ARCH_SUPPORTS # libbsd
+       depends on BR2_USE_WCHAR # libbsd
+       select BR2_PACKAGE_JPEG
+       select BR2_PACKAGE_LIBBSD
+       select BR2_PACKAGE_LIBEVENT

package/ustreamer/Config.in line 17

Quoted 6 lines
package/ustreamer/Config.in new file +6 -0
+	help
+	  Lightweight and fast MJPEG-HTTP streamer
+
+	  https://github.com/pikvm/ustreamer
+
+comment "ustreamer needs a toolchain w/ threads, headers >= 3.16, dynamic library"

This was missing depends on so that it only appears when relevant, i.e:

+comment "ustreamer needs a toolchain w/ headers >= 3.16, threads, dynamic library, wchar"
+ depends on BR2_PACKAGE_LIBBSD_ARCH_SUPPORTS
+ depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16 || \

+               !BR2_TOOLCHAIN_HAS_THREADS || \
+               BR2_STATIC_LIBS || \
+               !BR2_USE_WCHAR
Quoted 6 lines
package/ustreamer/ustreamer.mk new file +0 -0
new file mode 100644
index 0000000000..71de097a22

package/ustreamer/ustreamer.mk line 9

Quoted 9 lines
package/ustreamer/ustreamer.mk new file +9 -0
@@ -0,0 +1,25 @@
+################################################################################
+#
+# ustreamer
+#
+################################################################################
+
+USTREAMER_VERSION = 5.51
+USTREAMER_SITE = $(call github,pikvm,ustreamer,refs/tags)
+USTREAMER_SOURCE = v$(USTREAMER_VERSION).tar.gz

This is not how the github macro is meant to be used. It's supposed to be used like this:

+USTREAMER_VERSION = 5.51
+USTREAMER_SITE = $(call github,pikvm,ustreamer,v$(USTREAMER_VERSION))

package/ustreamer/ustreamer.mk line 10

Quoted 1 line
package/ustreamer/ustreamer.mk new file +1 -0
+USTREAMER_SUBDIR = ustreamer

This is not used, so I dropped it.

package/ustreamer/ustreamer.mk line 11

Quoted 1 line
package/ustreamer/ustreamer.mk new file +1 -0
+USTREAMER_LICENSE = GPL-3.0-or-later

We don't use the SPDX identifier for this case, we use:

+USTREAMER_LICENSE = GPL-3.0+

package/ustreamer/ustreamer.mk line 13

Quoted 2 lines
package/ustreamer/ustreamer.mk new file +2 -0
+USTREAMER_LICENSE_FILES = LICENSE
+USTREAMER_DEPENDENCIES = jpeg libevent libbsd libgpiod

I dropped libgpiod here.

package/ustreamer/ustreamer.mk line 14

Quoted 1 line
package/ustreamer/ustreamer.mk new file +1 -0
+USTREAMER_CONF_ENV = "CFLAGS=$(TARGET_CFLAGS)"

This was not used anywhere, so I dropped.

package/ustreamer/ustreamer.mk line 18

Quoted 4 lines
package/ustreamer/ustreamer.mk new file +4 -0
+
+define USTREAMER_BUILD_CMDS
+	$(MAKE)  $(if $(BR2_PACKAGE_SYSTEMD),WITH_SYSTEMD=1, ) WITH_PTHREAD_NP=1  WITH_SETPROCTITLE=1 HAS_PDEATHSIG=1 $(TARGET_CONFIGURE_OPTS) -C $(@D)
+endef

The systemd case was not working, because you were not adding a dependency on systemd, so nothing was making sure that systemd would get built before ustream. I also added handling libgpiod as an optional dependency. Overall it looks like this now:

+USTREAMER_MAKE_OPTS = \

+       $(TARGET_CONFIGURE_OPTS) \
+       WITH_PTHREAD_NP=1 \
+       WITH_SETPROCTITLE=1 \
+       HAS_PDEATHSIG=1

+
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+USTREAMER_MAKE_OPTS += WITH_SYSTEMD=1
+USTREAMER_DEPENDENCIES += systemd
+endif
+
+ifeq ($(BR2_PACKAGE_LIBGPIOD),y)
+USTREAMER_MAKE_OPTS += WITH_GPIO=1
+USTREAMER_DEPENDENCIES += libgpiod
+endif
+
+define USTREAMER_BUILD_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) $(USTREAMER_MAKE_OPTS) -C $(@D)
+endef

Applied with all those changes!

Best regards,

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot