Skip to contentSkip to conversation

package/alure: new package

PATCH New Romain Naour 2 participants 8 messages Jan 5, 2020 – Jan 12, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 package/alure: new package

Use the latest commit since there is no release since 1.2 (8 years ago).

While testing with test-pkg, the last build issue was due to the gcc 4.8.3 compiler missing C++11 feature:
"std::list.erase(const_iterator pos) not implemented" [1]

arm-none-linux-gnueabi/include/c++/4.8.3/bits/vector.tcc:134:5: note:
no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<const alure::Source*, std::vector<alure::Source> >' to 'std::vector<alure::Source>::iterator {aka __gnu_cxx::__normal_iterator<alure::Source*, std::vector<alure::Source> >}

https://github.com/kcat/alure/blob/14beed2a86d5a36030e907b21c46614d505f07cd/src/context.cpp#L1357

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57158

---
 package/Config.in        |  1 +
 package/alure/Config.in  | 27 +++++++++++++++++++++++++++
 package/alure/alure.hash |  2 ++
 package/alure/alure.mk   | 34 ++++++++++++++++++++++++++++++++++
 4 files changed, 64 insertions(+)
 create mode 100644 package/alure/Config.in
 create mode 100644 package/alure/alure.hash
 create mode 100644 package/alure/alure.mk
package/Config.in +1 -0
index 894284c650..98ac976138 100644
@@ -1199,6 +1199,7 @@ menu "Libraries"
 
 menu "Audio/Sound"
 	source "package/alsa-lib/Config.in"
+	source "package/alure/Config.in"
 	source "package/aubio/Config.in"
 	source "package/audiofile/Config.in"
 	source "package/bcg729/Config.in"
package/alure/Config.in new file +27 -0
new file mode 100644
index 0000000000..4acd66d2ee
@@ -0,0 +1,27 @@
+config BR2_PACKAGE_ALURE
+	bool "alure"
+	depends on BR2_PACKAGE_OPENAL_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++11
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # openal
+	depends on BR2_USE_WCHAR # use wchar_t
+	depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # std::shared_future
+	select BR2_PACKAGE_OPENAL
+	help
+	  Alure is a C++ 3D audio API. It uses OpenAL for audio
+	  rendering, and provides common higher-level features such as
+	  file loading and decoding, buffer caching, background
+	  streaming, and source management for virtually unlimited
+	  sound source handles.
+
+	  https://kcat.strangesoft.net/alure.html
+
+comment "alure needs a toolchain w/ C++, gcc >= 4.9, NPTL, wchar"
+	depends on BR2_PACKAGE_OPENAL_ARCH_SUPPORTS
+	depends on !BR2_INSTALL_LIBSTDCPP \
+		|| !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 \
+		|| !BR2_TOOLCHAIN_HAS_THREADS_NPTL || !BR2_USE_WCHAR
+
+comment "alure needs a toolchain not affected by GCC bug 64735"
+	depends on BR2_PACKAGE_OPENAL_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735
package/alure/alure.hash new file +2 -0
new file mode 100644
index 0000000000..3387f76f9d
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 9b808e5b5a54d156348221dc86704c7831115047d5238691e6088f8c4814b2ca  alure-14beed2a86d5a36030e907b21c46614d505f07cd.tar.gz
package/alure/alure.mk new file +34 -0
new file mode 100644
index 0000000000..c3bf5d31cf
@@ -0,0 +1,34 @@
+################################################################################
+#
+# alure
+#
+################################################################################
+
+ALURE_VERSION = 14beed2a86d5a36030e907b21c46614d505f07cd
+ALURE_SITE = $(call github,kcat,alure,$(ALURE_VERSION))
+ALURE_LICENSE = MIT, Public Domain (src/decoders/dr_flac.h)
+ALURE_LICENSE_FILES = LICENSE
+ALURE_INSTALL_STAGING = YES
+
+ALURE_DEPENDENCIES = openal
+
+# Disabling alure examples remove the dependecies on physfs and dump libraries.
+# Enable at least one built-in decoder (wave).
+ALURE_CONF_OPTS = -DALURE_INSTALL=ON \
+	-DALURE_BUILD_EXAMPLES=OFF \
+	-DALURE_ENABLE_FLAC=OFF \
+	-DALURE_ENABLE_MINIMP3=OFF \
+	-DALURE_ENABLE_OPUS=OFF \
+	-DALURE_ENABLE_SNDFILE=OFF \
+	-DALURE_ENABLE_VORBIS=OFF \
+	-DALURE_ENABLE_WAVE=ON
+
+ifeq ($(BR2_STATIC_LIBS),y)
+ALURE_CONF_OPTS += -DALURE_BUILD_SHARED=OFF \
+	-DALURE_BUILD_STATIC=ON
+else
+ALURE_CONF_OPTS += -DALURE_BUILD_SHARED=ON \
+	-DALURE_BUILD_STATIC=OFF
+endif
+
+$(eval $(cmake-package))
Signature · 1 line
2.24.1
#1 lore raw

