summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBehnam Momeni2020-01-27 00:06:04 +0330
committerBehnam Momeni2020-01-27 00:06:04 +0330
commit7c0ec3b065eb7b7867b210f00eaa7bf268c997db (patch)
treeef9e1057204f9a5f1e8968e406abd647412c1ef5
parent0b55b1cddc5e347be90091784094ea1b8df8ebe4 (diff)
downloadaur-7c0ec3b065eb7b7867b210f00eaa7bf268c997db.tar.gz
Patching cngpijmon for new cups API
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD10
-rw-r--r--cups.patch288
3 files changed, 283 insertions, 23 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 00be6b93232..2fd473b9e8b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Thu Jun 2 06:08:43 UTC 2016
+# Sun Jan 26 20:35:48 UTC 2020
pkgbase = cnijfilter-mx920
pkgdesc = Canon IJ printer driver (multifunction MX920 series)
pkgver = 3.90
- pkgrel = 2
+ pkgrel = 3
url = http://www.canon-europe.com/support/consumer_Products/products/fax__multifunctionals/inkjet/pixma_mx_series/mx925.aspx
install = cnijfilter-mx920.install
arch = i686
@@ -11,15 +11,13 @@ pkgbase = cnijfilter-mx920
license = custom
makedepends = autoconf>=2.13
makedepends = automake>=1.6
- makedepends = tar
- makedepends = make
depends = cnijfilter-common=4.10
source = http://gdlp01.c-wss.com/gds/1/0100005171/01/cnijfilter-source-3.90-1.tar.gz
source = cups.patch
source = buildfiles.patch
source = mychanges.patch
sha512sums = 9ec303dc7209f5534a20e533fc18ec810603f4515655ce67f28f0f35d521185181351fd866d2191939eb02c783b168f637e18888a4e6a1eacc9e93b1b656ebcb
- sha512sums = b46027090fc03f1b6503b4532881dfb49bf69eff342d4eedca6ed8e39f896de0ff8f8c5ae3dc8e9b5645a3dd1029390668a48737ce01d58d1b01b899fad56b4c
+ sha512sums = da39232c83aff4ec09428ab0e2a167638c6912578c0bd119b8c15aa0d7e4412c18339cc3fd09a5ce76763338a92cd129548fa41ada842340e8ca0db6860eff42
sha512sums = d827f8725e899cbeeae883141c55c3c1429797ceb3eaa2d11a1ab6602b4221e120f92fdee7d3ffc08cf99692332b73cb9e1da6b8d5631df3a8071dffbfde799e
sha512sums = 1cf54862db74f928a3a1ad0316b9940b843dbc4cae95bbb3d93ab317d248788cf844103bc006b4670c27b0f13952301b5907476a6c7d13ebb0cb5c0a942d6182
depends_i686 = gtk2
diff --git a/PKGBUILD b/PKGBUILD
index ad810dee93e..2e300044235 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,11 +3,11 @@
# Contributor: Behnam Momeni <sbmomeni [at the] gmail [dot] com>
# Contributor: Stefan Hackl <stef.hackl [at the] gmail [dot] com>
-pkgname=('cnijfilter-mx920')
+pkgname=cnijfilter-mx920
_pkgname=cnijfilter
pkgver=3.90
-pkgrel=2
+pkgrel=3
_pkgreview=1
pkgdesc="Canon IJ printer driver (multifunction MX920 series)"
@@ -22,7 +22,7 @@ depends_x86_64=('lib32-gtk2')
makedepends_i686=('gcc')
depends_i686=('gtk2')
-makedepends=('autoconf>=2.13' 'automake>=1.6' 'tar' 'make')
+makedepends=('autoconf>=2.13' 'automake>=1.6')
depends=("${_pkgname}-common=4.10")
install=cnijfilter-mx920.install
@@ -32,13 +32,11 @@ source=("http://gdlp01.c-wss.com/gds/1/0100005171/01/cnijfilter-source-3.90-1.ta
"buildfiles.patch"
"mychanges.patch")
sha512sums=('9ec303dc7209f5534a20e533fc18ec810603f4515655ce67f28f0f35d521185181351fd866d2191939eb02c783b168f637e18888a4e6a1eacc9e93b1b656ebcb'
- 'b46027090fc03f1b6503b4532881dfb49bf69eff342d4eedca6ed8e39f896de0ff8f8c5ae3dc8e9b5645a3dd1029390668a48737ce01d58d1b01b899fad56b4c'
+ 'da39232c83aff4ec09428ab0e2a167638c6912578c0bd119b8c15aa0d7e4412c18339cc3fd09a5ce76763338a92cd129548fa41ada842340e8ca0db6860eff42'
'd827f8725e899cbeeae883141c55c3c1429797ceb3eaa2d11a1ab6602b4221e120f92fdee7d3ffc08cf99692332b73cb9e1da6b8d5631df3a8071dffbfde799e'
'1cf54862db74f928a3a1ad0316b9940b843dbc4cae95bbb3d93ab317d248788cf844103bc006b4670c27b0f13952301b5907476a6c7d13ebb0cb5c0a942d6182')
prepare() {
- cd ${srcdir}
- tar xzf ${_pkgname}-source-${pkgver}-${_pkgreview}.tar.gz
cd ${srcdir}/${_pkgname}-source-${pkgver}-${_pkgreview}
patch -p1 -i ${srcdir}/cups.patch
diff --git a/cups.patch b/cups.patch
index 1480fc00e0f..9693a2b2e31 100644
--- a/cups.patch
+++ b/cups.patch
@@ -20,16 +20,280 @@ diff -Nur cnijfilter-source-3.20-1.orig/cngpij/cngpij/bjcups.c cnijfilter-source
#include <cups/cups.h>
#include <cups/language.h>
#include <cups/ppd.h>
-diff -Nur cnijfilter-source-3.20-1.orig/cngpijmon/src/bjcupsmon_cups.c cnijfilter-source-3.20-1/cngpijmon/src/bjcupsmon_cups.c
---- cnijfilter-source-3.20-1.orig/cngpijmon/src/bjcupsmon_cups.c 2009-04-24 08:12:49.000000000 +0200
-+++ cnijfilter-source-3.20-1/cngpijmon/src/bjcupsmon_cups.c 2012-08-15 15:28:54.618141976 +0200
-@@ -18,8 +18,9 @@
- */
+diff -Nur cnijfilter-source-3.90-1.orig/cngpijmon/src/bjcupsmon_cups.c cnijfilter-source-3.90-1/cngpijmon/src/bjcupsmon_cups.c
+--- cnijfilter-source-3.90-1.orig/cngpijmon/src/bjcupsmon_cups.c 2012-10-02 08:59:31.000000000 +0330
++++ cnijfilter-source-3.90-1/cngpijmon/src/bjcupsmon_cups.c 2020-01-26 23:59:44.324580174 +0330
+@@ -213,24 +213,17 @@
+ retVal = ID_ERR_CUPS_API_FAILED;
+ }
+ else {
+- pRequest = ippNew();
++ pRequest = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
+
+- pRequest->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES;
+- pRequest->request.op.request_id = 1;
+-
+- pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19
+-
+- ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, cupsLangEncoding(pLanguage));
+- ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, pLanguage->language);
+ ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, pURI);
- /*** Includes ***/
-+#define _IPP_PRIVATE_STRUCTURES 1
- #include <cups/cups.h>
- #include <cups/ppd.h>
- #include <cups/language.h>
- #include <sys/types.h>
- #include <unistd.h>
+ if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) {
+- if (pResponse->request.status.status_code > IPP_OK_CONFLICT) {
++ if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) {
+ retVal = ID_ERR_CUPS_API_FAILED;
+ }
+ else {
+ if ((pAttribute = ippFindAttribute(pResponse, "printer-state", IPP_TAG_ENUM)) != NULL) {
+- printerState = (ipp_state_t)pAttribute->values[0].integer;
++ printerState = ippGetInteger(pAttribute, 0);
+ }
+ }
+
+@@ -286,19 +279,12 @@
+ retVal = ID_ERR_CUPS_API_FAILED;
+ }
+ else {
+- pRequest = ippNew();
+-
+- pRequest->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES;
+- pRequest->request.op.request_id = 1;
+-
+- pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19
++ pRequest = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
+
+- ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, cupsLangEncoding(pLanguage));
+- ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, pLanguage->language);
+ ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printerURI);
+
+ if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) {
+- if (pResponse->request.status.status_code > IPP_OK_CONFLICT) {
++ if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) {
+ retVal = ID_ERR_CUPS_API_FAILED;
+ }
+ else {
+@@ -310,7 +296,7 @@
+ //}
+ pAttribute = ippFindAttribute(pResponse, "printer-state-message", IPP_TAG_TEXT);
+ if (pAttribute != NULL) {
+- strncpy(pStatus, pAttribute->values[0].string.text, bufSize);
++ strncpy(pStatus, ippGetString(pAttribute, 0, NULL), bufSize);
+ }
+ }
+ ippDelete(pResponse);
+@@ -367,21 +353,14 @@
+ retVal = ID_ERR_CUPS_API_FAILED;
+ }
+ else {
+- pRequest = ippNew();
++ pRequest = ippNewRequest(IPP_CANCEL_JOB);
+
+- pRequest->request.op.operation_id = IPP_CANCEL_JOB;
+- pRequest->request.op.request_id = 1;
+-
+- pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19
+-
+- ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, cupsLangEncoding(pLanguage));
+- ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, pLanguage->language);
+ ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printerURI);
+ ippAddInteger(pRequest, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id", jobID);
+ ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser());
+
+ if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/jobs/")) != NULL) {
+- if (pResponse->request.status.status_code > IPP_OK_CONFLICT) {
++ if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) {
+ retVal = ID_ERR_CUPS_API_FAILED;
+ }
+ ippDelete(pResponse);
+@@ -442,45 +421,38 @@
+ retVal = ID_ERR_CUPS_API_FAILED;
+ }
+ else {
+- pRequest = ippNew();
+-
+- pRequest->request.op.operation_id = IPP_GET_JOBS;
+- pRequest->request.op.request_id = 1;
++ pRequest = ippNewRequest(IPP_GET_JOBS);
+
+- pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19
+-
+- ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, cupsLangEncoding(pLanguage));
+- ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, pLanguage->language);
+ ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, pURI);
+ //for CUPS 1.4.3 STR #3383
+ ippAddStrings(pRequest, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes",(int)(sizeof(jobattrs) / sizeof(jobattrs[0])), NULL, jobattrs);
+
+ if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) {
+- if (pResponse->request.status.status_code > IPP_OK_CONFLICT) {
++ if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) {
+ retVal = ID_ERR_CUPS_API_FAILED;
+ }
+ else {
+- pAttribute = pResponse->attrs;
++ pAttribute = ippFirstAttribute(pResponse);
+
+ while (pAttribute != NULL) {
+- while (pAttribute != NULL && pAttribute->group_tag != IPP_TAG_JOB) {
+- pAttribute = pAttribute->next;
++ while (pAttribute != NULL && ippGetGroupTag(pAttribute) != IPP_TAG_JOB) {
++ pAttribute = ippNextAttribute(pResponse);
+ }
+ if (pAttribute == NULL) {
+ break;
+ }
+
+- while (pAttribute != NULL && pAttribute->group_tag == IPP_TAG_JOB) {
+- if (strcmp(pAttribute->name, "job-id") == 0 && pAttribute->value_tag == IPP_TAG_INTEGER) {
+- jobID = pAttribute->values[0].integer;
++ while (pAttribute != NULL && ippGetGroupTag(pAttribute) == IPP_TAG_JOB) {
++ if (strcmp(ippGetName(pAttribute), "job-id") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_INTEGER) {
++ jobID = ippGetInteger(pAttribute, 0);
+ }
+- if (strcmp(pAttribute->name, "job-state") == 0 && pAttribute->value_tag == IPP_TAG_ENUM) {
+- jobState = (ipp_jstate_t)pAttribute->values[0].integer;
++ if (strcmp(ippGetName(pAttribute), "job-state") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_ENUM) {
++ jobState = ippGetInteger(pAttribute, 0);
+ }
+- if (strcmp(pAttribute->name, "job-originating-user-name") == 0 && pAttribute->value_tag == IPP_TAG_NAME) {
+- pJobUserName = pAttribute->values[0].string.text;
++ if (strcmp(ippGetName(pAttribute), "job-originating-user-name") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_NAME) {
++ pJobUserName = ippGetString(pAttribute, 0, NULL);
+ }
+- pAttribute = pAttribute->next;
++ pAttribute = ippNextAttribute(pResponse);
+ }
+ if (jobState == IPP_JOB_PROCESSING) {
+ if (pJobUserName != NULL) {
+@@ -497,7 +469,7 @@
+ }
+
+ if (pAttribute != NULL)
+- pAttribute = pAttribute->next;
++ pAttribute = ippNextAttribute(pResponse);
+ }
+ }
+
+@@ -553,40 +525,33 @@
+ retVal = ID_ERR_CUPS_API_FAILED;
+ }
+ else {
+- pRequest = ippNew();
+-
+- pRequest->request.op.operation_id = CUPS_GET_PRINTERS;
+- pRequest->request.op.request_id = 1;
++ pRequest = ippNewRequest(CUPS_GET_PRINTERS);
+
+- pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19
+-
+- ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, cupsLangEncoding(pLanguage));
+- ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, pLanguage->language);
+ ippAddStrings(pRequest, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", sizeof(attributes) / sizeof(attributes[0]), NULL, attributes);
+
+ if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) {
+- if (pResponse->request.status.status_code > IPP_OK_CONFLICT) {
++ if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) {
+ retVal = ID_ERR_CUPS_API_FAILED;
+ }
+ else {
+- pAttribute = pResponse->attrs;
++ pAttribute = ippFirstAttribute(pResponse);
+
+ while (pAttribute != NULL) {
+- while (pAttribute != NULL && pAttribute->group_tag != IPP_TAG_PRINTER) {
+- pAttribute = pAttribute->next;
++ while (pAttribute != NULL && ippGetGroupTag(pAttribute != IPP_TAG_PRINTER)) {
++ pAttribute = ippNextAttribute(pResponse);
+ }
+ if (pAttribute == NULL) {
+ break;
+ }
+
+- while (pAttribute != NULL && pAttribute->group_tag == IPP_TAG_PRINTER) {
+- if (strcmp(pAttribute->name, "printer-name") == 0 && pAttribute->value_tag == IPP_TAG_NAME) {
+- pPrinter = pAttribute->values[0].string.text;
++ while (pAttribute != NULL && ippGetGroupTag(pAttribute) == IPP_TAG_PRINTER) {
++ if (strcmp(ippGetName(pAttribute), "printer-name") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_NAME) {
++ pPrinter = ippGetString(pAttribute, 0, NULL);
+ }
+- if (strcmp(pAttribute->name, "printer-uri-supported") == 0 && pAttribute->value_tag == IPP_TAG_URI) {
+- pUri = pAttribute->values[0].string.text;
++ if (strcmp(ippGetName(pAttribute), "printer-uri-supported") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_URI) {
++ pUri = ippGetString(pAttribute, 0, NULL);
+ }
+- pAttribute = pAttribute->next;
++ pAttribute = ippNextAttribute(pResponse);
+ }
+
+ // Tora 020418: Compare two printer names ignoring the character case.
+@@ -603,7 +568,7 @@
+ }
+
+ if (pAttribute != NULL)
+- pAttribute = pAttribute->next;
++ pAttribute = ippNextAttribute(pResponse);
+ }
+ }
+
+@@ -656,40 +621,33 @@
+ retVal = ID_ERR_CUPS_API_FAILED;
+ }
+ else {
+- pRequest = ippNew();
+-
+- pRequest->request.op.operation_id = CUPS_GET_PRINTERS;
+- pRequest->request.op.request_id = 1;
+-
+- pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19
+-
+- ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, cupsLangEncoding(pLanguage));
+- ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, pLanguage->language);
++ pRequest = ippNewRequest(CUPS_GET_PRINTERS);
++
+ ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, NULL);
+
+ if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) {
+- if (pResponse->request.status.status_code > IPP_OK_CONFLICT) {
++ if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) {
+ retVal = ID_ERR_CUPS_API_FAILED;
+ }
+ else {
+- pAttribute = pResponse->attrs;
++ pAttribute = ippFirstAttribute(pResponse);
+
+ while (pAttribute != NULL) {
+- while (pAttribute != NULL && pAttribute->group_tag != IPP_TAG_PRINTER) {
+- pAttribute = pAttribute->next;
++ while (pAttribute != NULL && ippGetGroupTag(pAttribute) != IPP_TAG_PRINTER) {
++ pAttribute = ippNextAttribute(pResponse);
+ }
+ if (pAttribute == NULL) {
+ break;
+ }
+
+- while (pAttribute != NULL && pAttribute->group_tag == IPP_TAG_PRINTER) {
+- if (strcmp(pAttribute->name, "printer-name") == 0 && pAttribute->value_tag == IPP_TAG_NAME) {
+- pPrinter = pAttribute->values[0].string.text;
++ while (pAttribute != NULL && ippGetGroupTag(pAttribute) == IPP_TAG_PRINTER) {
++ if (strcmp(ippGetName(pAttribute), "printer-name") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_NAME) {
++ pPrinter = ippGetString(pAttribute, 0, NULL);
+ }
+- if (strcmp(pAttribute->name, "device-uri") == 0 && pAttribute->value_tag == IPP_TAG_URI) {
+- pDUri = pAttribute->values[0].string.text;
++ if (strcmp(ippGetName(pAttribute), "device-uri") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_URI) {
++ pDUri = ippGetString(pAttribute, 0, NULL);
+ }
+- pAttribute = pAttribute->next;
++ pAttribute = ippNextAttribute(pResponse);
+ }
+
+ if (strcasecmp(pDestName, pPrinter) == 0) {
+@@ -698,7 +656,7 @@
+ }
+
+ if (pAttribute != NULL)
+- pAttribute = pAttribute->next;
++ pAttribute = ippNextAttribute(pResponse);
+ }
+ }
+