Skip to contentSkip to conversation

shr.conf: set DISTRO_apm = fso-apm

PATCH In review Sebastian Spaeth 4 participants 10 messages Dec 4, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 shr.conf: set DISTRO_apm = fso-apm

---
 conf/distro/shr.conf |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
conf/distro/shr.conf +1 -0
index 2a33427..80f89bd 100644
@@ -183,6 +183,7 @@ PREFERRED_PROVIDER_virtual/db-native = "db3-native"
 PREFERRED_PROVIDER_virtual/libsdl = "libsdl-x11"
 PREFERRED_PROVIDER_virtual/libx11 ?= "libx11"
 PREFERRED_PROVIDER_virtual/libusb0 ?= "libusb"
+DISTRO_apm = "fso-apm"
 
 #############################################################################
 # PREFERRED VERSIONS
Signature · 1 line
1.6.3.3
#1 lore raw

PATCH 2/2 task-base: Introduce DISTRO_apm and convert recipes to use it.

* This allows distros to override the apm provider with an DISTRO_apm variable
* The change should be transparent and invisible for other distros
* This could also be done with a virtual/apm package, and a PREFERED_PROVIDER set to apm

---
 recipes/ipaq-sleep/ipaq-sleep_0.9.bb           |    5 +++--
 recipes/matchbox2/matchbox-panel-2_svn.bb      |    6 ++++--
 recipes/openmoko2/neod_svn.bb                  |    6 ++++--
 recipes/suspend-desktop/suspend-desktop_1.0.bb |    5 +++--
 recipes/tasks/task-base.bb                     |    7 +++++--
 5 files changed, 19 insertions(+), 10 deletions(-)
recipes/ipaq-sleep/ipaq-sleep_0.9.bb +3 -2
index 24d881d..6c37b73 100644
@@ -2,8 +2,9 @@ DESCRIPTION = "Automatic sleep/suspend control daemon"
 SECTION = "x11/base"
 LICENSE = "GPL"
 DEPENDS = "apmd virtual/xserver libxext virtual/libx11 libxau xscrnsaverh libxss"
-RDEPENDS = "apm"
-PR = "r6"
+DISTRO_apm ?= "apm"
+RDEPENDS = "${DISTRO_apm}"
+PR = "r7"
 
 inherit gpe pkgconfig
 
recipes/matchbox2/matchbox-panel-2_svn.bb +4 -2
index a2a807f..9d1781b 100644
@@ -1,13 +1,15 @@
 DESCRIPTION = "matchbox-panel-2 is a lightweight dock (system tray) application based on Gtk+"
 LICENSE = "GPLv2"
 SECTION = "x11/panels"
+
+DISTRO_apm ?= "apm"
 DEPENDS = "gtk+ startup-notification dbus dbus-glib matchbox-panel-2-icon-themes"
 DEPENDS += " ${@base_contains("MACHINE_FEATURES", "acpi", "libacpi", "",d)}"
-DEPENDS += " ${@base_contains("MACHINE_FEATURES", "apm", "apmd", "",d)}"
+DEPENDS += " ${@base_contains("MACHINE_FEATURES", "${DISTRO_apm}", "apmd", "",d)}"
 RDEPENDS_${PN} = "matchbox-panel-2-icon-theme"
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 PV = "2.0+svnr${SRCPV}"
-PR = "r0"
+PR = "r1"
 
 inherit autotools_stage pkgconfig
 
recipes/openmoko2/neod_svn.bb +4 -2
index aeeee87..14858a7 100644
@@ -1,9 +1,11 @@
 DESCRIPTION = "Simple Neo1973 Daemon for Button Handling and Power Management"
 SECTION = "openmoko/daemons"
+
+DISTRO_apm ?= "apm"
 DEPENDS = "gtk+ pulseaudio apmd"
