readd patch to disable libImageProcessor [release 3.21.4-2mamba;Mon Jun 21 2021]

This commit is contained in:
Silvan Calarco 2024-01-05 23:42:58 +01:00
parent 07e71062ff
commit 6743799c1d
3 changed files with 57 additions and 162 deletions

View File

@ -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;
}

View File

@ -0,0 +1,38 @@
diff -Nru hplip-3.21.4.orig/Makefile.am hplip-3.21.4/Makefile.am
--- hplip-3.21.4.orig/Makefile.am 2021-05-06 10:39:14.000000000 +0200
+++ hplip-3.21.4/Makefile.am 2021-06-21 21:33:11.109559334 +0200
@@ -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_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 @@
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
@@ -685,16 +685,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 !HPLIP_CLASS_DRIVER
# If scanner build, add hpaio entry to sane dll.conf.
if [ "$(scan_build)" = "yes" ]; then \

View File

@ -2,14 +2,14 @@
%define lp_gid 9 %define lp_gid 9
%define cups_ver %(cups-config --api-version) %define cups_ver %(cups-config --api-version)
Name: hplip Name: hplip
Version: 3.20.11 Version: 3.21.4
Release: 2mamba Release: 2mamba
Summary: A printer driver for HP inkjet devices Summary: A printer driver for HP inkjet devices
Group: System/Spooling Group: System/Spooling
Vendor: openmamba Vendor: openmamba
Distribution: openmamba Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://hplipopensource.com/hplip-web/index.html URL: https://developers.hp.com/hp-linux-imaging-and-printing/hplip-web/index.html
Source: http://downloads.sourceforge.net/sourceforge/hplip/hplip-%{version}.tar.gz Source: http://downloads.sourceforge.net/sourceforge/hplip/hplip-%{version}.tar.gz
Source1: http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-%{version}-plugin.run Source1: http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-%{version}-plugin.run
Patch0: %{name}-3.11.7-cups-1.5.patch Patch0: %{name}-3.11.7-cups-1.5.patch
@ -17,23 +17,18 @@ Patch1: %{name}-3.12.9-cups-1.6.patch
Patch2: hplip-3.18.12-openmamba-AUTH_TYPES-warning.patch Patch2: hplip-3.18.12-openmamba-AUTH_TYPES-warning.patch
Patch3: hplip-3.16.5-systray-hide-when-inactive.patch Patch3: hplip-3.16.5-systray-hide-when-inactive.patch
Patch4: hplip-3.19.3-Makefile-missing-DESTDIR.patch Patch4: hplip-3.19.3-Makefile-missing-DESTDIR.patch
Patch5: hplip-3.19.6-remove-libImageProcessor.patch Patch5: hplip-3.21.4-remove-libImageProcessor.patch
Patch6: hplip-3.20.11-ui5-systray-hide-when-inactive.patch Patch6: hplip-3.20.11-ui5-systray-hide-when-inactive.patch
License: BSD, LGPL License: BSD, LGPL
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
BuildRequires: ldconfig
BuildRequires: libavahi-devel BuildRequires: libavahi-devel
BuildRequires: libcups-devel BuildRequires: libcups-devel
BuildRequires: libdbus-devel BuildRequires: libdbus-devel
BuildRequires: libgcc BuildRequires: libgcc
BuildRequires: libjpeg-devel BuildRequires: libjpeg-devel
BuildRequires: liblzma-devel
BuildRequires: libnetsnmp-devel BuildRequires: libnetsnmp-devel
BuildRequires: libnsl-devel
BuildRequires: libopenssl-devel BuildRequires: libopenssl-devel
BuildRequires: libperl
BuildRequires: libpython-devel
BuildRequires: libsane-backends-devel BuildRequires: libsane-backends-devel
BuildRequires: libssp-devel BuildRequires: libssp-devel
BuildRequires: libstdc++6-devel BuildRequires: libstdc++6-devel
@ -41,9 +36,7 @@ BuildRequires: libsystemd-devel
BuildRequires: libudev-devel BuildRequires: libudev-devel
BuildRequires: libusb-compat-devel BuildRequires: libusb-compat-devel
BuildRequires: libusb-devel BuildRequires: libusb-devel
BuildRequires: libxml2-devel
BuildRequires: libz-devel BuildRequires: libz-devel
BuildRequires: perl-devel
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
BuildRequires: libnetsnmp-devel >= 5.9-1mamba BuildRequires: libnetsnmp-devel >= 5.9-1mamba
BuildRequires: gcc-fortran >= 4.0.1 BuildRequires: gcc-fortran >= 4.0.1
@ -53,16 +46,8 @@ Requires: cups
Requires: PyQt5-py3 Requires: PyQt5-py3
Requires: python-Pillow-py3 Requires: python-Pillow-py3
Provides: hpijs = %{version} Provides: hpijs = %{version}
Obsoletes: hpijs Obsoletes: hpijs < 3.21.4
Requires(pre): libsane-backends >= 1.0.16 Requires(pre): libsane-backends >= 1.0.16
#%ifarch x86_64
#Provides: libImageProcessor.so()(64bit)
#Provides: libImageProcessor.so(VERS_1.0)(64bit)
#%else
#Provides: libImageProcessor.so
#Provides: libImageProcessor.so(VERS_1.0)
#%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description %description
A printer driver for HP inkjet devices. A printer driver for HP inkjet devices.
@ -100,6 +85,10 @@ This package contains the proprietary plugins needed by some printers.
#sed -i "s|SYSFS{|ATTRS{|g" data/rules/55-hpmud.rules data/rules/56-hpmud_support.rules #sed -i "s|SYSFS{|ATTRS{|g" data/rules/55-hpmud.rules data/rules/56-hpmud_support.rules
#sed -i "s|sysfs{|ATTR{|g" data/rules/55-hpmud.rules data/rules/56-hpmud_support.rules #sed -i "s|sysfs{|ATTR{|g" data/rules/55-hpmud.rules data/rules/56-hpmud_support.rules
# Complete remove of libImageProcessor
#rm -f prnt/hpcups/HPCupsFilter.cpp
rm prnt/hpcups/libImageProcessor-x86*
sed -i "s|chgrp \"lp\"|/bin/true \"lp\"|" Makefile.in sed -i "s|chgrp \"lp\"|/bin/true \"lp\"|" Makefile.in
sed -i "s|chmod 774|/bin/true 774|" Makefile.in sed -i "s|chmod 774|/bin/true 774|" Makefile.in
@ -124,33 +113,21 @@ autoreconf -f -i
--disable-qt4 \ --disable-qt4 \
--enable-hpcups-install \ --enable-hpcups-install \
--enable-cups-drv-install \ --enable-cups-drv-install \
--disable-imageProcessor-build \
--enable-pp-build \ --enable-pp-build \
--with-hpppddir=%{_datadir}/cups/model/HP \ --with-hpppddir=%{_datadir}/cups/model/HP \
PYTHON=%{__python3} PYTHON=%{__python3}
# --enable-cups-ppd-install \ sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
# \
# --disable-foomatic_install
# --enable-foomatic-rip-hplip-install \
# --enable-foomatic-drv-install \
# --enable-foomatic-ppd-install \
# --enable-hpijs-install \
%make -j1 rulessystemdir=%{_unitdir} \ %make
SNMPLIB="netsnmp -DNETSNMP_ATTRIBUTE_DEPRECATED=" #-j1 rulessystemdir=%{_unitdir} \
# SNMPLIB="netsnmp -DNETSNMP_ATTRIBUTE_DEPRECATED="
%install %install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall rulessystemdir=%{_unitdir} libdir=%{_libdir} %makeinstall rulessystemdir=%{_unitdir} libdir=%{_libdir}
#%ifarch x86_64
#cp prnt/hpcups/libImageProcessor-x86_64.so %{buildroot}%{_libdir}
#ln -sf %{_libdir}/libImageProcessor-x86_64.so %{buildroot}%{_libdir}/libImageProcessor.so
#%else
#cp prnt/hpcups/libImageProcessor-x86_32.so %{buildroot}%{_libdir}
#ln -sf %{_libdir}/libImageProcessor-x86_32.so %{buildroot}%{_libdir}/libImageProcessor.so
#%endif
# remove conflict with libsane-backends # remove conflict with libsane-backends
rm -f %{buildroot}%{_sysconfdir}/sane.d/dll.conf rm -f %{buildroot}%{_sysconfdir}/sane.d/dll.conf
@ -213,30 +190,17 @@ if [ $1 -ge 1 ]; then
fi fi
exit 0 exit 0
%post
if [ $1 -ge 1 ]; then
systemctl -q daemon-reload
fi
:
%preun %preun
# erase # erase
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
/sbin/chkconfig --del hplip
/usr/sbin/groupdel lp &>/dev/null /usr/sbin/groupdel lp &>/dev/null
/usr/sbin/userdel lp &>/dev/null /usr/sbin/userdel lp &>/dev/null
# service hplip stop
# service cups restart
fi fi
/sbin/ldconfig /sbin/ldconfig
: :
%postun %postun
# update # update
#if [ $1 -eq 1 ]; then
# service hplip restart
# service cups restart
#fi
if [ -e %{_sysconfdir}/sane.d/dll.conf ]; then if [ -e %{_sysconfdir}/sane.d/dll.conf ]; then
grep hpaio %{_sysconfdir}/sane.d/dll.conf >/dev/null || grep hpaio %{_sysconfdir}/sane.d/dll.conf >/dev/null ||
echo "hpaio" >> %{_sysconfdir}/sane.d/dll.conf echo "hpaio" >> %{_sysconfdir}/sane.d/dll.conf
@ -316,6 +280,12 @@ fi
%{_localstatedir}/lib/hp/hplip.state %{_localstatedir}/lib/hp/hplip.state
%changelog %changelog
* Mon Jun 21 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 3.21.4-2mamba
- readd patch to disable libImageProcessor
* Sat May 22 2021 Automatic Build System <autodist@mambasoft.it> 3.21.4-1mamba
- automatic version update by autodist
* Tue Dec 08 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 3.20.11-2mamba * Tue Dec 08 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 3.20.11-2mamba
- rebuilt by autoport with build requirements: libnetsnmp-devel>=5.9-1mamba - rebuilt by autoport with build requirements: libnetsnmp-devel>=5.9-1mamba