All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: "Théo Lebrun" <theo.lebrun@bootlin.com>
Cc: James Hilliard <james.hilliard1@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 2/3] package/roc: new package
Date: Wed, 20 Apr 2022 23:28:26 +0200	[thread overview]
Message-ID: <20220420212826.GK2730@scaer> (raw)
In-Reply-To: <20220310152048.633340-2-theo.lebrun@bootlin.com>

Théo, All,

On 2022-03-10 16:20 +0100, Théo Lebrun via buildroot spake thusly:
> Roc is a toolkit for real-time audio streaming over the network.
> https://roc-streaming.org/
> 
> Goal: optional dependency to PipeWire.
> Requires host-ragel to build.
> 
> Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
> ---
[--SNIP--]
> diff --git a/package/roc/0001-fix-build-that-used-removed-functionality.patch b/package/roc/0001-fix-build-that-used-removed-functionality.patch
> new file mode 100644
> index 0000000000..50147905c8
> --- /dev/null
> +++ b/package/roc/0001-fix-build-that-used-removed-functionality.patch
> @@ -0,0 +1,28 @@
> +build: fix build that used removed functionality
> +
> +The SConstruct file used the "SourceCode()" method that was removed in
> +SCons 4.0.0, after being deprecated in 2.0.0.
> +
> +This was fixed upstream but is not in the latest release yet.
> +https://github.com/roc-streaming/roc-toolkit/commit/abdfbb94df98fe88be4dd92ca587500126558411

Then please just backport that upstream commit (git format-patch, then
add your SoB line).

[--SNIP--]
> diff --git a/package/roc/Config.in b/package/roc/Config.in
> new file mode 100644
> index 0000000000..3fd74cab3f
> --- /dev/null
> +++ b/package/roc/Config.in
> @@ -0,0 +1,28 @@
> +comment "ROC needs a toolchain w/ shared libraries, C++, NPTL"
> +	depends on BR2_STATIC_LIBS || !BR2_INSTALL_LIBSTDCPP || \
> +		!BR2_TOOLCHAIN_HAS_THREADS_NPTL
> +	depends on BR2_USE_MMU
> +	depends on BR2_TOOLCHAIN_HAS_SYNC_4
> +
> +config BR2_PACKAGE_ROC
> +	bool "roc"
> +	# depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_1

Drop commented-out dependency.

> +	depends on !BR2_STATIC_LIBS
> +	depends on BR2_INSTALL_LIBSTDCPP
> +	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # libuv
> +	depends on BR2_USE_MMU # libuv
> +	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # libuv

Depenencies order are:
  - arch dependencies
  - toolchain dependencies
  - package dependencies

https://buildroot.org/downloads/manual/manual.html#_config_files

> +	select BR2_PACKAGE_HOST_PYTHON3
> +	select BR2_PACKAGE_HOST_PYTHON3_SSL
> +	select BR2_PACKAGE_LIBUV
> +	help
> +	  Roc is a toolkit for real-time audio streaming over the
> +	  network.
> +
> +	  https://roc-streaming.org/
> +
> +if BR2_PACKAGE_ROC