PATCH 2/6 package/alure: add flac decoder option

Alure doesn't use/need flac package as dependency.

---
 package/alure/Config.in | 9 +++++++++
 package/alure/alure.mk  | 7 ++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
package/alure/Config.in +9 -0
index 4acd66d2ee..df86ff2a92 100644
@@ -16,6 +16,15 @@ config BR2_PACKAGE_ALURE
 
 	  https://kcat.strangesoft.net/alure.html
 
+if BR2_PACKAGE_ALURE
+
+config BR2_PACKAGE_ALURE_FLAC_DECODER
+	bool "flac decoder"
+	help
+	  Enables the built-in FLAC decoder.
+
+endif
+
 comment "alure needs a toolchain w/ C++, gcc >= 4.9, NPTL, wchar"
 	depends on BR2_PACKAGE_OPENAL_ARCH_SUPPORTS
 	depends on !BR2_INSTALL_LIBSTDCPP \
package/alure/alure.mk +6 -1
index c3bf5d31cf..233d21529d 100644
@@ -16,13 +16,18 @@ ALURE_DEPENDENCIES = openal
 # Enable at least one built-in decoder (wave).
 ALURE_CONF_OPTS = -DALURE_INSTALL=ON \
 	-DALURE_BUILD_EXAMPLES=OFF \
-	-DALURE_ENABLE_FLAC=OFF \
 	-DALURE_ENABLE_MINIMP3=OFF \
 	-DALURE_ENABLE_OPUS=OFF \
 	-DALURE_ENABLE_SNDFILE=OFF \
 	-DALURE_ENABLE_VORBIS=OFF \
 	-DALURE_ENABLE_WAVE=ON
 
+ifeq ($(BR2_PACKAGE_ALURE_FLAC_DECODER),y)
+ALURE_CONF_OPTS += -DALURE_ENABLE_FLAC=ON
+else
+ALURE_CONF_OPTS += -DALURE_ENABLE_FLAC=OFF
+endif
+
 ifeq ($(BR2_STATIC_LIBS),y)
 ALURE_CONF_OPTS += -DALURE_BUILD_SHARED=OFF \
 	-DALURE_BUILD_STATIC=ON
Signature · 1 line
2.24.1
#2 lore raw

PATCH 3/6 package/alure: add opus decoder option

In reply to Romain Naour

The opus option is available only when libogg is
detected by the build system.

---
 package/alure/Config.in | 7 +++++++
 package/alure/alure.mk  | 8 +++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
package/alure/Config.in +7 -0
index df86ff2a92..7947e30a1f 100644
@@ -23,6 +23,13 @@ config BR2_PACKAGE_ALURE_FLAC_DECODER
 	help
 	  Enables the built-in FLAC decoder.
 
+config BR2_PACKAGE_ALURE_OPUS_DECODER
+	bool "opus decoder"
+	select BR2_PACKAGE_LIBOGG
+	select BR2_PACKAGE_OPUS
+	help
+	  Enables the built-in libopusfile decoder.
+
 endif
 
 comment "alure needs a toolchain w/ C++, gcc >= 4.9, NPTL, wchar"
