Package: libusb
Version: 2:0.1.12-23+nmu1
Severity: normal
Tags: patch
User: [email protected]
Usertags: cross

libusb fails to cross-build because it always builds the udeb for the
build architecture, not the host.  This results in:

  arm-linux-gnueabihf-objcopy:./lib/libusb-0.1.so.4.4.4: File format not 
recognized
  objcopy --only-keep-debug failed on 
/«PKGBUILDDIR»/debian/libusb-0.1-udeb/lib/libusb-0.1.so.4.4.4
  make: *** [binary-arch] Error 1

The following patch corrects this, as well as a minor oddity in the
build process.

  * Build in obj-$(DEB_HOST_GNU_TYPE) rather than obj-$(DEB_BUILD_GNU_TYPE),
    which is less confusing since the former corresponds to the architecture
    we're building for.
  * Cross-build the udeb pass if requested, as well as the deb pass.

diff -Nru libusb-0.1.12/debian/rules libusb-0.1.12/debian/rules
--- libusb-0.1.12/debian/rules  2012-04-03 22:12:25.000000000 +0100
+++ libusb-0.1.12/debian/rules  2012-11-23 02:59:37.000000000 +0000
@@ -39,7 +39,7 @@
        INSTALL_PROGRAM += -s
 endif
 
-objdir = $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)
+objdir = $(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)
 objdir_udeb = $(objdir)-udeb
 
 configure: configure-deb-stamp configure-udeb-stamp
@@ -86,6 +86,8 @@
        # run configure with build tree $(objdir_udeb)
        cd $(objdir_udeb) && \
                CPPFLAGS="$(CPPFLAGS_UDEB)" CFLAGS="$(CFLAGS_UDEB)" 
CXXFLAGS="$(CXXFLAGS_UDEB)" LDFLAGS="$(LDFLAGS_UDEB)" ../configure \
+                       --host=$(DEB_HOST_GNU_TYPE) \
+                       --build=$(DEB_BUILD_GNU_TYPE) \
                        --prefix=/usr \
                        --mandir=/usr/share/man \
                        --infodir=/usr/share/info \

Thanks,

-- 
Colin Watson                                       [[email protected]]


--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to