[oe] [PATCH] introduction of virtual/libusb0

Chris Larson clarson at kergoth.com
Wed Jun 24 19:44:59 UTC 2009


On Wed, Jun 24, 2009 at 12:18 PM, Stanislav Brabec<utx at penguin.cz> wrote:
> Hallo.
>
> I plan to submit attached patch to oe.dev to fix clash of libusb-compat
> and libusb in recipes by introduction of virtual/libusb0.
>
> libusb-compat and libusb provide exactly the same API and ABI using a
> different back-end, and applications should work with both of them
> without recompilation.
>
> After the commit, distro maintainers will be encouraged to set:
> PREFERRED_PROVIDER_virtual/libusb0 = "libusb-compat"
>
> Following technical problems may happen with libusb0 applications:
>
> - Application does not compile of fail on runtime linking with
> libusb-compat: Badly written application (using internal functions
> etc.), application needs fix.
> gnuradio is known to be affected.
>
> - Application does not work libusb-compat: Application depends on an
> obscure aspect of libusb behavior. Report it and help with debugging.
> With libusb-compat-1.0.2, there are no known defects of this type.
>
> The commit will also remove hack recipes/libusb/libusb_0.0.0.bb.
>
> diff --git a/conf/distro/angstrom-2008.1.conf b/conf/distro/angstrom-2008.1.conf
> index f0b8a04..dff9320 100644
> --- a/conf/distro/angstrom-2008.1.conf
> +++ b/conf/distro/angstrom-2008.1.conf
> @@ -140,6 +140,7 @@ PREFERRED_PROVIDER_virtual/db           ?= "db"
>  PREFERRED_PROVIDER_virtual/db-native    ?= "db-native"
>  PREFERRED_PROVIDER_virtual/libsdl       ?= "libsdl-x11"
>  PREFERRED_PROVIDER_virtual/libx11       ?= "libx11"
> +PREFERRED_PROVIDER_virtual/libusb0      ?= "libusb-compat"
>
>  # Others:
>  PREFERRED_PROVIDER_linux-libc-headers = "linux-libc-headers"
> @@ -158,6 +159,7 @@ PREFERRED_PROVIDER_bluez-utils-dbus      = "bluez-utils"
>  PREFERRED_PROVIDER_bluez-libs            = "bluez4"
>  PREFERRED_PROVIDER_bluez-utils           = "bluez4"
>
> +
>  # we don't ship gtk-directfb by default
>  PREFERRED_PROVIDER_gtk+                   ?= "gtk+"
>  PREFERRED_PROVIDER_gdk-pixbuf-loader-ani  ?= "gtk+"
> diff --git a/conf/distro/include/preferred-slugos-versions.inc b/conf/distro/include/preferred-slugos-versions.inc
> index 992235a..0eae85b 100644
> --- a/conf/distro/include/preferred-slugos-versions.inc
> +++ b/conf/distro/include/preferred-slugos-versions.inc
> @@ -63,11 +63,5 @@ PREFERRED_VERSION_udev                               ?= "118"
>
>  ##################### Stuff with special notes, and broken stuff:
>
> -# Hack alert - selecting this version of libusb effectively selects
> -# the use of libusb1 and libusb-compat in the case that something
> -# still depends on libusb. This is required because otherwise
> -# libusb will overwrite libusb-compat in staging.
> -PREFERRED_VERSION_libusb                       ?= "0.0.0"
> -
>  # boost 1.36 won't build
>  PREFERRED_VERSION_boost                                ?= "1.33.1"
> diff --git a/recipes/0xFFFF/0xffff-native_0.1.bb b/recipes/0xFFFF/0xffff-native_0.1.bb
> index 2530388..3e694eb 100644
> --- a/recipes/0xFFFF/0xffff-native_0.1.bb
> +++ b/recipes/0xFFFF/0xffff-native_0.1.bb
> @@ -1,6 +1,6 @@
>  require 0xffff.inc
>
> -DEPENDS = "libusb-native"
> +DEPENDS = "virtual/libusb0-native"
>
>  inherit native
>
> diff --git a/recipes/0xFFFF/0xffff-native_0.2.bb b/recipes/0xFFFF/0xffff-native_0.2.bb
> index eb82cb4..be15c8e 100644
> --- a/recipes/0xFFFF/0xffff-native_0.2.bb
> +++ b/recipes/0xFFFF/0xffff-native_0.2.bb
> @@ -1,6 +1,6 @@
>  require 0xffff.inc
>
> -DEPENDS = "libusb-native"
> +DEPENDS = "virtual/libusb0-native"
>
>  inherit native
>
> diff --git a/recipes/bluez/bluez-utils.inc b/recipes/bluez/bluez-utils.inc
> index 298650a..7c84f4e 100644
> --- a/recipes/bluez/bluez-utils.inc
> +++ b/recipes/bluez/bluez-utils.inc
> @@ -1,7 +1,7 @@
>  DESCRIPTION = "Linux Bluetooth Stack Userland Utilities."
>  SECTION = "console"
>  PRIORITY = "optional"
> -DEPENDS = "gstreamer gst-plugins-base bluez-libs-${PV} libusb-compat dbus cups"
> +DEPENDS = "gstreamer gst-plugins-base bluez-libs-${PV} virtual/libusb0 dbus cups"
>  PROVIDES = "bluez-utils-dbus"
>  RPROVIDES_${PN} = "bluez-pan bluez-sdp bluez-utils-dbus"
>  RREPLACES = "bluez-utils-dbus"
> diff --git a/recipes/bluez/bluez-utils3.inc b/recipes/bluez/bluez-utils3.inc
> index 5fab6e7..df071b7 100644
> --- a/recipes/bluez/bluez-utils3.inc
> +++ b/recipes/bluez/bluez-utils3.inc
> @@ -1,7 +1,7 @@
>  DESCRIPTION = "Linux Bluetooth Stack Userland Utilities."
>  SECTION = "console"
>  PRIORITY = "optional"
> -DEPENDS = "gstreamer gst-plugins-base bluez-libs-${PV} libusb-compat dbus glib-2.0"
> +DEPENDS = "gstreamer gst-plugins-base bluez-libs-${PV} virtual/libusb0 dbus glib-2.0"
>  PROVIDES = "bluez-utils-dbus"
>  RPROVIDES_${PN} = "bluez-pan bluez-sdp bluez-utils-dbus"
>  RREPLACES = "bluez-utils-dbus"
> diff --git a/recipes/bluez/bluez.inc b/recipes/bluez/bluez.inc
> index 711ac38..66c7d31 100644
> --- a/recipes/bluez/bluez.inc
> +++ b/recipes/bluez/bluez.inc
> @@ -5,7 +5,7 @@ HOMEPAGE = "http://www.bluez.org"
>  LICENSE = "GPL"
>  PR = "r0"
>
> -DEPENDS = "gstreamer gst-plugins-base libusb1 dbus glib-2.0"
> +DEPENDS = "gstreamer gst-plugins-base virtual/libusb0 dbus glib-2.0"
>  PROVIDES = "bluez-utils-dbus"
>  RPROVIDES_${PN} = "bluez-pan bluez-sdp bluez-utils-dbus"
>  RREPLACES = "bluez-utils-dbus"

This is wrong.  libusb0 does not replace libusb1.

It's worth noting that this could be done in a much less intrusive way.

In libusb-compat:
PROVIDES += "libusb"

In libusb:
DEFAULT_PREFERENCE = "-1", or just set the PREFERRED_PROVIDER_libusb =
"libusb-compat" in the distros.  Could also PROVIDES += "libusb0" or
PROVIDES += "libusb-old" or something, to let recipes explicitly
depend on the old one, though that's a bad thing to be doing.
-- 
Chris Larson
clarson at kergoth dot com
clarson at mvista dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Software Engineer
MontaVista Software, Inc.




More information about the Openembedded-devel mailing list