-RDEPENDS = "gpe-scap xrandr alsa-utils-amixer apm dbus"
+RDEPENDS = "gpe-scap xrandr alsa-utils-amixer ${DISTRO_apm} dbus"
 PV = "0.1.0+svnr${SRCPV}"
-PR = "r6"
+PR = "r7"
 
 inherit openmoko2 gconf
 
recipes/suspend-desktop/suspend-desktop_1.0.bb +3 -2
index fa9efba..8fcdfea 100644
@@ -3,10 +3,11 @@ PRIORITY    = "optional"
 DESCRIPTION = "Suspend feature for the application launcher menu."
 LICENSE     = "GPL"
 
-PR          = "r1"
+PR          = "r2"
 
+DISTRO-apm ?= "apm"
 RDEPENDS    = "gpe-conf"
-RRECOMMENDS = "apm"
+RRECOMMENDS = "${DISTRO_apm}"
 
 PACKAGES    = "${PN}"
 PACKAGE_ARCH = "all"
recipes/tasks/task-base.bb +5 -2
index ed561b8..6aad873 100644
@@ -1,5 +1,5 @@
 DESCRIPTION = "Merge machine and distro options to create a basic machine task/package"
-PR = "r86"
+PR = "r87"
 
 inherit task
 
@@ -60,6 +60,9 @@ HOTPLUG ?= "${@base_contains("MACHINE_FEATURES", "kernel24",  "linux-hotplug",""
 #
 DISTRO_SSH_DAEMON ?= "dropbear"
 
+# Distro can override apm provider
+DISTRO_apm ?= "apm"
+
 #
 # bluetooth manager
 #
@@ -190,7 +193,7 @@ RDEPENDS_task-base-acpi = "\
     acpid"
 
 RDEPENDS_task-base-apm = "\
-    apm \
+    "${DISTRO_apm}" \
     apmd \
     ${@base_contains('MACHINE_FEATURES', 'kernel24', 'network-suspend-scripts', '',d)}"
 
Signature · 1 line
1.6.3.3
#2 lore raw

Re: [PATCH 2/2] task-base: Introduce DISTRO_apm and convert recipes to use it.

This is my take on solving our problem that we want a different "apm" provider. Koen outlined this solution, so this way I went.

All recipes that RDPEND on "apm" basically get a

DISTRO_apm ?= "apm"
RDEPEND += ${DISTRO_apm}

This could also be done with a virtual/apm package, and a PREFERED_PROVIDER set to apm for all distros. Which would even be cleaner I think, with the downside that all other distros would need to set a prefered provider too.
For things like this is would be nice to get a common sane-providers.inc where these standard providers can be defined.

What do you think? Can I commit this?
spaetz

#3 lore raw

Re: [PATCH 2/2] task-base: Introduce DISTRO_apm and convert recipes to use it.

Quoted 5 lines · Sebastian Spaeth

This is my take on solving our problem that we want a different "apm" provider. Koen outlined this solution, so this way I went.

All recipes that RDPEND on "apm" basically get a

Quoted 7 lines

DISTRO_apm ?= "apm"
RDEPEND += ${DISTRO_apm}

This could also be done with a virtual/apm package, and a PREFERED_PROVIDER set to apm for all distros. Which would even be cleaner I think, with the downside that all other distros would need to set a prefered provider too.

The latter approach does sound rather better to me. This is exactly what virtuals are for, and I'm not sure that we want a massive proliferation of DISTRO_foo variables that effectively shadow PREFERRED_PROVIDER.

You're right that there is a bit of an issue with adding new virtuals, in that old distros need to remain pinned to the provider they were getting previously rather than being left to flap in the wind. Your proposal of adding a new include file sounds like a reasonable way to address that, though I'm not completely enamoured of the "sane-" terminology. I think something like "compatibility-providers.inc" or even "legacy-providers.inc" would better capture what the file is for.

p.

#5 lore raw

Re: [PATCH 2/2] task-base: Introduce DISTRO_apm and convert recipes to use it.

