Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] hplip: Update to 3.21.8
@ 2021-10-30 18:07 heindsight
  2021-10-31  8:40 ` biopsin
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: heindsight @ 2021-10-30 18:07 UTC (permalink / raw)
  To: ml

[-- 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}"

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-12-30 11:25 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-30 18:07 [PR PATCH] hplip: Update to 3.21.8 heindsight
2021-10-31  8:40 ` biopsin
2021-11-04 13:38 ` biopsin
2021-11-05 10:26 ` biopsin
2021-11-05 17:55 ` heindsight
2021-11-05 18:43 ` [PR PATCH] [Updated] " heindsight
2021-11-05 20:16 ` [PR PATCH] [Updated] hplip: Update to 3.21.10 heindsight
2021-11-09 13:20 ` biopsin
2021-11-09 19:30 ` heindsight
2021-11-23 10:01 ` biopsin
2021-11-28 11:46 ` [PR PATCH] [Updated] " heindsight
2021-12-06 21:42 ` ahesford
2021-12-07 20:27 ` biopsin
2021-12-08  1:05 ` [PR PATCH] [Merged]: " ahesford
2021-12-30 11:25 ` biopsin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).