gnome2.libgnomecups: remove

Unmaintained and no package depends on it.

+1 -345
+1 -2
pkgs/desktops/gnome-2/default.nix
··· 14 14 15 15 libglade = callPackage ./platform/libglade { }; 16 16 17 - libgnomecups = callPackage ./platform/libgnomecups { }; 18 - 19 17 libgtkhtml = callPackage ./platform/libgtkhtml { }; 20 18 21 19 GConf = callPackage ./platform/GConf { }; ··· 76 74 gnome_python = throw "gnome2.gnome_python has been removed"; # 2023-01-14 77 75 gnome_python_desktop = throw "gnome2.gnome_python_desktop has been removed"; # 2023-01-14 78 76 libglademm = throw "gnome2.libglademm has been removed"; # 2022-01-15 77 + libgnomecups = throw "gnome2.libgnomecups has been removed"; # 2023-01-15 79 78 libgnomeprint = throw "gnome2.libgnomeprint has been removed"; # 2023-01-15 80 79 libgnomeprintui = throw "gnome2.libgnomeprintui has been removed"; # 2023-01-15 81 80 python_rsvg = throw "gnome2.python_rsvg has been removed"; # 2023-01-14
-285
pkgs/desktops/gnome-2/platform/libgnomecups/cups_1.6.patch
··· 1 - From ae783efde4fa69578651994505462f02b8639220 Mon Sep 17 00:00:00 2001 2 - From: Alexandre Rostovtsev <tetromino@gentoo.org> 3 - Date: Tue, 7 Aug 2012 06:53:09 -0400 4 - Subject: [PATCH] Use CUPS-1.6 IPP API getter/setter functions 5 - 6 - CUPS 1.6 makes various structures private and introduces these ippGet 7 - and ippSet functions for all of the fields in these structures. 8 - http://www.cups.org/str.php?L3928 9 - 10 - We define our own accessors when building against CUPS < 1.6. 11 - 12 - Based on work by Jiri Popelka <jpopelka@redhat.com> at 13 - https://bugzilla.gnome.org/show_bug.cgi?id=679759 14 - --- 15 - libgnomecups/gnome-cups-printer.c | 48 +++++++++++++++++++++++++++++------- 16 - libgnomecups/gnome-cups-queue.c | 43 +++++++++++++++++++++++++++------ 17 - libgnomecups/gnome-cups-request.c | 44 ++++++++++++++++++++++++++++----- 18 - 3 files changed, 110 insertions(+), 25 deletions(-) 19 - 20 - diff --git a/libgnomecups/gnome-cups-printer.c b/libgnomecups/gnome-cups-printer.c 21 - index c924af0..f5e1ef7 100644 22 - --- a/libgnomecups/gnome-cups-printer.c 23 - +++ b/libgnomecups/gnome-cups-printer.c 24 - @@ -37,6 +37,34 @@ 25 - 26 - #define UPDATE_TIMEOUT 5000 27 - 28 - +#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) 29 - +#define HAVE_CUPS_1_6 1 30 - +#endif 31 - + 32 - +#ifndef HAVE_CUPS_1_6 33 - +#define ippGetCount(attr) attr->num_values 34 - +#define ippGetName(attr) attr->name 35 - +#define ippGetInteger(attr, element) attr->values[element].integer 36 - +#define ippGetString(attr, element, language) attr->values[element].string.text 37 - + 38 - +static ipp_attribute_t * 39 - +ippFirstAttribute(ipp_t *ipp) 40 - +{ 41 - + if (!ipp) 42 - + return (NULL); 43 - + return (ipp->current = ipp->attrs); 44 - +} 45 - + 46 - +static ipp_attribute_t * 47 - +ippNextAttribute(ipp_t *ipp) 48 - +{ 49 - + if (!ipp || !ipp->current) 50 - + return (NULL); 51 - + return (ipp->current = ipp->current->next); 52 - +} 53 - +#endif 54 - + 55 - + 56 - struct _GnomeCupsPPDFile { 57 - char name[1]; 58 - }; 59 - @@ -173,9 +201,9 @@ map_reasons (GnomeCupsPrinter *printer, 60 - printer->details->state_reasons = NULL; 61 - 62 - /* cf. RFC2911 4.4.12 */ 63 - - for (i = 0; i < attr->num_values; i++) { 64 - + for (i = 0; i < ippGetCount (attr); i++) { 65 - const char *p; 66 - - const char *keyword = attr->values [i].string.text; 67 - + const char *keyword = ippGetString (attr, i, NULL); 68 - 69 - reason = g_new (GnomeCupsPrinterReason, 1); 70 - 71 - @@ -224,8 +252,8 @@ gnome_cups_printer_get_info (GnomeCupsPrinter *printer) 72 - return printer->details->info; 73 - } 74 - 75 - -#define MAP_INT(v,a) {if (!g_ascii_strcasecmp (attr->name, (a))) { if ((v) != attr->values[0].integer) { changed = TRUE; } (v) = attr->values[0].integer; }} 76 - -#define MAP_STRING(v,a) {if (!g_ascii_strcasecmp (attr->name, (a))) { if (!v || strcmp (v, attr->values[0].string.text)) { g_free (v); changed = TRUE; (v) = g_strdup (attr->values[0].string.text); }}} 77 - +#define MAP_INT(v,a) {if (!g_ascii_strcasecmp (ippGetName (attr), (a))) { if ((v) != ippGetInteger (attr, 0)) { changed = TRUE; } (v) = ippGetInteger (attr, 0); }} 78 - +#define MAP_STRING(v,a) {if (!g_ascii_strcasecmp (ippGetName (attr), (a))) { if (!v || strcmp (v, ippGetString (attr, 0, NULL))) { g_free (v); changed = TRUE; (v) = g_strdup (ippGetString (attr, 0, NULL)); }}} 79 - 80 - static void 81 - attributes_update_cb (guint id, 82 - @@ -243,14 +271,14 @@ attributes_update_cb (guint id, 83 - changed = FALSE; 84 - 85 - if (!error && response) { 86 - - for (attr = response->attrs; attr != NULL; attr = attr->next) { 87 - - if (!attr->name) { 88 - + for (attr = ippFirstAttribute (response); attr != NULL; attr = ippNextAttribute (response)) { 89 - + if (!ippGetName (attr)) { 90 - continue; 91 - } 92 - - if (!g_ascii_strcasecmp (attr->name, "attributes-charset") || !strcmp (attr->name, "attributes-charset")) { 93 - + if (!g_ascii_strcasecmp (ippGetName (attr), "attributes-charset") || !strcmp (ippGetName (attr), "attributes-charset")) { 94 - continue; 95 - } 96 - - if (!g_ascii_strcasecmp (attr->name, "printer-state-reasons")) { 97 - + if (!g_ascii_strcasecmp (ippGetName (attr), "printer-state-reasons")) { 98 - map_reasons (printer, attr); 99 - } 100 - MAP_INT (printer->details->state, "printer-state"); 101 - @@ -570,7 +598,7 @@ get_default (void) 102 - 103 - attr = ippFindAttribute (response, "printer-name", IPP_TAG_NAME); 104 - if (attr) { 105 - - name = g_strdup (attr->values[0].string.text); 106 - + name = g_strdup (ippGetString (attr, 0, NULL)); 107 - } else { 108 - name = NULL; 109 - } 110 - @@ -698,7 +726,7 @@ get_printer_names (void) 111 - attr = ippFindAttribute (response, "printer-name", IPP_TAG_NAME); 112 - while (attr) { 113 - ret = g_list_prepend (ret, 114 - - g_strdup (attr->values[0].string.text)); 115 - + g_strdup (ippGetString (attr, 0, NULL))); 116 - 117 - attr = ippFindNextAttribute (response, 118 - "printer-name", 119 - diff --git a/libgnomecups/gnome-cups-queue.c b/libgnomecups/gnome-cups-queue.c 120 - index 9f98ed9..298db42 100644 121 - --- a/libgnomecups/gnome-cups-queue.c 122 - +++ b/libgnomecups/gnome-cups-queue.c 123 - @@ -15,6 +15,33 @@ 124 - 125 - #define UPDATE_TIMEOUT 3000 126 - 127 - +#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) 128 - +#define HAVE_CUPS_1_6 1 129 - +#endif 130 - + 131 - +#ifndef HAVE_CUPS_1_6 132 - +#define ippGetName(attr) attr->name 133 - +#define ippGetInteger(attr, element) attr->values[element].integer 134 - +#define ippGetString(attr, element, language) attr->values[element].string.text 135 - + 136 - +static ipp_attribute_t * 137 - +ippFirstAttribute(ipp_t *ipp) 138 - +{ 139 - + if (!ipp) 140 - + return (NULL); 141 - + return (ipp->current = ipp->attrs); 142 - +} 143 - + 144 - +static ipp_attribute_t * 145 - +ippNextAttribute(ipp_t *ipp) 146 - +{ 147 - + if (!ipp || !ipp->current) 148 - + return (NULL); 149 - + return (ipp->current = ipp->current->next); 150 - +} 151 - +#endif 152 - + 153 - + 154 - struct _GnomeCupsQueueDetails { 155 - char *queue_name; 156 - GList *jobs; 157 - @@ -199,8 +226,8 @@ finish_job (GnomeCupsJob *job) 158 - job->size = job->size * 1024; 159 - } 160 - 161 - -#define MAP_STR(dest, src) { if (!g_ascii_strcasecmp (attr->name, (src))) { if ((dest) != NULL) g_free (dest); (dest) = g_strdup (attr->values[0].string.text);}} 162 - -#define MAP_INT(dest, src) { if (!g_ascii_strcasecmp (attr->name, (src))) { (dest) = attr->values[0].integer; } } 163 - +#define MAP_STR(dest, src) { if (!g_ascii_strcasecmp (ippGetName (attr), (src))) { if ((dest) != NULL) g_free (dest); (dest) = g_strdup (ippGetString (attr, 0, NULL));}} 164 - +#define MAP_INT(dest, src) { if (!g_ascii_strcasecmp (ippGetName (attr), (src))) { (dest) = ippGetInteger (attr, 0); } } 165 - 166 - static void 167 - get_jobs_cb (guint id, 168 - @@ -231,8 +258,8 @@ get_jobs_cb (guint id, 169 - 170 - if (response) { 171 - job = g_new0 (GnomeCupsJob, 1); 172 - - for (attr = response->attrs; attr != NULL; attr = attr->next) { 173 - - if (attr->name == NULL) { 174 - + for (attr = ippFirstAttribute (response); attr != NULL; attr = ippNextAttribute (response)) { 175 - + if (ippGetName (attr) == NULL) { 176 - if (job->name) { 177 - finish_job (job); 178 - jobs = g_list_prepend (jobs, job); 179 - @@ -244,7 +271,7 @@ get_jobs_cb (guint id, 180 - continue; 181 - } 182 - 183 - - if (!g_ascii_strcasecmp (attr->name, "attributes-charset") || !g_ascii_strcasecmp (attr->name, "attributes-charset")) { 184 - + if (!g_ascii_strcasecmp (ippGetName (attr), "attributes-charset") || !g_ascii_strcasecmp (ippGetName (attr), "attributes-charset")) { 185 - continue; 186 - 187 - } 188 - @@ -355,8 +382,8 @@ gnome_cups_queue_get_job_nocache (GnomeCupsQueue *queue, 189 - 190 - if (response) { 191 - job = g_new0 (GnomeCupsJob, 1); 192 - - for (attr = response->attrs; attr != NULL; attr = attr->next) { 193 - - if (attr->name == NULL) { 194 - + for (attr = ippFirstAttribute (response); attr != NULL; attr = ippNextAttribute (response)) { 195 - + if (ippGetName (attr) == NULL) { 196 - if (job->name) { 197 - finish_job (job); 198 - } else { 199 - @@ -366,7 +393,7 @@ gnome_cups_queue_get_job_nocache (GnomeCupsQueue *queue, 200 - break; 201 - } 202 - 203 - - if (!g_ascii_strcasecmp (attr->name, "attributes-charset") || !g_ascii_strcasecmp (attr->name, "attributes-charset")) { 204 - + if (!g_ascii_strcasecmp (ippGetName (attr), "attributes-charset") || !g_ascii_strcasecmp (ippGetName (attr), "attributes-charset")) { 205 - continue; 206 - } 207 - 208 - diff --git a/libgnomecups/gnome-cups-request.c b/libgnomecups/gnome-cups-request.c 209 - index c94f623..13f0948 100644 210 - --- a/libgnomecups/gnome-cups-request.c 211 - +++ b/libgnomecups/gnome-cups-request.c 212 - @@ -19,6 +19,36 @@ 213 - #define STOP_UNUSED_THREADS_TIMEOUT 60 214 - #define CLOSE_UNUSED_CONNECTIONS_TIMEOUT 30 215 - 216 - +#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) 217 - +#define HAVE_CUPS_1_6 1 218 - +#endif 219 - + 220 - +#ifndef HAVE_CUPS_1_6 221 - +#define ippGetCount(attr) attr->num_values 222 - +#define ippGetValueTag(attr) attr->value_tag 223 - +#define ippGetName(attr) attr->name 224 - +#define ippGetBoolean(attr, element) attr->values[element].boolean 225 - +#define ippGetInteger(attr, element) attr->values[element].integer 226 - +#define ippGetString(attr, element, language) attr->values[element].string.text 227 - + 228 - +static ipp_attribute_t * 229 - +ippFirstAttribute(ipp_t *ipp) 230 - +{ 231 - + if (!ipp) 232 - + return (NULL); 233 - + return (ipp->current = ipp->attrs); 234 - +} 235 - + 236 - +static ipp_attribute_t * 237 - +ippNextAttribute(ipp_t *ipp) 238 - +{ 239 - + if (!ipp || !ipp->current) 240 - + return (NULL); 241 - + return (ipp->current = ipp->current->next); 242 - +} 243 - +#endif 244 - + 245 - + 246 - typedef struct 247 - { 248 - GMutex *mutex; 249 - @@ -276,14 +306,14 @@ dump_request (ipp_t const *req) 250 - unsigned i; 251 - ipp_attribute_t *attr; 252 - 253 - - for (attr = req->attrs; attr != NULL; attr = attr->next) { 254 - - g_print ("%s", attr->name); 255 - - for (i = 0 ; i < attr->num_values ; i++) { 256 - + for (attr = ippFirstAttribute (req); attr != NULL; attr = ippNextAttribute (req)) { 257 - + g_print ("%s", ippGetName (attr)); 258 - + for (i = 0 ; i < ippGetCount (attr) ; i++) { 259 - g_print ("\t[%d] = ", i); 260 - - switch (attr->value_tag & ~IPP_TAG_COPY) { 261 - + switch (ippGetValueTag (attr) & ~IPP_TAG_COPY) { 262 - case IPP_TAG_INTEGER: 263 - case IPP_TAG_ENUM: 264 - - g_print ("%d\n", attr->values[i].integer); 265 - + g_print ("%d\n", ippGetInteger (attr, i)); 266 - break; 267 - 268 - case IPP_TAG_STRING: 269 - @@ -294,11 +324,11 @@ dump_request (ipp_t const *req) 270 - case IPP_TAG_CHARSET: 271 - case IPP_TAG_LANGUAGE: 272 - case IPP_TAG_MIMETYPE: 273 - - g_print ("'%s'\n", attr->values[i].string.text); 274 - + g_print ("'%s'\n", ippGetString (attr, i, NULL)); 275 - break; 276 - 277 - case IPP_TAG_BOOLEAN: 278 - - g_print ("%s\n", (int)attr->values[i].boolean ? "true" : "false"); 279 - + g_print ("%s\n", (int)ippGetBoolean (attr, i) ? "true" : "false"); 280 - break; 281 - 282 - default: 283 - -- 284 - 1.7.8.6 285 -
-20
pkgs/desktops/gnome-2/platform/libgnomecups/default.nix
··· 1 - { lib, stdenv, fetchurl, pkg-config, gtk2, gettext, libxml2, intltool, libart_lgpl }: 2 - 3 - stdenv.mkDerivation rec { 4 - pname = "libgnomecups"; 5 - version = "0.2.3"; 6 - 7 - src = fetchurl { 8 - url = "mirror://gnome/sources/libgnomecups/${lib.versions.majorMinor version}/libgnomecups-${version}.tar.bz2"; 9 - sha256 = "0a8xdaxzz2wc0n1fjcav65093gixzyac3948l8cxx1mk884yhc71"; 10 - }; 11 - 12 - hardeningDisable = [ "format" ]; 13 - 14 - patches = [ ./glib.patch ./cups_1.6.patch ]; 15 - 16 - nativeBuildInputs = [ pkg-config intltool ]; 17 - buildInputs = [ gtk2 gettext libart_lgpl ]; 18 - 19 - propagatedBuildInputs = [ libxml2 ]; 20 - }
-38
pkgs/desktops/gnome-2/platform/libgnomecups/glib.patch
··· 1 - From d84eee9450b3b6f6155074915efc61bedcc8d446 Mon Sep 17 00:00:00 2001 2 - From: Dominique Leuenberger <dimstar@opensuse.org> 3 - Date: Sun, 27 Nov 2011 21:36:41 +0100 4 - Subject: [PATCH] Fix: Only glib.h can be included 5 - 6 - --- 7 - libgnomecups/gnome-cups-i18n.c | 2 +- 8 - libgnomecups/gnome-cups-init.h | 3 +-- 9 - 2 files changed, 2 insertions(+), 3 deletions(-) 10 - 11 - diff --git a/libgnomecups/gnome-cups-i18n.c b/libgnomecups/gnome-cups-i18n.c 12 - index 8987c5c..127756d 100644 13 - --- a/libgnomecups/gnome-cups-i18n.c 14 - +++ b/libgnomecups/gnome-cups-i18n.c 15 - @@ -1,5 +1,5 @@ 16 - #include <config.h> 17 - -#include <glib/gmacros.h> 18 - +#include <glib.h> 19 - #include "gnome-cups-i18n.h" 20 - 21 - #ifdef ENABLE_NLS 22 - diff --git a/libgnomecups/gnome-cups-init.h b/libgnomecups/gnome-cups-init.h 23 - index 22b682a..c4600fc 100644 24 - --- a/libgnomecups/gnome-cups-init.h 25 - +++ b/libgnomecups/gnome-cups-init.h 26 - @@ -1,8 +1,7 @@ 27 - #ifndef GNOME_CUPS_INIT 28 - #define GNOME_CUPS_INIT 29 - 30 - -#include <glib/gtypes.h> 31 - -#include <glib/gmacros.h> 32 - +#include <glib.h> 33 - 34 - G_BEGIN_DECLS 35 - 36 - -- 37 - 1.7.7 38 -