Quoted 2 lines · Michael 'Mickey' Lauer

Shouldn't that rather be DISTRO_APM? That way it looks less like an override.

DISTRO_APM is just as fine for me. I was using PREFERRED_PROVIDER_glibc as an example. But I see that DISTRO_SSH_SERVER is also capitalized. Will modify to all CAPS, thanks.

spaetz

#6 lore raw

PATCH 1/1 task-base: Introduce DISTRO_APM and convert recipes to use that

In reply to Michael 'Mickey' Lauer
---
 conf/distro/shr.conf                           |    2 +-
 recipes/ipaq-sleep/ipaq-sleep_0.9.bb           |    5 +++--
 recipes/openmoko2/neod_svn.bb                  |    6 ++++--
 recipes/suspend-desktop/suspend-desktop_1.0.bb |    5 +++--
 recipes/tasks/task-base.bb                     |    7 +++++--
 5 files changed, 16 insertions(+), 9 deletions(-)
conf/distro/shr.conf +1 -1
index 80f89bd..833eb09 100644
@@ -30,6 +30,7 @@ DISTRO_TYPE = "debug"
 DISTRO = "shr"
 
 DISTRO_SSH_DAEMON = "openssh"
+DISTRO_APM = "fso-apm"
 
 #Generate locales on the buildsystem instead of on the target. Speeds up first boot, set to "1" to enable
 ENABLE_BINARY_LOCALE_GENERATION ?= "1"
@@ -183,7 +184,6 @@ PREFERRED_PROVIDER_virtual/db-native = "db3-native"
 PREFERRED_PROVIDER_virtual/libsdl = "libsdl-x11"
 PREFERRED_PROVIDER_virtual/libx11 ?= "libx11"
 PREFERRED_PROVIDER_virtual/libusb0 ?= "libusb"
-DISTRO_apm = "fso-apm"
 
 #############################################################################
 # PREFERRED VERSIONS
recipes/ipaq-sleep/ipaq-sleep_0.9.bb +3 -2
index 24d881d..158de80 100644
@@ -2,8 +2,9 @@ DESCRIPTION = "Automatic sleep/suspend control daemon"
 SECTION = "x11/base"
 LICENSE = "GPL"
 DEPENDS = "apmd virtual/xserver libxext virtual/libx11 libxau xscrnsaverh libxss"
-RDEPENDS = "apm"
-PR = "r6"
+DISTRO_APM ?= "apm"
+RDEPENDS = "${DISTRO_APM}"
+PR = "r7"
 
 inherit gpe pkgconfig
 
recipes/openmoko2/neod_svn.bb +4 -2
index aeeee87..e57bf08 100644
@@ -1,9 +1,11 @@
 DESCRIPTION = "Simple Neo1973 Daemon for Button Handling and Power Management"
 SECTION = "openmoko/daemons"
+
+DISTRO_APM ?= "apm"
 DEPENDS = "gtk+ pulseaudio apmd"
-RDEPENDS = "gpe-scap xrandr alsa-utils-amixer apm dbus"
+RDEPENDS = "gpe-scap xrandr alsa-utils-amixer ${DISTRO_APM} dbus"
 PV = "0.1.0+svnr${SRCPV}"
-PR = "r6"
+PR = "r7"
 
 inherit openmoko2 gconf
 
recipes/suspend-desktop/suspend-desktop_1.0.bb +3 -2
index fa9efba..085d686 100644
@@ -3,10 +3,11 @@ PRIORITY    = "optional"
 DESCRIPTION = "Suspend feature for the application launcher menu."
 LICENSE     = "GPL"
 
-PR          = "r1"
+PR          = "r2"
 
+DISTRO_APM ?= "apm"
 RDEPENDS    = "gpe-conf"
-RRECOMMENDS = "apm"
+RRECOMMENDS = "${DISTRO_APM}"
 
 PACKAGES    = "${PN}"
 PACKAGE_ARCH = "all"
