diff mbox series

[v2,4/4] package/mpd: introduce sub-options for expat and yajl

Message ID 20221005091032.3014-5-br015@umbiko.net
State Accepted
Headers show
Series User-visible Config.in feature sub-options | expand

Commit Message

Andreas Ziegler Oct. 5, 2022, 9:10 a.m. UTC
Make inclusion of expat and yajl libraries in the mpd build dependent on
user selection, not presence of the libraries in the target filesystem.

Signed-off-by: Andreas Ziegler <br015@umbiko.net>
---
Changes v1 -> v2:
 - based on a discussion w/ Arnout Vandecapelle, Yann Morin

 package/mpd/Config.in | 17 ++++++++++++++---
 package/mpd/mpd.mk    | 24 +++++++++++++++++-------
 2 files changed, 31 insertions(+), 10 deletions(-)

Comments

Thomas Petazzoni Aug. 6, 2023, 8:45 p.m. UTC | #1
Hello Andreas,

On Wed,  5 Oct 2022 11:10:32 +0200
Andreas Ziegler <br015@umbiko.net> wrote:

> Make inclusion of expat and yajl libraries in the mpd build dependent on
> user selection, not presence of the libraries in the target filesystem.
> 
> Signed-off-by: Andreas Ziegler <br015@umbiko.net>

So I handled this differently:

- First, one patch that adds the "missing" dependency of
  BR2_PACKAGE_MPD_UPNP_NPUPNP on expat:

  https://gitlab.com/buildroot.org/buildroot/-/commit/6cdb48a0482a093dcdf73d0d748f5435262515ab

- Second, a patch that takes care of expat and yajl, but without the
  intermediate options: as soon as expat or yajl are available in
  Buildroot, their support will enabled in mpq:

  https://gitlab.com/buildroot.org/buildroot/-/commit/3693462a1f8bd328c1a4f8fb68f00ce9127c31cd

Thanks!

Thomas
Peter Korsgaard Sept. 11, 2023, 7:23 a.m. UTC | #2
>>>>> "Thomas" == Thomas Petazzoni via buildroot <buildroot@buildroot.org> writes:

 > Hello Andreas,
 > On Wed,  5 Oct 2022 11:10:32 +0200
 > Andreas Ziegler <br015@umbiko.net> wrote:

 >> Make inclusion of expat and yajl libraries in the mpd build dependent on
 >> user selection, not presence of the libraries in the target filesystem.
 >> 
 >> Signed-off-by: Andreas Ziegler <br015@umbiko.net>

 > So I handled this differently:

 > - First, one patch that adds the "missing" dependency of
 >   BR2_PACKAGE_MPD_UPNP_NPUPNP on expat:

 >   https://gitlab.com/buildroot.org/buildroot/-/commit/6cdb48a0482a093dcdf73d0d748f5435262515ab

 > - Second, a patch that takes care of expat and yajl, but without the
 >   intermediate options: as soon as expat or yajl are available in
 >   Buildroot, their support will enabled in mpq:

 >   https://gitlab.com/buildroot.org/buildroot/-/commit/3693462a1f8bd328c1a4f8fb68f00ce9127c31cd

Committed to 2023.02.x and 2023.05.x, thanks.
diff mbox series

Patch

diff --git a/package/mpd/Config.in b/package/mpd/Config.in
index daf1469cae..fe4f22201a 100644
--- a/package/mpd/Config.in
+++ b/package/mpd/Config.in
@@ -20,6 +20,16 @@  menuconfig BR2_PACKAGE_MPD
 
 if BR2_PACKAGE_MPD
 
+# mpd internal feature dependencies
+
+config BR2_PACKAGE_MPD_EXPAT
+	bool
+	select BR2_PACKAGE_EXPAT
+
+config BR2_PACKAGE_MPD_YAJL
+	bool
+	select BR2_PACKAGE_YAJL
+
 comment "Archive plugins"
 
 config BR2_PACKAGE_MPD_BZIP2
@@ -48,14 +58,14 @@  config BR2_PACKAGE_MPD_QOBUZ
 	depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS
 	select BR2_PACKAGE_MPD_CURL
 	select BR2_PACKAGE_LIBGCRYPT
-	select BR2_PACKAGE_YAJL
+	select BR2_PACKAGE_MPD_YAJL
 	help
 	  Play songs from the commercial streaming service Qobuz.
 
 config BR2_PACKAGE_MPD_SOUNDCLOUD
 	bool "soundcloud"
 	select BR2_PACKAGE_MPD_CURL