package/alure/alure.mk +7 -1
index 233d21529d..32f3df5349 100644
@@ -17,7 +17,6 @@ ALURE_DEPENDENCIES = openal
 ALURE_CONF_OPTS = -DALURE_INSTALL=ON \
 	-DALURE_BUILD_EXAMPLES=OFF \
 	-DALURE_ENABLE_MINIMP3=OFF \
-	-DALURE_ENABLE_OPUS=OFF \
 	-DALURE_ENABLE_SNDFILE=OFF \
 	-DALURE_ENABLE_VORBIS=OFF \
 	-DALURE_ENABLE_WAVE=ON
@@ -28,6 +27,13 @@ else
 ALURE_CONF_OPTS += -DALURE_ENABLE_FLAC=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_ALURE_OPUS_DECODER),y)
+ALURE_CONF_OPTS += -DALURE_ENABLE_OPUS=ON
+ALURE_DEPENDENCIES += libogg opus
+else
+ALURE_CONF_OPTS += -DALURE_ENABLE_OPUS=OFF
+endif
+
 ifeq ($(BR2_STATIC_LIBS),y)
 ALURE_CONF_OPTS += -DALURE_BUILD_SHARED=OFF \
 	-DALURE_BUILD_STATIC=ON
Signature · 1 line
2.24.1
#3 lore raw

PATCH 4/6 package/alure: add libvorbis decoder option

In reply to Romain Naour
---
 package/alure/Config.in | 7 +++++++
 package/alure/alure.mk  | 8 +++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
package/alure/Config.in +7 -0
index 7947e30a1f..20b9e4e4e9 100644
@@ -30,6 +30,13 @@ config BR2_PACKAGE_ALURE_OPUS_DECODER
 	help
 	  Enables the built-in libopusfile decoder.
 
+config BR2_PACKAGE_ALURE_VORBIS_DECODER
+	bool "vorbis decoder"
+	select BR2_PACKAGE_LIBVORBIS
+	select BR2_PACKAGE_OPUS
+	help
+	  Enables the built-in libvorbis decoder.
+
 endif
 
 comment "alure needs a toolchain w/ C++, gcc >= 4.9, NPTL, wchar"
package/alure/alure.mk +7 -1
index 32f3df5349..1a4509ed6b 100644
@@ -18,7 +18,6 @@ ALURE_CONF_OPTS = -DALURE_INSTALL=ON \
 	-DALURE_BUILD_EXAMPLES=OFF \
 	-DALURE_ENABLE_MINIMP3=OFF \
 	-DALURE_ENABLE_SNDFILE=OFF \
-	-DALURE_ENABLE_VORBIS=OFF \
 	-DALURE_ENABLE_WAVE=ON
 
 ifeq ($(BR2_PACKAGE_ALURE_FLAC_DECODER),y)
@@ -34,6 +33,13 @@ else
 ALURE_CONF_OPTS += -DALURE_ENABLE_OPUS=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_ALURE_VORBIS_DECODER),y)
+ALURE_CONF_OPTS += -DALURE_ENABLE_VORBIS=ON
+ALURE_DEPENDENCIES += libogg libvorbis
+else
+ALURE_CONF_OPTS += -DALURE_ENABLE_VORBIS=OFF
+endif
+
 ifeq ($(BR2_STATIC_LIBS),y)
 ALURE_CONF_OPTS += -DALURE_BUILD_SHARED=OFF \
 	-DALURE_BUILD_STATIC=ON
Signature · 1 line
2.24.1
#4 lore raw

PATCH 4/6 package/alure: add libvorbis decoder option

Quoted 11 lines · On Sun, 5 Jan 2020 12:32:02 +0100 Romain Naour <[email protected]> wrote:
---
 package/alure/Config.in | 7 +++++++
 package/alure/alure.mk  | 8 +++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
package/alure/Config.in +0 -0
index 7947e30a1f..20b9e4e4e9 100644

