diff options
author | Maksim 'max_posedon' Melnikau <maxposedon@gmail.com> | 2009-04-15 23:53:32 +0000 |
---|---|---|
committer | Maksim 'max_posedon' Melnikau <maxposedon@gmail.com> | 2009-04-15 23:53:32 +0000 |
commit | 74fec8df39ee651d781db1046f9a4548a936bf55 (patch) | |
tree | c6723d183499b9714cac048a61684bf149896b81 /dev-libs | |
parent | fixing libgsm0710 Manifest, thanks edje (diff) | |
download | embedded-cross-74fec8df39ee651d781db1046f9a4548a936bf55.tar.gz embedded-cross-74fec8df39ee651d781db1046f9a4548a936bf55.tar.bz2 embedded-cross-74fec8df39ee651d781db1046f9a4548a936bf55.zip |
Fix hal cross compliation ( reported by kvaster ).
portage's libusb-0.1.12-r5 doesn't generate ROOT/lib/libusb.so,
and this breaks any linking with libusb, because of ugly fix bug #4411.
Diffstat (limited to 'dev-libs')
-rw-r--r-- | dev-libs/libusb/Manifest | 5 | ||||
-rw-r--r-- | dev-libs/libusb/files/0.1.12-fbsd.patch | 97 | ||||
-rw-r--r-- | dev-libs/libusb/files/libusb-0.1.12-no-infinite-bulk.patch | 24 | ||||
-rw-r--r-- | dev-libs/libusb/files/libusb-0.1.12-nocpp.patch | 20 | ||||
-rw-r--r-- | dev-libs/libusb/libusb-0.1.12-r5.ebuild | 60 |
5 files changed, 206 insertions, 0 deletions
diff --git a/dev-libs/libusb/Manifest b/dev-libs/libusb/Manifest new file mode 100644 index 0000000..7c73110 --- /dev/null +++ b/dev-libs/libusb/Manifest @@ -0,0 +1,5 @@ +AUX 0.1.12-fbsd.patch 2477 RMD160 aa92a57100c98cf1ef900d1f27685a33a9c3fc91 SHA1 75dbab5891a5753463661806e89263f13e8653b3 SHA256 21ef0d24c6f64d5aaa50e358a342071d120154425d7d034c1f4efae9f8efc24d +AUX libusb-0.1.12-no-infinite-bulk.patch 807 RMD160 bba6194bb6cc9c0008791684c325c599ea6a2415 SHA1 92b97b247baa0e548f1909addf69bb159534a991 SHA256 141b8a6f6e4cef3b9e08377cb1d79cb9398f2437894d368d0eca8f1c07848db7 +AUX libusb-0.1.12-nocpp.patch 572 RMD160 cdceb6a5550a6371401046fb26a9ccc67e4a3d5d SHA1 c55022ae4965b469949329cd6839707790a44ec4 SHA256 6a9833ea9238b9df0f6a359c3d84f829bdf83e26dedb31ce9d614f9c6cda3ab0 +DIST libusb-0.1.12.tar.gz 389343 RMD160 63848df717e00fff67ab30ba86a85466370d4e8e SHA1 599a5168590f66bc6f1f9a299579fd8500614807 SHA256 37f6f7d9de74196eb5fc0bbe0aea9b5c939de7f500acba3af6fd643f3b538b44 +EBUILD libusb-0.1.12-r5.ebuild 1818 RMD160 77adc7792070ce1eb660049df0ae835aa81149cd SHA1 83e6396baba0deecaf9b8592970ac5c468b56766 SHA256 bf7433eba973a08679e28b62edb3caf1dc8fe6f15ae3c7bf94fb5e62ba0d2dad diff --git a/dev-libs/libusb/files/0.1.12-fbsd.patch b/dev-libs/libusb/files/0.1.12-fbsd.patch new file mode 100644 index 0000000..57fd2ee --- /dev/null +++ b/dev-libs/libusb/files/0.1.12-fbsd.patch @@ -0,0 +1,97 @@ +Index: libusb-0.1.12/configure.in +=================================================================== +--- libusb-0.1.12.orig/configure.in ++++ libusb-0.1.12/configure.in +@@ -90,6 +90,8 @@ LINUX_API=0 + DARWIN_API=0 + BSD_API=0 + ++DEFINE_USB_HID_DESCRIPTOR=1 ++ + AC_MSG_CHECKING(for what USB OS support) + case $host in + *-linux*) +@@ -101,13 +103,40 @@ case $host in + AC_MSG_RESULT(Linux) + OSLIBS="" + ;; +- *-freebsd*|*-kfreebsd*-gnu|*-openbsd*|*-netbsd*) ++ *-freebsd*) ++ AC_DEFINE(BSD_API, 1) ++ AC_DEFINE(LINUX_API, 0) ++ AC_DEFINE(DARWIN_API, 0) ++ BSD_API=1 ++ os_support=bsd ++ AC_MSG_RESULT(FreeBSD) ++ OSLIBS="" ++ AC_CHECK_HEADERS([dev/usb/usbhid.h]) ++ if test "x$ac_cv_header_dev_usb_hisbhid_h" = "xyes"; then ++ AC_MSG_CHECKING([for usb_hid_descriptor]) ++ have_usb_hid_descriptor=no ++ AC_TRY_COMPILE([ ++ #include <sys/types.h> ++ #include <dev/usb/usb.h> ++ #include <dev/usb/usbhid.h> ++ ], [ ++ struct usb_hid_descriptor descr; ++ ], [ ++ have_usb_hid_descriptor=yes ++ ]) ++ AC_MSG_RESULT([$have_usb_hid_descriptor]) ++ if test "x$have_usb_hid_descriptor" = "xyes"; then ++ DEFINE_USB_HID_DESCRIPTOR=0 ++ fi ++ fi ++ ;; ++ *-dragonfly*|*-kfreebsd*-gnu|*-openbsd*|*-netbsd*) + AC_DEFINE(BSD_API, 1) + AC_DEFINE(LINUX_API, 0) + AC_DEFINE(DARWIN_API, 0) + BSD_API=1 + os_support=bsd +- AC_MSG_RESULT(FreeBSD, OpenBSD and/or NetBSD) ++ AC_MSG_RESULT(DragonFly, OpenBSD and/or NetBSD) + OSLIBS="" + ;; + *-darwin*) +@@ -128,6 +157,7 @@ esac + AC_SUBST(DARWIN_API) + AC_SUBST(LINUX_API) + AC_SUBST(BSD_API) ++AC_SUBST(DEFINE_USB_HID_DESCRIPTOR) + + AM_CONDITIONAL(LINUX_API, test "$os_support" = "linux") + AM_CONDITIONAL(BSD_API, test "$os_support" = "bsd") +Index: libusb-0.1.12/usb.h.in +=================================================================== +--- libusb-0.1.12.orig/usb.h.in ++++ libusb-0.1.12/usb.h.in +@@ -17,6 +17,12 @@ + + #include <dirent.h> + ++#if ! @DEFINE_USB_HID_DESCRIPTOR@ && defined(__FreeBSD__) ++#include <sys/types.h> ++#include <dev/usb/usb.h> ++#include <dev/usb/usbhid.h> ++#endif ++ + /* + * USB spec information + * +@@ -75,6 +81,7 @@ struct usb_string_descriptor { + u_int16_t wData[1]; + }; + ++#if ! @DEFINE_USB_HID_DESCRIPTOR@ && defined(__FreeBSD__) + /* HID descriptor */ + struct usb_hid_descriptor { + u_int8_t bLength; +@@ -86,6 +93,7 @@ struct usb_hid_descriptor { + /* u_int16_t wDescriptorLength; */ + /* ... */ + }; ++#endif + + /* Endpoint descriptor */ + #define USB_MAXENDPOINTS 32 diff --git a/dev-libs/libusb/files/libusb-0.1.12-no-infinite-bulk.patch b/dev-libs/libusb/files/libusb-0.1.12-no-infinite-bulk.patch new file mode 100644 index 0000000..563397d --- /dev/null +++ b/dev-libs/libusb/files/libusb-0.1.12-no-infinite-bulk.patch @@ -0,0 +1,24 @@ +Patch-from: http://bugs.gentoo.org/show_bug.cgi?id=225879 +Gentoo-Bug: 225879 +Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> + +Prevents an infinite loop if device is removed during usb_bulk_read or +usb_bulk_write. + +diff -Naur libusb-0.1.12/linux.c libusb-0.1.12-new/linux.c +--- libusb-0.1.12/linux.c 2006-03-04 04:52:46.000000000 +0200 ++++ libusb-0.1.12-new/linux.c 2008-06-11 14:22:20.000000000 +0300 +@@ -220,6 +220,13 @@ + waiting = 1; + context = NULL; + while (!urb.usercontext && ((ret = ioctl(dev->fd, IOCTL_USB_REAPURBNDELAY, &context)) == -1) && waiting) { ++ if (ret == -1) ++ { ++ if (errno == ENODEV) ++ { ++ return -ENODEV; ++ } ++ } + tv.tv_sec = 0; + tv.tv_usec = 1000; // 1 msec + select(dev->fd + 1, NULL, &writefds, NULL, &tv); //sub second wait diff --git a/dev-libs/libusb/files/libusb-0.1.12-nocpp.patch b/dev-libs/libusb/files/libusb-0.1.12-nocpp.patch new file mode 100644 index 0000000..de1a8c7 --- /dev/null +++ b/dev-libs/libusb/files/libusb-0.1.12-nocpp.patch @@ -0,0 +1,20 @@ +--- libusb-0.1.12/Makefile.am 2006-03-04 13:52:46.000000000 +1100 ++++ libusb-0.1.12/Makefile.am.new 2007-11-08 16:25:38.000000000 +1100 +@@ -4,7 +4,7 @@ + # gnu strictness chokes on README being autogenerated + AUTOMAKE_OPTIONS = 1.4 foreign + +-SUBDIRS = . tests doc ++SUBDIRS = . doc + + AM_CFLAGS = -Werror + +@@ -19,7 +19,7 @@ + apidocs/footer.html apidocs/doxygen.css apidocs/doxygen.png libusb.pc.in + EXTRA_libusb_la_SOURCE = linux.c linux.h bsd.c darwin.c + +-lib_LTLIBRARIES = libusb.la libusbpp.la ++lib_LTLIBRARIES = libusb.la + + pkgconfig_DATA = libusb.pc + diff --git a/dev-libs/libusb/libusb-0.1.12-r5.ebuild b/dev-libs/libusb/libusb-0.1.12-r5.ebuild new file mode 100644 index 0000000..cfb6646 --- /dev/null +++ b/dev-libs/libusb/libusb-0.1.12-r5.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/libusb/libusb-0.1.12-r5.ebuild,v 1.2 2009/03/28 11:30:42 vapier Exp $ + +inherit eutils libtool autotools toolchain-funcs + +DESCRIPTION="Userspace access to USB devices" +HOMEPAGE="http://libusb.sourceforge.net/" +SRC_URI="mirror://sourceforge/libusb/${P}.tar.gz" + +LICENSE="LGPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" +IUSE="debug doc nocxx" +RESTRICT="test" + +RDEPEND="" +DEPEND="doc? ( app-text/openjade + app-text/docbook-dsssl-stylesheets + app-text/docbook-sgml-utils + ~app-text/docbook-sgml-dtd-4.2 )" + +src_unpack() { + unpack ${A} + cd "${S}" + sed -i -e 's:-Werror::' Makefile.am + sed -i 's:AC_LANG_CPLUSPLUS:AC_PROG_CXX:' configure.in #213800 + epatch "${FILESDIR}"/${PV}-fbsd.patch + use nocxx && epatch "${FILESDIR}"/${PN}-0.1.12-nocpp.patch + epatch "${FILESDIR}"/${PN}-0.1.12-no-infinite-bulk.patch + eautoreconf + elibtoolize + + # Ensure that the documentation actually finds the DTD it needs + docbookdtd="/usr/share/sgml/docbook/sgml-dtd-4.2/docbook.dtd" + sysid='"-//OASIS//DTD DocBook V4.2//EN"' + sed -r -i -e \ + "s,(${sysid}) \[\$,\1 \"${docbookdtd}\" \[,g" \ + "${S}"/doc/manual.sgml +} + +src_compile() { + econf \ + $(use_enable debug debug all) \ + $(use_enable doc build-docs) + emake || die "emake failed" +} + +src_install() { + emake -j1 DESTDIR="${D}" install || die "make install failed" + dodoc AUTHORS NEWS README + use doc && dohtml doc/html/*.html + + dodir /$(get_libdir) + mv "${D}"/usr/$(get_libdir)/*.so* "${D}"/$(get_libdir) \ + || die "Failed to put dynamic libs in /$(get_libdir)" + + gen_usr_ldscript libusb.so + use nocxx && rm -f "${D}"/usr/include/usbpp.h || gen_usr_ldscript libusbpp.so +} |