[-- Attachment #1: Type: text/plain, Size: 1676 bytes --] There is a new pull request by heindsight against master on the void-packages repository https://github.com/heindsight/void-packages hplip https://github.com/void-linux/void-packages/pull/33832 hplip: Update to 3.21.8 Update hplip to latest upstream version and patch to fix Python 3.10 compatibility. <!-- Mark items with [x] where applicable --> #### General - [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements) #### Have the results of the proposed changes been tested? - [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me - [ ] I generally don't use the affected packages but briefly tested this PR <!-- If GitHub CI cannot be used to validate the build result (for example, if the build is likely to take several hours), make sure to [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration). When skipping CI, uncomment and fill out the following section. Note: for builds that are likely to complete in less than 2 hours, it is not acceptable to skip CI. --> <!-- #### Does it build and run successfully? (Please choose at least one native build and, if supported, at least one cross build. More are better.) - [ ] I built this PR locally for my native architecture, (ARCH-LIBC) - [ ] I built this PR locally for these architectures (if supported. mark crossbuilds): - [ ] aarch64-musl - [ ] armv7l - [ ] armv6l-musl --> A patch file from https://github.com/void-linux/void-packages/pull/33832.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-hplip-33832.patch --] [-- Type: text/x-diff, Size: 15812 bytes --] From 8a65088e5a93ed83416610c184ed208fb52642f3 Mon Sep 17 00:00:00 2001 From: Heinrich Kruger <heindsight@kruger.dev> Date: Wed, 20 Oct 2021 09:18:02 +0100 Subject: [PATCH] hplip: Update to 3.21.8 Update hplip to latest upstream version and patch to fix Python 3.10 compatibility. --- ...Processor-functionality-which-is-clo.patch | 113 ------------------ ...emove-ImageProcessor-binary-installs.patch | 47 ++++++++ srcpkgs/hplip/patches/gzip_text.patch | 13 ++ srcpkgs/hplip/patches/pysizet_clean.patch | 100 ++++++++++++++++ srcpkgs/hplip/patches/sane.patch | 31 ----- srcpkgs/hplip/template | 7 +- 6 files changed, 164 insertions(+), 147 deletions(-) delete mode 100644 srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch create mode 100644 srcpkgs/hplip/patches/0028-Remove-ImageProcessor-binary-installs.patch create mode 100644 srcpkgs/hplip/patches/gzip_text.patch create mode 100644 srcpkgs/hplip/patches/pysizet_clean.patch delete mode 100644 srcpkgs/hplip/patches/sane.patch diff --git a/srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch b/srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch deleted file mode 100644 index 8d3b4d7bfda2..000000000000 --- a/srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch +++ /dev/null @@ -1,113 +0,0 @@ -From fa9c0cf1a5db9bf8880b4796d5e3e0da46534e3d Mon Sep 17 00:00:00 2001 -From: Didier Raboud <odyx@debian.org> -Date: Tue, 21 Aug 2018 18:18:10 +0200 -Subject: Remove all ImageProcessor functionality, which is closed-source - ---- - Makefile.am | 14 ++------------ - prnt/hpcups/HPCupsFilter.cpp | 21 --------------------- - 2 files changed, 2 insertions(+), 33 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 1b097c4f9..8d5d78c9f 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -166,7 +166,7 @@ if !HPLIP_CLASS_DRIVER - dist_hplip_SCRIPTS = hpssd.py __init__.py hpdio.py - endif #HPLIP_CLASS_DRIVER - --dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template prnt/hpcups/libImageProcessor-x86_64.so prnt/hpcups/libImageProcessor-x86_32.so -+dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template - dist_noinst_SCRIPTS += dat2drv.py install.py hplip-install init-suse-firewall init-iptables-firewall class_rpm_build.sh hplipclassdriver.spec createPPD.sh Makefile_dat2drv hpijs-drv - - if !HPLIP_CLASS_DRIVER -@@ -594,7 +594,7 @@ hpcups_SOURCES = prnt/hpcups/HPCupsFilter.cpp prnt/hpcups/HPCupsFilter.h prnt/hp - prnt/hpcups/ImageProcessor.h - - hpcups_CXXFLAGS = $(APDK_ENDIAN_FLAG) $(DBUS_CFLAGS) --hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lImageProcessor -lcups -lcupsimage -lz $(DBUS_LIBS) -+hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lcups -lcupsimage -lz $(DBUS_LIBS) - #else - #hpcupsdir = $(cupsfilterdir) - #hpcups_PROGRAMS = hpcups -@@ -686,16 +686,6 @@ endif #HPLIP_CLASS_DRIVER - - install-data-hook: - if HPLIP_BUILD -- if [ \( "$(UNAME)" = "x86_64" -a -d "$(libdir)/" \) ]; then \ -- cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \ -- chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \ -- ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \ -- fi; \ -- if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \ -- cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \ -- chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \ -- ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \ -- fi - if !HPLIP_CLASS_DRIVER - # If scanner build, add hpaio entry to sane dll.conf. - if [ "$(scan_build)" = "yes" ]; then \ -diff --git a/prnt/hpcups/HPCupsFilter.cpp b/prnt/hpcups/HPCupsFilter.cpp -index 5b282d83f..0bacfafac 100644 ---- a/prnt/hpcups/HPCupsFilter.cpp -+++ b/prnt/hpcups/HPCupsFilter.cpp -@@ -31,7 +31,6 @@ - \*****************************************************************************/ - - #include "HPCupsFilter.h" --#include "ImageProcessor.h" - - #include <signal.h> - #include <sys/wait.h> -@@ -637,16 +636,10 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) - - - sprintf(hpPreProcessedRasterFile, "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name); -- image_processor_t* imageProcessor = imageProcessorCreate(); - - while (cupsRasterReadHeader2(cups_raster, &cups_header)) - { - -- IMAGE_PROCESSOR_ERROR result = imageProcessorStartPage(imageProcessor, &cups_header); -- if (result != IPE_SUCCESS){ -- dbglog("DEBUG: imageProcessorStartPage failed result = %d\n", result); -- } -- - current_page_number++; - - if (current_page_number == 1) { -@@ -745,12 +738,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) - color_raster = rgbRaster; - black_raster = kRaster; - -- result = imageProcessorProcessLine(imageProcessor, m_pPrinterBuffer, cups_header.cupsBytesPerLine); -- if (result != IPE_SUCCESS){ -- dbglog("DEBUG: imageProcessorProcessLine failed result = %d\n", result); -- } -- -- - if ((y == 0) && !is_ljmono) { - //For ljmono, make sure that first line is not a blankRaster line.Otherwise printer - //may not skip blank lines before actual data -@@ -780,12 +767,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) - } - } // for() loop end - -- result = imageProcessorEndPage(imageProcessor); -- if (result != IPE_SUCCESS){ -- dbglog("DEBUG: imageProcessorEndPage failed result = %d\n", result); -- } -- -- - m_Job.NewPage(); - if (err != NO_ERROR) { - break; -@@ -800,8 +781,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) - rgbRaster = NULL; - } - -- imageProcessorDestroy(imageProcessor); -- - unlink(hpPreProcessedRasterFile); - return ret_status; - } diff --git a/srcpkgs/hplip/patches/0028-Remove-ImageProcessor-binary-installs.patch b/srcpkgs/hplip/patches/0028-Remove-ImageProcessor-binary-installs.patch new file mode 100644 index 000000000000..cad59a7a6e2e --- /dev/null +++ b/srcpkgs/hplip/patches/0028-Remove-ImageProcessor-binary-installs.patch @@ -0,0 +1,47 @@ +From: Didier Raboud <odyx@debian.org> +Date: Tue, 21 Aug 2018 18:18:10 +0200 +Subject: Remove ImageProcessor binary installs + +--- + Makefile.am | 14 ++------------ + 1 file changed, 2 insertions(+), 12 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index c707e1e..0d8b692 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -167,7 +167,7 @@ if !HPLIP_CLASS_DRIVER + dist_hplip_SCRIPTS = hpssd.py __init__.py hpdio.py + endif #HPLIP_CLASS_DRIVER + +-dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template prnt/hpcups/libImageProcessor-x86_64.so prnt/hpcups/libImageProcessor-x86_32.so ++dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template + dist_noinst_SCRIPTS += dat2drv.py install.py hplip-install init-suse-firewall init-iptables-firewall class_rpm_build.sh hplipclassdriver.spec createPPD.sh Makefile_dat2drv hpijs-drv + + if !HPLIP_CLASS_DRIVER +@@ -595,7 +595,7 @@ hpcups_SOURCES = prnt/hpcups/HPCupsFilter.cpp prnt/hpcups/HPCupsFilter.h prnt/hp + prnt/hpcups/ImageProcessor.h + + hpcups_CXXFLAGS = $(APDK_ENDIAN_FLAG) $(DBUS_CFLAGS) +-hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lImageProcessor -lcups -lcupsimage -lz $(DBUS_LIBS) ++hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lcups -lcupsimage -lz $(DBUS_LIBS) + #else + #hpcupsdir = $(cupsfilterdir) + #hpcups_PROGRAMS = hpcups +@@ -687,16 +687,6 @@ endif #HPLIP_CLASS_DRIVER + + install-data-hook: + if HPLIP_BUILD +- if [ \( "$(UNAME)" = "x86_64" -a -d "$(libdir)/" \) ]; then \ +- cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \ +- chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \ +- ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \ +- fi; \ +- if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \ +- cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \ +- chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \ +- ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \ +- fi + if !HPLIP_CLASS_DRIVER + # If scanner build, add hpaio entry to sane dll.conf. + if [ "$(scan_build)" = "yes" ]; then \ diff --git a/srcpkgs/hplip/patches/gzip_text.patch b/srcpkgs/hplip/patches/gzip_text.patch new file mode 100644 index 000000000000..8309415a2a7a --- /dev/null +++ b/srcpkgs/hplip/patches/gzip_text.patch @@ -0,0 +1,13 @@ +Open gzipped PPD file in text mode, otherwise text regex search fails + +--- a/setup.py 2021-10-18 18:37:49.795887272 +0100 ++++ b/setup.py 2021-10-18 18:37:20.214898473 +0100 +@@ -552,7 +552,7 @@ + if os.path.exists(file_path) and os.path.isfile(file_path): + + if file_path.endswith('.gz'): +- nickname = gzip.GzipFile(file_path, 'r').read(4096) ++ nickname = gzip.open(file_path, 'rt').read(4096) + else: + nickname = open(file_path, 'r').read(4096) + diff --git a/srcpkgs/hplip/patches/pysizet_clean.patch b/srcpkgs/hplip/patches/pysizet_clean.patch new file mode 100644 index 000000000000..38d21f520934 --- /dev/null +++ b/srcpkgs/hplip/patches/pysizet_clean.patch @@ -0,0 +1,100 @@ +Based on patch by Zdenek Dohnal obtained from +https://bugs.launchpad.net/hplip/+bug/1933973 + +diff -pru hplip-3.21.8/io/mudext/hpmudext.c hplip-3.21.8-patched/io/mudext/hpmudext.c +--- hplip-3.21.8/io/mudext/hpmudext.c 2021-09-01 16:10:17.000000000 +0100 ++++ hplip-3.21.8-patched/io/mudext/hpmudext.c 2021-10-22 08:30:38.600922861 +0100 +@@ -24,6 +24,8 @@ Authors: Don Welch, David Suffield, Naga + + \*****************************************************************************/ + ++#define PY_SSIZE_T_CLEAN ++ + #include <Python.h> + #include <stdarg.h> + #include "hpmud.h" +@@ -187,14 +189,22 @@ static PyObject *write_channel(PyObject + HPMUD_CHANNEL cd; + int timeout = 30; + char * buf; +- int buf_size = 0; ++ Py_ssize_t buf_size = 0; ++ int buf_size_asInt = 0; + int bytes_written = 0; + + if (!PyArg_ParseTuple(args, "iis#|i", &dd, &cd, &buf, &buf_size, &timeout)) + return NULL; + ++ if (buf_size < INT_MIN) ++ buf_size_asInt = INT_MIN; ++ else if (buf_size > INT_MAX) ++ buf_size_asInt = INT_MAX; ++ else ++ buf_size_asInt = (int)buf_size; ++ + Py_BEGIN_ALLOW_THREADS +- result = hpmud_write_channel(dd, cd, buf, buf_size, timeout, &bytes_written); ++ result = hpmud_write_channel(dd, cd, buf, buf_size_asInt, timeout, &bytes_written); + Py_END_ALLOW_THREADS + + return Py_BuildValue("(ii)", result, bytes_written); +@@ -231,14 +241,22 @@ static PyObject *set_pml(PyObject *self, + char * oid; + int type; + char * data; +- int data_size; ++ Py_ssize_t data_size = 0; ++ int data_size_asInt = 0; + int pml_result; + + if (!PyArg_ParseTuple(args, "iisis#", &dd, &cd, &oid, &type, &data, &data_size)) + return NULL; + ++ if (data_size < INT_MIN) ++ data_size_asInt = INT_MIN; ++ else if (data_size > INT_MAX) ++ data_size_asInt = INT_MAX; ++ else ++ data_size_asInt = (int)data_size; ++ + Py_BEGIN_ALLOW_THREADS +- result = hpmud_set_pml(dd, cd, oid, type, (void *)data, data_size, &pml_result); ++ result = hpmud_set_pml(dd, cd, oid, type, (void *)data, data_size_asInt, &pml_result); + Py_END_ALLOW_THREADS + + return Py_BuildValue("(ii)", result, pml_result); +diff -pru hplip-3.21.8/pcard/pcardext/pcardext.c hplip-3.21.8-patched/pcard/pcardext/pcardext.c +--- hplip-3.21.8/pcard/pcardext/pcardext.c 2021-09-01 16:10:17.000000000 +0100 ++++ hplip-3.21.8-patched/pcard/pcardext/pcardext.c 2021-10-22 08:24:11.010798381 +0100 +@@ -24,6 +24,8 @@ Author: Don Welch + + \*****************************************************************************/ + ++#define PY_SSIZE_T_CLEAN ++ + #include <Python.h> + #include <structmember.h> + #include "../fat.h" +diff -pru hplip-3.21.8/prnt/cupsext/cupsext.c hplip-3.21.8-patched/prnt/cupsext/cupsext.c +--- hplip-3.21.8/prnt/cupsext/cupsext.c 2021-09-01 16:10:17.000000000 +0100 ++++ hplip-3.21.8-patched/prnt/cupsext/cupsext.c 2021-10-22 08:26:30.975843330 +0100 +@@ -73,6 +73,7 @@ Yashwant Kumar Sahu + Sanjay Kumar + */ + ++#define PY_SSIZE_T_CLEAN + + #include <Python.h> + #include <structmember.h> +diff -pru hplip-3.21.8/scan/scanext/scanext.c hplip-3.21.8-patched/scan/scanext/scanext.c +--- hplip-3.21.8/scan/scanext/scanext.c 2021-09-01 16:10:17.000000000 +0100 ++++ hplip-3.21.8-patched/scan/scanext/scanext.c 2021-10-21 21:31:23.074739743 +0100 +@@ -45,6 +45,8 @@ PERFORMANCE OF THIS SOFTWARE. + *******************************************************************/ + + ++#define PY_SSIZE_T_CLEAN ++ + /* _ScanDevice objects */ + + #include "Python.h" diff --git a/srcpkgs/hplip/patches/sane.patch b/srcpkgs/hplip/patches/sane.patch deleted file mode 100644 index d3579638ee97..000000000000 --- a/srcpkgs/hplip/patches/sane.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/scan/sane.py 2020-10-13 22:29:59.456276307 -0400 -+++ b/scan/sane.py 2020-10-13 22:32:44.663586789 -0400 -@@ -378,14 +378,14 @@ - - def isScanActive(self): - if self.scan_thread is not None: -- return self.scan_thread.isAlive() and self.scan_thread.scan_active -+ return self.scan_thread.is_alive() and self.scan_thread.scan_active - else: - return False - - - def waitForScanDone(self): - if self.scan_thread is not None and \ -- self.scan_thread.isAlive() and \ -+ self.scan_thread.is_alive() and \ - self.scan_thread.scan_active: - - try: -@@ -398,9 +398,9 @@ - #time.sleep(0.5) - if self.scan_thread is not None: - while True: -- #print self.scan_thread.isAlive() -+ #print self.scan_thread.is_alive() - #print self.scan_thread.scan_active -- if self.scan_thread.isAlive() and \ -+ if self.scan_thread.is_alive() and \ - self.scan_thread.scan_active: - return - diff --git a/srcpkgs/hplip/template b/srcpkgs/hplip/template index c6bc1a9b0df2..cc7b45385422 100644 --- a/srcpkgs/hplip/template +++ b/srcpkgs/hplip/template @@ -1,7 +1,7 @@ # Template file for 'hplip' pkgname=hplip -version=3.20.9 -revision=6 +version=3.21.8 +revision=1 build_style=gnu-configure pycompile_dirs="usr/share/hplip" # configure checks sys.version[:3] for Python versioning, so 3.10 becomes 3.1; @@ -19,6 +19,7 @@ configure_args=" --enable-hpijs-install --enable-foomatic-drv-install --enable-pp-build + --disable-imageProcessor-build --with-mimedir=/usr/share/cups/mime am_cv_python_version=${py3_ver}" conf_files="/etc/hp/hplip.conf" @@ -34,7 +35,7 @@ maintainer="Orphaned <orphan@voidlinux.org>" license="GPL-2.0-only, BSD-3-Clause, MIT" homepage="https://developers.hp.com/hp-linux-imaging-and-printing" distfiles="${SOURCEFORGE_SITE}/hplip/hplip/${version}/hplip-${version}.tar.gz" -checksum=36251189aa9cc349f6a3eacbb7ac3c4fd26fc9f087c9f75cee051010c85d2ddf +checksum=f13e5295c1f0c2894f742bad44b2f40c80dbf8df010263d809081bc4df97ce1c conflicts="hplip-gui" CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/libusb-1.0 -I${XBPS_CROSS_BASE}/${py3_inc}"
[-- Attachment #1: Type: text/plain, Size: 165 bytes --] New comment by biopsin on void-packages repository https://github.com/void-linux/void-packages/pull/33832#issuecomment-955659658 Comment: closes #33700 Thank you
[-- Attachment #1: Type: text/plain, Size: 574 bytes --] New comment by biopsin on void-packages repository https://github.com/void-linux/void-packages/pull/33832#issuecomment-960949018 Comment: Managed to test PR and unfortunate it breaks xsane (scanner) with ``` Failed to open device hpaio:/net/HP_Neverstop_Laser_MPF_120x?ip=192.168.1.201 Error during device I/O ``` but ``` ~ $ hp-probe -bcups HP Linux Imaging and Printing System (ver. 3.21.8) Printer Discovery Utility ver. 4.1 hp:/net/HP_Neverstop_Laser_MFP_120x?ip=192.168.1.201 HP_Neverstop_Laser_MFP_120x Found 1 printer(s) on the 'cups' bus. ```
[-- Attachment #1: Type: text/plain, Size: 318 bytes --] New comment by biopsin on void-packages repository https://github.com/void-linux/void-packages/pull/33832#issuecomment-961781050 Comment: Please add changelog="https://developers.hp.com/hp-linux-imaging-and-printing/release_notes" and bump to version 3.21.10 I will test further issue with xsane this weekend..
[-- Attachment #1: Type: text/plain, Size: 509 bytes --] New comment by heindsight on void-packages repository https://github.com/void-linux/void-packages/pull/33832#issuecomment-962099473 Comment: @biopsin thanks for testing. Not sure why xsane isn't working for you, it does work for me on my Deskjet 3630. One notable difference is that mine uses the LEDM backend and as far as I can tell the Neverstop MFP 120x models use ESCL, so I suppose it's possible there's been a regression for ESCL scanners. I'll add the changelog and bump to 3.21.10 as requested.
[-- Attachment #1: Type: text/plain, Size: 1681 bytes --] There is an updated pull request by heindsight against master on the void-packages repository https://github.com/heindsight/void-packages hplip https://github.com/void-linux/void-packages/pull/33832 hplip: Update to 3.21.8 Update hplip to latest upstream version and patch to fix Python 3.10 compatibility. <!-- Mark items with [x] where applicable --> #### General - [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements) #### Have the results of the proposed changes been tested? - [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me - [ ] I generally don't use the affected packages but briefly tested this PR <!-- If GitHub CI cannot be used to validate the build result (for example, if the build is likely to take several hours), make sure to [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration). When skipping CI, uncomment and fill out the following section. Note: for builds that are likely to complete in less than 2 hours, it is not acceptable to skip CI. --> <!-- #### Does it build and run successfully? (Please choose at least one native build and, if supported, at least one cross build. More are better.) - [ ] I built this PR locally for my native architecture, (ARCH-LIBC) - [ ] I built this PR locally for these architectures (if supported. mark crossbuilds): - [ ] aarch64-musl - [ ] armv7l - [ ] armv6l-musl --> A patch file from https://github.com/void-linux/void-packages/pull/33832.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-hplip-33832.patch --] [-- Type: text/x-diff, Size: 15516 bytes --] From 7496a3024194289cca0b5c9df9c1c6be86708c02 Mon Sep 17 00:00:00 2001 From: Heinrich Kruger <heindsight@kruger.dev> Date: Wed, 20 Oct 2021 09:18:02 +0100 Subject: [PATCH] hplip: Update to 3.21.10 Update hplip to latest upstream version and patch to fix Python 3.10 compatibility. --- ...Processor-functionality-which-is-clo.patch | 113 ------------------ srcpkgs/hplip/patches/gzip_text.patch | 13 ++ srcpkgs/hplip/patches/pysizet_clean.patch | 100 ++++++++++++++++ .../remove-imageprocessing-install.patch | 37 ++++++ srcpkgs/hplip/patches/sane.patch | 31 ----- srcpkgs/hplip/template | 8 +- 6 files changed, 155 insertions(+), 147 deletions(-) delete mode 100644 srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch create mode 100644 srcpkgs/hplip/patches/gzip_text.patch create mode 100644 srcpkgs/hplip/patches/pysizet_clean.patch create mode 100644 srcpkgs/hplip/patches/remove-imageprocessing-install.patch delete mode 100644 srcpkgs/hplip/patches/sane.patch diff --git a/srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch b/srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch deleted file mode 100644 index 8d3b4d7bfda2..000000000000 --- a/srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch +++ /dev/null @@ -1,113 +0,0 @@ -From fa9c0cf1a5db9bf8880b4796d5e3e0da46534e3d Mon Sep 17 00:00:00 2001 -From: Didier Raboud <odyx@debian.org> -Date: Tue, 21 Aug 2018 18:18:10 +0200 -Subject: Remove all ImageProcessor functionality, which is closed-source - ---- - Makefile.am | 14 ++------------ - prnt/hpcups/HPCupsFilter.cpp | 21 --------------------- - 2 files changed, 2 insertions(+), 33 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 1b097c4f9..8d5d78c9f 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -166,7 +166,7 @@ if !HPLIP_CLASS_DRIVER - dist_hplip_SCRIPTS = hpssd.py __init__.py hpdio.py - endif #HPLIP_CLASS_DRIVER - --dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template prnt/hpcups/libImageProcessor-x86_64.so prnt/hpcups/libImageProcessor-x86_32.so -+dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template - dist_noinst_SCRIPTS += dat2drv.py install.py hplip-install init-suse-firewall init-iptables-firewall class_rpm_build.sh hplipclassdriver.spec createPPD.sh Makefile_dat2drv hpijs-drv - - if !HPLIP_CLASS_DRIVER -@@ -594,7 +594,7 @@ hpcups_SOURCES = prnt/hpcups/HPCupsFilter.cpp prnt/hpcups/HPCupsFilter.h prnt/hp - prnt/hpcups/ImageProcessor.h - - hpcups_CXXFLAGS = $(APDK_ENDIAN_FLAG) $(DBUS_CFLAGS) --hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lImageProcessor -lcups -lcupsimage -lz $(DBUS_LIBS) -+hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lcups -lcupsimage -lz $(DBUS_LIBS) - #else - #hpcupsdir = $(cupsfilterdir) - #hpcups_PROGRAMS = hpcups -@@ -686,16 +686,6 @@ endif #HPLIP_CLASS_DRIVER - - install-data-hook: - if HPLIP_BUILD -- if [ \( "$(UNAME)" = "x86_64" -a -d "$(libdir)/" \) ]; then \ -- cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \ -- chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \ -- ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \ -- fi; \ -- if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \ -- cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \ -- chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \ -- ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \ -- fi - if !HPLIP_CLASS_DRIVER - # If scanner build, add hpaio entry to sane dll.conf. - if [ "$(scan_build)" = "yes" ]; then \ -diff --git a/prnt/hpcups/HPCupsFilter.cpp b/prnt/hpcups/HPCupsFilter.cpp -index 5b282d83f..0bacfafac 100644 ---- a/prnt/hpcups/HPCupsFilter.cpp -+++ b/prnt/hpcups/HPCupsFilter.cpp -@@ -31,7 +31,6 @@ - \*****************************************************************************/ - - #include "HPCupsFilter.h" --#include "ImageProcessor.h" - - #include <signal.h> - #include <sys/wait.h> -@@ -637,16 +636,10 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) - - - sprintf(hpPreProcessedRasterFile, "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name); -- image_processor_t* imageProcessor = imageProcessorCreate(); - - while (cupsRasterReadHeader2(cups_raster, &cups_header)) - { - -- IMAGE_PROCESSOR_ERROR result = imageProcessorStartPage(imageProcessor, &cups_header); -- if (result != IPE_SUCCESS){ -- dbglog("DEBUG: imageProcessorStartPage failed result = %d\n", result); -- } -- - current_page_number++; - - if (current_page_number == 1) { -@@ -745,12 +738,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) - color_raster = rgbRaster; - black_raster = kRaster; - -- result = imageProcessorProcessLine(imageProcessor, m_pPrinterBuffer, cups_header.cupsBytesPerLine); -- if (result != IPE_SUCCESS){ -- dbglog("DEBUG: imageProcessorProcessLine failed result = %d\n", result); -- } -- -- - if ((y == 0) && !is_ljmono) { - //For ljmono, make sure that first line is not a blankRaster line.Otherwise printer - //may not skip blank lines before actual data -@@ -780,12 +767,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) - } - } // for() loop end - -- result = imageProcessorEndPage(imageProcessor); -- if (result != IPE_SUCCESS){ -- dbglog("DEBUG: imageProcessorEndPage failed result = %d\n", result); -- } -- -- - m_Job.NewPage(); - if (err != NO_ERROR) { - break; -@@ -800,8 +781,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) - rgbRaster = NULL; - } - -- imageProcessorDestroy(imageProcessor); -- - unlink(hpPreProcessedRasterFile); - return ret_status; - } diff --git a/srcpkgs/hplip/patches/gzip_text.patch b/srcpkgs/hplip/patches/gzip_text.patch new file mode 100644 index 000000000000..8309415a2a7a --- /dev/null +++ b/srcpkgs/hplip/patches/gzip_text.patch @@ -0,0 +1,13 @@ +Open gzipped PPD file in text mode, otherwise text regex search fails + +--- a/setup.py 2021-10-18 18:37:49.795887272 +0100 ++++ b/setup.py 2021-10-18 18:37:20.214898473 +0100 +@@ -552,7 +552,7 @@ + if os.path.exists(file_path) and os.path.isfile(file_path): + + if file_path.endswith('.gz'): +- nickname = gzip.GzipFile(file_path, 'r').read(4096) ++ nickname = gzip.open(file_path, 'rt').read(4096) + else: + nickname = open(file_path, 'r').read(4096) + diff --git a/srcpkgs/hplip/patches/pysizet_clean.patch b/srcpkgs/hplip/patches/pysizet_clean.patch new file mode 100644 index 000000000000..38d21f520934 --- /dev/null +++ b/srcpkgs/hplip/patches/pysizet_clean.patch @@ -0,0 +1,100 @@ +Based on patch by Zdenek Dohnal obtained from +https://bugs.launchpad.net/hplip/+bug/1933973 + +diff -pru hplip-3.21.8/io/mudext/hpmudext.c hplip-3.21.8-patched/io/mudext/hpmudext.c +--- hplip-3.21.8/io/mudext/hpmudext.c 2021-09-01 16:10:17.000000000 +0100 ++++ hplip-3.21.8-patched/io/mudext/hpmudext.c 2021-10-22 08:30:38.600922861 +0100 +@@ -24,6 +24,8 @@ Authors: Don Welch, David Suffield, Naga + + \*****************************************************************************/ + ++#define PY_SSIZE_T_CLEAN ++ + #include <Python.h> + #include <stdarg.h> + #include "hpmud.h" +@@ -187,14 +189,22 @@ static PyObject *write_channel(PyObject + HPMUD_CHANNEL cd; + int timeout = 30; + char * buf; +- int buf_size = 0; ++ Py_ssize_t buf_size = 0; ++ int buf_size_asInt = 0; + int bytes_written = 0; + + if (!PyArg_ParseTuple(args, "iis#|i", &dd, &cd, &buf, &buf_size, &timeout)) + return NULL; + ++ if (buf_size < INT_MIN) ++ buf_size_asInt = INT_MIN; ++ else if (buf_size > INT_MAX) ++ buf_size_asInt = INT_MAX; ++ else ++ buf_size_asInt = (int)buf_size; ++ + Py_BEGIN_ALLOW_THREADS +- result = hpmud_write_channel(dd, cd, buf, buf_size, timeout, &bytes_written); ++ result = hpmud_write_channel(dd, cd, buf, buf_size_asInt, timeout, &bytes_written); + Py_END_ALLOW_THREADS + + return Py_BuildValue("(ii)", result, bytes_written); +@@ -231,14 +241,22 @@ static PyObject *set_pml(PyObject *self, + char * oid; + int type; + char * data; +- int data_size; ++ Py_ssize_t data_size = 0; ++ int data_size_asInt = 0; + int pml_result; + + if (!PyArg_ParseTuple(args, "iisis#", &dd, &cd, &oid, &type, &data, &data_size)) + return NULL; + ++ if (data_size < INT_MIN) ++ data_size_asInt = INT_MIN; ++ else if (data_size > INT_MAX) ++ data_size_asInt = INT_MAX; ++ else ++ data_size_asInt = (int)data_size; ++ + Py_BEGIN_ALLOW_THREADS +- result = hpmud_set_pml(dd, cd, oid, type, (void *)data, data_size, &pml_result); ++ result = hpmud_set_pml(dd, cd, oid, type, (void *)data, data_size_asInt, &pml_result); + Py_END_ALLOW_THREADS + + return Py_BuildValue("(ii)", result, pml_result); +diff -pru hplip-3.21.8/pcard/pcardext/pcardext.c hplip-3.21.8-patched/pcard/pcardext/pcardext.c +--- hplip-3.21.8/pcard/pcardext/pcardext.c 2021-09-01 16:10:17.000000000 +0100 ++++ hplip-3.21.8-patched/pcard/pcardext/pcardext.c 2021-10-22 08:24:11.010798381 +0100 +@@ -24,6 +24,8 @@ Author: Don Welch + + \*****************************************************************************/ + ++#define PY_SSIZE_T_CLEAN ++ + #include <Python.h> + #include <structmember.h> + #include "../fat.h" +diff -pru hplip-3.21.8/prnt/cupsext/cupsext.c hplip-3.21.8-patched/prnt/cupsext/cupsext.c +--- hplip-3.21.8/prnt/cupsext/cupsext.c 2021-09-01 16:10:17.000000000 +0100 ++++ hplip-3.21.8-patched/prnt/cupsext/cupsext.c 2021-10-22 08:26:30.975843330 +0100 +@@ -73,6 +73,7 @@ Yashwant Kumar Sahu + Sanjay Kumar + */ + ++#define PY_SSIZE_T_CLEAN + + #include <Python.h> + #include <structmember.h> +diff -pru hplip-3.21.8/scan/scanext/scanext.c hplip-3.21.8-patched/scan/scanext/scanext.c +--- hplip-3.21.8/scan/scanext/scanext.c 2021-09-01 16:10:17.000000000 +0100 ++++ hplip-3.21.8-patched/scan/scanext/scanext.c 2021-10-21 21:31:23.074739743 +0100 +@@ -45,6 +45,8 @@ PERFORMANCE OF THIS SOFTWARE. + *******************************************************************/ + + ++#define PY_SSIZE_T_CLEAN ++ + /* _ScanDevice objects */ + + #include "Python.h" diff --git a/srcpkgs/hplip/patches/remove-imageprocessing-install.patch b/srcpkgs/hplip/patches/remove-imageprocessing-install.patch new file mode 100644 index 000000000000..de0efe17fbda --- /dev/null +++ b/srcpkgs/hplip/patches/remove-imageprocessing-install.patch @@ -0,0 +1,37 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -167,7 +167,7 @@ + dist_hplip_SCRIPTS = hpssd.py __init__.py hpdio.py + endif #HPLIP_CLASS_DRIVER + +-dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template prnt/hpcups/libImageProcessor-x86_64.so prnt/hpcups/libImageProcessor-x86_32.so ++dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template + + dist_noinst_DATA += prnt/ipp-usb/HPLIP.conf + dist_noinst_SCRIPTS += dat2drv.py install.py hplip-install init-suse-firewall init-iptables-firewall class_rpm_build.sh hplipclassdriver.spec createPPD.sh Makefile_dat2drv hpijs-drv +@@ -597,7 +597,7 @@ + prnt/hpcups/ImageProcessor.h + + hpcups_CXXFLAGS = $(APDK_ENDIAN_FLAG) $(DBUS_CFLAGS) +-hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lImageProcessor -lcups -lcupsimage -lz $(DBUS_LIBS) ++hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lcups -lcupsimage -lz $(DBUS_LIBS) + #else + #hpcupsdir = $(cupsfilterdir) + #hpcups_PROGRAMS = hpcups +@@ -687,16 +687,6 @@ + + install-data-hook: + if HPLIP_BUILD +- if [ \( "$(UNAME)" = "x86_64" -a -d "$(libdir)/" \) ]; then \ +- cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \ +- chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \ +- ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \ +- fi; \ +- if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \ +- cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \ +- chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \ +- ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \ +- fi + if [ -d "/usr/share/ipp-usb/quirks/" ]; then \ + echo "ipp-usb directory exists"; \ + cp prnt/ipp-usb/HPLIP.conf /usr/share/ipp-usb/quirks/ ; \ diff --git a/srcpkgs/hplip/patches/sane.patch b/srcpkgs/hplip/patches/sane.patch deleted file mode 100644 index d3579638ee97..000000000000 --- a/srcpkgs/hplip/patches/sane.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/scan/sane.py 2020-10-13 22:29:59.456276307 -0400 -+++ b/scan/sane.py 2020-10-13 22:32:44.663586789 -0400 -@@ -378,14 +378,14 @@ - - def isScanActive(self): - if self.scan_thread is not None: -- return self.scan_thread.isAlive() and self.scan_thread.scan_active -+ return self.scan_thread.is_alive() and self.scan_thread.scan_active - else: - return False - - - def waitForScanDone(self): - if self.scan_thread is not None and \ -- self.scan_thread.isAlive() and \ -+ self.scan_thread.is_alive() and \ - self.scan_thread.scan_active: - - try: -@@ -398,9 +398,9 @@ - #time.sleep(0.5) - if self.scan_thread is not None: - while True: -- #print self.scan_thread.isAlive() -+ #print self.scan_thread.is_alive() - #print self.scan_thread.scan_active -- if self.scan_thread.isAlive() and \ -+ if self.scan_thread.is_alive() and \ - self.scan_thread.scan_active: - return - diff --git a/srcpkgs/hplip/template b/srcpkgs/hplip/template index c6bc1a9b0df2..339d08b463d8 100644 --- a/srcpkgs/hplip/template +++ b/srcpkgs/hplip/template @@ -1,7 +1,7 @@ # Template file for 'hplip' pkgname=hplip -version=3.20.9 -revision=6 +version=3.21.10 +revision=1 build_style=gnu-configure pycompile_dirs="usr/share/hplip" # configure checks sys.version[:3] for Python versioning, so 3.10 becomes 3.1; @@ -19,6 +19,7 @@ configure_args=" --enable-hpijs-install --enable-foomatic-drv-install --enable-pp-build + --disable-imageProcessor-build --with-mimedir=/usr/share/cups/mime am_cv_python_version=${py3_ver}" conf_files="/etc/hp/hplip.conf" @@ -33,8 +34,9 @@ short_desc="HP Linux Imaging and Printing" maintainer="Orphaned <orphan@voidlinux.org>" license="GPL-2.0-only, BSD-3-Clause, MIT" homepage="https://developers.hp.com/hp-linux-imaging-and-printing" +changelog="https://developers.hp.com/hp-linux-imaging-and-printing/release_notes" distfiles="${SOURCEFORGE_SITE}/hplip/hplip/${version}/hplip-${version}.tar.gz" -checksum=36251189aa9cc349f6a3eacbb7ac3c4fd26fc9f087c9f75cee051010c85d2ddf +checksum=de230e1fdd1e718fc718417265612e0c882949e08fe045ee56f9f9882e6b6a60 conflicts="hplip-gui" CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/libusb-1.0 -I${XBPS_CROSS_BASE}/${py3_inc}"
[-- Attachment #1: Type: text/plain, Size: 1682 bytes --] There is an updated pull request by heindsight against master on the void-packages repository https://github.com/heindsight/void-packages hplip https://github.com/void-linux/void-packages/pull/33832 hplip: Update to 3.21.10 Update hplip to latest upstream version and patch to fix Python 3.10 compatibility. <!-- Mark items with [x] where applicable --> #### General - [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements) #### Have the results of the proposed changes been tested? - [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me - [ ] I generally don't use the affected packages but briefly tested this PR <!-- If GitHub CI cannot be used to validate the build result (for example, if the build is likely to take several hours), make sure to [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration). When skipping CI, uncomment and fill out the following section. Note: for builds that are likely to complete in less than 2 hours, it is not acceptable to skip CI. --> <!-- #### Does it build and run successfully? (Please choose at least one native build and, if supported, at least one cross build. More are better.) - [ ] I built this PR locally for my native architecture, (ARCH-LIBC) - [ ] I built this PR locally for these architectures (if supported. mark crossbuilds): - [ ] aarch64-musl - [ ] armv7l - [ ] armv6l-musl --> A patch file from https://github.com/void-linux/void-packages/pull/33832.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-hplip-33832.patch --] [-- Type: text/x-diff, Size: 15516 bytes --] From 2f8ecb5bd3b56b18b127a55db0f13990392240a5 Mon Sep 17 00:00:00 2001 From: Heinrich Kruger <heindsight@kruger.dev> Date: Wed, 20 Oct 2021 09:18:02 +0100 Subject: [PATCH] hplip: Update to 3.21.10 Update hplip to latest upstream version and patch to fix Python 3.10 compatibility. --- ...Processor-functionality-which-is-clo.patch | 113 ------------------ srcpkgs/hplip/patches/gzip_text.patch | 13 ++ srcpkgs/hplip/patches/pysizet_clean.patch | 100 ++++++++++++++++ .../remove-imageprocessing-install.patch | 37 ++++++ srcpkgs/hplip/patches/sane.patch | 31 ----- srcpkgs/hplip/template | 8 +- 6 files changed, 155 insertions(+), 147 deletions(-) delete mode 100644 srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch create mode 100644 srcpkgs/hplip/patches/gzip_text.patch create mode 100644 srcpkgs/hplip/patches/pysizet_clean.patch create mode 100644 srcpkgs/hplip/patches/remove-imageprocessing-install.patch delete mode 100644 srcpkgs/hplip/patches/sane.patch diff --git a/srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch b/srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch deleted file mode 100644 index 8d3b4d7bfda2..000000000000 --- a/srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch +++ /dev/null @@ -1,113 +0,0 @@ -From fa9c0cf1a5db9bf8880b4796d5e3e0da46534e3d Mon Sep 17 00:00:00 2001 -From: Didier Raboud <odyx@debian.org> -Date: Tue, 21 Aug 2018 18:18:10 +0200 -Subject: Remove all ImageProcessor functionality, which is closed-source - ---- - Makefile.am | 14 ++------------ - prnt/hpcups/HPCupsFilter.cpp | 21 --------------------- - 2 files changed, 2 insertions(+), 33 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 1b097c4f9..8d5d78c9f 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -166,7 +166,7 @@ if !HPLIP_CLASS_DRIVER - dist_hplip_SCRIPTS = hpssd.py __init__.py hpdio.py - endif #HPLIP_CLASS_DRIVER - --dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template prnt/hpcups/libImageProcessor-x86_64.so prnt/hpcups/libImageProcessor-x86_32.so -+dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template - dist_noinst_SCRIPTS += dat2drv.py install.py hplip-install init-suse-firewall init-iptables-firewall class_rpm_build.sh hplipclassdriver.spec createPPD.sh Makefile_dat2drv hpijs-drv - - if !HPLIP_CLASS_DRIVER -@@ -594,7 +594,7 @@ hpcups_SOURCES = prnt/hpcups/HPCupsFilter.cpp prnt/hpcups/HPCupsFilter.h prnt/hp - prnt/hpcups/ImageProcessor.h - - hpcups_CXXFLAGS = $(APDK_ENDIAN_FLAG) $(DBUS_CFLAGS) --hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lImageProcessor -lcups -lcupsimage -lz $(DBUS_LIBS) -+hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lcups -lcupsimage -lz $(DBUS_LIBS) - #else - #hpcupsdir = $(cupsfilterdir) - #hpcups_PROGRAMS = hpcups -@@ -686,16 +686,6 @@ endif #HPLIP_CLASS_DRIVER - - install-data-hook: - if HPLIP_BUILD -- if [ \( "$(UNAME)" = "x86_64" -a -d "$(libdir)/" \) ]; then \ -- cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \ -- chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \ -- ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \ -- fi; \ -- if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \ -- cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \ -- chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \ -- ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \ -- fi - if !HPLIP_CLASS_DRIVER - # If scanner build, add hpaio entry to sane dll.conf. - if [ "$(scan_build)" = "yes" ]; then \ -diff --git a/prnt/hpcups/HPCupsFilter.cpp b/prnt/hpcups/HPCupsFilter.cpp -index 5b282d83f..0bacfafac 100644 ---- a/prnt/hpcups/HPCupsFilter.cpp -+++ b/prnt/hpcups/HPCupsFilter.cpp -@@ -31,7 +31,6 @@ - \*****************************************************************************/ - - #include "HPCupsFilter.h" --#include "ImageProcessor.h" - - #include <signal.h> - #include <sys/wait.h> -@@ -637,16 +636,10 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) - - - sprintf(hpPreProcessedRasterFile, "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name); -- image_processor_t* imageProcessor = imageProcessorCreate(); - - while (cupsRasterReadHeader2(cups_raster, &cups_header)) - { - -- IMAGE_PROCESSOR_ERROR result = imageProcessorStartPage(imageProcessor, &cups_header); -- if (result != IPE_SUCCESS){ -- dbglog("DEBUG: imageProcessorStartPage failed result = %d\n", result); -- } -- - current_page_number++; - - if (current_page_number == 1) { -@@ -745,12 +738,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) - color_raster = rgbRaster; - black_raster = kRaster; - -- result = imageProcessorProcessLine(imageProcessor, m_pPrinterBuffer, cups_header.cupsBytesPerLine); -- if (result != IPE_SUCCESS){ -- dbglog("DEBUG: imageProcessorProcessLine failed result = %d\n", result); -- } -- -- - if ((y == 0) && !is_ljmono) { - //For ljmono, make sure that first line is not a blankRaster line.Otherwise printer - //may not skip blank lines before actual data -@@ -780,12 +767,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) - } - } // for() loop end - -- result = imageProcessorEndPage(imageProcessor); -- if (result != IPE_SUCCESS){ -- dbglog("DEBUG: imageProcessorEndPage failed result = %d\n", result); -- } -- -- - m_Job.NewPage(); - if (err != NO_ERROR) { - break; -@@ -800,8 +781,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) - rgbRaster = NULL; - } - -- imageProcessorDestroy(imageProcessor); -- - unlink(hpPreProcessedRasterFile); - return ret_status; - } diff --git a/srcpkgs/hplip/patches/gzip_text.patch b/srcpkgs/hplip/patches/gzip_text.patch new file mode 100644 index 000000000000..8309415a2a7a --- /dev/null +++ b/srcpkgs/hplip/patches/gzip_text.patch @@ -0,0 +1,13 @@ +Open gzipped PPD file in text mode, otherwise text regex search fails + +--- a/setup.py 2021-10-18 18:37:49.795887272 +0100 ++++ b/setup.py 2021-10-18 18:37:20.214898473 +0100 +@@ -552,7 +552,7 @@ + if os.path.exists(file_path) and os.path.isfile(file_path): + + if file_path.endswith('.gz'): +- nickname = gzip.GzipFile(file_path, 'r').read(4096) ++ nickname = gzip.open(file_path, 'rt').read(4096) + else: + nickname = open(file_path, 'r').read(4096) + diff --git a/srcpkgs/hplip/patches/pysizet_clean.patch b/srcpkgs/hplip/patches/pysizet_clean.patch new file mode 100644 index 000000000000..38d21f520934 --- /dev/null +++ b/srcpkgs/hplip/patches/pysizet_clean.patch @@ -0,0 +1,100 @@ +Based on patch by Zdenek Dohnal obtained from +https://bugs.launchpad.net/hplip/+bug/1933973 + +diff -pru hplip-3.21.8/io/mudext/hpmudext.c hplip-3.21.8-patched/io/mudext/hpmudext.c +--- hplip-3.21.8/io/mudext/hpmudext.c 2021-09-01 16:10:17.000000000 +0100 ++++ hplip-3.21.8-patched/io/mudext/hpmudext.c 2021-10-22 08:30:38.600922861 +0100 +@@ -24,6 +24,8 @@ Authors: Don Welch, David Suffield, Naga + + \*****************************************************************************/ + ++#define PY_SSIZE_T_CLEAN ++ + #include <Python.h> + #include <stdarg.h> + #include "hpmud.h" +@@ -187,14 +189,22 @@ static PyObject *write_channel(PyObject + HPMUD_CHANNEL cd; + int timeout = 30; + char * buf; +- int buf_size = 0; ++ Py_ssize_t buf_size = 0; ++ int buf_size_asInt = 0; + int bytes_written = 0; + + if (!PyArg_ParseTuple(args, "iis#|i", &dd, &cd, &buf, &buf_size, &timeout)) + return NULL; + ++ if (buf_size < INT_MIN) ++ buf_size_asInt = INT_MIN; ++ else if (buf_size > INT_MAX) ++ buf_size_asInt = INT_MAX; ++ else ++ buf_size_asInt = (int)buf_size; ++ + Py_BEGIN_ALLOW_THREADS +- result = hpmud_write_channel(dd, cd, buf, buf_size, timeout, &bytes_written); ++ result = hpmud_write_channel(dd, cd, buf, buf_size_asInt, timeout, &bytes_written); + Py_END_ALLOW_THREADS + + return Py_BuildValue("(ii)", result, bytes_written); +@@ -231,14 +241,22 @@ static PyObject *set_pml(PyObject *self, + char * oid; + int type; + char * data; +- int data_size; ++ Py_ssize_t data_size = 0; ++ int data_size_asInt = 0; + int pml_result; + + if (!PyArg_ParseTuple(args, "iisis#", &dd, &cd, &oid, &type, &data, &data_size)) + return NULL; + ++ if (data_size < INT_MIN) ++ data_size_asInt = INT_MIN; ++ else if (data_size > INT_MAX) ++ data_size_asInt = INT_MAX; ++ else ++ data_size_asInt = (int)data_size; ++ + Py_BEGIN_ALLOW_THREADS +- result = hpmud_set_pml(dd, cd, oid, type, (void *)data, data_size, &pml_result); ++ result = hpmud_set_pml(dd, cd, oid, type, (void *)data, data_size_asInt, &pml_result); + Py_END_ALLOW_THREADS + + return Py_BuildValue("(ii)", result, pml_result); +diff -pru hplip-3.21.8/pcard/pcardext/pcardext.c hplip-3.21.8-patched/pcard/pcardext/pcardext.c +--- hplip-3.21.8/pcard/pcardext/pcardext.c 2021-09-01 16:10:17.000000000 +0100 ++++ hplip-3.21.8-patched/pcard/pcardext/pcardext.c 2021-10-22 08:24:11.010798381 +0100 +@@ -24,6 +24,8 @@ Author: Don Welch + + \*****************************************************************************/ + ++#define PY_SSIZE_T_CLEAN ++ + #include <Python.h> + #include <structmember.h> + #include "../fat.h" +diff -pru hplip-3.21.8/prnt/cupsext/cupsext.c hplip-3.21.8-patched/prnt/cupsext/cupsext.c +--- hplip-3.21.8/prnt/cupsext/cupsext.c 2021-09-01 16:10:17.000000000 +0100 ++++ hplip-3.21.8-patched/prnt/cupsext/cupsext.c 2021-10-22 08:26:30.975843330 +0100 +@@ -73,6 +73,7 @@ Yashwant Kumar Sahu + Sanjay Kumar + */ + ++#define PY_SSIZE_T_CLEAN + + #include <Python.h> + #include <structmember.h> +diff -pru hplip-3.21.8/scan/scanext/scanext.c hplip-3.21.8-patched/scan/scanext/scanext.c +--- hplip-3.21.8/scan/scanext/scanext.c 2021-09-01 16:10:17.000000000 +0100 ++++ hplip-3.21.8-patched/scan/scanext/scanext.c 2021-10-21 21:31:23.074739743 +0100 +@@ -45,6 +45,8 @@ PERFORMANCE OF THIS SOFTWARE. + *******************************************************************/ + + ++#define PY_SSIZE_T_CLEAN ++ + /* _ScanDevice objects */ + + #include "Python.h" diff --git a/srcpkgs/hplip/patches/remove-imageprocessing-install.patch b/srcpkgs/hplip/patches/remove-imageprocessing-install.patch new file mode 100644 index 000000000000..de0efe17fbda --- /dev/null +++ b/srcpkgs/hplip/patches/remove-imageprocessing-install.patch @@ -0,0 +1,37 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -167,7 +167,7 @@ + dist_hplip_SCRIPTS = hpssd.py __init__.py hpdio.py + endif #HPLIP_CLASS_DRIVER + +-dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template prnt/hpcups/libImageProcessor-x86_64.so prnt/hpcups/libImageProcessor-x86_32.so ++dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template + + dist_noinst_DATA += prnt/ipp-usb/HPLIP.conf + dist_noinst_SCRIPTS += dat2drv.py install.py hplip-install init-suse-firewall init-iptables-firewall class_rpm_build.sh hplipclassdriver.spec createPPD.sh Makefile_dat2drv hpijs-drv +@@ -597,7 +597,7 @@ + prnt/hpcups/ImageProcessor.h + + hpcups_CXXFLAGS = $(APDK_ENDIAN_FLAG) $(DBUS_CFLAGS) +-hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lImageProcessor -lcups -lcupsimage -lz $(DBUS_LIBS) ++hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lcups -lcupsimage -lz $(DBUS_LIBS) + #else + #hpcupsdir = $(cupsfilterdir) + #hpcups_PROGRAMS = hpcups +@@ -687,16 +687,6 @@ + + install-data-hook: + if HPLIP_BUILD +- if [ \( "$(UNAME)" = "x86_64" -a -d "$(libdir)/" \) ]; then \ +- cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \ +- chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \ +- ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \ +- fi; \ +- if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \ +- cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \ +- chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \ +- ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \ +- fi + if [ -d "/usr/share/ipp-usb/quirks/" ]; then \ + echo "ipp-usb directory exists"; \ + cp prnt/ipp-usb/HPLIP.conf /usr/share/ipp-usb/quirks/ ; \ diff --git a/srcpkgs/hplip/patches/sane.patch b/srcpkgs/hplip/patches/sane.patch deleted file mode 100644 index d3579638ee97..000000000000 --- a/srcpkgs/hplip/patches/sane.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/scan/sane.py 2020-10-13 22:29:59.456276307 -0400 -+++ b/scan/sane.py 2020-10-13 22:32:44.663586789 -0400 -@@ -378,14 +378,14 @@ - - def isScanActive(self): - if self.scan_thread is not None: -- return self.scan_thread.isAlive() and self.scan_thread.scan_active -+ return self.scan_thread.is_alive() and self.scan_thread.scan_active - else: - return False - - - def waitForScanDone(self): - if self.scan_thread is not None and \ -- self.scan_thread.isAlive() and \ -+ self.scan_thread.is_alive() and \ - self.scan_thread.scan_active: - - try: -@@ -398,9 +398,9 @@ - #time.sleep(0.5) - if self.scan_thread is not None: - while True: -- #print self.scan_thread.isAlive() -+ #print self.scan_thread.is_alive() - #print self.scan_thread.scan_active -- if self.scan_thread.isAlive() and \ -+ if self.scan_thread.is_alive() and \ - self.scan_thread.scan_active: - return - diff --git a/srcpkgs/hplip/template b/srcpkgs/hplip/template index c6bc1a9b0df2..339d08b463d8 100644 --- a/srcpkgs/hplip/template +++ b/srcpkgs/hplip/template @@ -1,7 +1,7 @@ # Template file for 'hplip' pkgname=hplip -version=3.20.9 -revision=6 +version=3.21.10 +revision=1 build_style=gnu-configure pycompile_dirs="usr/share/hplip" # configure checks sys.version[:3] for Python versioning, so 3.10 becomes 3.1; @@ -19,6 +19,7 @@ configure_args=" --enable-hpijs-install --enable-foomatic-drv-install --enable-pp-build + --disable-imageProcessor-build --with-mimedir=/usr/share/cups/mime am_cv_python_version=${py3_ver}" conf_files="/etc/hp/hplip.conf" @@ -33,8 +34,9 @@ short_desc="HP Linux Imaging and Printing" maintainer="Orphaned <orphan@voidlinux.org>" license="GPL-2.0-only, BSD-3-Clause, MIT" homepage="https://developers.hp.com/hp-linux-imaging-and-printing" +changelog="https://developers.hp.com/hp-linux-imaging-and-printing/release_notes" distfiles="${SOURCEFORGE_SITE}/hplip/hplip/${version}/hplip-${version}.tar.gz" -checksum=36251189aa9cc349f6a3eacbb7ac3c4fd26fc9f087c9f75cee051010c85d2ddf +checksum=de230e1fdd1e718fc718417265612e0c882949e08fe045ee56f9f9882e6b6a60 conflicts="hplip-gui" CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/libusb-1.0 -I${XBPS_CROSS_BASE}/${py3_inc}"
[-- Attachment #1: Type: text/plain, Size: 409 bytes --] New comment by biopsin on void-packages repository https://github.com/void-linux/void-packages/pull/33832#issuecomment-964145208 Comment: @heindsight nope Im at loss; cant manage to resolve this, I've compaird hp-scan debug logs between 3.20.9 and 3.21.10, further tested hp-doctor -i outputs, there is just no significant diff between versions. I will update this comment as I forgot to attach the logs..
[-- Attachment #1: Type: text/plain, Size: 478 bytes --] New comment by heindsight on void-packages repository https://github.com/void-linux/void-packages/pull/33832#issuecomment-964467812 Comment: @biopsin That's rather strange. Could you rebuild with ` -UNDEBUG -DHPMUD_DEBUG -DESCL_DEBUG` added to the `CFLAGS` set in the template? Then run: ``` scanimage -T -d hpaio:/net/HP_Neverstop_Laser_MFP_120x?ip=192.168.1.201 --verbose ``` while tailing syslog? That might give some more insight into where things are going wrong.
[-- Attachment #1: Type: text/plain, Size: 204 bytes --] New comment by biopsin on void-packages repository https://github.com/void-linux/void-packages/pull/33832#issuecomment-976356491 Comment: @heindsight sorry for the delay, I'll see how far I get today..
[-- Attachment #1: Type: text/plain, Size: 1682 bytes --] There is an updated pull request by heindsight against master on the void-packages repository https://github.com/heindsight/void-packages hplip https://github.com/void-linux/void-packages/pull/33832 hplip: Update to 3.21.10 Update hplip to latest upstream version and patch to fix Python 3.10 compatibility. <!-- Mark items with [x] where applicable --> #### General - [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements) #### Have the results of the proposed changes been tested? - [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me - [ ] I generally don't use the affected packages but briefly tested this PR <!-- If GitHub CI cannot be used to validate the build result (for example, if the build is likely to take several hours), make sure to [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration). When skipping CI, uncomment and fill out the following section. Note: for builds that are likely to complete in less than 2 hours, it is not acceptable to skip CI. --> <!-- #### Does it build and run successfully? (Please choose at least one native build and, if supported, at least one cross build. More are better.) - [ ] I built this PR locally for my native architecture, (ARCH-LIBC) - [ ] I built this PR locally for these architectures (if supported. mark crossbuilds): - [ ] aarch64-musl - [ ] armv7l - [ ] armv6l-musl --> A patch file from https://github.com/void-linux/void-packages/pull/33832.patch is attached [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: github-pr-hplip-33832.patch --] [-- Type: text/x-diff, Size: 15516 bytes --] From 7e7abf6ea24e034dfc7a27e4c5d3bd2991f2d859 Mon Sep 17 00:00:00 2001 From: Heinrich Kruger <heindsight@kruger.dev> Date: Wed, 20 Oct 2021 09:18:02 +0100 Subject: [PATCH] hplip: Update to 3.21.10 Update hplip to latest upstream version and patch to fix Python 3.10 compatibility. --- ...Processor-functionality-which-is-clo.patch | 113 ------------------ srcpkgs/hplip/patches/gzip_text.patch | 13 ++ srcpkgs/hplip/patches/pysizet_clean.patch | 100 ++++++++++++++++ .../remove-imageprocessing-install.patch | 37 ++++++ srcpkgs/hplip/patches/sane.patch | 31 ----- srcpkgs/hplip/template | 8 +- 6 files changed, 155 insertions(+), 147 deletions(-) delete mode 100644 srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch create mode 100644 srcpkgs/hplip/patches/gzip_text.patch create mode 100644 srcpkgs/hplip/patches/pysizet_clean.patch create mode 100644 srcpkgs/hplip/patches/remove-imageprocessing-install.patch delete mode 100644 srcpkgs/hplip/patches/sane.patch diff --git a/srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch b/srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch deleted file mode 100644 index 8d3b4d7bfda2..000000000000 --- a/srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch +++ /dev/null @@ -1,113 +0,0 @@ -From fa9c0cf1a5db9bf8880b4796d5e3e0da46534e3d Mon Sep 17 00:00:00 2001 -From: Didier Raboud <odyx@debian.org> -Date: Tue, 21 Aug 2018 18:18:10 +0200 -Subject: Remove all ImageProcessor functionality, which is closed-source - ---- - Makefile.am | 14 ++------------ - prnt/hpcups/HPCupsFilter.cpp | 21 --------------------- - 2 files changed, 2 insertions(+), 33 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 1b097c4f9..8d5d78c9f 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -166,7 +166,7 @@ if !HPLIP_CLASS_DRIVER - dist_hplip_SCRIPTS = hpssd.py __init__.py hpdio.py - endif #HPLIP_CLASS_DRIVER - --dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template prnt/hpcups/libImageProcessor-x86_64.so prnt/hpcups/libImageProcessor-x86_32.so -+dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template - dist_noinst_SCRIPTS += dat2drv.py install.py hplip-install init-suse-firewall init-iptables-firewall class_rpm_build.sh hplipclassdriver.spec createPPD.sh Makefile_dat2drv hpijs-drv - - if !HPLIP_CLASS_DRIVER -@@ -594,7 +594,7 @@ hpcups_SOURCES = prnt/hpcups/HPCupsFilter.cpp prnt/hpcups/HPCupsFilter.h prnt/hp - prnt/hpcups/ImageProcessor.h - - hpcups_CXXFLAGS = $(APDK_ENDIAN_FLAG) $(DBUS_CFLAGS) --hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lImageProcessor -lcups -lcupsimage -lz $(DBUS_LIBS) -+hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lcups -lcupsimage -lz $(DBUS_LIBS) - #else - #hpcupsdir = $(cupsfilterdir) - #hpcups_PROGRAMS = hpcups -@@ -686,16 +686,6 @@ endif #HPLIP_CLASS_DRIVER - - install-data-hook: - if HPLIP_BUILD -- if [ \( "$(UNAME)" = "x86_64" -a -d "$(libdir)/" \) ]; then \ -- cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \ -- chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \ -- ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \ -- fi; \ -- if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \ -- cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \ -- chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \ -- ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \ -- fi - if !HPLIP_CLASS_DRIVER - # If scanner build, add hpaio entry to sane dll.conf. - if [ "$(scan_build)" = "yes" ]; then \ -diff --git a/prnt/hpcups/HPCupsFilter.cpp b/prnt/hpcups/HPCupsFilter.cpp -index 5b282d83f..0bacfafac 100644 ---- a/prnt/hpcups/HPCupsFilter.cpp -+++ b/prnt/hpcups/HPCupsFilter.cpp -@@ -31,7 +31,6 @@ - \*****************************************************************************/ - - #include "HPCupsFilter.h" --#include "ImageProcessor.h" - - #include <signal.h> - #include <sys/wait.h> -@@ -637,16 +636,10 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) - - - sprintf(hpPreProcessedRasterFile, "%s/hp_%s_cups_SwapedPagesXXXXXX",CUPS_TMP_DIR, m_JA.user_name); -- image_processor_t* imageProcessor = imageProcessorCreate(); - - while (cupsRasterReadHeader2(cups_raster, &cups_header)) - { - -- IMAGE_PROCESSOR_ERROR result = imageProcessorStartPage(imageProcessor, &cups_header); -- if (result != IPE_SUCCESS){ -- dbglog("DEBUG: imageProcessorStartPage failed result = %d\n", result); -- } -- - current_page_number++; - - if (current_page_number == 1) { -@@ -745,12 +738,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) - color_raster = rgbRaster; - black_raster = kRaster; - -- result = imageProcessorProcessLine(imageProcessor, m_pPrinterBuffer, cups_header.cupsBytesPerLine); -- if (result != IPE_SUCCESS){ -- dbglog("DEBUG: imageProcessorProcessLine failed result = %d\n", result); -- } -- -- - if ((y == 0) && !is_ljmono) { - //For ljmono, make sure that first line is not a blankRaster line.Otherwise printer - //may not skip blank lines before actual data -@@ -780,12 +767,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) - } - } // for() loop end - -- result = imageProcessorEndPage(imageProcessor); -- if (result != IPE_SUCCESS){ -- dbglog("DEBUG: imageProcessorEndPage failed result = %d\n", result); -- } -- -- - m_Job.NewPage(); - if (err != NO_ERROR) { - break; -@@ -800,8 +781,6 @@ int HPCupsFilter::processRasterData(cups_raster_t *cups_raster) - rgbRaster = NULL; - } - -- imageProcessorDestroy(imageProcessor); -- - unlink(hpPreProcessedRasterFile); - return ret_status; - } diff --git a/srcpkgs/hplip/patches/gzip_text.patch b/srcpkgs/hplip/patches/gzip_text.patch new file mode 100644 index 000000000000..8309415a2a7a --- /dev/null +++ b/srcpkgs/hplip/patches/gzip_text.patch @@ -0,0 +1,13 @@ +Open gzipped PPD file in text mode, otherwise text regex search fails + +--- a/setup.py 2021-10-18 18:37:49.795887272 +0100 ++++ b/setup.py 2021-10-18 18:37:20.214898473 +0100 +@@ -552,7 +552,7 @@ + if os.path.exists(file_path) and os.path.isfile(file_path): + + if file_path.endswith('.gz'): +- nickname = gzip.GzipFile(file_path, 'r').read(4096) ++ nickname = gzip.open(file_path, 'rt').read(4096) + else: + nickname = open(file_path, 'r').read(4096) + diff --git a/srcpkgs/hplip/patches/pysizet_clean.patch b/srcpkgs/hplip/patches/pysizet_clean.patch new file mode 100644 index 000000000000..38d21f520934 --- /dev/null +++ b/srcpkgs/hplip/patches/pysizet_clean.patch @@ -0,0 +1,100 @@ +Based on patch by Zdenek Dohnal obtained from +https://bugs.launchpad.net/hplip/+bug/1933973 + +diff -pru hplip-3.21.8/io/mudext/hpmudext.c hplip-3.21.8-patched/io/mudext/hpmudext.c +--- hplip-3.21.8/io/mudext/hpmudext.c 2021-09-01 16:10:17.000000000 +0100 ++++ hplip-3.21.8-patched/io/mudext/hpmudext.c 2021-10-22 08:30:38.600922861 +0100 +@@ -24,6 +24,8 @@ Authors: Don Welch, David Suffield, Naga + + \*****************************************************************************/ + ++#define PY_SSIZE_T_CLEAN ++ + #include <Python.h> + #include <stdarg.h> + #include "hpmud.h" +@@ -187,14 +189,22 @@ static PyObject *write_channel(PyObject + HPMUD_CHANNEL cd; + int timeout = 30; + char * buf; +- int buf_size = 0; ++ Py_ssize_t buf_size = 0; ++ int buf_size_asInt = 0; + int bytes_written = 0; + + if (!PyArg_ParseTuple(args, "iis#|i", &dd, &cd, &buf, &buf_size, &timeout)) + return NULL; + ++ if (buf_size < INT_MIN) ++ buf_size_asInt = INT_MIN; ++ else if (buf_size > INT_MAX) ++ buf_size_asInt = INT_MAX; ++ else ++ buf_size_asInt = (int)buf_size; ++ + Py_BEGIN_ALLOW_THREADS +- result = hpmud_write_channel(dd, cd, buf, buf_size, timeout, &bytes_written); ++ result = hpmud_write_channel(dd, cd, buf, buf_size_asInt, timeout, &bytes_written); + Py_END_ALLOW_THREADS + + return Py_BuildValue("(ii)", result, bytes_written); +@@ -231,14 +241,22 @@ static PyObject *set_pml(PyObject *self, + char * oid; + int type; + char * data; +- int data_size; ++ Py_ssize_t data_size = 0; ++ int data_size_asInt = 0; + int pml_result; + + if (!PyArg_ParseTuple(args, "iisis#", &dd, &cd, &oid, &type, &data, &data_size)) + return NULL; + ++ if (data_size < INT_MIN) ++ data_size_asInt = INT_MIN; ++ else if (data_size > INT_MAX) ++ data_size_asInt = INT_MAX; ++ else ++ data_size_asInt = (int)data_size; ++ + Py_BEGIN_ALLOW_THREADS +- result = hpmud_set_pml(dd, cd, oid, type, (void *)data, data_size, &pml_result); ++ result = hpmud_set_pml(dd, cd, oid, type, (void *)data, data_size_asInt, &pml_result); + Py_END_ALLOW_THREADS + + return Py_BuildValue("(ii)", result, pml_result); +diff -pru hplip-3.21.8/pcard/pcardext/pcardext.c hplip-3.21.8-patched/pcard/pcardext/pcardext.c +--- hplip-3.21.8/pcard/pcardext/pcardext.c 2021-09-01 16:10:17.000000000 +0100 ++++ hplip-3.21.8-patched/pcard/pcardext/pcardext.c 2021-10-22 08:24:11.010798381 +0100 +@@ -24,6 +24,8 @@ Author: Don Welch + + \*****************************************************************************/ + ++#define PY_SSIZE_T_CLEAN ++ + #include <Python.h> + #include <structmember.h> + #include "../fat.h" +diff -pru hplip-3.21.8/prnt/cupsext/cupsext.c hplip-3.21.8-patched/prnt/cupsext/cupsext.c +--- hplip-3.21.8/prnt/cupsext/cupsext.c 2021-09-01 16:10:17.000000000 +0100 ++++ hplip-3.21.8-patched/prnt/cupsext/cupsext.c 2021-10-22 08:26:30.975843330 +0100 +@@ -73,6 +73,7 @@ Yashwant Kumar Sahu + Sanjay Kumar + */ + ++#define PY_SSIZE_T_CLEAN + + #include <Python.h> + #include <structmember.h> +diff -pru hplip-3.21.8/scan/scanext/scanext.c hplip-3.21.8-patched/scan/scanext/scanext.c +--- hplip-3.21.8/scan/scanext/scanext.c 2021-09-01 16:10:17.000000000 +0100 ++++ hplip-3.21.8-patched/scan/scanext/scanext.c 2021-10-21 21:31:23.074739743 +0100 +@@ -45,6 +45,8 @@ PERFORMANCE OF THIS SOFTWARE. + *******************************************************************/ + + ++#define PY_SSIZE_T_CLEAN ++ + /* _ScanDevice objects */ + + #include "Python.h" diff --git a/srcpkgs/hplip/patches/remove-imageprocessing-install.patch b/srcpkgs/hplip/patches/remove-imageprocessing-install.patch new file mode 100644 index 000000000000..de0efe17fbda --- /dev/null +++ b/srcpkgs/hplip/patches/remove-imageprocessing-install.patch @@ -0,0 +1,37 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -167,7 +167,7 @@ + dist_hplip_SCRIPTS = hpssd.py __init__.py hpdio.py + endif #HPLIP_CLASS_DRIVER + +-dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template prnt/hpcups/libImageProcessor-x86_64.so prnt/hpcups/libImageProcessor-x86_32.so ++dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template + + dist_noinst_DATA += prnt/ipp-usb/HPLIP.conf + dist_noinst_SCRIPTS += dat2drv.py install.py hplip-install init-suse-firewall init-iptables-firewall class_rpm_build.sh hplipclassdriver.spec createPPD.sh Makefile_dat2drv hpijs-drv +@@ -597,7 +597,7 @@ + prnt/hpcups/ImageProcessor.h + + hpcups_CXXFLAGS = $(APDK_ENDIAN_FLAG) $(DBUS_CFLAGS) +-hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lImageProcessor -lcups -lcupsimage -lz $(DBUS_LIBS) ++hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lcups -lcupsimage -lz $(DBUS_LIBS) + #else + #hpcupsdir = $(cupsfilterdir) + #hpcups_PROGRAMS = hpcups +@@ -687,16 +687,6 @@ + + install-data-hook: + if HPLIP_BUILD +- if [ \( "$(UNAME)" = "x86_64" -a -d "$(libdir)/" \) ]; then \ +- cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \ +- chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \ +- ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \ +- fi; \ +- if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \ +- cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \ +- chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \ +- ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \ +- fi + if [ -d "/usr/share/ipp-usb/quirks/" ]; then \ + echo "ipp-usb directory exists"; \ + cp prnt/ipp-usb/HPLIP.conf /usr/share/ipp-usb/quirks/ ; \ diff --git a/srcpkgs/hplip/patches/sane.patch b/srcpkgs/hplip/patches/sane.patch deleted file mode 100644 index d3579638ee97..000000000000 --- a/srcpkgs/hplip/patches/sane.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/scan/sane.py 2020-10-13 22:29:59.456276307 -0400 -+++ b/scan/sane.py 2020-10-13 22:32:44.663586789 -0400 -@@ -378,14 +378,14 @@ - - def isScanActive(self): - if self.scan_thread is not None: -- return self.scan_thread.isAlive() and self.scan_thread.scan_active -+ return self.scan_thread.is_alive() and self.scan_thread.scan_active - else: - return False - - - def waitForScanDone(self): - if self.scan_thread is not None and \ -- self.scan_thread.isAlive() and \ -+ self.scan_thread.is_alive() and \ - self.scan_thread.scan_active: - - try: -@@ -398,9 +398,9 @@ - #time.sleep(0.5) - if self.scan_thread is not None: - while True: -- #print self.scan_thread.isAlive() -+ #print self.scan_thread.is_alive() - #print self.scan_thread.scan_active -- if self.scan_thread.isAlive() and \ -+ if self.scan_thread.is_alive() and \ - self.scan_thread.scan_active: - return - diff --git a/srcpkgs/hplip/template b/srcpkgs/hplip/template index c6bc1a9b0df2..339d08b463d8 100644 --- a/srcpkgs/hplip/template +++ b/srcpkgs/hplip/template @@ -1,7 +1,7 @@ # Template file for 'hplip' pkgname=hplip -version=3.20.9 -revision=6 +version=3.21.10 +revision=1 build_style=gnu-configure pycompile_dirs="usr/share/hplip" # configure checks sys.version[:3] for Python versioning, so 3.10 becomes 3.1; @@ -19,6 +19,7 @@ configure_args=" --enable-hpijs-install --enable-foomatic-drv-install --enable-pp-build + --disable-imageProcessor-build --with-mimedir=/usr/share/cups/mime am_cv_python_version=${py3_ver}" conf_files="/etc/hp/hplip.conf" @@ -33,8 +34,9 @@ short_desc="HP Linux Imaging and Printing" maintainer="Orphaned <orphan@voidlinux.org>" license="GPL-2.0-only, BSD-3-Clause, MIT" homepage="https://developers.hp.com/hp-linux-imaging-and-printing" +changelog="https://developers.hp.com/hp-linux-imaging-and-printing/release_notes" distfiles="${SOURCEFORGE_SITE}/hplip/hplip/${version}/hplip-${version}.tar.gz" -checksum=36251189aa9cc349f6a3eacbb7ac3c4fd26fc9f087c9f75cee051010c85d2ddf +checksum=de230e1fdd1e718fc718417265612e0c882949e08fe045ee56f9f9882e6b6a60 conflicts="hplip-gui" CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/libusb-1.0 -I${XBPS_CROSS_BASE}/${py3_inc}"
[-- Attachment #1: Type: text/plain, Size: 204 bytes --] New comment by ahesford on void-packages repository https://github.com/void-linux/void-packages/pull/33832#issuecomment-987259580 Comment: @biopsin, have you had a chance to dig into the scanner issue?
[-- Attachment #1: Type: text/plain, Size: 293 bytes --] New comment by biopsin on void-packages repository https://github.com/void-linux/void-packages/pull/33832#issuecomment-988241456 Comment: @ahesford go ahead and merge this, I will fiddle with it in the upcomming hollydays. I'll rather open a issue if something is amiss with the template.
[-- Attachment #1: Type: text/plain, Size: 1522 bytes --] There's a merged pull request on the void-packages repository hplip: Update to 3.21.10 https://github.com/void-linux/void-packages/pull/33832 Description: Update hplip to latest upstream version and patch to fix Python 3.10 compatibility. <!-- Mark items with [x] where applicable --> #### General - [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements) #### Have the results of the proposed changes been tested? - [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me - [ ] I generally don't use the affected packages but briefly tested this PR <!-- If GitHub CI cannot be used to validate the build result (for example, if the build is likely to take several hours), make sure to [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration). When skipping CI, uncomment and fill out the following section. Note: for builds that are likely to complete in less than 2 hours, it is not acceptable to skip CI. --> <!-- #### Does it build and run successfully? (Please choose at least one native build and, if supported, at least one cross build. More are better.) - [ ] I built this PR locally for my native architecture, (ARCH-LIBC) - [ ] I built this PR locally for these architectures (if supported. mark crossbuilds): - [ ] aarch64-musl - [ ] armv7l - [ ] armv6l-musl -->
[-- Attachment #1: Type: text/plain, Size: 529 bytes --] New comment by biopsin on void-packages repository https://github.com/void-linux/void-packages/pull/33832#issuecomment-1002987653 Comment: [Solved and Note] After a hplip update, to make the scanner pickup the changes,run `"$ hp-plugin"` again and reinstall the scanner plugin. While the prosess it will complain and > warning: void distro is not found in AUTH_TYPES > error: Unable to recieve key from keyserver but the plugin will eventually install successfull and xsane works again. Anyway happy new year !!