From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Kadambini Nema <kadambini.nema@gmail.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/ustreamer: new package
Date: Sat, 11 May 2024 22:08:09 +0200 [thread overview]
Message-ID: <20240511220809.5d62155e@windsurf> (raw)
In-Reply-To: <20240219213402.186876-1-kadambini.nema@gmail.com>
Hello Kadambini,
Thanks, I applied your patch, with a number of changes, see below.
On Mon, 19 Feb 2024 13:34:02 -0800
Kadambini Nema <kadambini.nema@gmail.com> wrote:
> diff --git a/package/ustreamer/Config.in b/package/ustreamer/Config.in
> new file mode 100644
> index 0000000000..52c511e22d
> --- /dev/null
> +++ b/package/ustreamer/Config.in
> @@ -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.
> + 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
> + 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
> diff --git a/package/ustreamer/ustreamer.mk b/package/ustreamer/ustreamer.mk
> new file mode 100644
> index 0000000000..71de097a22
> --- /dev/null
> +++ b/package/ustreamer/ustreamer.mk
> @@ -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))
> +USTREAMER_SUBDIR = ustreamer
This is not used, so I dropped it.
> +USTREAMER_LICENSE = GPL-3.0-or-later
We don't use the SPDX identifier for this case, we use:
+USTREAMER_LICENSE = GPL-3.0+
> +USTREAMER_LICENSE_FILES = LICENSE
> +USTREAMER_DEPENDENCIES = jpeg libevent libbsd libgpiod
I dropped libgpiod here.
> +USTREAMER_CONF_ENV = "CFLAGS=$(TARGET_CFLAGS)"
This was not used anywhere, so I dropped.
> +
> +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
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2024-05-11 20:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-12 0:26 [Buildroot] [PATCH v2] package/ustreamer: new package Kadambini Nema
2024-02-19 21:34 ` [Buildroot] [PATCH 1/1] " Kadambini Nema
2024-05-11 20:08 ` Thomas Petazzoni via buildroot [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-02-11 9:14 Kadambini Nema
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240511220809.5d62155e@windsurf \
--to=buildroot@buildroot.org \
--cc=kadambini.nema@gmail.com \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox