I forgot to cvs add the patches in my commit yesterday; spotted by ian@, thanks!
While here, regen WANTLIB/depends.
This commit is contained in:
parent
b0c2996700
commit
e9a6cc6dbc
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.55 2012/08/04 14:55:37 ajacoutot Exp $
|
||||
# $OpenBSD: Makefile,v 1.56 2012/08/05 06:46:10 ajacoutot Exp $
|
||||
|
||||
SHARED_ONLY= Yes
|
||||
|
||||
@ -19,7 +19,7 @@ PKGNAME-gui= hplip-gui-${V}
|
||||
|
||||
REVISION-main= 3
|
||||
REVISION-gui= 0
|
||||
REVISION-hpcups=1
|
||||
REVISION-hpcups=2
|
||||
REVISION-libs= 0
|
||||
REVISION-hpijs= 0
|
||||
|
||||
@ -76,10 +76,13 @@ LIB_DEPENDS-hpijs= print/hplip,-libs \
|
||||
x11/dbus
|
||||
RUN_DEPENDS-hpijs= print/foomatic-filters
|
||||
|
||||
WANTLIB-hpcups += ${cWANTLIB} png tiff z asn1 gssapi krb5 ssl
|
||||
WANTLIB-hpcups += ${cWANTLIB} z asn1 gssapi krb5 ssl
|
||||
WANTLIB-hpcups += c jpeg stdc++ hpip cups cupsimage dbus-1
|
||||
LIB_DEPENDS-hpcups= print/hplip,-libs \
|
||||
print/cups,-libs
|
||||
LIB_DEPENDS-hpcups= \
|
||||
graphics/jpeg \
|
||||
print/hplip,-libs \
|
||||
print/cups,-libs \
|
||||
x11/dbus
|
||||
|
||||
WANTLIB-libs += ${cWANTLIB} netsnmp usb-1.0
|
||||
LIB_DEPENDS-libs= net/net-snmp \
|
||||
|
310
print/hplip/patches/patch-prnt_cupsext_cupsext_c
Normal file
310
print/hplip/patches/patch-prnt_cupsext_cupsext_c
Normal file
@ -0,0 +1,310 @@
|
||||
$OpenBSD: patch-prnt_cupsext_cupsext_c,v 1.1 2012/08/05 06:46:10 ajacoutot Exp $
|
||||
|
||||
https://bugs.launchpad.net/hplip/+bug/1026666
|
||||
|
||||
--- prnt/cupsext/cupsext.c.orig Sun Aug 5 08:28:22 2012
|
||||
+++ prnt/cupsext/cupsext.c Sun Aug 5 08:35:12 2012
|
||||
@@ -87,6 +87,46 @@ typedef int Py_ssize_t;
|
||||
#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 @@ PyObject * getPrinters( PyObject * self, PyObject * ar
|
||||
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 @@ PyObject * getPrinters( PyObject * self, PyObject * ar
|
||||
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 @@ PyObject * getPrinters( PyObject * self, PyObject * ar
|
||||
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;
|
||||
+ 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 );
|
||||
|
||||
- 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;
|
||||
-
|
||||
- attr = attr->next;
|
||||
+ attr = ippNextAttribute( response );
|
||||
}
|
||||
|
||||
if ( device_uri == NULL )
|
||||
@@ -522,8 +562,8 @@ PyObject * addPrinter( PyObject * self, PyObject * arg
|
||||
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 @@ PyObject * addPrinter( PyObject * self, PyObject * arg
|
||||
}
|
||||
else
|
||||
{
|
||||
- status = response->request.status.status_code;
|
||||
+ status = ippGetStatusCode( response );
|
||||
//ippDelete( response );
|
||||
r = 1;
|
||||
}
|
||||
@@ -631,8 +671,8 @@ PyObject * delPrinter( PyObject * self, PyObject * arg
|
||||
*/
|
||||
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 @@ PyObject * delPrinter( PyObject * self, PyObject * arg
|
||||
*/
|
||||
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 @@ PyObject * setDefaultPrinter( PyObject * self, PyObjec
|
||||
|
||||
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 @@ PyObject * setDefaultPrinter( PyObject * self, PyObjec
|
||||
|
||||
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 @@ PyObject * controlPrinter( PyObject * self, PyObject *
|
||||
|
||||
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 @@ PyObject * controlPrinter( PyObject * self, PyObject *
|
||||
|
||||
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 @@ abort:
|
||||
if ( response != NULL )
|
||||
ippDelete( response );
|
||||
|
||||
- return Py_BuildValue( "i", r );;
|
||||
+ return Py_BuildValue( "i", r );
|
||||
}
|
||||
|
||||
|
||||
@@ -1116,8 +1156,8 @@ PyObject * getPPDList( PyObject * self, PyObject * arg
|
||||
|
||||
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 @@ PyObject * getPPDList( PyObject * self, PyObject * arg
|
||||
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);
|
||||
}
|
||||
}
|
88
print/hplip/patches/patch-scan_sane_hpaio_c
Normal file
88
print/hplip/patches/patch-scan_sane_hpaio_c
Normal file
@ -0,0 +1,88 @@
|
||||
$OpenBSD: patch-scan_sane_hpaio_c,v 1.1 2012/08/05 06:46:10 ajacoutot Exp $
|
||||
|
||||
https://bugs.launchpad.net/hplip/+bug/1026666
|
||||
|
||||
--- scan/sane/hpaio.c.orig Mon Jun 18 12:42:51 2012
|
||||
+++ scan/sane/hpaio.c Sun Aug 5 08:28:22 2012
|
||||
@@ -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 @@ static int GetCupsPrinters(char ***printer)
|
||||
/* 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 @@ static int GetCupsPrinters(char ***printer)
|
||||
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)
|
Loading…
x
Reference in New Issue
Block a user