recipes/tasks/task-base.bb +5 -2
index ed561b8..b540c80 100644
@@ -1,5 +1,5 @@
 DESCRIPTION = "Merge machine and distro options to create a basic machine task/package"
-PR = "r86"
+PR = "r87"
 
 inherit task
 
@@ -60,6 +60,9 @@ HOTPLUG ?= "${@base_contains("MACHINE_FEATURES", "kernel24",  "linux-hotplug",""
 #
 DISTRO_SSH_DAEMON ?= "dropbear"
 
+# Distro can override apm provider
+DISTRO_APM ?= "apm"
+
 #
 # bluetooth manager
 #
@@ -190,7 +193,7 @@ RDEPENDS_task-base-acpi = "\
     acpid"
 
 RDEPENDS_task-base-apm = "\
-    apm \
+    "${DISTRO_APM}" \
     apmd \
     ${@base_contains('MACHINE_FEATURES', 'kernel24', 'network-suspend-scripts', '',d)}"
 
Signature · 1 line
1.6.3.3
#7 lore raw

Re: [PATCH 2/2] task-base: Introduce DISTRO_apm and convert recipes to use it.

In reply to Sebastian Spaeth
Quoted 2 lines · Sebastian Spaeth
recipes/matchbox2/matchbox-panel-2_svn.bb +0 -0

...

Quoted 2 lines
recipes/matchbox2/matchbox-panel-2_svn.bb +2 -0
+
+DISTRO_apm ?= "apm"

...

recipes/matchbox2/matchbox-panel-2_svn.bb line 8

Quoted 2 lines
recipes/matchbox2/matchbox-panel-2_svn.bb +1 -1
-DEPENDS += " ${@base_contains("MACHINE_FEATURES", "apm", "apmd", "",d)}"
+DEPENDS += " ${@base_contains("MACHINE_FEATURES", "${DISTRO_apm}", "apmd", "",d)}"

This change is of course bogus and would not go in! spaetz

#8 lore raw

Re: [PATCH 2/2] task-base: Introduce DISTRO_apm and convert recipes to use it.

In reply to Sebastian Spaeth
Quoted 3 lines · Sebastian Spaeth

* This allows distros to override the apm provider with an DISTRO_apm variable
* The change should be transparent and invisible for other distros
* This could also be done with a virtual/apm package, and a PREFERED_PROVIDER set to apm

Don't forget to remove the (R)PROVIDES in fso-apmd which are causing all the problems. Some comment as mickey, please use caps for vars.

regards,

Koen

Quoted 113 lines
---
  recipes/ipaq-sleep/ipaq-sleep_0.9.bb           |    5 +++--
  recipes/matchbox2/matchbox-panel-2_svn.bb      |    6 ++++--
  recipes/openmoko2/neod_svn.bb                  |    6 ++++--
  recipes/suspend-desktop/suspend-desktop_1.0.bb |    5 +++--
  recipes/tasks/task-base.bb                     |    7 +++++--
  5 files changed, 19 insertions(+), 10 deletions(-)
recipes/ipaq-sleep/ipaq-sleep_0.9.bb +3 -2
index 24d881d..6c37b73 100644
@@ -2,8 +2,9 @@ DESCRIPTION = "Automatic sleep/suspend control daemon"
  SECTION = "x11/base"
  LICENSE = "GPL"
  DEPENDS = "apmd virtual/xserver libxext virtual/libx11 libxau xscrnsaverh libxss"
-RDEPENDS = "apm"
-PR = "r6"
+DISTRO_apm ?= "apm"
+RDEPENDS = "${DISTRO_apm}"
+PR = "r7"
 
  inherit gpe pkgconfig
 