Empty line after an if (not a written rule, but it's more readable).

> +config BR2_PACKAGE_ROC_TOOLS
> +	bool "build roc-{conv,recv,send} tools"
> +	default y

We sually shy away from 'default y', unless there is a good reason,
which thus needs to be explained in the commit log.

Empty line before an endif (ditto).

[--SNIP--]
> diff --git a/package/roc/roc.mk b/package/roc/roc.mk
> new file mode 100644
> index 0000000000..90d226ffbd
> --- /dev/null
> +++ b/package/roc/roc.mk
> @@ -0,0 +1,75 @@
> +################################################################################
> +#
> +# roc
> +#
> +################################################################################
> +
> +ROC_VERSION = v0.1.5
> +ROC_SITE = $(call github,roc-streaming,roc-toolkit,$(ROC_VERSION))
> +ROC_LICENSE = MPL-2.0
> +ROC_LICENSE_FILES = LICENSE
> +ROC_INSTALL_STAGING = YES
> +ROC_DEPENDENCIES = \
> +	host-gengetopt \
> +	host-pkgconf \
> +	host-ragel \
> +	host-scons \
> +	libuv
> +
> +ROC_SCONS_OPTS = \
> +	--disable-tests \
> +	--disable-examples \
> +	--disable-doc \
> +	--disable-libunwind \
> +	--build-3rdparty=openfec

> +# We are not building OpenFEC ourselves as they are using a forked version. See
> +# the following note in the documentation:
> +# https://github.com/roc-streaming/roc-toolkit/blob/c89687330bfce6f4dce79826f7a235b581f2b49d/docs/sphinx/building/dependencies.rst

This must be explained in the commit log.

But why can't we use openfec as a separate package, using the roc fork?
The original OpenFEC has not been updated sine 2014: http://openfec.org/
The fork is not in a much better shape, not having been updated since
2019: https://github.com/roc-streaming/openfec

So, I would think it would be OK to package the roc fork of OpenFEC,
rather than use the bundled version.

Also, using --build-3rdparty means the download is done at configure
time (or even at build time), but we try to be able to build without
network; the following is expected to work:

    $ make source
    [unplug network]
    $ make

but --build-3rdparty will make that faile, AFAICS.

> +# The shared library is enabled by default. --enable-lib does not exist.
> +ifneq ($(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),y)

Why not use positive logic;

    ifeq ($(BR2_STATIC_LIBS),y)

> +ROC_SCONS_OPTS += --disable-lib
> +endif
> +
> +ifeq ($(BR2_PACKAGE_ROC_TOOLS),y)
> +
> +# Tools are enabled by default. --enable-tools does not exist.
> +
> +# SoX and Pulseaudio support is only used for tools or examples, which is why
> +# their support is inside the TOOLS condition.

Are examples built by default? If yes, can we disable them? If yes,
should we do that unconditionally, or add an option (I'd vote against
the option)?

> +ifeq ($(BR2_PACKAGE_SOX),y)
> +ROC_DEPENDENCIES += sox
> +else
> +ROC_SCONS_OPTS += --disable-sox
> +endif
> +
> +ifeq ($(BR2_PACKAGE_PULSEAUDIO),y)
> +ROC_DEPENDENCIES += pulseaudio
> +else
> +ROC_SCONS_OPTS += --disable-pulseaudio
> +endif
> +
> +else
> +ROC_SCONS_OPTS += --disable-tools
> +endif
> +
> +define ROC_BUILD_CMDS
> +	(cd $(@D); \

Enclosing the build commands in parentheses is useless; it just spawns
an extra shell for nothing. Ditto for all _CMDS below, of course.

> +	$(TARGET_CONFIGURE_OPTS) CROSS=$(TARGET_CROSS) \
> +		$(SCONS) $(ROC_SCONS_OPTS))
> +endef
> +
> +define ROC_INSTALL_STAGING_CMDS
> +	(cd $(@D); \
> +	$(TARGET_CONFIGURE_OPTS) CROSS=$(TARGET_CROSS) \
> +		$(SCONS) $(ROC_SCONS_OPTS) --prefix="$(STAGING_DIR)/usr" install)
> +endef
> +
> +define ROC_INSTALL_TARGET_CMDS
> +	(cd $(@D); \
> +	$(TARGET_CONFIGURE_OPTS) CROSS=$(TARGET_CROSS) \
> +		$(SCONS) $(ROC_SCONS_OPTS) --prefix="$(TARGET_DIR)/usr" install)
> +endef
> +
> +$(eval $(generic-package))
> -- 
> 2.35.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-04-20 21:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10 15:20 [Buildroot] [PATCH 1/3] package/ragel: new package Théo Lebrun via buildroot
2022-03-10 15:20 ` [Buildroot] [PATCH 2/3] package/roc: " Théo Lebrun via buildroot
2022-04-20 21:28   ` Yann E. MORIN [this message]
2022-03-10 15:20 ` [Buildroot] [PATCH 3/3] package/pipewire: add optional roc Théo Lebrun via buildroot
2022-04-20 20:57 ` [Buildroot] [PATCH 1/3] package/ragel: new package Yann E. MORIN
2022-04-20 21:07   ` Yann E. MORIN

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=20220420212826.GK2730@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=james.hilliard1@gmail.com \
    --cc=theo.lebrun@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.