Fix build with cups >= 1.6.

This commit is contained in:
ajacoutot 2012-08-04 14:48:18 +00:00
parent af7cfff551
commit 08d1829c51
9 changed files with 508 additions and 21 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.69 2012/07/08 11:19:23 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.70 2012/08/04 14:49:51 ajacoutot Exp $
# XXX Binary files patch-panels_info_hostnames-test_txt and
# patch-panels_info_hostnames-test_txt.new differ
@ -10,7 +10,7 @@ COMMENT= GNOME control center
GNOME_PROJECT= gnome-control-center
GNOME_VERSION= 3.4.2
REVISION= 4
REVISION= 5
CATEGORIES= x11
@ -48,7 +48,7 @@ LIB_DEPENDS= x11/gnome/desktop \
x11/gnome/online-accounts \
sysutils/upower \
devel/libgtop2 \
print/cups \
print/cups,-libs \
audio/pulseaudio \
audio/libcanberra,-gtk3 \
graphics/colord

View File

@ -1,7 +1,52 @@
$OpenBSD: patch-panels_printers_cc-printers-panel_c,v 1.5 2012/03/29 06:57:03 ajacoutot Exp $
--- panels/printers/cc-printers-panel.c.orig Sat Mar 24 22:35:16 2012
+++ panels/printers/cc-printers-panel.c Wed Mar 28 10:25:04 2012
@@ -2200,7 +2200,7 @@ test_page_cb (GtkButton *button,
$OpenBSD: patch-panels_printers_cc-printers-panel_c,v 1.6 2012/08/04 14:49:52 ajacoutot Exp $
https://bugzilla.gnome.org/show_bug.cgi?id=679759
--- panels/printers/cc-printers-panel.c.orig Sat Jul 28 17:57:48 2012
+++ panels/printers/cc-printers-panel.c Sat Jul 28 17:58:14 2012
@@ -58,6 +58,16 @@ G_DEFINE_DYNAMIC_TYPE (CcPrintersPanel, cc_printers_pa
#define CUPS_STATUS_CHECK_INTERVAL 5
+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
+#define HAVE_CUPS_1_6 1
+#endif
+
+#ifndef HAVE_CUPS_1_6
+#define ippGetState(ipp) ipp->state
+#define ippGetStatusCode(ipp) ipp->request.status.status_code
+#define ippGetString(attr, element, language) attr->values[element].string.text
+#endif
+
struct _CcPrintersPanelPrivate
{
GtkBuilder *builder;
@@ -311,7 +321,7 @@ on_cups_notification (GDBusConnection *connection,
if (response)
{
- if (response->request.status.status_code <= IPP_OK_CONFLICT)
+ if (ippGetStatusCode (response) <= IPP_OK_CONFLICT)
{
ipp_attribute_t *attr_username = NULL;
ipp_attribute_t *attr_printer_uri = NULL;
@@ -319,12 +329,12 @@ on_cups_notification (GDBusConnection *connection,
attr_username = ippFindAttribute(response, "job-originating-user-name", IPP_TAG_NAME);
attr_printer_uri = ippFindAttribute(response, "job-printer-uri", IPP_TAG_URI);
if (attr_username && attr_printer_uri &&
- g_strcmp0 (attr_username->values[0].string.text, cupsUser ()) == 0 &&
- g_strrstr (attr_printer_uri->values[0].string.text, "/") != 0 &&
+ g_strcmp0 (ippGetString (attr_username, 0, NULL), cupsUser ()) == 0 &&
+ g_strrstr (ippGetString (attr_printer_uri, 0, NULL), "/") != 0 &&
priv->current_dest >= 0 &&
priv->current_dest < priv->num_dests &&
priv->dests != NULL &&
- g_strcmp0 (g_strrstr (attr_printer_uri->values[0].string.text, "/") + 1,
+ g_strcmp0 (g_strrstr (ippGetString (attr_printer_uri, 0, NULL), "/") + 1,
priv->dests[priv->current_dest].name) == 0)
actualize_jobs_list (self);
}
@@ -2200,7 +2210,7 @@ test_page_cb (GtkButton *button,
if (printer_name)
{
const gchar *const dirs[] = { "/usr/share/cups",
@ -10,3 +55,12 @@ $OpenBSD: patch-panels_printers_cc-printers-panel_c,v 1.5 2012/03/29 06:57:03 aj
NULL };
const gchar *testprint[] = { "%s/data/testprint",
"%s/data/testprint.ps",
@@ -2288,7 +2298,7 @@ test_page_cb (GtkButton *button,
if (response)
{
- if (response->state == IPP_ERROR)
+ if (ippGetState(response) == IPP_ERROR)
g_warning ("An error has occured during printing of test page.");
ippDelete (response);
}

View File

@ -1,10 +1,27 @@
$OpenBSD: patch-panels_printers_pp-new-printer-dialog_c,v 1.8 2012/04/17 11:02:32 jasper Exp $
$OpenBSD: patch-panels_printers_pp-new-printer-dialog_c,v 1.9 2012/08/04 14:49:52 ajacoutot Exp $
https://bugzilla.gnome.org/show_bug.cgi?id=679759
No PackageKit on OpenBSD.
--- panels/printers/pp-new-printer-dialog.c.orig Mon Apr 16 14:54:29 2012
+++ panels/printers/pp-new-printer-dialog.c Tue Apr 17 12:52:09 2012
@@ -1607,6 +1607,7 @@ new_printer_add_button_cb (GtkButton *button,
--- panels/printers/pp-new-printer-dialog.c.orig Sat Jul 28 17:57:56 2012
+++ panels/printers/pp-new-printer-dialog.c Sat Jul 28 17:58:14 2012
@@ -59,6 +59,14 @@
#define ALLOWED_CHARACTERS "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"
+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
+#define HAVE_CUPS_1_6 1
+#endif
+
+#ifndef HAVE_CUPS_1_6
+#define ippGetState(ipp) ipp->state
+#endif
+
static void pp_new_printer_dialog_hide (PpNewPrinterDialog *pp);
static void actualize_devices_list (PpNewPrinterDialog *pp);
@@ -1607,6 +1615,7 @@ new_printer_add_button_cb (GtkButton *button,
pp->devices[device_id].device_make_and_model,
pp->devices[device_id].device_uri);
@ -12,7 +29,7 @@ No PackageKit on OpenBSD.
if (ppd_name == NULL || ppd_name->ppd_match_level < PPD_EXACT_MATCH)
{
/* Try PackageKit to install printer driver */
@@ -1668,6 +1669,7 @@ new_printer_add_button_cb (GtkButton *button,
@@ -1668,6 +1677,7 @@ new_printer_add_button_cb (GtkButton *button,
pp->devices[device_id].device_uri);
}
}
@ -20,3 +37,12 @@ No PackageKit on OpenBSD.
/* Add the new printer */
if (ppd_name && ppd_name->ppd_name)
@@ -1760,7 +1770,7 @@ new_printer_add_button_cb (GtkButton *button,
_("Automatic configuration"));
if (response)
{
- if (response->state == IPP_ERROR)
+ if (ippGetState(response) == IPP_ERROR)
g_warning ("An error has occured during automatic configuration of new printer.");
ippDelete (response);
}

View File

@ -0,0 +1,270 @@
$OpenBSD: patch-panels_printers_pp-utils_c,v 1.3 2012/08/04 14:49:52 ajacoutot Exp $
https://bugzilla.gnome.org/show_bug.cgi?id=679759
--- panels/printers/pp-utils.c.orig Mon Apr 16 14:54:29 2012
+++ panels/printers/pp-utils.c Sat Jul 28 17:58:14 2012
@@ -35,6 +35,37 @@
#define SCP_PATH "/org/fedoraproject/Config/Printing"
#define SCP_IFACE "org.fedoraproject.Config.Printing"
+#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 ippGetStatusCode(ipp) ipp->request.status.status_code
+#define ippGetInteger(attr, element) attr->values[element].integer
+#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);
+}
+#endif
+
+
gchar *
get_tag_value (const gchar *tag_string, const gchar *tag_name)
{
@@ -935,12 +966,12 @@ DBus method \"GetBestDrivers\". Using fallback solutio
response = cupsDoRequest (http, request, "/");
if (response &&
- response->request.status.status_code <= IPP_OK_CONFLICT)
+ ippGetStatusCode (response) <= IPP_OK_CONFLICT)
{
- 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;
@@ -950,22 +981,22 @@ DBus method \"GetBestDrivers\". Using fallback solutio
ppd_name = NULL;
ppd_product = NULL;
- while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
+ while (attr != NULL && ippGetGroupTag (attr) == IPP_TAG_PRINTER)
{
- if (g_strcmp0 (attr->name, "ppd-device-id") == 0 &&
- attr->value_tag == IPP_TAG_TEXT)
- ppd_device_id = attr->values[0].string.text;
- else if (g_strcmp0 (attr->name, "ppd-make-and-model") == 0 &&
- attr->value_tag == IPP_TAG_TEXT)
- ppd_make_and_model = attr->values[0].string.text;
- else if (g_strcmp0 (attr->name, "ppd-name") == 0 &&
- attr->value_tag == IPP_TAG_NAME)
- ppd_name = attr->values[0].string.text;
- else if (g_strcmp0 (attr->name, "ppd-product") == 0 &&
- attr->value_tag == IPP_TAG_TEXT)
- ppd_product = attr->values[0].string.text;
+ if (g_strcmp0 (ippGetName (attr), "ppd-device-id") == 0 &&
+ ippGetValueTag (attr) == IPP_TAG_TEXT)
+ ppd_device_id = (gchar *) ippGetString (attr, 0, NULL);
+ else if (g_strcmp0 (ippGetName (attr), "ppd-make-and-model") == 0 &&
+ ippGetValueTag (attr) == IPP_TAG_TEXT)
+ ppd_make_and_model = ippGetString (attr, 0, NULL);
+ else if (g_strcmp0 (ippGetName (attr), "ppd-name") == 0 &&
+ ippGetValueTag (attr) == IPP_TAG_NAME)
+ ppd_name = ippGetString (attr, 0, NULL);
+ else if (g_strcmp0 (ippGetName (attr), "ppd-product") == 0 &&
+ ippGetValueTag (attr) == IPP_TAG_TEXT)
+ ppd_product = ippGetString (attr, 0, NULL);
- attr = attr->next;
+ attr = ippNextAttribute (response);
}
if (ppd_device_id && ppd_name)
@@ -1009,15 +1040,15 @@ DBus method \"GetBestDrivers\". Using fallback solutio
response = cupsDoRequest (http, request, "/");
if (response &&
- response->request.status.status_code <= IPP_OK_CONFLICT)
+ ippGetStatusCode (response) <= IPP_OK_CONFLICT)
{
for (i = 0; equivalents && equivalents[i]; i++)
{
eq_normalized = normalize (equivalents[i]);
- 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;
@@ -1027,22 +1058,22 @@ DBus method \"GetBestDrivers\". Using fallback solutio
ppd_name = NULL;
ppd_product = NULL;
- while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
+ while (attr != NULL && ippGetGroupTag (attr) == IPP_TAG_PRINTER)
{
- if (g_strcmp0 (attr->name, "ppd-device-id") == 0 &&
- attr->value_tag == IPP_TAG_TEXT)
- ppd_device_id = attr->values[0].string.text;
- else if (g_strcmp0 (attr->name, "ppd-make-and-model") == 0 &&
- attr->value_tag == IPP_TAG_TEXT)
- ppd_make_and_model = attr->values[0].string.text;
- else if (g_strcmp0 (attr->name, "ppd-name") == 0 &&
- attr->value_tag == IPP_TAG_NAME)
- ppd_name = attr->values[0].string.text;
- else if (g_strcmp0 (attr->name, "ppd-product") == 0 &&
- attr->value_tag == IPP_TAG_TEXT)
- ppd_product = attr->values[0].string.text;
+ if (g_strcmp0 (ippGetName (attr), "ppd-device-id") == 0 &&
+ ippGetValueTag (attr) == IPP_TAG_TEXT)
+ ppd_device_id = ippGetString (attr, 0, NULL);
+ else if (g_strcmp0 (ippGetName (attr), "ppd-make-and-model") == 0 &&
+ ippGetValueTag (attr) == IPP_TAG_TEXT)
+ ppd_make_and_model = ippGetString (attr, 0, NULL);
+ else if (g_strcmp0 (ippGetName (attr), "ppd-name") == 0 &&
+ ippGetValueTag (attr) == IPP_TAG_NAME)
+ ppd_name = ippGetString (attr, 0, NULL);
+ else if (g_strcmp0 (ippGetName (attr), "ppd-product") == 0 &&
+ ippGetValueTag (attr) == IPP_TAG_TEXT)
+ ppd_product = ippGetString (attr, 0, NULL);
- attr = attr->next;
+ attr = ippNextAttribute (response);
}
if (ppd_device_id && ppd_name)
@@ -1352,23 +1383,23 @@ ccGetAllowedUsers (gchar ***allowed_users, const char
ipp_attribute_t *attr = NULL;
ipp_attribute_t *allowed = NULL;
- for (attr = response->attrs; attr != NULL; attr = attr->next)
+ for (attr = ippFirstAttribute (response); attr != NULL; attr = ippNextAttribute (response))
{
- if (attr->group_tag == IPP_TAG_PRINTER &&
- attr->value_tag == IPP_TAG_NAME &&
- !g_strcmp0 (attr->name, "requesting-user-name-allowed"))
+ if (ippGetGroupTag (attr) == IPP_TAG_PRINTER &&
+ ippGetValueTag (attr) == IPP_TAG_NAME &&
+ !g_strcmp0 (ippGetName (attr), "requesting-user-name-allowed"))
allowed = attr;
}
- if (allowed && allowed->num_values > 0)
+ if (allowed && ippGetCount (allowed) > 0)
{
int i;
- num_allowed_users = allowed->num_values;
+ num_allowed_users = ippGetCount (allowed);
users = g_new (gchar*, num_allowed_users);
for (i = 0; i < num_allowed_users; i ++)
- users[i] = g_strdup (allowed->values[i].string.text);
+ users[i] = g_strdup (ippGetString (allowed, i, NULL));
}
ippDelete(response);
}
@@ -1454,12 +1485,12 @@ renew_cups_subscription (gint id,
"notify-lease-duration", lease_duration);
response = cupsDoRequest (http, request, "/");
if (response != NULL &&
- response->request.status.status_code <= IPP_OK_CONFLICT) {
+ ippGetStatusCode (response) <= IPP_OK_CONFLICT) {
if ((attr = ippFindAttribute (response, "notify-lease-duration",
IPP_TAG_INTEGER)) == NULL)
g_debug ("No notify-lease-duration in response!\n");
else
- if (attr->values[0].integer == lease_duration)
+ if (ippGetInteger (attr, 0) == lease_duration)
result = id;
}
}
@@ -1481,12 +1512,12 @@ renew_cups_subscription (gint id,
response = cupsDoRequest (http, request, "/");
if (response != NULL &&
- response->request.status.status_code <= IPP_OK_CONFLICT) {
+ ippGetStatusCode (response) <= IPP_OK_CONFLICT) {
if ((attr = ippFindAttribute (response, "notify-subscription-id",
IPP_TAG_INTEGER)) == NULL)
g_debug ("No notify-subscription-id in response!\n");
else
- result = attr->values[0].integer;
+ result = ippGetInteger (attr, 0);
}
}
@@ -1655,38 +1686,38 @@ printer_rename (const gchar *old_name,
if (response)
{
- if (response->request.status.status_code <= IPP_OK_CONFLICT)
+ if (ippGetStatusCode (response) <= IPP_OK_CONFLICT)
{
attr = ippFindAttribute (response, "printer-error-policy", IPP_TAG_NAME);
if (attr)
- error_policy = g_strdup (attr->values[0].string.text);
+ error_policy = g_strdup (ippGetString (attr, 0, NULL));
attr = ippFindAttribute (response, "printer-op-policy", IPP_TAG_NAME);
if (attr)
- op_policy = g_strdup (attr->values[0].string.text);
+ op_policy = g_strdup (ippGetString (attr, 0, NULL));
attr = ippFindAttribute (response, "requesting-user-name-allowed", IPP_TAG_NAME);
- if (attr && attr->num_values > 0)
+ if (attr && ippGetCount (attr) > 0)
{
- users_allowed = g_new0 (gchar *, attr->num_values + 1);
- for (i = 0; i < attr->num_values; i++)
- users_allowed[i] = g_strdup (attr->values[i].string.text);
+ users_allowed = g_new0 (gchar *, ippGetCount (attr) + 1);
+ for (i = 0; i < ippGetCount (attr); i++)
+ users_allowed[i] = g_strdup (ippGetString (attr, i, NULL));
}
attr = ippFindAttribute (response, "requesting-user-name-denied", IPP_TAG_NAME);
- if (attr && attr->num_values > 0)
+ if (attr && ippGetCount (attr) > 0)
{
- users_denied = g_new0 (gchar *, attr->num_values + 1);
- for (i = 0; i < attr->num_values; i++)
- users_denied[i] = g_strdup (attr->values[i].string.text);
+ users_denied = g_new0 (gchar *, ippGetCount (attr) + 1);
+ for (i = 0; i < ippGetCount (attr); i++)
+ users_denied[i] = g_strdup (ippGetString (attr, i, NULL));
}
attr = ippFindAttribute (response, "member-names", IPP_TAG_NAME);
- if (attr && attr->num_values > 0)
+ if (attr && ippGetCount (attr) > 0)
{
- member_names = g_new0 (gchar *, attr->num_values + 1);
- for (i = 0; i < attr->num_values; i++)
- member_names[i] = g_strdup (attr->values[i].string.text);
+ member_names = g_new0 (gchar *, ippGetCount (attr) + 1);
+ for (i = 0; i < ippGetCount (attr); i++)
+ member_names[i] = g_strdup (ippGetString (attr, i, NULL));
}
}
ippDelete (response);

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.77 2012/06/15 08:30:20 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.78 2012/08/04 14:50:19 ajacoutot Exp $
SHARED_ONLY= Yes
@ -6,7 +6,7 @@ COMMENT= GNOME settings daemon
GNOME_PROJECT= gnome-settings-daemon
GNOME_VERSION= 3.4.2
REVISION= 1
REVISION= 2
# GPLv3
PERMIT_PACKAGE_CDROM= Yes
@ -34,8 +34,8 @@ LIB_DEPENDS= devel/libnotify>=0.7.2 \
x11/gnome/desktop \
x11/gnome/libgnomekbd \
security/nss \
print/cups \
audio/pulseaudio>=2.0 \
print/cups,-libs \
audio/pulseaudio \
audio/libcanberra,-gtk3 \
sysutils/upower \
graphics/colord

View File

@ -0,0 +1,51 @@
$OpenBSD: patch-plugins_print-notifications_gsd-print-notifications-manager_c,v 1.1 2012/08/04 14:50:19 ajacoutot Exp $
https://bugzilla.gnome.org/show_bug.cgi?id=679761
--- plugins/print-notifications/gsd-print-notifications-manager.c.orig Tue May 15 12:14:49 2012
+++ plugins/print-notifications/gsd-print-notifications-manager.c Sat Jul 28 17:49:19 2012
@@ -52,6 +52,16 @@
#define CONNECTING_TIMEOUT 60
#define REASON_TIMEOUT 15000
+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
+#define HAVE_CUPS_1_6 1
+#endif
+
+#ifndef HAVE_CUPS_1_6
+#define ippGetStatusCode(ipp) ipp->request.status.status_code
+#define ippGetInteger(attr, element) attr->values[element].integer
+#define ippGetString(attr, element, language) attr->values[element].string.text
+#endif
+
struct GsdPrintNotificationsManagerPrivate
{
GDBusProxy *cups_proxy;
@@ -396,10 +406,10 @@ on_cups_notification (GDBusConnection *connection,
response = cupsDoRequest (http, request, "/");
if (response) {
- if (response->request.status.status_code <= IPP_OK_CONFLICT &&
+ if (ippGetStatusCode (response) <= IPP_OK_CONFLICT &&
(attr = ippFindAttribute(response, "job-originating-user-name",
IPP_TAG_NAME))) {
- if (g_strcmp0 (attr->values[0].string.text, cupsUser ()) == 0)
+ if (g_strcmp0 (ippGetString (attr, 0, NULL), cupsUser ()) == 0)
my_job = TRUE;
}
ippDelete(response);
@@ -889,12 +899,12 @@ renew_subscription (gpointer data)
"notify-lease-duration", SUBSCRIPTION_DURATION);
response = cupsDoRequest (http, request, "/");
- if (response != NULL && response->request.status.status_code <= IPP_OK_CONFLICT) {
+ if (response != NULL && ippGetStatusCode (response) <= IPP_OK_CONFLICT) {
if ((attr = ippFindAttribute (response, "notify-subscription-id",
IPP_TAG_INTEGER)) == NULL)
g_debug ("No notify-subscription-id in response!\n");
else
- manager->priv->subscription_id = attr->values[0].integer;
+ manager->priv->subscription_id = ippGetInteger (attr, 0);
}
if (response)

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-plugins_print-notifications_gsd-printer_c,v 1.4 2012/08/04 14:50:19 ajacoutot Exp $
https://bugzilla.gnome.org/show_bug.cgi?id=679761
--- plugins/print-notifications/gsd-printer.c.orig Mon Apr 16 14:34:43 2012
+++ plugins/print-notifications/gsd-printer.c Sat Jul 28 17:49:19 2012
@@ -63,6 +63,14 @@ static GDBusNodeInfo *pdi_introspection_data = NULL;
#define GNOME_SESSION_PRESENCE_DBUS_PATH "/org/gnome/SessionManager/Presence"
#define GNOME_SESSION_PRESENCE_DBUS_IFACE "org.gnome.SessionManager.Presence"
+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
+#define HAVE_CUPS_1_6 1
+#endif
+
+#ifndef HAVE_CUPS_1_6
+#define ippGetState(ipp) ipp->state
+#endif
+
enum {
PRESENCE_STATUS_AVAILABLE = 0,
PRESENCE_STATUS_INVISIBLE,
@@ -725,7 +733,7 @@ printer_autoconfigure (gchar *printer_name)
"AutoConfigure",
("Automatic configuration"));
if (response) {
- if (response->state == IPP_ERROR)
+ if (ippGetState (response) == IPP_ERROR)
g_warning ("An error has occured during automatic configuration of new printer.");
ippDelete (response);
}

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.32 2012/06/15 08:30:25 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.33 2012/08/04 14:48:18 ajacoutot Exp $
COMMENT= Xfce4 printing helper
XFCE_PROJECT= xfprint
XFCE_VERSION= 4.6.1
REVISION= 15
REVISION= 16
MASTER_SITES= http://archive.xfce.org/src/archive/${XFCE_PROJECT}/${XFCE_BRANCH}/
SHARED_LIBS= xfprint 0.1
@ -27,7 +27,7 @@ RUN_DEPENDS= print/a2ps
LIB_DEPENDS= x11/xfce4/libxfcegui4 \
x11/xfce4/xfconf \
print/cups
print/cups,-libs
WANTLIB += GL ICE SM X11 X11-xcb Xau Xcomposite Xcursor Xdamage
WANTLIB += Xdmcp Xext Xfixes Xi Xinerama Xrandr Xrender Xxf86vm
@ -36,7 +36,7 @@ WANTLIB += drm expat ffi fontconfig freetype gdk-x11-2.0 gdk_pixbuf-2.0
WANTLIB += gio-2.0 glib-2.0 gmodule-2.0 gobject-2.0 gssapi gthread-2.0
WANTLIB += gtk-x11-2.0 krb5 m pango-1.0 pangocairo-1.0 pangoft2-1.0
WANTLIB += pcre pixman-1 png pthread pthread-stubs ssl startup-notification-1
WANTLIB += xcb xcb-aux xcb-render xcb-shm xfce4util xfcegui4 xfconf-0
WANTLIB += z
WANTLIB += stdc++ xcb xcb-aux xcb-render xcb-shm xfce4util xfcegui4
WANTLIB += xfconf-0 z
.include <bsd.port.mk>

View File

@ -0,0 +1,56 @@
$OpenBSD: patch-printing-systems_cups_cups_c,v 1.1 2012/08/04 14:48:18 ajacoutot Exp $
Fix build with cups >= 1.6.0
--- printing-systems/cups/cups.c.orig Tue Feb 24 22:34:16 2009
+++ printing-systems/cups/cups.c Mon Jul 30 14:11:22 2012
@@ -133,8 +133,8 @@ cups_request_new (int operation_id)
language = cupsLangDefault ();
request = ippNew ();
- request->request.op.operation_id = operation_id;
- request->request.op.request_id = 1;
+ ippSetOperation(request, operation_id);
+ ippSetRequestId(request, 1);
ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8");
@@ -242,24 +242,24 @@ get_printers ()
if (!request)
continue;
- if (request->state == IPP_ERROR || request->state == IPP_IDLE) {
+ if (ippGetState (request) == IPP_ERROR || ippGetState (request) == IPP_IDLE) {
ippDelete (request);
continue;
}
attr = ippFindAttribute (request, "printer-info", IPP_TAG_TEXT);
- if (!attr || strlen (attr->values[0].string.text) == 0) {
+ if (!attr || strlen (ippGetString (attr, 0, NULL)) == 0) {
attr = ippFindAttribute (request, "printer-make-and-model", IPP_TAG_TEXT);
if (attr)
- printer->alias = g_strdup (attr->values[0].string.text);
+ printer->alias = g_strdup (ippGetString (attr, 0, NULL));
else
printer->alias = g_strdup ("");
}
else
- printer->alias = g_strdup (attr->values[0].string.text);
+ printer->alias = g_strdup (ippGetString (attr, 0, NULL));
attr = ippFindAttribute (request, "printer-type", IPP_TAG_ENUM);
- if (attr && (attr->values[0].integer & CUPS_PRINTER_CLASS))
+ if (attr && (ippGetInteger (attr, 0) & CUPS_PRINTER_CLASS))
printer->type = PRINTER_TYPE_CLASS;
else
printer->type = PRINTER_TYPE_PRINTER;
@@ -309,7 +309,7 @@ get_printer_state (const gchar * printer)
ipp_attribute_t *attr = ippFindAttribute (request, "printer-state",
IPP_TAG_ENUM);
if (attr)
- switch (attr->values[0].integer) {
+ switch (ippGetInteger (attr, 0)) {
case IPP_PRINTER_IDLE:
state = PRINTER_STATE_IDLE;
break;