package/alure/Config.in config BR2_PACKAGE_ALURE_OPUS_DECODER · line 36

Quoted 7 lines
package/alure/Config.in +4 -0
@@ -30,6 +30,13 @@ config BR2_PACKAGE_ALURE_OPUS_DECODER
 	help
 	  Enables the built-in libopusfile decoder.
 
+config BR2_PACKAGE_ALURE_VORBIS_DECODER
+	bool "vorbis decoder"
+	select BR2_PACKAGE_LIBVORBIS
+	select BR2_PACKAGE_OPUS

This doesn't match what you're doing in the .mk file: the .mk file adds a dependency on libogg and libvorbis, and this is what is correct. So I've replaced the select BR2_PACKAGE_OPUS by a select BR2_PACKAGE_LIBOGG.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH 5/6 package/alure: add libsndfile decoder option

In reply to Romain Naour
---
 package/alure/Config.in | 6 ++++++
 package/alure/alure.mk  | 8 +++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)
package/alure/Config.in +6 -0
index 20b9e4e4e9..346e607eb8 100644
@@ -30,6 +30,12 @@ config BR2_PACKAGE_ALURE_OPUS_DECODER
 	help
 	  Enables the built-in libopusfile decoder.
 
+config BR2_PACKAGE_ALURE_SNDFILE_DECODER
+	bool "sndfile decoder"
+	select BR2_PACKAGE_LIBSNDFILE
+	help
+	  Enables the built-in libsndfile decoder.
+
 config BR2_PACKAGE_ALURE_VORBIS_DECODER
 	bool "vorbis decoder"
 	select BR2_PACKAGE_LIBVORBIS
package/alure/alure.mk +7 -1
index 1a4509ed6b..74e918f8f3 100644
@@ -17,7 +17,6 @@ ALURE_DEPENDENCIES = openal
 ALURE_CONF_OPTS = -DALURE_INSTALL=ON \
 	-DALURE_BUILD_EXAMPLES=OFF \
 	-DALURE_ENABLE_MINIMP3=OFF \
-	-DALURE_ENABLE_SNDFILE=OFF \
 	-DALURE_ENABLE_WAVE=ON
 
 ifeq ($(BR2_PACKAGE_ALURE_FLAC_DECODER),y)
@@ -33,6 +32,13 @@ else
 ALURE_CONF_OPTS += -DALURE_ENABLE_OPUS=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_ALURE_SNDFILE_DECODER),y)
+ALURE_CONF_OPTS += -DALURE_ENABLE_SNDFILE=ON
+ALURE_DEPENDENCIES += libsndfile
+else
+ALURE_CONF_OPTS += -DALURE_ENABLE_SNDFILE=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_ALURE_VORBIS_DECODER),y)
 ALURE_CONF_OPTS += -DALURE_ENABLE_VORBIS=ON
 ALURE_DEPENDENCIES += libogg libvorbis
Signature · 1 line
2.24.1
#6 lore raw

PATCH 6/6 package/alure: add minimp3 decoder option

In reply to Romain Naour

Alure doesn't use/need an external minimp3 library.

---
 package/alure/Config.in | 5 +++++
 package/alure/alure.mk  | 7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
package/alure/Config.in +5 -0
index 346e607eb8..651b6b0bab 100644
@@ -23,6 +23,11 @@ config BR2_PACKAGE_ALURE_FLAC_DECODER
 	help
 	  Enables the built-in FLAC decoder.
 
+config BR2_PACKAGE_ALURE_MINIMP3_DECODER
+	bool "minimp3 decoder"
+	help
+	  Enables the built-in minimp3 decoder.
+
 config BR2_PACKAGE_ALURE_OPUS_DECODER
 	bool "opus decoder"
 	select BR2_PACKAGE_LIBOGG
package/alure/alure.mk +6 -1
index 74e918f8f3..d3c87d704a 100644
@@ -16,7 +16,6 @@ ALURE_DEPENDENCIES = openal
 # Enable at least one built-in decoder (wave).
 ALURE_CONF_OPTS = -DALURE_INSTALL=ON \
 	-DALURE_BUILD_EXAMPLES=OFF \
