Skip to contentSkip to conversation

gutenprint: fix host build when libusb found

PATCH In review Waldemar Brodkorb 3 participants 5 messages Apr 2, 2016 – Apr 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gutenprint: fix host build when libusb found

Allow to disable USB support, otherwise host build breaks when libusb is found as installation tries to install to /usr. Fixes following autobuild error:
http://autobuild.buildroot.net/results/081b3be918ac1eaa8cfbc5919e00bc1ea267c1df/

---
 .../0004-build-usb-backends-conditional.patch      | 23 ++++++++++++++++++++++
 package/gutenprint/gutenprint.mk                   |  1 +
 2 files changed, 24 insertions(+)
 create mode 100644 package/gutenprint/0004-build-usb-backends-conditional.patch
package/gutenprint/0004-build-usb-backends-conditional.patch new file +23 -0
new file mode 100644
index 0000000..db44a12
@@ -0,0 +1,23 @@
+Allow to disable USB backend
+
+Signed-off-by: Waldemar Brodkorb <[email protected]>
+
+diff -Nur gutenprint-5.2.11.orig/configure.ac gutenprint-5.2.11/configure.ac
+--- gutenprint-5.2.11.orig/configure.ac	2016-01-14 04:02:49.000000000 +0100
++++ gutenprint-5.2.11/configure.ac	2016-04-02 20:07:54.649589473 +0200
+@@ -442,12 +442,15 @@
+ dnl   [EXTRA_LIBREADLINE_DEPS]=""
+ dnl fi
+ 
++AC_ARG_WITH([libusb], AS_HELP_STRING([--with-libusb], [Build with USB backend support]))
+ # libusb-1.0 (For CUPS backends)
++AS_IF([test "x$with_libusb" = "xyes"], [
+ PKG_CHECK_MODULES([LIBUSB], [libusb-1.0],
+                   [HAVE_LIBUSB=yes
+                    BUILD_LIBUSB_BACKENDS=yes],
+                   [HAVE_LIBUSB=no
+ 	           BUILD_LIBUSB_BACKENDS=no])
++])
+ 
+ AC_PATH_PROGS([GIMPTOOL2_CHECK], [gimptool-2.0 gimptool])
+ if test -z "${GIMPTOOL2_CHECK}" ; then
package/gutenprint/gutenprint.mk +1 -0
index 7e3024d..2a5fc95 100644
@@ -67,6 +67,7 @@ HOST_GUTENPRINT_CONF_OPTS = \
 	--disable-escputil \
 	--disable-test \
 	--disable-testpattern \
+	--without-libusb \
 	--without-cups
 
 # Needed by autoreconf
Signature · 1 line
2.1.4
Tested-by on v1 1/1
#1 lore raw

Hi Waldemar,

Quoted 6 lines · Waldemar Brodkorb

Allow to disable USB support, otherwise host build breaks when libusb is found as installation tries to install to /usr. Fixes following autobuild error:
http://autobuild.buildroot.net/results/081b3be918ac1eaa8cfbc5919e00bc1ea267c1df/

Quoted 12 lines
---
 .../0004-build-usb-backends-conditional.patch      | 23 ++++++++++++++++++++++
 package/gutenprint/gutenprint.mk                   |  1 +
 2 files changed, 24 insertions(+)
 create mode 100644 package/gutenprint/0004-build-usb-backends-conditional.patch
package/gutenprint/0004-build-usb-backends-conditional.patch new file +0 -0
new file mode 100644
index 0000000..db44a12

package/gutenprint/0004-build-usb-backends-conditional.patch line 3

Quoted 3 lines
package/gutenprint/0004-build-usb-backends-conditional.patch new file +3 -0
@@ -0,0 +1,23 @@
+Allow to disable USB backend
+
+Signed-off-by: Waldemar Brodkorb <[email protected]>

Have you tried to upstream this patch?

Since we would now be patching also configure.ac, please updated the AUTORECONF comment in gutenprint.mk.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#2 lore raw

PATCH 1/1 gutenprint: fix host build when libusb found

In reply to Waldemar Brodkorb
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Waldemar" == Waldemar Brodkorb <[email protected]> writes:

Allow to disable USB support, otherwise host build breaks when libusb is found as installation tries to install to /usr. Fixes following autobuild error:
http://autobuild.buildroot.net/results/081b3be918ac1eaa8cfbc5919e00bc1ea267c1df/

Hmm, but why does that end up with /usr and not $(HOST_DIR)/usr? Is it picking up a libusb.pc from your host or is our host-libusb .pc file wrong?

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/1 gutenprint: fix host build when libusb found

Hi Peter,
Peter Korsgaard wrote,

Quoted 10 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Waldemar" == Waldemar Brodkorb <[email protected]> writes:

Allow to disable USB support, otherwise host build breaks when libusb is found as installation tries to install to /usr. Fixes following autobuild error:
http://autobuild.buildroot.net/results/081b3be918ac1eaa8cfbc5919e00bc1ea267c1df/

Hmm, but why does that end up with /usr and not $(HOST_DIR)/usr? Is it picking up a libusb.pc from your host or is our host-libusb .pc file wrong?

It is picking up libusb.pc from the host and I don't think gutenprint-print will build host libusb at all. As cups support is disabled anyway for the host, I don't think installing any USB backends for the hosttools is strictly necessary and might be better avoided.

best regards
Waldemar

#4 lore raw

PATCH 1/1 gutenprint: fix host build when libusb found

Quoted 16 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Waldemar" == Waldemar Brodkorb <[email protected]> writes:

Hi Peter,
Peter Korsgaard wrote,

Quoted 10 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Waldemar" == Waldemar Brodkorb <[email protected]> writes:

Allow to disable USB support, otherwise host build breaks when libusb is found as installation tries to install to /usr. Fixes following autobuild error:
http://autobuild.buildroot.net/results/081b3be918ac1eaa8cfbc5919e00bc1ea267c1df/

Hmm, but why does that end up with /usr and not $(HOST_DIR)/usr? Is it picking up a libusb.pc from your host or is our host-libusb .pc file wrong?

Quoted 5 lines

It is picking up libusb.pc from the host and I don't think gutenprint-print will build host libusb at all. As cups support is disabled anyway for the host, I don't think installing any USB backends for the hosttools is strictly necessary and might be better avoided.

I had a closer look, and it actually isn't libusb.pc from the build host (or directly anything to do with libusb).

The problem is really that the --without-cups option doesn't really work. We already have a related workaround for this where we ac_cv_path_CUPS_CONFIG='', but more is needed. When we pass --without-cups the configure script hardcodes cups_prefix to "/usr".

host-gutenprint itself doesn't depend on host-libusb, but other packages do so it might be built before host-gutenprint. If the configure script detects libusb support (using pkg-config), then it will build a cups backend using libusb (even though cups support is disabled) and intall it into $cups_prefix/share/cups/usb, breaking the build :/

So either we fix the configure script to really disable the cups support when configured with --without-cups, we add your patch as a workaround or we simply add PKG_CONFIG=false to HOST_GUTENPRINT_CONF_ENV to make sure the configure script doesn't find libusb. We can do that as pkg-config is only used to check for libusb and gtk2, neither of which we need for host-gutenprint.

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard