diff options
author | Tony Lambiris | 2021-05-12 06:10:07 -0400 |
---|---|---|
committer | Tony Lambiris | 2021-05-12 06:10:07 -0400 |
commit | 93c596ee7c9f4f3f58b19843d8ca748298d40224 (patch) | |
tree | 00d660962ae6d619bb64b00abde61c4d41f02ebd | |
parent | 672936b235a77e0dc8c9ed835da34c901c86c003 (diff) | |
download | aur-93c596ee7c9f4f3f58b19843d8ca748298d40224.tar.gz |
Update build process, add fixes for latest cups
-rw-r--r-- | .SRCINFO | 14 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 130 | ||||
-rw-r--r-- | cups.patch | 349 |
4 files changed, 448 insertions, 50 deletions
@@ -1,8 +1,8 @@ pkgbase = cnijfilter-mx880 pkgdesc = Canon IJ Printer Driver for Pixma MX885 pkgver = 3.50_1 - pkgrel = 1 - url = http://software.canon-europe.com/software/0040869.asp + pkgrel = 2 + url = https://software.canon-europe.com/software/0040869.asp arch = i686 arch = x86_64 license = custom @@ -10,14 +10,14 @@ pkgbase = cnijfilter-mx880 depends = cups depends = ghostscript depends = popt - source = http://files.canon-europe.com/files/soft40869/software/cnijfilter-source-3.50-1.tar.gz + source = https://files.canon-europe.com/files/soft40869/software/cnijfilter-source-3.50-1.tar.gz source = cups.patch source = id.po.patch source = png.patch - md5sums = a900a47246c3d17d1ed5ed801ee29787 - md5sums = f0b3e72bbf0b0426aa31f52eac755f49 - md5sums = 8440dbf3edd142e746d0b3043d6307b2 - md5sums = da5fcef8eef444ea1d049bc75323611a + sha256sums = e3b00bad3065fcbfc0e9bf340ab830ad9fda91cbde784753a45d239128438aa2 + sha256sums = 5284075650c40bdef7cd519e6898c0369b99d42b96bc1d80cc1c8d538715f746 + sha256sums = 26bfc31d455f8729c9f86951add6194037d49a8168d214943f68e46335ae5732 + sha256sums = e0537dd99a7f0c74a376ea1e35deaf22033419a7b98d151051ed38f19814ba73 pkgname = cnijfilter-mx880 diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..d9f00cc2d11e --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +src +pkg +cnijfilter-source-*.tar.gz +*.pkg.tar.* +tags @@ -2,62 +2,106 @@ pkgname=cnijfilter-mx880 pkgver=3.50_1 -pkgrel=1 +pkgrel=2 pkgdesc='Canon IJ Printer Driver for Pixma MX885' arch=('i686' 'x86_64') -url='http://software.canon-europe.com/software/0040869.asp' +url='https://software.canon-europe.com/software/0040869.asp' license=('custom') depends=('libglade' 'cups' 'ghostscript' 'popt') -source=("http://files.canon-europe.com/files/soft40869/software/cnijfilter-source-${pkgver//_/-}.tar.gz" +source=("https://files.canon-europe.com/files/soft40869/software/cnijfilter-source-${pkgver//_/-}.tar.gz" 'cups.patch' 'id.po.patch' 'png.patch') -md5sums=('a900a47246c3d17d1ed5ed801ee29787' - 'f0b3e72bbf0b0426aa31f52eac755f49' - '8440dbf3edd142e746d0b3043d6307b2' - 'da5fcef8eef444ea1d049bc75323611a') +sha256sums=('e3b00bad3065fcbfc0e9bf340ab830ad9fda91cbde784753a45d239128438aa2' + '5284075650c40bdef7cd519e6898c0369b99d42b96bc1d80cc1c8d538715f746' + '26bfc31d455f8729c9f86951add6194037d49a8168d214943f68e46335ae5732' + 'e0537dd99a7f0c74a376ea1e35deaf22033419a7b98d151051ed38f19814ba73') prepare() { - patch -Np0 -i cups.patch - patch -Np0 -i id.po.patch - patch -Np0 -i png.patch + cd "${srcdir}/cnijfilter-source-${pkgver//_/-}" + + patch -Np1 -i "${srcdir}/cups.patch" + patch -Np1 -i "${srcdir}/id.po.patch" + patch -Np1 -i "${srcdir}/png.patch" } build() { - cd cnijfilter-source-${pkgver//_/-} - - for _d in backend libs pstocanonij cngpij ppd cnijfilter printui lgmon cngpijmon; do - msg2 "$_d" - pushd "$_d" - ./autogen.sh \ - --prefix=/usr \ - --program-suffix=mx880 \ - --enable-progpath=/usr/bin \ - --enable-binpath=/usr/bin \ - --enable-libpath=/usr/lib/bjlib \ - --datadir=/usr/share - make - popd - done + cd "${srcdir}/cnijfilter-source-${pkgver//_/-}" + _model="${pkgname##*-}" + + ## Compile and install ${_model} stuff + # ppd file + cd "${srcdir}/cnijfilter-source-${pkgver//_/-}/ppd" + ./autogen.sh --prefix=/usr --enable-ppdpath=/usr/share/cups/model --program-suffix=${_model} + make + # cnijfilter + cd "${srcdir}/cnijfilter-source-${pkgver//_/-}/cnijfilter" + ./autogen.sh --prefix=/usr --enable-libpath=/usr/lib/bjlib --enable-binpath=/usr/bin --program-suffix=${_model} + make + # printui + cd "${srcdir}/cnijfilter-source-${pkgver//_/-}/printui" + ./autogen.sh --prefix=/usr --datadir=/usr/share --program-suffix=${_model} + #make || true # Needed to avoid errors while building locales + make + # lgmon + cd "${srcdir}/cnijfilter-source-${pkgver//_/-}/lgmon" + ./autogen.sh --prefix=/usr --enable-progpath=/usr/bin --program-suffix=${_model} + make + # cngpijmon + cd "${srcdir}/cnijfilter-source-${pkgver//_/-}/cngpijmon" + ./autogen.sh --prefix=/usr --enable-progpath=/usr/bin --datadir=/usr/share --program-suffix=${_model} + make + + ## Compile common stuff + # libs + cd "${srcdir}/cnijfilter-source-${pkgver//_/-}/libs" + ./autogen.sh --prefix=/usr + make + # cngpij, pstocanonij, backend + for _c in cngpij pstocanonij backend; do + cd "${srcdir}/cnijfilter-source-${pkgver//_/-}/${_c}" + ./autogen.sh --prefix=/usr --enable-progpath=/usr/bin + make + done + # backendnet + cd "${srcdir}/cnijfilter-source-${pkgver//_/-}/backendnet" + ./autogen.sh --prefix=/usr --enable-progpath=/usr/bin LDFLAGS="-L../../com/libs_bin64" + make + # sm sub process + cd "${srcdir}/cnijfilter-source-${pkgver//_/-}/cngpijmon/cnijnpr" + ./autogen.sh --prefix=/usr --enable-progpath=/usr/bin LIBS="-ldl" + make } package() { - cd cnijfilter-source-${pkgver//_/-} - - for _d in backend libs pstocanonij cngpij ppd cnijfilter printui lgmon cngpijmon; do - msg2 "$_d" - pushd "$_d" - make install DESTDIR="$pkgdir" - popd - done - install -Dm644 LICENSE-cnijfilter-${pkgver%_*}EN.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE" - ln -s pstocanonijmx880 "$pkgdir/usr/lib/cups/filter/pstocanonij" - install -dm755 "$pkgdir/usr/lib/bjlib" - install -m 755 383/database/* "$pkgdir/usr/lib/bjlib" - case $CARCH in - i686) install -m 755 383/libs_bin32/*.so.* "$pkgdir/usr/lib";; - x86_64) install -m 755 383/libs_bin64/*.so.* "$pkgdir/usr/lib";; - esac -} + cd "${srcdir}/cnijfilter-source-${pkgver//_/-}" -# vim:set ts=2 sw=2 et: + _modelid="$(find . -type f -name "cif${pkgname##*-}.conf" -printf '%P' | cut -d'/' -f1)" + [ -n "${_modelid}" ] + + for dir in ppd cnijfilter printui lgmon cngpijmon libs cngpij pstocanonij backend backendnet cngpijmon/cnijnpr; do + pushd "${dir}" + make install DESTDIR="${pkgdir}" + popd + done + + # Install ${_model} libraries + install -d ${pkgdir}/usr/lib/ + install -m 755 ${srcdir}/cnijfilter-source-${pkgver//_/-}/${_modelid}/libs_bin64/*so.* ${pkgdir}/usr/lib/ + install -d ${pkgdir}/usr/lib/bjlib/ + install -m 644 ${srcdir}/cnijfilter-source-${pkgver//_/-}/${_modelid}/database/* ${pkgdir}/usr/lib/bjlib/ + # Install common libraries + install -m 755 ${srcdir}/cnijfilter-source-${pkgver//_/-}/com/libs_bin64/*so.* ${pkgdir}/usr/lib/ + install -m 666 ${srcdir}/cnijfilter-source-${pkgver//_/-}/com/ini/* ${pkgdir}/usr/lib/bjlib/ + # Make symbolic links for libraries + cd ${pkgdir}/usr/lib/ + ln -s libcnnet.so.*.*.* libcnnet.so + for _l in cmcm cnclapi cnclbjcmd cnclui ess; do + ln -s libcnbp${_l}${_modelid}.so.*.*.* libcnbp${_l}${_modelid}.so + done + ln -s libcnbpess${_modelid}.so.*.*.* libcnbpo${_modelid}.so + + # Install license file + cd ${srcdir}/cnijfilter-source-${pkgver//_/-} + install -D LICENSE-cnijfilter-${pkgver%_*}EN.txt ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-cnijfilter-${pkgver}EN.txt +} diff --git a/cups.patch b/cups.patch index f829a0fddca2..38a633e38562 100644 --- a/cups.patch +++ b/cups.patch @@ -34,3 +34,352 @@ diff -ur cnijfilter-source-3.50-1/cngpijmon/src/bjcupsmon_cups.c cnijfilter-sour #include <sys/types.h> #include <unistd.h> #include <pwd.h> +@@ -214,24 +212,16 @@ + 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 +- +- 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(IPP_GET_PRINTER_ATTRIBUTES); + ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, pURI); + + 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); + } + } + +@@ -287,19 +277,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; ++ pRequest = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); + +- 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); + + 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 { +@@ -311,7 +294,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); +@@ -368,21 +351,14 @@ + retVal = ID_ERR_CUPS_API_FAILED; + } + else { +- pRequest = ippNew(); +- +- pRequest->request.op.operation_id = IPP_CANCEL_JOB; +- pRequest->request.op.request_id = 1; +- +- pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19 ++ pRequest = ippNewRequest(IPP_CANCEL_JOB); + +- 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); +@@ -443,45 +419,38 @@ + retVal = ID_ERR_CUPS_API_FAILED; + } + else { +- pRequest = ippNew(); ++ pRequest = ippNewRequest(IPP_GET_JOBS); + +- pRequest->request.op.operation_id = IPP_GET_JOBS; +- 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); + //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) { +@@ -498,7 +467,7 @@ + } + + if (pAttribute != NULL) +- pAttribute = pAttribute->next; ++ pAttribute = ippNextAttribute(pResponse); + } + } + +@@ -554,40 +523,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. +@@ -604,7 +566,7 @@ + } + + if (pAttribute != NULL) +- pAttribute = pAttribute->next; ++ pAttribute = ippNextAttribute(pResponse); + } + } + +@@ -657,40 +619,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 ++ pRequest = ippNewRequest(CUPS_GET_PRINTERS); + +- 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, 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) { +@@ -699,7 +654,7 @@ + } + + if (pAttribute != NULL) +- pAttribute = pAttribute->next; ++ pAttribute = ippNextAttribute(pResponse); + } + } + +diff -ur cnijfilter-source-3.50-1/cngpij/cngpij/bjcups.c cnijfilter-source-3.50-1_patched/cngpij/cngpig/bjcups.c +--- cnijfilter-source-3.50-1/cngpij/cngpij/bjcups.c 2021-05-12 02:26:37.855631000 -0400 ++++ cnijfilter-source-3.50-1_patched/cngpij/cngpij/bjcups.c 2021-05-12 02:40:26.499397960 -0400 +@@ -687,41 +687,34 @@ + goto onErr; + } + else { +- pRequest = ippNew(); ++ pRequest = ippNewRequest(CUPS_GET_PRINTERS); + +- 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); + 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) { + fputs("ERROR: IPP ERROR\n", stderr); + goto onErr; + } + 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) { +@@ -730,7 +723,7 @@ + } + + if (pAttribute != NULL) +- pAttribute = pAttribute->next; ++ pAttribute = ippNextAttribute(pResponse); + } + } + +--- cnijfilter-source-3.50-1/cngpijmon/cnijnpr/cnijnpr/cnijnpr.c 2010-10-28 05:52:46.000000000 -0400 ++++ cnijfilter-source-3.50-1_patched/cngpijmon/cnijnpr/cnijnpr/cnijnpr.c 2021-05-12 04:38:39.926093191 -0400 +@@ -33,7 +33,7 @@ + #include <signal.h> + #include <sys/ioctl.h> + #include <net/if.h> +-#include <sys/sysctl.h> ++#include <unistd.h> + #include <config.h> + + #include <dlfcn.h> |