-	-DALURE_ENABLE_MINIMP3=OFF \
 	-DALURE_ENABLE_WAVE=ON
 
 ifeq ($(BR2_PACKAGE_ALURE_FLAC_DECODER),y)
@@ -25,6 +24,12 @@ else
 ALURE_CONF_OPTS += -DALURE_ENABLE_FLAC=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_ALURE_MINIMP3_DECODER),y)
+ALURE_CONF_OPTS += -DALURE_ENABLE_MINIMP3=ON
+else
+ALURE_CONF_OPTS += -DALURE_ENABLE_MINIMP3=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_ALURE_OPUS_DECODER),y)
 ALURE_CONF_OPTS += -DALURE_ENABLE_OPUS=ON
 ALURE_DEPENDENCIES += libogg opus
Signature · 1 line
2.24.1
#7 lore raw

PATCH 1/6 package/alure: new package

In reply to Romain Naour

Hello,

Quoted 10 lines · On Sun, 5 Jan 2020 12:31:59 +0100 Romain Naour <[email protected]> wrote:

Use the latest commit since there is no release since 1.2 (8 years ago).

While testing with test-pkg, the last build issue was due to the gcc 4.8.3 compiler missing C++11 feature:
"std::list.erase(const_iterator pos) not implemented" [1]

arm-none-linux-gnueabi/include/c++/4.8.3/bits/vector.tcc:134:5: note:
no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<const alure::Source*, std::vector<alure::Source> >' to 'std::vector<alure::Source>::iterator {aka __gnu_cxx::__normal_iterator<alure::Source*, std::vector<alure::Source> >}

Quoted 5 lines

https://github.com/kcat/alure/blob/14beed2a86d5a36030e907b21c46614d505f07cd/src/context.cpp#L1357

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57158

I've applied the entire series, but with a few changes. I'll comment only on the patches where changes were needed, including this one.

Quoted 6 lines
---
 package/Config.in        |  1 +
 package/alure/Config.in  | 27 +++++++++++++++++++++++++++
 package/alure/alure.hash |  2 ++
 package/alure/alure.mk   | 34 ++++++++++++++++++++++++++++++++++
 4 files changed, 64 insertions(+)

Missing entry in the DEVELOPERS file.

package/alure/alure.hash line 2

Quoted 8 lines
package/alure/alure.hash new file +2 -0
new file mode 100644
index 0000000000..3387f76f9d
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 9b808e5b5a54d156348221dc86704c7831115047d5238691e6088f8c4814b2ca  alure-14beed2a86d5a36030e907b21c46614d505f07cd.tar.gz

Hash of the license file is missing... and I forgot to add it as well, I'm only seeing this now that I review the patch once again. A follow-up patch to add it would be good.

package/alure/alure.hash

Quoted 3 lines
package/alure/alure.hash new file +3 -0
+ALURE_VERSION = 14beed2a86d5a36030e907b21c46614d505f07cd
+ALURE_SITE = $(call github,kcat,alure,$(ALURE_VERSION))
+ALURE_LICENSE = MIT, Public Domain (src/decoders/dr_flac.h)

The license is not MIT, but Zlib. Make sure to compare the license text when determining the license type.

package/alure/alure.hash

Quoted 7 lines
package/alure/alure.hash new file +7 -0
+ifeq ($(BR2_STATIC_LIBS),y)
+ALURE_CONF_OPTS += -DALURE_BUILD_SHARED=OFF \
+	-DALURE_BUILD_STATIC=ON
+else
+ALURE_CONF_OPTS += -DALURE_BUILD_SHARED=ON \
+	-DALURE_BUILD_STATIC=OFF
+endif

You forgot to handle the BR2_STATIC_SHARED_LIBS=y case, where both the static and the shared libraries must be built.

That being said, the static library support of alure is quite broken:
it installs the library as libalure_s.a, i.e with a different name than the shared library. This means that any application/library using alure must now whether it should use -lalure or -lalure_s.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com