hplip: Upgrade to 3.19.12

Use python3 instead of py2
Apply patches from openwrt to fix crosscompile and musl builds

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj
2020-01-21 21:47:03 -08:00
parent e47f8dfd83
commit 2767682e98
14 changed files with 264 additions and 573 deletions
@@ -1,42 +0,0 @@
From 7ef9c040dd959105c16d4dc67e14f3bbea25e77f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 16 Dec 2016 19:51:19 +0000
Subject: [PATCH] include cups/ppd.h for missing ppd definitions
Fixes errors spotted by clang
| prnt/hpcups/HPCupsFilter.cpp:365:18: error: use of undeclared identifier 'ppdFindAttr'
| if (((attr = ppdFindAttr(m_ppd, "hpPrinterLanguage", NULL)) == NULL) ||
| ^
| prnt/hpcups/HPCupsFilter.cpp:368:13: error: use of undeclared identifier 'ppdClose'
| ppdClose(m_ppd);
| ^
| prnt/hpcups/HPCupsFilter.cpp:444:9: error: use of undeclared identifier 'ppdClose'
| ppdClose(m_ppd);
| ^
| prnt/hpcups/HPCupsFilter.cpp:497:13: error: use of undeclared identifier 'ppdOpenFile'
| m_ppd = ppdOpenFile(getenv("PPD"));
| ^
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
prnt/hpcups/HPCupsFilter.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/prnt/hpcups/HPCupsFilter.h b/prnt/hpcups/HPCupsFilter.h
index 0431a7a..eb0cad6 100644
--- a/prnt/hpcups/HPCupsFilter.h
+++ b/prnt/hpcups/HPCupsFilter.h
@@ -37,6 +37,7 @@
#include "Job.h"
#include "dbuscomm.h"
+#include <cups/ppd.h>
#define DBITMAPFILEHEADER 14
#define DBITMAPINFOHEADER 40
--
1.9.1
@@ -1,14 +0,0 @@
Index: hplip-3.12.6/configure.in
===================================================================
--- hplip-3.12.6.orig/configure.in 2014-07-16 20:03:51.310044196 +0000
+++ hplip-3.12.6/configure.in 2014-07-18 07:53:31.589559192 +0000
@@ -27,8 +27,7 @@
#AC_PREREQ(2.59)
AC_INIT([HP Linux Imaging and Printing], [3.12.6], [3.12.6], [hplip])
-#AM_INIT_AUTOMAKE([1.9 foreign])
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([1.9 foreign])
AC_DISABLE_STATIC
# Checks for programs.
@@ -1,395 +0,0 @@
Imported from gentoo:
https://bugs.gentoo.org/show_bug.cgi?id=428672
diff -Naur hplip-3.12.6_old/prnt/cupsext/cupsext.c hplip-3.12.6/prnt/cupsext/cupsext.c
--- hplip-3.12.6_old/prnt/cupsext/cupsext.c 2012-08-04 09:18:18.388330038 +0200
+++ hplip-3.12.6/prnt/cupsext/cupsext.c 2012-08-04 09:18:27.855181327 +0200
@@ -87,6 +87,46 @@
#define PY_SSIZE_T_MIN INT_MIN
#endif
+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
+#define HAVE_CUPS_1_6 1
+#endif
+
+#ifndef HAVE_CUPS_1_6
+#define ippGetCount(attr) attr->num_values
+#define ippGetGroupTag(attr) attr->group_tag
+#define ippGetValueTag(attr) attr->value_tag
+#define ippGetName(attr) attr->name
+#define ippGetBoolean(attr, element) attr->values[element].boolean
+#define ippGetInteger(attr, element) attr->values[element].integer
+#define ippGetStatusCode(ipp) ipp->request.status.status_code
+#define ippGetString(attr, element, language) attr->values[element].string.text
+
+static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp )
+{
+ if (!ipp)
+ return (NULL);
+ return (ipp->current = ipp->attrs);
+}
+
+static ipp_attribute_t * ippNextAttribute( ipp_t *ipp )
+{
+ if (!ipp || !ipp->current)
+ return (NULL);
+ return (ipp->current = ipp->current->next);
+}
+
+static int ippSetOperation( ipp_t *ipp, ipp_op_t op )
+{
+ ipp->request.op.operation_id = op;
+ return (1);
+}
+
+static int ippSetRequestId( ipp_t *ipp, int request_id )
+{
+ ipp->request.any.request_id = request_id;
+ return (1);
+}
+#endif
int g_num_options = 0;
cups_option_t * g_options;
@@ -333,8 +373,8 @@
request = ippNew();
language = cupsLangDefault();
- request->request.op.operation_id = CUPS_GET_PRINTERS;
- request->request.any.request_id = 1;
+ ippSetOperation( request, CUPS_GET_PRINTERS );
+ ippSetRequestId ( request, 1);
ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
"attributes-charset", NULL, cupsLangEncoding( language ) );
@@ -378,10 +418,10 @@
ipp_pstate_t state;
int i = 0;
- for ( attr = response->attrs; attr != NULL; attr = attr->next )
+ for ( attr = ippFirstAttribute( response ); attr != NULL; attr = ippNextAttribute( response ) )
{
- while ( attr != NULL && attr->group_tag != IPP_TAG_PRINTER )
- attr = attr->next;
+ while ( attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER )
+ attr = ippNextAttribute( response );
if ( attr == NULL )
break;
@@ -390,41 +430,41 @@
state = IPP_PRINTER_IDLE;
accepting = 0;
- while ( attr != NULL && attr->group_tag == IPP_TAG_PRINTER )
+ while ( attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER )
{
- if ( strcmp( attr->name, "printer-name" ) == 0 &&
- attr->value_tag == IPP_TAG_NAME )
- name = attr->values[ 0 ].string.text;
-
- else if ( strcmp( attr->name, "device-uri" ) == 0 &&
- attr->value_tag == IPP_TAG_URI )
- device_uri = attr->values[ 0 ].string.text;
-
- else if ( strcmp( attr->name, "printer-uri-supported" ) == 0 &&
- attr->value_tag == IPP_TAG_URI )
- printer_uri = attr->values[ 0 ].string.text;
-
- else if ( strcmp( attr->name, "printer-info" ) == 0 &&
- attr->value_tag == IPP_TAG_TEXT )
- info = attr->values[ 0 ].string.text;
-
- else if ( strcmp( attr->name, "printer-location" ) == 0 &&
- attr->value_tag == IPP_TAG_TEXT )
- location = attr->values[ 0 ].string.text;
-
- else if ( strcmp( attr->name, "printer-make-and-model" ) == 0 &&
- attr->value_tag == IPP_TAG_TEXT )
- make_model = attr->values[ 0 ].string.text;
-
- else if ( strcmp( attr->name, "printer-state" ) == 0 &&
- attr->value_tag == IPP_TAG_ENUM )
- state = ( ipp_pstate_t ) attr->values[ 0 ].integer;
-
- else if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
- attr->value_tag == IPP_TAG_BOOLEAN)
- accepting = attr->values[ 0 ].boolean;
+ if ( strcmp( ippGetName( attr ), "printer-name" ) == 0 &&
+ ippGetValueTag( attr ) == IPP_TAG_NAME )
+ name = ippGetString( attr, 0, NULL );
+
+ else if ( strcmp( ippGetName( attr ), "device-uri" ) == 0 &&
+ ippGetValueTag( attr ) == IPP_TAG_URI )
+ device_uri = ippGetString( attr, 0, NULL );
+
+ else if ( strcmp( ippGetName( attr ), "printer-uri-supported" ) == 0 &&
+ ippGetValueTag( attr ) == IPP_TAG_URI )
+ printer_uri = ippGetString( attr, 0, NULL );
+
+ else if ( strcmp( ippGetName( attr ), "printer-info" ) == 0 &&
+ ippGetValueTag( attr ) == IPP_TAG_TEXT )
+ info = ippGetString( attr, 0, NULL );
+
+ else if ( strcmp( ippGetName( attr ), "printer-location" ) == 0 &&
+ ippGetValueTag( attr ) == IPP_TAG_TEXT )
+ location = ippGetString( attr, 0, NULL );
+
+ else if ( strcmp( ippGetName( attr ), "printer-make-and-model" ) == 0 &&
+ ippGetValueTag( attr ) == IPP_TAG_TEXT )
+ make_model = ippGetString( attr, 0, NULL );
+
+ else if ( strcmp( ippGetName( attr ), "printer-state" ) == 0 &&
+ ippGetValueTag( attr ) == IPP_TAG_ENUM )
+ state = ( ipp_pstate_t ) ippGetInteger( attr, 0 );
+
+ else if (!strcmp(ippGetName( attr ), "printer-is-accepting-jobs") &&
+ ippGetValueTag( attr ) == IPP_TAG_BOOLEAN)
+ accepting = ippGetBoolean( attr, 0 );
- attr = attr->next;
+ attr = ippNextAttribute( response );
}
if ( device_uri == NULL )
@@ -522,8 +562,8 @@
request = ippNew();
language = cupsLangDefault();
- request->request.op.operation_id = CUPS_ADD_PRINTER;
- request->request.any.request_id = 1;
+ ippSetOperation( request, CUPS_ADD_PRINTER );
+ ippSetRequestId ( request, 1 );
ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
"attributes-charset", NULL, cupsLangEncoding( language ) );
@@ -568,7 +608,7 @@
}
else
{
- status = response->request.status.status_code;
+ status = ippGetStatusCode( response );
//ippDelete( response );
r = 1;
}
@@ -631,8 +671,8 @@
*/
request = ippNew();
- request->request.op.operation_id = CUPS_DELETE_PRINTER;
- request->request.op.request_id = 1;
+ ippSetOperation( request, CUPS_DELETE_PRINTER );
+ ippSetRequestId ( request, 1 );
language = cupsLangDefault();
@@ -650,7 +690,7 @@
*/
response = cupsDoRequest( http, request, "/admin/" );
- if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) )
+ if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) )
{
r = 1;
}
@@ -721,8 +761,8 @@
request = ippNew();
- request->request.op.operation_id = CUPS_SET_DEFAULT;
- request->request.op.request_id = 1;
+ ippSetOperation( request, CUPS_SET_DEFAULT );
+ ippSetRequestId ( request, 1 );
language = cupsLangDefault();
@@ -743,7 +783,7 @@
response = cupsDoRequest( http, request, "/admin/" );
- if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) )
+ if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) )
{
r = 1;
}
@@ -797,8 +837,8 @@
request = ippNew();
- request->request.op.operation_id = op;
- request->request.op.request_id = 1;
+ ippSetOperation( request, op );
+ ippSetRequestId ( request, 1 );
language = cupsLangDefault();
@@ -822,7 +862,7 @@
response = cupsDoRequest(http, request, "/admin/");
- if (( response != NULL ) && (response->request.status.status_code <= IPP_OK_CONFLICT))
+ if (( response != NULL ) && (ippGetStatusCode( response ) <= IPP_OK_CONFLICT))
{
r = 1;
}
@@ -837,7 +877,7 @@
if ( response != NULL )
ippDelete( response );
- return Py_BuildValue( "i", r );;
+ return Py_BuildValue( "i", r );
}
@@ -1116,8 +1156,8 @@
request = ippNew();
- request->request.op.operation_id = CUPS_GET_PPDS;
- request->request.op.request_id = 1;
+ ippSetOperation( request, CUPS_GET_PPDS );
+ ippSetRequestId ( request, 1 );
language = cupsLangDefault();
@@ -1143,43 +1183,43 @@
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
- for (attr = response->attrs; attr; attr = attr->next)
+ for (attr = ippFirstAttribute( response ); attr; attr = ippNextAttribute( response ))
{
PyObject *dict;
char *ppdname = NULL;
- while (attr && attr->group_tag != IPP_TAG_PRINTER)
- attr = attr->next;
+ while (attr && ippGetGroupTag( attr ) != IPP_TAG_PRINTER)
+ attr = ippNextAttribute( response );
if (!attr)
break;
dict = PyDict_New ();
- for (; attr && attr->group_tag == IPP_TAG_PRINTER; attr = attr->next)
+ for (; attr && ippGetGroupTag( attr ) == IPP_TAG_PRINTER; attr = ippNextAttribute( response ))
{
PyObject *val = NULL;
- if (!strcmp (attr->name, "ppd-name") && attr->value_tag == IPP_TAG_NAME)
+ if (!strcmp (ippGetName( attr ), "ppd-name") && ippGetValueTag( attr ) == IPP_TAG_NAME)
{
- ppdname = attr->values[0].string.text;
+ ppdname = ippGetString( attr, 0, NULL );
//sprintf( buf, "print '%s'", ppdname);
//PyRun_SimpleString( buf );
}
- else if (attr->value_tag == IPP_TAG_TEXT || attr->value_tag == IPP_TAG_NAME || attr->value_tag == IPP_TAG_KEYWORD)
- //else if ((!strcmp (attr->name, "ppd-natural-language") && attr->value_tag == IPP_TAG_LANGUAGE) ||
- // (!strcmp (attr->name, "ppd-make-and-model") && attr->value_tag == IPP_TAG_TEXT) ||
- // (!strcmp (attr->name, "ppd-make") && attr->value_tag == IPP_TAG_TEXT) ||
- // (!strcmp (attr->name, "ppd-device-id") && attr->value_tag == IPP_TAG_TEXT))
+ else if (ippGetValueTag( attr ) == IPP_TAG_TEXT || ippGetValueTag( attr ) == IPP_TAG_NAME || ippGetValueTag( attr ) == IPP_TAG_KEYWORD)
+ //else if ((!strcmp (ippGetName( attr ), "ppd-natural-language") && ippGetValueTag( attr ) == IPP_TAG_LANGUAGE) ||
+ // (!strcmp (ippGetName( attr ), "ppd-make-and-model") && ippGetValueTag( attr ) == IPP_TAG_TEXT) ||
+ // (!strcmp (ippGetName( attr ), "ppd-make") && ippGetValueTag( attr ) == IPP_TAG_TEXT) ||
+ // (!strcmp (ippGetName( attr ), "ppd-device-id") && ippGetValueTag( attr ) == IPP_TAG_TEXT))
{
- val = PyObj_from_UTF8(attr->values[0].string.text);
+ val = PyObj_from_UTF8(ippGetString( attr, 0, NULL ));
}
if (val)
{
- PyDict_SetItemString (dict, attr->name, val);
+ PyDict_SetItemString (dict, ippGetName( attr ), val);
Py_DECREF (val);
}
}
diff -Naur hplip-3.12.6_old/scan/sane/hpaio.c hplip-3.12.6/scan/sane/hpaio.c
--- hplip-3.12.6_old/scan/sane/hpaio.c 2012-08-04 09:18:21.458389913 +0200
+++ hplip-3.12.6/scan/sane/hpaio.c 2012-08-04 09:18:27.875181720 +0200
@@ -47,6 +47,43 @@
#define DEBUG_DECLARE_ONLY
#include "sanei_debug.h"
+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
+#define HAVE_CUPS_1_6 1
+#endif
+
+#ifndef HAVE_CUPS_1_6
+#define ippGetGroupTag(attr) attr->group_tag
+#define ippGetValueTag(attr) attr->value_tag
+#define ippGetName(attr) attr->name
+#define ippGetString(attr, element, language) attr->values[element].string.text
+
+static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp )
+{
+ if (!ipp)
+ return (NULL);
+ return (ipp->current = ipp->attrs);
+}
+
+static ipp_attribute_t * ippNextAttribute( ipp_t *ipp )
+{
+ if (!ipp || !ipp->current)
+ return (NULL);
+ return (ipp->current = ipp->current->next);
+}
+
+static int ippSetOperation( ipp_t *ipp, ipp_op_t op )
+{
+ ipp->request.op.operation_id = op;
+ return (1);
+}
+
+static int ippSetRequestId( ipp_t *ipp, int request_id )
+{
+ ipp->request.any.request_id = request_id;
+ return (1);
+}
+#endif
+
static SANE_Device **DeviceList = NULL;
static int AddDeviceList(char *uri, char *model, SANE_Device ***pd)
@@ -186,8 +223,8 @@
/* Assemble the IPP request */
request = ippNew();
- request->request.op.operation_id = CUPS_GET_PRINTERS;
- request->request.any.request_id = 1;
+ ippSetOperation( request, CUPS_GET_PRINTERS );
+ ippSetRequestId( request, 1 );
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8");
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, "en");
@@ -197,20 +234,20 @@
if ((response = cupsDoRequest(http, request, "/")) == NULL)
goto bugout;
- for (attr = response->attrs; attr != NULL; attr = attr->next)
+ for (attr = ippFirstAttribute ( response ); attr != NULL; attr = ippNextAttribute( response ))
{
/* Skip leading attributes until we hit a printer. */
- while (attr != NULL && attr->group_tag != IPP_TAG_PRINTER)
- attr = attr->next;
+ while (attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER)
+ attr = ippNextAttribute( response );
if (attr == NULL)
break;
- while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
+ while (attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER)
{
- if (strcmp(attr->name, "device-uri") == 0 && attr->value_tag == IPP_TAG_URI && AddCupsList(attr->values[0].string.text, printer) == 0)
+ if (strcmp(ippGetName( attr ), "device-uri") == 0 && ippGetValueTag( attr ) == IPP_TAG_URI && AddCupsList(ippGetString( attr, 0, NULL ), printer) == 0)
cnt++;
- attr = attr->next;
+ attr = ippNextAttribute( response );
}
if (attr == NULL)
@@ -1,35 +0,0 @@
Upstream-Status: Inappropriate [configuration]
diff -rupN hplip-3.12.6_orig/configure.in hplip-3.12.6/configure.in
--- hplip-3.12.6_orig/configure.in 2012-06-18 20:44:24.000000000 +1000
+++ hplip-3.12.6/configure.in 2012-08-16 13:40:07.259927650 +1000
@@ -524,6 +524,8 @@ if test "$hpijs_only_build" = "no"; then
AC_CHECK_HEADERS(usb.h, ,[AC_MSG_ERROR([cannot find libusb-devel support], 11)])
else
AC_CHECK_LIB([usb-1.0], [libusb_init], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libusb 1.0 support], 2)])
+ LIBUSBINCLUDEROOT?="/usr/include/"
+ AC_ARG_VAR(LIBUSBINCLUDEROOT, [path to libusb-1.0 folder])
AC_CHECK_HEADERS(libusb-1.0/libusb.h, ,[AC_MSG_ERROR([cannot find libusb-1.0-devel support], 11)])
fi
fi
diff -rupN hplip-3.12.6_orig/Makefile.am hplip-3.12.6/Makefile.am
--- hplip-3.12.6_orig/Makefile.am 2012-06-18 20:44:13.000000000 +1000
+++ hplip-3.12.6/Makefile.am 2012-08-16 13:41:12.307932822 +1000
@@ -72,7 +72,7 @@ libhpmud_la_SOURCES = io/hpmud/hpmud.c i
io/hpmud/hpmud.h io/hpmud/hpmudi.h io/hpmud/list.h io/hpmud/mlc.h io/hpmud/pml.h io/hpmud/dot4.c \
io/hpmud/dot4.h io/hpmud/jd.c io/hpmud/jd.h io/hpmud/pp.c io/hpmud/pp.h io/hpmud/musb.h io/hpmud/musb_libusb01.c
else
-libhpmud_la_CFLAGS = -I/usr/include/libusb-1.0 -DMUDNAME=\"$(MUDNAME)\" -DCONFDIR=\"$(hplip_confdir)\"
+libhpmud_la_CFLAGS = -I/$(LIBUSBINCLUDEROOT)/libusb-1.0 -DMUDNAME=\"$(MUDNAME)\" -DCONFDIR=\"$(hplip_confdir)\"
libhpmud_la_SOURCES = io/hpmud/hpmud.c io/hpmud/mlc.c io/hpmud/model.c io/hpmud/pml.c \
io/hpmud/hpmud.h io/hpmud/hpmudi.h io/hpmud/list.h io/hpmud/mlc.h io/hpmud/pml.h io/hpmud/dot4.c \
io/hpmud/dot4.h io/hpmud/jd.c io/hpmud/jd.h io/hpmud/pp.c io/hpmud/pp.h io/hpmud/musb.h io/hpmud/musb.c
@@ -286,7 +286,7 @@ hpmudext_la_LIBADD = libhpmud.la
if LIBUSB01_BUILD
hpmudext_la_CFLAGS = -I$(PYTHONINCLUDEDIR)
else
-hpmudext_la_CFLAGS =-I/usr/include/libusb-1.0 -I$(PYTHONINCLUDEDIR)
+hpmudext_la_CFLAGS =-I$(LIBUSBINCLUDEROOT)/libusb-1.0 -I$(PYTHONINCLUDEDIR)
endif
# ui (qt3)
@@ -1,12 +0,0 @@
Upstream-Status: Inappropriate [embedded specific]
--- hplip-3.11.10/setup.py.orig 2011-10-02 14:06:19.000000000 +1100
+++ hplip-3.11.10/setup.py 2012-02-29 08:21:39.167999938 +1100
@@ -573,6 +573,7 @@
log.debug("Restarting CUPS...")
status, output = utils.run(restart_cups())
+ time.sleep(3)
log.debug("Restart CUPS returned: exit=%d output=%s" % (status, output))
cups.setPasswordPrompt("You do not have permission to add a printer.")
@@ -0,0 +1,15 @@
https://bugs.launchpad.net/hplip/+bug/1672256
memcpy should never be used with overlapping memory regions
--- a/io/hpmud/musb.c
+++ b/io/hpmud/musb.c
@@ -775,7 +775,7 @@ static int device_id(int fd, unsigned ch
len = size-1; /* leave byte for zero termination */
if (len > 2)
len -= 2;
- memcpy(buffer, buffer+2, len); /* remove length */
+ memmove(buffer, buffer+2, len); /* remove length */
buffer[len]=0;
DBG("read actual device_id successfully fd=%d len=%d\n", fd, len);
@@ -0,0 +1,17 @@
diff --git a/scan/sane/OrbliteScan/LinuxCommon.h b/scan/sane/OrbliteScan/LinuxCommon.h
index 6605dd9..55c7110 100644
--- a/scan/sane/OrbliteScan/LinuxCommon.h
+++ b/scan/sane/OrbliteScan/LinuxCommon.h
@@ -18,10 +18,8 @@ typedef u_int32_t UInt32;
typedef int32_t SInt32;
//typedef unsigned long UInt32;
//typedef signed long SInt32;
-typedef __S64_TYPE SInt64;
-typedef __U64_TYPE UInt64;
-typedef __S64_TYPE int64_t;
-typedef __U64_TYPE uint64_t;
+typedef int64_t SInt64;
+typedef uint64_t UInt64;
//typedef unsigned long ULONG;
//typedef void* LPVOID;
@@ -0,0 +1,10 @@
--- a/configure.in
+++ b/configure.in
@@ -254,7 +254,6 @@ if test "$class_driver" = "yes"; then
test `sh ./createPPD.sh -f` == 0
else
AC_MSG_RESULT(no)
- test `sh ./createPPD.sh -q` == 0
fi
AM_CONDITIONAL(HPLIP_CLASS_DRIVER, test x$class_driver = xyes)
@@ -0,0 +1,69 @@
# ../bin/ld: cannot find -lImageProcessor
--- a/Makefile.am
+++ b/Makefile.am
@@ -590,11 +590,10 @@ hpcups_SOURCES = prnt/hpcups/HPCupsFilte
prnt/hpcups/flate_colorspace.h prnt/hpcups/RunLenEncoding.h prnt/hpcups/common_defines.h \
prnt/hpcups/genPCLm.h \
common/utils.c common/utils.h prnt/hpcups/Hbpl1_Wrapper.cpp prnt/hpcups/genPCLm.cpp \
- prnt/hpcups/genJPEGStrips.cpp prnt/hpcups/RunLenEncoding.cpp \
- prnt/hpcups/ImageProcessor.h
+ prnt/hpcups/genJPEGStrips.cpp prnt/hpcups/RunLenEncoding.cpp
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
--- a/prnt/hpcups/HPCupsFilter.cpp
+++ b/prnt/hpcups/HPCupsFilter.cpp
@@ -637,16 +637,10 @@ int HPCupsFilter::processRasterData(cups
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,11 +739,6 @@ int HPCupsFilter::processRasterData(cups
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
@@ -780,11 +769,6 @@ int HPCupsFilter::processRasterData(cups
}
} // 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) {
@@ -800,8 +784,6 @@ int HPCupsFilter::processRasterData(cups
rgbRaster = NULL;
}
- imageProcessorDestroy(imageProcessor);
-
unlink(hpPreProcessedRasterFile);
return ret_status;
}
@@ -0,0 +1,12 @@
--- a/configure.in
+++ b/configure.in
@@ -27,8 +27,7 @@
#AC_PREREQ(2.59)
AC_INIT([HP Linux Imaging and Printing], [3.19.12], [3.19.12], [hplip])
-#AM_INIT_AUTOMAKE([1.9 foreign])
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([foreign])
AC_DISABLE_STATIC
# Checks for programs.
@@ -0,0 +1,33 @@
Upstream-Status: Inappropriate [configuration]
--- a/configure.in
+++ b/configure.in
@@ -599,6 +599,8 @@ if test "$class_driver" = "no" && test "
AC_CHECK_HEADERS(usb.h, ,[AC_MSG_ERROR([cannot find libusb-devel support], 11)])
else
AC_CHECK_LIB([usb-1.0], [libusb_init], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libusb 1.0 support], 2)])
+ LIBUSBINCLUDEROOT?="/usr/include/"
+ AC_ARG_VAR(LIBUSBINCLUDEROOT, [path to libusb-1.0 folder])
AC_CHECK_HEADERS(libusb-1.0/libusb.h, ,[AC_MSG_ERROR([cannot find libusb-1.0-devel support], 11)])
fi
fi
--- a/Makefile.am
+++ b/Makefile.am
@@ -109,7 +109,7 @@ libhpmud_la_SOURCES += io/hpmud/musb_lib
libhpmud_la_LDFLAGS += -lusb
else
libhpmud_la_SOURCES += io/hpmud/musb.c
-libhpmud_la_CFLAGS += -I/usr/include/libusb-1.0
+libhpmud_la_CFLAGS += -I$(LIBUSBINCLUDEROOT)/libusb-1.0
libhpmud_la_LDFLAGS += -lusb-1.0
endif
@@ -362,7 +362,7 @@ hpmudext_la_CFLAGS += -Iprotocol/discove
endif
if !LIBUSB01_BUILD
-hpmudext_la_CFLAGS +=-I/usr/include/libusb-1.0
+hpmudext_la_CFLAGS +=-I$(LIBUSBINCLUDEROOT)/libusb-1.0
endif
endif #!HPLIP_CLASS_DRIVER
# ui (qt3)
@@ -0,0 +1,20 @@
From 2fcd0e79b21ec6dbf975ad7d1b5697a78993e2f1 Mon Sep 17 00:00:00 2001
From: David Valleau <valleau@chromium.org>
Date: Wed, 14 Aug 2019 15:47:38 -0700
Subject: [PATCH] Fixing invalid return in void function
---
prnt/hpps/hppsfilter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/prnt/hpps/hppsfilter.c
+++ b/prnt/hpps/hppsfilter.c
@@ -104,7 +104,7 @@ static void open_tempbookletfile(char *m
if(ptempbooklet_file == NULL)
{
fprintf(stderr, "ERROR: Unable to open temp file %s\n", temp_filename);
- return 1;
+ return;
}
chmod(temp_filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
@@ -1,75 +0,0 @@
SUMMARY = "HP Linux Imaging and Printing"
LICENSE="GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=442bb3cbbeeb60643a87325718b8a8ee"
PR = "r1"
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
file://setup-add-sleep-after-cups-reset.patch \
file://fix-libusb-paths.patch \
file://cups-1.6.patch \
file://configure.patch \
file://0001-include-cups-ppd.h-for-missing-ppd-definitions.patch \
"
DEPENDS += "cups python libusb"
inherit autotools-brokensep python3-dir python3native pkgconfig
export STAGING_INCDIR
export STAGING_LIBDIR
EXTRA_OECONF += "\
LIBUSBINCLUDEROOT=${STAGING_INCDIR} \
--disable-network-build \
--disable-doc-build \
--disable-pp-build \
--disable-scan-build \
--disable-gui-build \
--disable-fax-build \
--disable-policykit \
--disable-qt4 \
--disable-qt3 \
--disable-dbus-build \
--disable-foomatic-drv-install \
--enable-foomatic-ppd-install \
--enable-foomatic-rip-hplip-install \
--with-cupsbackenddir=${libdir}/cups/backend \
--with-cupsfilterdir=${libdir}/cups/filter \
"
PACKAGES += "${PN}-ppd ${PN}-cups ${PN}-backend ${PN}-filter ${PN}-hal"
RDEPENDS_${PN} += " \
python \
python-syslog \
python-pprint \
python-compression \
python-shell \
python-xml \
python-unixadmin \
python-html \
python-resource \
python-terminal \
python-subprocess\
"
RDEPENDS_${PN}-filter += "perl"
# need to snag the debug file or OE will fail on backend package
FILES_${PN}-dbg += "\
${libdir}/cups/backend/.debug \
${PYTHON_SITEPACKAGES_DIR}/.debug \
${libdir}/cups/filter/.debug "
FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la"
FILES_${PN}-ppd = "${datadir}/ppd"
FILES_${PN}-cups = "${datadir}/cups"
FILES_${PN}-backend = "${libdir}/cups/backend"
FILES_${PN}-filter = "${libdir}/cups/filter"
FILES_${PN}-hal = "${datadir}/hal"
FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR}/*.so"
SRC_URI[md5sum] = "5303938e8630775ea6fb383af85775e5"
SRC_URI[sha256sum] = "54578000792969adb583e75efeacb9c46ab69659ec7e9424de390613f3595775"
@@ -0,0 +1,88 @@
SUMMARY = "HP Linux Imaging and Printing"
LICENSE="GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=20f2c819499cc2063e9a7b07b408815c"
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
file://configure.patch \
file://fix-libusb-paths.patch \
file://999-remove-lImageProcessor.patch \
file://600-fix.patch \
file://030-replace_unsafe_memcpy_with_memmove.patch \
file://050-fix-glibcisms.patch \
file://hplip-3.19.6-fix-return.patch \
"
SRC_URI[md5sum] = "d72bc77d791c150c2c22b84e9553bab3"
SRC_URI[sha256sum] = "b7f398502fb659e0de8e54976237e3c6a64fec0b3c36054a515876f7b006b255"
DEPENDS += "cups python3 libusb"
inherit autotools-brokensep python3-dir python3native pkgconfig systemd
export STAGING_INCDIR
export STAGING_LIBDIR
CFLAGS += "-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}"
EXTRA_OECONF += "\
LIBUSBINCLUDEROOT=${STAGING_INCDIR} \
--enable-cups-ppd-install \
--disable-network-build \
--disable-doc-build \
--disable-pp-build \
--disable-scan-build \
--disable-gui-build \
--disable-fax-build \
--disable-policykit \
--disable-qt4 \
--disable-qt3 \
--disable-dbus-build \
--enable-foomatic-drv-install \
--disable-foomatic-ppd-install \
--disable-foomatic-rip-hplip-install \
--with-cupsbackenddir=${libdir}/cups/backend \
--with-cupsfilterdir=${libdir}/cups/filter \
"
EXTRA_OEMAKE = "rulessystemdir=${systemd_unitdir}/system/"
do_install_append() {
rm -rf ${D}${datadir}/hplip/upgrade.py
rm -rf ${D}${datadir}/hplip/uninstall.py
sed -i -e "s|/usr/bin/env python|/usr/bin/env python3|g" ${D}${datadir}/hplip/*.py
sed -i -e "s|/usr/bin/python|/usr/bin/env python3|g" ${D}${datadir}/hplip/*.py
}
PACKAGES += "${PN}-ppd ${PN}-cups ${PN}-backend ${PN}-filter ${PN}-hal"
RDEPENDS_${PN} += " \
python3\
python3-syslog \
python3-pprint \
python3-compression \
python3-shell \
python3-xml \
python3-unixadmin \
python3-html \
python3-resource \
python3-terminal \
"
RDEPENDS_${PN}-filter += "perl"
# need to snag the debug file or OE will fail on backend package
FILES_${PN}-dbg += "\
${libdir}/cups/backend/.debug \
${PYTHON_SITEPACKAGES_DIR}/.debug \
${libdir}/cups/filter/.debug "
FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la"
FILES_${PN}-ppd = "${datadir}/ppd"
FILES_${PN}-cups = "${datadir}/cups"
FILES_${PN}-backend = "${libdir}/cups/backend"
FILES_${PN}-filter = "${libdir}/cups/filter"
FILES_${PN}-hal = "${datadir}/hal"
FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR}/*.so"
SYSTEMD_SERVICE_${PN} = "hplip-printer@.service"
CLEANBROKEN = "1"