Skip to contentSkip to conversation

package/ragel: new package

PATCH Applied Théo Lebrun via buildroot 2 participants 6 messages Mar 10, 2022 – Apr 20, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 package/ragel: new package

This is an host-only package that does preprocessing to .rl files to turn them into .c or .cpp files.

Initially added to support package/roc.

See https://www.colm.net/open-source/ragel/ for the project's home page:

Ragel compiles executable finite state machines from regular languages. Ragel targets C, C++ and ASM. Ragel state machines can not only recognize byte sequences as regular expression machines do, but can also execute code at arbitrary points in the recognition of a regular language. Code embedding is done using inline operators that do not disrupt the regular language syntax.

---
 package/ragel/ragel.hash |  3 +++
 package/ragel/ragel.mk   | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+)
 create mode 100644 package/ragel/ragel.hash
 create mode 100644 package/ragel/ragel.mk
package/ragel/ragel.hash new file +3 -0
new file mode 100644
index 0000000000..332f587432
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256  5f156edb65d20b856d638dd9ee2dfb43285914d9aa2b6ec779dac0270cd56c3f  ragel-6.10.tar.gz
+sha256  05a87975accb539399d0c8a4f4402ac27a6762fb1e4f31d04d455a8bee3e3693  COPYING
package/ragel/ragel.mk new file +18 -0
new file mode 100644
index 0000000000..476aff5da4
@@ -0,0 +1,18 @@
+################################################################################
+#
+# ragel
+#
+################################################################################
+
+RAGEL_VERSION = 6.10
+RAGEL_SITE = https://www.colm.net/files/ragel/
+RAGEL_LICENSE = GPL-2.0
+RAGEL_LICENSE_FILES = COPYING
+RAGEL_CONF_OPTS = \
+	--disable-silent-rules \
+	--disable-manual \
+	--disable-dependency-tracking
+RAGEL_DEPENDENCIES =
+HOST_RAGEL_DEPENDENCIES =
+
+$(eval $(host-autotools-package))
Signature · 6 lines
2.35.1

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

PATCH 2/3 package/roc: new package

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.

---
 package/Config.in                             |  1 +
 ...uild-that-used-removed-functionality.patch | 28 +++++++
 package/roc/Config.in                         | 28 +++++++
 package/roc/roc.hash                          |  3 +
 package/roc/roc.mk                            | 75 +++++++++++++++++++
 5 files changed, 135 insertions(+)
 create mode 100644 package/roc/0001-fix-build-that-used-removed-functionality.patch
 create mode 100644 package/roc/Config.in
 create mode 100644 package/roc/roc.hash
 create mode 100644 package/roc/roc.mk
package/Config.in +1 -0
index 0d5d763180..7ed075ae19 100644
@@ -48,6 +48,7 @@ menu "Audio and video applications"
 	source "package/on2-8170-libs/Config.in"
 	source "package/opus-tools/Config.in"
 	source "package/pulseaudio/Config.in"
+	source "package/roc/Config.in"
 	source "package/sox/Config.in"
 	source "package/squeezelite/Config.in"
 	source "package/tovid/Config.in"