recipes/matchbox2/matchbox-panel-2_svn.bb +4 -2
index a2a807f..9d1781b 100644
@@ -1,13 +1,15 @@
  DESCRIPTION = "matchbox-panel-2 is a lightweight dock (system tray) application based on Gtk+"
  LICENSE = "GPLv2"
  SECTION = "x11/panels"
+
+DISTRO_apm ?= "apm"
  DEPENDS = "gtk+ startup-notification dbus dbus-glib matchbox-panel-2-icon-themes"
  DEPENDS += " ${@base_contains("MACHINE_FEATURES", "acpi", "libacpi", "",d)}"
-DEPENDS += " ${@base_contains("MACHINE_FEATURES", "apm", "apmd", "",d)}"
+DEPENDS += " ${@base_contains("MACHINE_FEATURES", "${DISTRO_apm}", "apmd", "",d)}"
  RDEPENDS_${PN} = "matchbox-panel-2-icon-theme"
  PACKAGE_ARCH = "${MACHINE_ARCH}"
  PV = "2.0+svnr${SRCPV}"
-PR = "r0"
+PR = "r1"
 
  inherit autotools_stage pkgconfig
 
recipes/openmoko2/neod_svn.bb +4 -2
index aeeee87..14858a7 100644
@@ -1,9 +1,11 @@
  DESCRIPTION = "Simple Neo1973 Daemon for Button Handling and Power Management"
  SECTION = "openmoko/daemons"
+
+DISTRO_apm ?= "apm"
  DEPENDS = "gtk+ pulseaudio apmd"
-RDEPENDS = "gpe-scap xrandr alsa-utils-amixer apm dbus"
+RDEPENDS = "gpe-scap xrandr alsa-utils-amixer ${DISTRO_apm} dbus"
  PV = "0.1.0+svnr${SRCPV}"
-PR = "r6"
+PR = "r7"
 
  inherit openmoko2 gconf
 
recipes/suspend-desktop/suspend-desktop_1.0.bb +3 -2
index fa9efba..8fcdfea 100644
@@ -3,10 +3,11 @@ PRIORITY    = "optional"
  DESCRIPTION = "Suspend feature for the application launcher menu."
  LICENSE     = "GPL"
 
-PR          = "r1"
+PR          = "r2"
 
+DISTRO-apm ?= "apm"
  RDEPENDS    = "gpe-conf"
-RRECOMMENDS = "apm"
+RRECOMMENDS = "${DISTRO_apm}"
 
  PACKAGES    = "${PN}"
  PACKAGE_ARCH = "all"
recipes/tasks/task-base.bb +5 -2
index ed561b8..6aad873 100644
@@ -1,5 +1,5 @@
  DESCRIPTION = "Merge machine and distro options to create a basic machine task/package"
-PR = "r86"
+PR = "r87"
 
  inherit task
 
@@ -60,6 +60,9 @@ HOTPLUG ?= "${@base_contains("MACHINE_FEATURES", "kernel24",  "linux-hotplug",""
  #
  DISTRO_SSH_DAEMON ?= "dropbear"
 
+# Distro can override apm provider
+DISTRO_apm ?= "apm"
+
  #
  # bluetooth manager
  #
@@ -190,7 +193,7 @@ RDEPENDS_task-base-acpi = "\
      acpid"
 
  RDEPENDS_task-base-apm = "\
-    apm \
+    "${DISTRO_apm}" \
      apmd \
      ${@base_contains('MACHINE_FEATURES', 'kernel24', 'network-suspend-scripts', '',d)}"
 
#9 lore raw

Re: [PATCH 2/2] task-base: Introduce DISTRO_apm and convert recipes to use it.

Quoted 2 lines · Koen Kooi

Don't forget to remove the (R)PROVIDES in fso-apmd which are causing all the problems. Some comment as mickey, please use caps for vars.

I have pushed this now (using caps), to get angstrom fixed. I agree with Phil that using "virtaul/apm" would be cleaner though, so I will be working towards using that.

Removing the RPROVIDES now from fsp-apm.

spaetz