From de6795e509835abfc2bff38a65452d2174670068 Mon Sep 17 00:00:00 2001 From: biopsin Date: Wed, 25 May 2022 09:36:15 +0200 Subject: [PATCH 1/2] hplip: update to 3.22.4. Continue from #35611 --- srcpkgs/hplip/patches/pysizet_clean.patch | 100 ---------------------- srcpkgs/hplip/template | 6 +- 2 files changed, 3 insertions(+), 103 deletions(-) delete mode 100644 srcpkgs/hplip/patches/pysizet_clean.patch diff --git a/srcpkgs/hplip/patches/pysizet_clean.patch b/srcpkgs/hplip/patches/pysizet_clean.patch deleted file mode 100644 index 38d21f520934..000000000000 --- a/srcpkgs/hplip/patches/pysizet_clean.patch +++ /dev/null @@ -1,100 +0,0 @@ -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 - #include - #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 - #include - #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 - #include -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/template b/srcpkgs/hplip/template index 339d08b463d8..e33c6847197a 100644 --- a/srcpkgs/hplip/template +++ b/srcpkgs/hplip/template @@ -1,6 +1,6 @@ # Template file for 'hplip' pkgname=hplip -version=3.21.10 +version=3.22.4 revision=1 build_style=gnu-configure pycompile_dirs="usr/share/hplip" @@ -27,7 +27,7 @@ make_dirs="/var/lib/hp 0755 root root" hostmakedepends="pkg-config automake libtool python3" makedepends="openssl-devel python3-devel libxml2-python3 cups-devel sane-devel ghostscript-devel net-snmp-devel libusb-devel libjpeg-turbo-devel dbus-devel - avahi-libs-devel" + avahi-libs-devel zlib-devel" depends="python3-gobject python3-dbus desktop-file-utils foomatic-db foomatic-db-engine python3-distro" short_desc="HP Linux Imaging and Printing" @@ -36,7 +36,7 @@ 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=de230e1fdd1e718fc718417265612e0c882949e08fe045ee56f9f9882e6b6a60 +checksum=7be9e547c5ac40917160ef34f59f82275d1daea577067f7eeeb2ae07c7bec110 conflicts="hplip-gui" CFLAGS="-I${XBPS_CROSS_BASE}/usr/include/libusb-1.0 -I${XBPS_CROSS_BASE}/${py3_inc}" From ecf26cb965b7d7cf0384d3ae1e70539416cf97c8 Mon Sep 17 00:00:00 2001 From: biopsin Date: Wed, 25 May 2022 09:38:21 +0200 Subject: [PATCH 2/2] New Package: hplip-plugin-3.22.4. Closes #34845 --- srcpkgs/hplip-plugin/template | 64 +++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 srcpkgs/hplip-plugin/template diff --git a/srcpkgs/hplip-plugin/template b/srcpkgs/hplip-plugin/template new file mode 100644 index 000000000000..70f04ef9ae4c --- /dev/null +++ b/srcpkgs/hplip-plugin/template @@ -0,0 +1,64 @@ +# Template file for 'hplip-plugin' +# Must be in sync with main hplip package +pkgname=hplip-plugin +version=3.22.4 +revision=1 +archs="i686 x86_64 armv6h armv7h aarch64" +hostmakedepends="tar" +short_desc="Binary plugin for HPs hplip printer driver library" +maintainer="biopsin " +license="custom:proprietary" +homepage="https://developers.hp.com/hp-linux-imaging-and-printing/binary_plugin.html" +changelog="https://developers.hp.com/hp-linux-imaging-and-printing/release_notes" +distfiles="https://developers.hp.com/sites/default/files/hplip-${version}-plugin.run" +checksum=c888f93256f48230685053d9baf3e34fb6f2969a79a7c9289356e5fee9bfb81c +repository=nonfree +ignore_elf_dirs="/usr/share/hplip" + +do_extract() { + /bin/sh ${XBPS_SRCDISTDIR}/${pkgname}-${version}/hplip-${version}-plugin.run \ + --noexec --target ${wrksrc} +} + +do_install() { + vmkdir usr/share/hplip/data/firmware + vmkdir usr/share/hplip/fax/plugins + vmkdir usr/share/hplip/prnt/plugins + vmkdir usr/share/hplip/scan/plugins + vmkdir usr/share/licenses/hplip-plugin + vmkdir var/lib/hp + + if [ $XBPS_TARGET_MACHINE = "i686" ]; then + _arch='x86_32' + elif [ $XBPS_TARGET_MACHINE = "x86_64" ]; then + _arch='x86_64' + elif [ $XBPS_TARGET_MACHINE = "armv6h" ]; then + _arch='arm32' + elif [ $XBPS_TARGET_MACHINE = "armv7h" ]; then + _arch='arm32' + elif [ $XBPS_TARGET_MACHINE = "aarch64" ]; then + _arch='arm64' + fi + + vcopy plugin.spec usr/share/hplip/ + vcopy hp_laserjet_*.fw.gz usr/share/hplip/data/firmware/ + vcopy fax_marvell-"$_arch".so usr/share/hplip/fax/plugins/ + vcopy hbpl1-"$_arch".so usr/share/hplip/prnt/plugins/ + vcopy lj-"$_arch".so usr/share/hplip/prnt/plugins/ + vcopy bb_*-"$_arch".so usr/share/hplip/scan/plugins/ + vlicense license.txt + + cat << EOF > hplip.state +[plugin] +installed = 1 +eula = 1 +version = ${version} +EOF + vcopy hplip.state var/lib/hp + + find "${DESTDIR}/usr/share/hplip" -type f -name "*.so" | while read f; do + lib_dir="${f%/*}" + lib_name="${f##*/}" + ln -sf "$lib_name" "$lib_dir/${lib_name%%-*}.so" + done +}