[OE-core] [PATCH] alsa-lib: Allow empty alsa-lib package for SDK

Joshua Watt jpewhacker at gmail.com
Thu Aug 2 21:22:00 UTC 2018


Without ALLOW_EMPTY, the empty alsa-lib package (which gets culled)
makes it fairly difficult to create an image that has libasound, then
create an SDK from that image that has the proper development files.

If there is no alsa-lib package, the only way to get libasound on a
target image is to do:

 IMAGE_INSTALL += "libasound"

This however causes a problem because all of the development files that
would be desired in the SDK are located in alsa-lib-dev, which won't be
included (because alsa-lib wasn't included). Without ALLOW_EMPTY_${PN},
it is not possible to do:

 IMAGE_INSTALL += "alsa-lib"

because the package is empty and gets culled. Adding the ALLOW_EMPTY and
then making alsa-lib RDEPEND on libasound solves this problem and allows
alsa-lib to be installed on the target and have the correct development
files in the SDK

Signed-off-by: Joshua Watt <JPEWhacker at gmail.com>
---
 meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb b/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb
index 6364e9eafaa..581655c5349 100644
--- a/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb
+++ b/meta/recipes-multimedia/alsa/alsa-lib_1.1.6.bb
@@ -24,6 +24,13 @@ FILES_libasound = "${libdir}/libasound.so.*"
 FILES_alsa-server = "${bindir}/*"
 FILES_alsa-conf = "${datadir}/alsa/"
 
+# Create an alsa-lib package even though it is empty and make it RDEPEND on
+# libasound for target builds. This makes it possible to sanely create a image
+# that has libasound and then generate an SDK from that image that has
+# alsa-lib-dev
+ALLOW_EMPTY_${PN} = "1"
+RDEPENDS_${PN}_class-target = "libasound"
+
 RDEPENDS_libasound = "alsa-conf"
 
 # alsa-lib gets automatically added to alsa-lib-dev dependencies, but the
-- 
2.17.1




More information about the Openembedded-core mailing list