package/roc/0001-fix-build-that-used-removed-functionality.patch new file +28 -0
new file mode 100644
index 0000000000..50147905c8
@@ -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
+
+Signed-off-by: Théo Lebrun <[email protected]>
+---
+ SConstruct | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/SConstruct b/SConstruct
+index c724854..91fd469 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -49,7 +49,6 @@ env = Environment(ENV=os.environ, tools=[
+ # performance tuning
+ env.Decider('MD5-timestamp')
+ env.SetOption('implicit_cache', 1)
+-env.SourceCode('.', None)
+ 
+ # provide absolute path to force single sconsign file
+ # per-directory sconsign files seems to be buggy with generated sources
+-- 
+2.35.1
+
package/roc/Config.in new file +28 -0
new file mode 100644
index 0000000000..3fd74cab3f
@@ -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
+	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
+	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
+config BR2_PACKAGE_ROC_TOOLS
+	bool "build roc-{conv,recv,send} tools"
+	default y
+endif
package/roc/roc.hash new file +3 -0
new file mode 100644
index 0000000000..92bd8ce022
@@ -0,0 +1,3 @@
+# Computed locally:
+sha256  b5f6eda94e5f989226bc6e61dcd0e307e711f00e3b27da49b552133862117353  roc-v0.1.5.tar.gz
+sha256  60222c28c1a7f6a92c7df98e5c5f4459e624e6e285e0b9b94467af5f6ab3343d  LICENSE
package/roc/roc.mk new file +75 -0

75 lines not on this page · raw message

Signature · 6 lines
2.35.1

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

Re: [Buildroot] [PATCH 2/3] package/roc: new package

Théo, All,

On 2022-03-10 16:20 +0100, Théo Lebrun via buildroot spake thusly:

Quoted 8 lines

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.

---

[--SNIP--]

package/roc/0001-fix-build-that-used-removed-functionality.patch line 7

Quoted 13 lines
package/roc/0001-fix-build-that-used-removed-functionality.patch new file +7 -0
new file mode 100644
index 0000000000..50147905c8
@@ -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--]

Quoted 6 lines
package/roc/Config.in new file +0 -0
new file mode 100644
index 0000000000..3fd74cab3f

package/roc/Config.in line 9

Quoted 9 lines
package/roc/Config.in new file +9 -0
@@ -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.

package/roc/Config.in line 14

Quoted 5 lines
package/roc/Config.in new file +5 -0
+	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

package/roc/Config.in line 24

Quoted 10 lines
package/roc/Config.in new file +10 -0
+	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).

package/roc/Config.in line 27

Quoted 3 lines
package/roc/Config.in new file +3 -0
+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--]

Quoted 24 lines
package/roc/roc.mk new file +18 -0
new file mode 100644
index 0000000000..90d226ffbd
@@ -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
+

package/roc/roc.mk line 27

Quoted 10 lines
package/roc/roc.mk new file +9 -0
+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.

package/roc/roc.mk line 30

Quoted 2 lines
package/roc/roc.mk new file +2 -0
+# 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)

package/roc/roc.mk line 39

Quoted 9 lines
package/roc/roc.mk new file +9 -0
+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)?

Quoted 8 lines
package/roc/roc.mk new file +8 -0
+ifeq ($(BR2_PACKAGE_SOX),y)
+ROC_DEPENDENCIES += sox
+else
+ROC_SCONS_OPTS += --disable-sox
+endif
+
+ifeq ($(BR2_PACKAGE_PULSEAUDIO),y)
+ROC_DEPENDENCIES += pulseaudio

package/roc/roc.mk line 58

Quoted 10 lines
package/roc/roc.mk new file +10 -0
+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.

Quoted 24 lines
package/roc/roc.mk new file +17 -0
+	$(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))
Signature · 6 lines
2.35.1

_______________________________________________
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
#3 lore raw

PATCH 3/3 package/pipewire: add optional roc

In reply to Théo Lebrun via buildroot

Roc is a toolkit for real-time audio streaming over the network, that can be used as a PipeWire module.

Successful if libpipewire-module-roc-{sink,source}.so get built.

---
 package/pipewire/pipewire.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/pipewire/pipewire.mk +7 -0
index fc521c86ac..de27bce10c 100644
@@ -189,6 +189,13 @@ else
 PIPEWIRE_CONF_OPTS += -Draop=disabled
 endif
 
+ifeq ($(BR2_PACKAGE_ROC),y)
+PIPEWIRE_CONF_OPTS += -Droc=enabled
+PIPEWIRE_DEPENDENCIES += roc
+else
+PIPEWIRE_CONF_OPTS += -Droc=disabled
+endif
+
 define PIPEWIRE_USERS
 	pipewire -1 pipewire -1 * - - audio,video PipeWire System Daemon
 endef