-	select BR2_PACKAGE_YAJL
+	select BR2_PACKAGE_MPD_YAJL
 	help
 	  Enable soundcloud.com playlist support.
 
@@ -399,9 +409,9 @@  choice
 
 config BR2_PACKAGE_MPD_UPNP_PUPNP
 	bool "pupnp"
-	select BR2_PACKAGE_EXPAT
 	select BR2_PACKAGE_LIBUPNP
 	select BR2_PACKAGE_MPD_CURL
+	select BR2_PACKAGE_MPD_EXPAT
 	help
 	  Provides UPnP database access through libupnp
 	  (the legacy Portable SDK for UPnP devices).
@@ -412,6 +422,7 @@  config BR2_PACKAGE_MPD_UPNP_NPUPNP
 	bool "npupnp"
 	select BR2_PACKAGE_LIBNPUPNP
 	select BR2_PACKAGE_MPD_CURL
+	select BR2_PACKAGE_MPD_EXPAT
 	help
 	  Provides UPnP database access through libnpupnp
 	  (a C++ reimplementation of the Portable UPnP library).
diff --git a/package/mpd/mpd.mk b/package/mpd/mpd.mk
index 1269b90661..1c3b659220 100644
--- a/package/mpd/mpd.mk
+++ b/package/mpd/mpd.mk
@@ -78,6 +78,13 @@  else
 MPD_CONF_OPTS += -Ddsd=false
 endif
 
+ifeq ($(BR2_PACKAGE_MPD_EXPAT),y)
+MPD_DEPENDENCIES += expat
+MPD_CONF_OPTS += -Dexpat=enabled
+else
+MPD_CONF_OPTS += -Dexpat=disabled
+endif
+
 ifeq ($(BR2_PACKAGE_MPD_FAAD2),y)
 MPD_DEPENDENCIES += faad2
 MPD_CONF_OPTS += -Dfaad=enabled
@@ -252,7 +259,7 @@  MPD_CONF_OPTS += -Dpulse=disabled
 endif
 
 ifeq ($(BR2_PACKAGE_MPD_QOBUZ),y)
-MPD_DEPENDENCIES += libgcrypt yajl
+MPD_DEPENDENCIES += libgcrypt
 MPD_CONF_OPTS += -Dqobuz=enabled
 else
 MPD_CONF_OPTS += -Dqobuz=disabled
@@ -273,7 +280,6 @@  MPD_CONF_OPTS += -Dsidplay=disabled
 endif
 
 ifeq ($(BR2_PACKAGE_MPD_SOUNDCLOUD),y)
-MPD_DEPENDENCIES += yajl
 MPD_CONF_OPTS += -Dsoundcloud=enabled
 else
 MPD_CONF_OPTS += -Dsoundcloud=disabled
@@ -306,13 +312,10 @@  MPD_CONF_OPTS += -Dtwolame=disabled
 endif
 
 ifeq ($(BR2_PACKAGE_MPD_UPNP_PUPNP),y)
-MPD_DEPENDENCIES += \
-	expat \
-	libupnp
+MPD_DEPENDENCIES += libupnp
 MPD_CONF_OPTS += -Dupnp=pupnp
 else ifeq ($(BR2_PACKAGE_MPD_UPNP_NPUPNP),y)
-MPD_DEPENDENCIES += \
-	libnpupnp
+MPD_DEPENDENCIES += libnpupnp
 MPD_CONF_OPTS += -Dupnp=npupnp
 else ifeq ($(BR2_PACKAGE_MPD_UPNP_DISABLED),y)
 MPD_CONF_OPTS += -Dupnp=disabled
@@ -333,6 +336,13 @@  else
 MPD_CONF_OPTS += -Dwavpack=disabled
 endif
 
+ifeq ($(BR2_PACKAGE_MPD_YAJL),y)
+MPD_DEPENDENCIES += yajl
+MPD_CONF_OPTS += -Dyajl=enabled
+else
+MPD_CONF_OPTS += -Dyajl=disabled
+endif
+
 ifeq ($(BR2_PACKAGE_MPD_ZZIP),y)
 MPD_DEPENDENCIES += zziplib
 MPD_CONF_OPTS += -Dzzip=enabled