From patchwork Tue May 23 12:18:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 24324 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6C3FC7EE2A for ; Tue, 23 May 2023 12:18:39 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.20573.1684844314457240986 for ; Tue, 23 May 2023 05:18:34 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0F1A8139F; Tue, 23 May 2023 05:19:19 -0700 (PDT) Received: from oss-tx204.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8F5E93F6C4; Tue, 23 May 2023 05:18:33 -0700 (PDT) From: ross.burton@arm.com To: openembedded-devel@lists.openembedded.org Cc: nd@arm.com Subject: [PATCH 1/3] hplip: build against libusb1 Date: Tue, 23 May 2023 13:18:29 +0100 Message-Id: <20230523121831.1877208-1-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 23 May 2023 12:18:39 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/102732 From: Ross Burton Build against the maintained libusb1 instead of the obsolete libusb-compat. Update the patch to use pkg-config so that it does the correct linkage too. Signed-off-by: Ross Burton --- .../hplip/hplip/fix-libusb-paths.patch | 76 ++++++++++++++----- .../recipes-extended/hplip/hplip_3.22.10.bb | 3 +- 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 @@ -Upstream-Status: Inappropriate [configuration] +Don't hardcode paths to libusb, instead use pkg-config. ---- a/configure.in -+++ b/configure.in -@@ -599,6 +599,8 @@ if test "$class_driver" = "no" && test " - AC_CHECK_HEADERS(usb.h, ,[AC_MSG_ERROR([cannot find libusb-devel support], 11)]) - else - AC_CHECK_LIB([usb-1.0], [libusb_init], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libusb 1.0 support], 2)]) -+ LIBUSBINCLUDEROOT?="/usr/include/" -+ AC_ARG_VAR(LIBUSBINCLUDEROOT, [path to libusb-1.0 folder]) - AC_CHECK_HEADERS(libusb-1.0/libusb.h, ,[AC_MSG_ERROR([cannot find libusb-1.0-devel support], 11)]) - fi - fi +Upstream-Status: Pending +Signed-off-by: Ross Burton + +diff --git a/Makefile.am b/Makefile.am +index b77327f..29e838a 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -109,7 +109,7 @@ libhpmud_la_SOURCES += io/hpmud/musb_lib - libhpmud_la_LDFLAGS += -lusb +@@ -107,12 +107,11 @@ libhpmud_la_SOURCES = io/hpmud/hpmud.c io/hpmud/mlc.c io/hpmud/model.c io/hpmud/ + + if LIBUSB01_BUILD + libhpmud_la_SOURCES += io/hpmud/musb_libusb01.c +-libhpmud_la_LDFLAGS += -lusb else libhpmud_la_SOURCES += io/hpmud/musb.c -libhpmud_la_CFLAGS += -I/usr/include/libusb-1.0 -+libhpmud_la_CFLAGS += -I$(LIBUSBINCLUDEROOT)/libusb-1.0 - libhpmud_la_LDFLAGS += -lusb-1.0 +-libhpmud_la_LDFLAGS += -lusb-1.0 endif ++libhpmud_la_CFLAGS += $(USB_CFLAGS) ++libhpmud_la_LDFLAGS += $(USB_LIBS) + + + if NETWORK_BUILD +@@ -356,7 +355,7 @@ hpmudextdir = $(pyexecdir) + hpmudext_LTLIBRARIES = hpmudext.la + hpmudext_la_LDFLAGS = -module -avoid-version + hpmudext_la_SOURCES = io/mudext/hpmudext.c +-hpmudext_la_CFLAGS = -I$(PYTHONINCLUDEDIR) ++hpmudext_la_CFLAGS = -I$(PYTHONINCLUDEDIR) $(USB_CFLAGS) + hpmudext_la_LIBADD = libhpmud.la -@@ -362,7 +362,7 @@ hpmudext_la_CFLAGS += -Iprotocol/discove + if NETWORK_BUILD +@@ -364,9 +363,6 @@ hpmudext_la_LIBADD += libhpdiscovery.la + hpmudext_la_CFLAGS += -Iprotocol/discovery endif - if !LIBUSB01_BUILD +-if !LIBUSB01_BUILD -hpmudext_la_CFLAGS +=-I/usr/include/libusb-1.0 -+hpmudext_la_CFLAGS +=-I$(LIBUSBINCLUDEROOT)/libusb-1.0 - endif +-endif endif #!HPLIP_CLASS_DRIVER # ui (qt3) + if GUI_BUILD +diff --git a/configure.in b/configure.in +index b1c690c..4a65c97 100644 +--- a/configure.in ++++ b/configure.in +@@ -36,6 +36,7 @@ AC_PROG_CXX + AC_PROG_CC + AC_PROG_INSTALL + AC_PROG_LIBTOOL ++PKG_PROG_PKG_CONFIG + + # Checks for required libraries, don't set global -lpthread, -lm, -ljpeg, ... here, set in Makefile. + AC_CHECK_LIB([pthread], [pthread_create], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libpthread support], 7)]) +@@ -620,11 +621,9 @@ if test "$class_driver" = "no" && test "$hpijs_only_build" = "no" && test "$hpcu + AC_CHECK_LIB([cups], [cupsDoFileRequest], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libcups support], 9)]) + AC_CHECK_HEADERS(cups/cups.h, ,[AC_MSG_ERROR([cannot find cups-devel support], 3)]) + if test "$libusb01_build" = "yes"; then +- AC_CHECK_LIB([usb], [usb_init], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libusb support], 2)]) +- AC_CHECK_HEADERS(usb.h, ,[AC_MSG_ERROR([cannot find libusb-devel support], 11)]) ++ PKG_CHECK_MODULES([USB], [libusb]) + else +- AC_CHECK_LIB([usb-1.0], [libusb_init], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libusb 1.0 support], 2)]) +- AC_CHECK_HEADERS(libusb-1.0/libusb.h, ,[AC_MSG_ERROR([cannot find libusb-1.0-devel support], 11)]) ++ PKG_CHECK_MODULES([USB], [libusb-1.0]) + fi + fi + 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 \ file://0001-Drop-using-register-storage-classifier.patch" SRC_URI[sha256sum] = "533c3f2f6b53e4163ded4fd81d1f11ae6162a0f6451bd5e62a8382d0c1366624" -DEPENDS += "cups python3 libusb" +DEPENDS += "cups python3 libusb1" inherit autotools-brokensep python3-dir python3native python3targetconfig pkgconfig systemd @@ -29,7 +29,6 @@ export STAGING_LIBDIR CFLAGS += "-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}" EXTRA_OECONF += "\ - LIBUSBINCLUDEROOT=${STAGING_INCDIR} \ --enable-cups-drv-install \ --enable-cups-ppd-install \ --disable-network-build \