summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-extended/hplip/hplip/fix-libusb-paths.patch76
-rw-r--r--meta-oe/recipes-extended/hplip/hplip_3.22.10.bb3
2 files changed, 57 insertions, 22 deletions
diff --git a/meta-oe/recipes-extended/hplip/hplip/fix-libusb-paths.patch b/meta-oe/recipes-extended/hplip/hplip/fix-libusb-paths.patch
index 6aa1de0a8a..f2cd2be60d 100644
--- a/meta-oe/recipes-extended/hplip/hplip/fix-libusb-paths.patch
+++ b/meta-oe/recipes-extended/hplip/hplip/fix-libusb-paths.patch
@@ -1,33 +1,69 @@
1Upstream-Status: Inappropriate [configuration] 1Don't hardcode paths to libusb, instead use pkg-config.
2 2
3--- a/configure.in 3Upstream-Status: Pending
4+++ b/configure.in 4Signed-off-by: Ross Burton <ross.burton@arm.com>
5@@ -599,6 +599,8 @@ if test "$class_driver" = "no" && test " 5
6 AC_CHECK_HEADERS(usb.h, ,[AC_MSG_ERROR([cannot find libusb-devel support], 11)]) 6diff --git a/Makefile.am b/Makefile.am
7 else 7index b77327f..29e838a 100644
8 AC_CHECK_LIB([usb-1.0], [libusb_init], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libusb 1.0 support], 2)])
9+ LIBUSBINCLUDEROOT?="/usr/include/"
10+ AC_ARG_VAR(LIBUSBINCLUDEROOT, [path to libusb-1.0 folder])
11 AC_CHECK_HEADERS(libusb-1.0/libusb.h, ,[AC_MSG_ERROR([cannot find libusb-1.0-devel support], 11)])
12 fi
13 fi
14--- a/Makefile.am 8--- a/Makefile.am
15+++ b/Makefile.am 9+++ b/Makefile.am
16@@ -109,7 +109,7 @@ libhpmud_la_SOURCES += io/hpmud/musb_lib 10@@ -107,12 +107,11 @@ libhpmud_la_SOURCES = io/hpmud/hpmud.c io/hpmud/mlc.c io/hpmud/model.c io/hpmud/
17 libhpmud_la_LDFLAGS += -lusb 11
12 if LIBUSB01_BUILD
13 libhpmud_la_SOURCES += io/hpmud/musb_libusb01.c
14-libhpmud_la_LDFLAGS += -lusb
18 else 15 else
19 libhpmud_la_SOURCES += io/hpmud/musb.c 16 libhpmud_la_SOURCES += io/hpmud/musb.c
20-libhpmud_la_CFLAGS += -I/usr/include/libusb-1.0 17-libhpmud_la_CFLAGS += -I/usr/include/libusb-1.0
21+libhpmud_la_CFLAGS += -I$(LIBUSBINCLUDEROOT)/libusb-1.0 18-libhpmud_la_LDFLAGS += -lusb-1.0
22 libhpmud_la_LDFLAGS += -lusb-1.0
23 endif 19 endif
20+libhpmud_la_CFLAGS += $(USB_CFLAGS)
21+libhpmud_la_LDFLAGS += $(USB_LIBS)
22
23
24 if NETWORK_BUILD
25@@ -356,7 +355,7 @@ hpmudextdir = $(pyexecdir)
26 hpmudext_LTLIBRARIES = hpmudext.la
27 hpmudext_la_LDFLAGS = -module -avoid-version
28 hpmudext_la_SOURCES = io/mudext/hpmudext.c
29-hpmudext_la_CFLAGS = -I$(PYTHONINCLUDEDIR)
30+hpmudext_la_CFLAGS = -I$(PYTHONINCLUDEDIR) $(USB_CFLAGS)
31 hpmudext_la_LIBADD = libhpmud.la
24 32
25@@ -362,7 +362,7 @@ hpmudext_la_CFLAGS += -Iprotocol/discove 33 if NETWORK_BUILD
34@@ -364,9 +363,6 @@ hpmudext_la_LIBADD += libhpdiscovery.la
35 hpmudext_la_CFLAGS += -Iprotocol/discovery
26 endif 36 endif
27 37
28 if !LIBUSB01_BUILD 38-if !LIBUSB01_BUILD
29-hpmudext_la_CFLAGS +=-I/usr/include/libusb-1.0 39-hpmudext_la_CFLAGS +=-I/usr/include/libusb-1.0
30+hpmudext_la_CFLAGS +=-I$(LIBUSBINCLUDEROOT)/libusb-1.0 40-endif
31 endif
32 endif #!HPLIP_CLASS_DRIVER 41 endif #!HPLIP_CLASS_DRIVER
33 # ui (qt3) 42 # ui (qt3)
43 if GUI_BUILD
44diff --git a/configure.in b/configure.in
45index b1c690c..4a65c97 100644
46--- a/configure.in
47+++ b/configure.in
48@@ -36,6 +36,7 @@ AC_PROG_CXX
49 AC_PROG_CC
50 AC_PROG_INSTALL
51 AC_PROG_LIBTOOL
52+PKG_PROG_PKG_CONFIG
53
54 # Checks for required libraries, don't set global -lpthread, -lm, -ljpeg, ... here, set in Makefile.
55 AC_CHECK_LIB([pthread], [pthread_create], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libpthread support], 7)])
56@@ -620,11 +621,9 @@ if test "$class_driver" = "no" && test "$hpijs_only_build" = "no" && test "$hpcu
57 AC_CHECK_LIB([cups], [cupsDoFileRequest], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libcups support], 9)])
58 AC_CHECK_HEADERS(cups/cups.h, ,[AC_MSG_ERROR([cannot find cups-devel support], 3)])
59 if test "$libusb01_build" = "yes"; then
60- AC_CHECK_LIB([usb], [usb_init], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libusb support], 2)])
61- AC_CHECK_HEADERS(usb.h, ,[AC_MSG_ERROR([cannot find libusb-devel support], 11)])
62+ PKG_CHECK_MODULES([USB], [libusb])
63 else
64- AC_CHECK_LIB([usb-1.0], [libusb_init], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libusb 1.0 support], 2)])
65- AC_CHECK_HEADERS(libusb-1.0/libusb.h, ,[AC_MSG_ERROR([cannot find libusb-1.0-devel support], 11)])
66+ PKG_CHECK_MODULES([USB], [libusb-1.0])
67 fi
68 fi
69
diff --git a/meta-oe/recipes-extended/hplip/hplip_3.22.10.bb b/meta-oe/recipes-extended/hplip/hplip_3.22.10.bb
index ca683483b6..3ccfa7d662 100644
--- a/meta-oe/recipes-extended/hplip/hplip_3.22.10.bb
+++ b/meta-oe/recipes-extended/hplip/hplip_3.22.10.bb
@@ -19,7 +19,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
19 file://0001-Drop-using-register-storage-classifier.patch" 19 file://0001-Drop-using-register-storage-classifier.patch"
20SRC_URI[sha256sum] = "533c3f2f6b53e4163ded4fd81d1f11ae6162a0f6451bd5e62a8382d0c1366624" 20SRC_URI[sha256sum] = "533c3f2f6b53e4163ded4fd81d1f11ae6162a0f6451bd5e62a8382d0c1366624"
21 21
22DEPENDS += "cups python3 libusb" 22DEPENDS += "cups python3 libusb1"
23 23
24inherit autotools-brokensep python3-dir python3native python3targetconfig pkgconfig systemd 24inherit autotools-brokensep python3-dir python3native python3targetconfig pkgconfig systemd
25 25
@@ -29,7 +29,6 @@ export STAGING_LIBDIR
29CFLAGS += "-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}" 29CFLAGS += "-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}"
30 30
31EXTRA_OECONF += "\ 31EXTRA_OECONF += "\
32 LIBUSBINCLUDEROOT=${STAGING_INCDIR} \
33 --enable-cups-drv-install \ 32 --enable-cups-drv-install \
34 --enable-cups-ppd-install \ 33 --enable-cups-ppd-install \
35 --disable-network-build \ 34 --disable-network-build \