diff mbox series

[meta-oe,04/13] hplip: Upgrade 3.26.6 -> 3.26.10

Message ID 20261204183211.546018-5-khem.raj@oss.qualcomm.com
State New
Headers show
Series meta-oe: Recipe upgrades and a libpulse recipe | expand

Commit Message

Khem Raj Dec. 4, 2026, 6:32 p.m. UTC
Adds PPDs for HP Color LaserJet 4701, MFP 4801, MFP X476 and X451.
configure.in now uses LT_INIT with an m4 directory, saves and restores
CFLAGS around the python-config probe, and adds hardening flags of its
own. pcardext is now ported to the Python 3 C API. No release notes
were published; this is from comparing the two tarballs.

Drop patches fixed upstream:
- 0001-Fix-upstream-CFLAGS-override.patch (CFLAGS are saved now)
- 0003-pserror.c-Define-column-to-be-int-explcitly.patch
- 0006-Workaround-patch-for-missing-Python3-transition-of-t.patch
  (pcardext is ported, so the workaround and the hp-unload disable
  are no longer needed)
Refresh configure.patch and fix-libusb-paths.patch.

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 .../0001-Fix-upstream-CFLAGS-override.patch   |  68 ---------
 ....c-Define-column-to-be-int-explcitly.patch |  23 ---
 ...-for-missing-Python3-transition-of-t.patch | 132 ------------------
 .../hplip/hplip/configure.patch               |  10 +-
 .../hplip/hplip/fix-libusb-paths.patch        |  18 +--
 .../{hplip_3.26.6.bb => hplip_3.26.10.bb}     |   6 +-
 6 files changed, 17 insertions(+), 240 deletions(-)
 delete mode 100644 meta-oe/recipes-extended/hplip/hplip/0001-Fix-upstream-CFLAGS-override.patch
 delete mode 100644 meta-oe/recipes-extended/hplip/hplip/0003-pserror.c-Define-column-to-be-int-explcitly.patch
 delete mode 100644 meta-oe/recipes-extended/hplip/hplip/0006-Workaround-patch-for-missing-Python3-transition-of-t.patch
 rename meta-oe/recipes-extended/hplip/{hplip_3.26.6.bb => hplip_3.26.10.bb} (91%)
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/hplip/hplip/0001-Fix-upstream-CFLAGS-override.patch b/meta-oe/recipes-extended/hplip/hplip/0001-Fix-upstream-CFLAGS-override.patch
deleted file mode 100644
index c8c892c5e1..0000000000
--- a/meta-oe/recipes-extended/hplip/hplip/0001-Fix-upstream-CFLAGS-override.patch
+++ /dev/null
@@ -1,68 +0,0 @@ 
-From 297e517d302469fa27dd96c091021b53f9ac2254 Mon Sep 17 00:00:00 2001
-From: Zdenek Dohnal <zdohnal@redhat.com>
-Date: Fri, 26 Apr 2024 14:17:54 -0600
-Subject: [PATCH] Fix upstream CFLAGS override
-
-Upstream check for python clears OS build system CFLAGS
-
-Upstream-Status: Submitted [https://bugs.launchpad.net/hplip/+bug/1879445]
----
- configure.in | 36 +++++++++++++++++++++++-------------
- 1 file changed, 23 insertions(+), 13 deletions(-)
-
-diff --git a/configure.in b/configure.in
-index ebea052..80c4618 100644
---- a/configure.in
-+++ b/configure.in
-@@ -628,20 +628,31 @@ if test "$class_driver" = "no" && test "$hpijs_only_build" = "no" && test "$hpcu
-    fi
- fi
- 
--SAVE_CPPFLAGS="$CPPFLAGS"
--CFLAGS=`python-config --includes`
--if [ $? -eq 0 ] 
--then
--   echo $FLAGS
--else
--CFLAGS=`python3-config --includes`
--   if [ $? -eq 0 ]
--   then
--   echo $FLAGS
--   fi
-+AC_PATH_PROG(python3_config_path, python3-config, [AC_MSG_ERROR([python3-config not installed], 6)])
-+
-+PYTHON_INCLUDES=`$python3_config_path --includes`
-+if test "X$PYTHON_INCLUDES" == "X" ; then
-+  AC_MSG_ERROR([Cannot get Python includes via python3-config], 6)
-+fi
-+
-+PYTHON_LIBS=`$python3_config_path --libs`
-+if test "X$PYTHON_LIBS" == "X" ; then
-+  AC_MSG_ERROR([Cannot get Python libs via python3-config], 6)
-+fi
-+
-+SAVE_CFLAGS=$CFLAGS
-+SAVE_LIBS=$LIBS
-+
-+CFLAGS="$CFLAGS $PYTHON_INCLUDES"
-+LIBS="$LIBS $PYTHON_LIBS"
-+
-+AC_TRY_LINK(,[ ], AC_MSG_RESULT(yes); python_includes="ok", AC_MSG_ERROR([no: PYTHON DISABLED], 6))
-+
-+if test "X$python_includes" != "Xok" ; then
-+  CFLAGS="$SAVE_CFLAGS"
-+  LIBS="$SAVE_LIBS"
- fi
- 
--#CFLAGS=`(python-config --includes)`
- if test "$class_driver" = "no" && test "$hpijs_only_build" = "no" && test "$lite_build" = "no" && test "$hpcups_only_build" = "no"; then
-    AC_ARG_VAR([PYTHON], [Python interpreter/compiler command])
-    AC_CHECK_PROGS(PYTHON,[python python3 python2])
-@@ -664,7 +675,6 @@ if test "$class_driver" = "no" && test "$hpijs_only_build" = "no" && test "$lite
-    AS_IF([test "x$FOUND_HEADER" != "xyes"],
-           [AC_MSG_ERROR([cannot find python-devel support], 6)])
- fi
--CFLAGS="$save_CFLAGS"
- 
- if test "$hpijs_only_build" = "no" && test "$scan_build" = "yes" && test "$hpcups_only_build" = "no"; then
-    AC_CHECK_LIB([sane], [sane_open], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find sane-backends-devel support (or --disable-scan-build)], 12)])
diff --git a/meta-oe/recipes-extended/hplip/hplip/0003-pserror.c-Define-column-to-be-int-explcitly.patch b/meta-oe/recipes-extended/hplip/hplip/0003-pserror.c-Define-column-to-be-int-explcitly.patch
deleted file mode 100644
index bf93c222ea..0000000000
--- a/meta-oe/recipes-extended/hplip/hplip/0003-pserror.c-Define-column-to-be-int-explcitly.patch
+++ /dev/null
@@ -1,23 +0,0 @@ 
-From a27d6264671e7201b5d78bcc9200e7d946429979 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 2 Sep 2022 17:57:53 -0700
-Subject: [PATCH 3/4] pserror.c: Define column to be int explcitly
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- prnt/hpps/pserror.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/prnt/hpps/pserror.c
-+++ b/prnt/hpps/pserror.c
-@@ -24,7 +24,7 @@ extern char *program ;	/* Defined by mai
- void message(int flags, char *format, ...)
- {
-   va_list args ;
--  static column = 0 ;		/* current screen column for message wrap */
-+  static int column = 0 ;	/* current screen column for message wrap */
-   char msgbuf[MAX_MESSAGE] ;	/* buffer in which to put the message */
-   char *bufptr = msgbuf ;	/* message buffer pointer */
- 
diff --git a/meta-oe/recipes-extended/hplip/hplip/0006-Workaround-patch-for-missing-Python3-transition-of-t.patch b/meta-oe/recipes-extended/hplip/hplip/0006-Workaround-patch-for-missing-Python3-transition-of-t.patch
deleted file mode 100644
index 194deb8b81..0000000000
--- a/meta-oe/recipes-extended/hplip/hplip/0006-Workaround-patch-for-missing-Python3-transition-of-t.patch
+++ /dev/null
@@ -1,132 +0,0 @@ 
-From: Till Kamppeter <till.kamppeter@gmail.com>
-Date: Fri, 22 Jul 2016 09:33:04 +0200
-Subject: Workaround patch for missing Python3 transition of the old
- (pre-USB-storage) photo memory card support (pcardext) as this part builds
- in Python3 environments but with pointer-related warnings which are fatal
- errors for Ubuntu's build servers. The patch silences the warnings but the
- memory card support is dropped in Python3 environments. This patch is
- supplied by the HPLIP upstream developers and will be replaced by a more
- proper solution in the next upstream release of HPLIP (see LP: #1275353)
-
----
-Upstream-Status: Pending
-
- pcard/pcardext/pcardext.c | 59 +++++++++++++++++++++++++++++++++++++----------
- pcard/photocard.py        |  2 +-
- unload.py                 |  5 ++++
- 3 files changed, 53 insertions(+), 13 deletions(-)
-
---- a/pcard/pcardext/pcardext.c
-+++ b/pcard/pcardext/pcardext.c
-@@ -20,7 +20,7 @@ pcardext - Python extension for HP photo
- Requires:
- Python 2.2+
- 
--Author: Don Welch
-+Author: Don Welch
- 
- \*****************************************************************************/
- 
-@@ -41,9 +41,37 @@ typedef int Py_ssize_t;
- 
- int verbose=0;
- 
-+#if PY_MAJOR_VERSION >= 3
-+  #define MOD_ERROR_VAL NULL
-+  #define MOD_SUCCESS_VAL(val) val
-+  #define MOD_INIT(name) PyMODINIT_FUNC PyInit_##name(void)
-+  #define PyInt_AS_LONG PyLong_AS_LONG
-+  #define MOD_DEF(ob, name, doc, methods) \
-+          static struct PyModuleDef moduledef = { \
-+            PyModuleDef_HEAD_INIT, name, doc, -1, methods, }; \
-+          ob = PyModule_Create(&moduledef);
-+
-+
-+  #define PY_String_Bytes  PyBytes_FromStringAndSize
-+  #define PY_AsString_Bytes  PyBytes_AsStringAndSize
-+
-+#else
-+  #define MOD_ERROR_VAL
-+  #define MOD_SUCCESS_VAL(val)
-+  #define MOD_INIT(name) void init##name(void)
-+  #define MOD_DEF(ob, name, doc, methods)         \
-+        ob = Py_InitModule3(name, methods, doc);
-+
-+  #define PY_String_Bytes PyString_FromStringAndSize
-+  #define PY_AsString_Bytes PyString_AsStringAndSize
-+
-+#endif
-+
- PyObject * readsectorFunc = NULL;
- PyObject * writesectorFunc = NULL;
- 
-+
-+
- int ReadSector(int sector, int nsector, void *buf, int size)
- {
-     PyObject * result;
-@@ -59,9 +87,13 @@ int ReadSector(int sector, int nsector,
-         if( result )
-         {
-             Py_ssize_t len = 0;
--            PyString_AsStringAndSize( result, &result_str, &len );
-+
-+            //PyString_AsStringAndSize( result, &result_str, &len );
-+            //PyBytes_AsStringAndSize( result, &result_str, &len );
-+            PY_AsString_Bytes( result, &result_str, &len );
-             
--            if( len < nsector*FAT_HARDSECT )
-+
-+	    if( len < nsector*FAT_HARDSECT )
-             {
-                 goto abort;
-             }
-@@ -208,7 +240,9 @@ PyObject * pcardext_read( PyObject * sel
-     
-     if( FatReadFileExt( name, offset, len, buffer ) == len )
-     {
--        return PyString_FromStringAndSize( (char *)buffer, len );
-+        // return PyString_FromStringAndSize( (char *)buffer, len );
-+        return PY_String_Bytes( (char *)buffer, len );
-+        // return PyBytes_FromStringAndSize( (char *)buffer, len );
-     }
-     else
-     {
-@@ -236,14 +270,15 @@ static PyMethodDef pcardext_methods[] =
- 
- static char pcardext_documentation[] = "Python extension for HP photocard services";
- 
--void initpcardext( void )
--{
--    PyObject * mod = Py_InitModule4( "pcardext", pcardext_methods, 
--                                     pcardext_documentation, (PyObject*)NULL, 
--                                     PYTHON_API_VERSION );
--                     
--    if (mod == NULL)
--      return;
-+MOD_INIT(pcardext)  {
-+
-+  PyObject* mod ;
-+  MOD_DEF(mod, "pcardext", pcardext_documentation, pcardext_methods);
-+  if (mod == NULL)
-+    return MOD_ERROR_VAL;
-+
-+  return MOD_SUCCESS_VAL(mod);
-+
- }
- 
- 
---- a/unload.py
-+++ b/unload.py
-@@ -44,6 +44,11 @@ except ImportError:
- 
- # Local
- from base.g import *
-+from base.sixext import PY3
-+if PY3:
-+    log.error("This functionality is not spported in python3 environment.")
-+    sys.exit(1)
-+
- from base import device, utils, tui, module
- from prnt import cups
- 
diff --git a/meta-oe/recipes-extended/hplip/hplip/configure.patch b/meta-oe/recipes-extended/hplip/hplip/configure.patch
index 85df6aad60..26fc5d580e 100644
--- a/meta-oe/recipes-extended/hplip/hplip/configure.patch
+++ b/meta-oe/recipes-extended/hplip/hplip/configure.patch
@@ -1,13 +1,15 @@ 
 Upstream-Status: Pending
 
+diff --git a/configure.in b/configure.in
+index 46f575c..36d643b 100644
 --- a/configure.in
 +++ b/configure.in
-@@ -32,7 +32,7 @@ AC_INIT([HP Linux Imaging and Printing], [3.26.4], [3.26.4], [hplip])
-
-
+@@ -36,7 +36,7 @@ AC_INIT([HP Linux Imaging and Printing], [3.26.10], [3.26.10], [hplip])
+ AC_CONFIG_MACRO_DIR([m4])
+ 
  #AM_INIT_AUTOMAKE([1.9 foreign])
 -AM_INIT_AUTOMAKE
 +AM_INIT_AUTOMAKE([foreign])
  AC_DISABLE_STATIC
-
+ #AM_INIT_AUTOMAKE([subdir-objects])
  # Checks for programs.
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 f2cd2be60d..afbddcc8c8 100644
--- a/meta-oe/recipes-extended/hplip/hplip/fix-libusb-paths.patch
+++ b/meta-oe/recipes-extended/hplip/hplip/fix-libusb-paths.patch
@@ -4,10 +4,10 @@  Upstream-Status: Pending
 Signed-off-by: Ross Burton <ross.burton@arm.com>
 
 diff --git a/Makefile.am b/Makefile.am
-index b77327f..29e838a 100644
+index 39d884c..6464190 100644
 --- a/Makefile.am
 +++ b/Makefile.am
-@@ -107,12 +107,11 @@ libhpmud_la_SOURCES = io/hpmud/hpmud.c io/hpmud/mlc.c io/hpmud/model.c io/hpmud/
+@@ -125,12 +125,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 
@@ -22,7 +22,7 @@  index b77327f..29e838a 100644
  
  
  if NETWORK_BUILD
-@@ -356,7 +355,7 @@ hpmudextdir = $(pyexecdir)
+@@ -375,7 +374,7 @@ hpmudextdir = $(PYTHONEXECDIR)
  hpmudext_LTLIBRARIES = hpmudext.la
  hpmudext_la_LDFLAGS = -module -avoid-version
  hpmudext_la_SOURCES = io/mudext/hpmudext.c
@@ -31,7 +31,7 @@  index b77327f..29e838a 100644
  hpmudext_la_LIBADD = libhpmud.la
  
  if NETWORK_BUILD
-@@ -364,9 +363,6 @@ hpmudext_la_LIBADD += libhpdiscovery.la
+@@ -383,9 +382,6 @@ hpmudext_la_LIBADD += libhpdiscovery.la
  hpmudext_la_CFLAGS += -Iprotocol/discovery
  endif
  
@@ -42,18 +42,18 @@  index b77327f..29e838a 100644
  # ui (qt3)
  if GUI_BUILD
 diff --git a/configure.in b/configure.in
-index b1c690c..4a65c97 100644
+index 46f575c..383ca3a 100644
 --- a/configure.in
 +++ b/configure.in
-@@ -36,6 +36,7 @@ AC_PROG_CXX
- AC_PROG_CC
+@@ -45,6 +45,7 @@ AC_PROG_CC
  AC_PROG_INSTALL
- AC_PROG_LIBTOOL
+ # LT_INIT replaces the deprecated AC_PROG_LIBTOOL/AC_DISABLE_STATIC pair
+ LT_INIT([disable-static])
 +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
+@@ -619,11 +620,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
diff --git a/meta-oe/recipes-extended/hplip/hplip_3.26.6.bb b/meta-oe/recipes-extended/hplip/hplip_3.26.10.bb
similarity index 91%
rename from meta-oe/recipes-extended/hplip/hplip_3.26.6.bb
rename to meta-oe/recipes-extended/hplip/hplip_3.26.10.bb
index ac6f4a34a5..5abeee5d30 100644
--- a/meta-oe/recipes-extended/hplip/hplip_3.26.6.bb
+++ b/meta-oe/recipes-extended/hplip/hplip_3.26.10.bb
@@ -10,13 +10,11 @@  SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
            file://050-fix-glibcisms.patch \
            file://0001-common-utils-Include-string.h-for-strcasestr.patch \
            file://0002-Add-ImageProcessor-only-when-DISBALE_IMAGEPROCESSOR_.patch \
-           file://0003-pserror.c-Define-column-to-be-int-explcitly.patch \
            file://0004-Define-missing-prototype-for-functions.patch \
-           file://0006-Workaround-patch-for-missing-Python3-transition-of-t.patch \
            file://0001-Fix-installing-ipp-usb-quirk.patch \
            file://0001-Drop-using-register-storage-classifier.patch \
-           file://0001-Fix-upstream-CFLAGS-override.patch"
-SRC_URI[sha256sum] = "5fb2235a9cb6ec07cb4786c4066b151359c301324d54aaabf69ae7eef35606b3"
+           "
+SRC_URI[sha256sum] = "55ddf24e22d3050bbbfd95ffd797c20f83d6e962bb40157b3e07a35d9e5eec45"
 
 CVE_PRODUCT = "hplip linux_imaging_and_printing"