Signature · 6 lines
2.35.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw
In reply to Théo Lebrun via buildroot

Théo, All,

On 2022-03-10 16:20 +0100, Théo Lebrun via buildroot spake thusly:

Quoted 43 lines

This is an host-only package that does preprocessing to .rl files to turn them into .c or .cpp files.

Initially added to support package/roc.

See https://www.colm.net/open-source/ragel/ for the project's home page:

Ragel compiles executable finite state machines from regular languages. Ragel targets C, C++ and ASM. Ragel state machines can not only recognize byte sequences as regular expression machines do, but can also execute code at arbitrary points in the recognition of a regular language. Code embedding is done using inline operators that do not disrupt the regular language syntax.

---
 package/ragel/ragel.hash |  3 +++
 package/ragel/ragel.mk   | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+)
 create mode 100644 package/ragel/ragel.hash
 create mode 100644 package/ragel/ragel.mk
package/ragel/ragel.hash new file +3 -0
new file mode 100644
index 0000000000..332f587432
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256  5f156edb65d20b856d638dd9ee2dfb43285914d9aa2b6ec779dac0270cd56c3f  ragel-6.10.tar.gz
+sha256  05a87975accb539399d0c8a4f4402ac27a6762fb1e4f31d04d455a8bee3e3693  COPYING
package/ragel/ragel.mk new file +6 -0
new file mode 100644
index 0000000000..476aff5da4
@@ -0,0 +1,18 @@
+################################################################################
+#
+# ragel
+#
+################################################################################
+

package/ragel/ragel.mk line 16

Quoted 10 lines
package/ragel/ragel.mk new file +10 -0
+RAGEL_VERSION = 6.10
+RAGEL_SITE = https://www.colm.net/files/ragel/
+RAGEL_LICENSE = GPL-2.0
+RAGEL_LICENSE_FILES = COPYING
+RAGEL_CONF_OPTS = \
+	--disable-silent-rules \
+	--disable-manual \
+	--disable-dependency-tracking
+RAGEL_DEPENDENCIES =
+HOST_RAGEL_DEPENDENCIES =

Useless setting of empty variables. Besides, RAGEL_DEPENDENCIES is not even needed as this is a host-only package.

Applied to master after dropping those two variables, thanks.

Regards,
Yann E. MORIN.

Quoted 8 lines
package/ragel/ragel.mk new file +1 -0
+$(eval $(host-autotools-package))
Signature · 6 lines
2.35.1

_______________________________________________
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
#5 lore raw

Théo, All,

On 2022-04-20 22:57 +0200, Yann E. MORIN spake thusly:

Quoted 3 lines

On 2022-03-10 16:20 +0100, Théo Lebrun via buildroot spake thusly:

Quoted 2 lines

This is an host-only package that does preprocessing to .rl files to turn them into .c or .cpp files.

[--SNIP--]

Quoted 8 lines

package/ragel/ragel.mk line 14

Quoted 8 lines
package/ragel/ragel.mk new file +8 -0
+RAGEL_VERSION = 6.10
+RAGEL_SITE = https://www.colm.net/files/ragel/
+RAGEL_LICENSE = GPL-2.0
+RAGEL_LICENSE_FILES = COPYING
+RAGEL_CONF_OPTS = \
+	--disable-silent-rules \
+	--disable-manual \
+	--disable-dependency-tracking

Gah, I forgot to comment about those before pushing and sending the previous mail...

So, why were --disable-silent-rules and --disable-dependency-tracking needed? Usually, they are not needed, and we do not even set them in our autotools-package infra.

If they are really important, could you please send a followup that adds a comment above RAGEL_CONF_OPTS? And if they are not needed, can you send a followup patch that removes them?

Regards,
Yann E. MORIN.

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