-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update hplip to latest upstream version and patch to fix Python 3.10 compatibility.
- Loading branch information
1 parent
e437bb3
commit 6f33e38
Showing
6 changed files
with
155 additions
and
147 deletions.
There are no files selected for viewing
113 changes: 0 additions & 113 deletions
113
srcpkgs/hplip/patches/0025-Remove-all-ImageProcessor-functionality-which-is-clo.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
37 changes: 37 additions & 0 deletions
37
srcpkgs/hplip/patches/remove-imageprocessing-install.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/ ; \ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters