summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@rogentos.ro>2016-08-24 10:49:13 +0100
committerV3n3RiX <venerix@rogentos.ro>2016-08-24 10:49:13 +0100
commita1110ef0ee711656ed124065794a3bfefa3b88bd (patch)
treed44dcae621611322d8772bed08b2172e41351f68
parent3a1931e26fcf501e116352d43dc3930eed24710b (diff)
forgot to add these to the commit
-rw-r--r--net-print/cnijfilter/cnijfilter-3.80.ebuild112
-rw-r--r--net-print/cnijfilter/files/cnijfilter-3.70-libexec-backend.patch22
-rw-r--r--net-print/cnijfilter/files/cnijfilter-3.70-libexec-cups.patch9
-rw-r--r--net-print/cnijfilter/files/cnijfilter-3.70-png.patch22
-rw-r--r--net-print/cnijfilter/files/cnijfilter-3.70-ppd.patch11
-rw-r--r--net-print/cnijfilter/files/cnijfilter-3.70-ppd2.patch11
-rw-r--r--net-print/cnijfilter/files/cnijfilter-3.80-cups1.6.patch90
7 files changed, 277 insertions, 0 deletions
diff --git a/net-print/cnijfilter/cnijfilter-3.80.ebuild b/net-print/cnijfilter/cnijfilter-3.80.ebuild
new file mode 100644
index 00000000..ba59915a
--- /dev/null
+++ b/net-print/cnijfilter/cnijfilter-3.80.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit eutils autotools flag-o-matic multilib
+
+DESCRIPTION="Canon InkJet Printer Driver for Linux (Pixus/Pixma-Series)."
+HOMEPAGE="http://support-sg.canon-asia.com/contents/SG/EN/0100469302.html"
+SRC_URI="http://gdlp01.c-wss.com/gds/3/0100004693/01/${PN}-source-${PV}-1.tar.gz"
+
+LICENSE="GPL-2 cnijfilter"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="+net +servicetools"
+
+RDEPEND="
+ >=media-libs/libpng-1.5
+ >=media-libs/tiff-3.4
+ >=net-print/cups-1.4
+ servicetools? (
+ >=dev-libs/libxml2-2.7.3-r2
+ >=x11-libs/gtk+-2.6:2
+ )
+"
+DEPEND="${DEPEND}
+ sys-devel/gettext
+"
+
+S="${WORKDIR}/${PN}-source-${PV}-1"
+
+_dir_build() {
+ local dirs=$1
+ local command=$2
+ local d
+
+ [[ $# -ne 2 ]] && die "Call as: _dir_build DIRS COMMAND"
+
+ for d in ${dirs}; do
+ local suffix=""
+ echo ">>> Working in: ${d}"
+ pushd ${d} >/dev/null
+ # progpath must be set otherwise we go for /usr/local/bin
+ if [[ ${command} == econf* ]]; then
+ ${command} --enable-progpath="${EPREFIX}/usr/bin"
+ else
+ ${command}
+ fi
+ popd > /dev/null
+ done
+}
+
+pkg_setup() {
+ [[ -z ${LINGUAS} ]] && LINGUAS="en"
+
+ DIRS="libs pstocanonij backend"
+ use net && DIRS+=" backendnet"
+ #use servicetools && DIRS+=" cngpij cngpijmon/cnijnpr"
+ use servicetools && DIRS+=" cngpij"
+}
+
+src_prepare() {
+ local d i
+
+ epatch \
+ "${FILESDIR}/${PN}"-3.70-png.patch \
+ "${FILESDIR}/${PN}"-3.70-ppd.patch \
+ "${FILESDIR}/${PN}"-3.70-ppd2.patch \
+ "${FILESDIR}/${PN}"-3.70-libexec-cups.patch \
+ "${FILESDIR}/${PN}"-3.70-libexec-backend.patch \
+ "${FILESDIR}/${P}"-cups1.6.patch
+
+ _dir_build "${DIRS}" "eautoreconf"
+}
+
+src_configure() {
+ local d i
+
+ _dir_build "${DIRS}" "econf"
+}
+
+src_compile() {
+ _dir_build "${DIRS}" "emake"
+}
+
+src_install() {
+ local _libdir="${EPREFIX}/usr/$(get_libdir)"
+ local _libdir_pkg=libs_bin$(use amd64 && echo 64 || echo 32)
+
+ _dir_build "${DIRS}" "emake DESTDIR=${D} install"
+
+ if use net; then
+ pushd com/${_libdir_pkg} > /dev/null
+ dodir ${_libdir}
+ # no doexe to preserve symlinks
+ cp -a libcnnet.so* "${D}/${_libdir}" || die
+ popd > /dev/null
+ fi
+}
+
+pkg_postinst() {
+ einfo ""
+ einfo "For installing a printer:"
+ einfo " * Restart CUPS: /etc/init.d/cupsd restart"
+ einfo " * Go to http://127.0.0.1:631/"
+ einfo " -> Printers -> Add Printer"
+ einfo ""
+ einfo "If you experience any problems, please visit:"
+ einfo " http://forums.gentoo.org/viewtopic-p-3217721.html"
+ einfo ""
+}
diff --git a/net-print/cnijfilter/files/cnijfilter-3.70-libexec-backend.patch b/net-print/cnijfilter/files/cnijfilter-3.70-libexec-backend.patch
new file mode 100644
index 00000000..ca2073a5
--- /dev/null
+++ b/net-print/cnijfilter/files/cnijfilter-3.70-libexec-backend.patch
@@ -0,0 +1,22 @@
+diff -urN cnijfilter-source-3.70-1.old/backend/src/Makefile.am cnijfilter-source-3.70-1/backend/src/Makefile.am
+--- cnijfilter-source-3.70-1.old/backend/src/Makefile.am 2012-12-22 11:09:21.674631729 +0100
++++ cnijfilter-source-3.70-1/backend/src/Makefile.am 2012-12-22 14:20:50.879566578 +0100
+@@ -1,6 +1,6 @@
+ ## Process this file with automake to produce Makefile.in
+
+-backend_bindir = /usr/lib/cups/backend
++backend_bindir = /usr/libexec/cups/backend
+ backend_bin_PROGRAMS = cnijusb
+ transform =
+
+diff -urN cnijfilter-source-3.70-1.old/backendnet/backend/Makefile.am cnijfilter-source-3.70-1/backendnet/backend/Makefile.am
+--- cnijfilter-source-3.70-1.old/backendnet/backend/Makefile.am 2012-12-22 11:09:21.673631729 +0100
++++ cnijfilter-source-3.70-1/backendnet/backend/Makefile.am 2012-12-22 14:20:20.176569425 +0100
+@@ -1,6 +1,6 @@
+ ## Process this file with automake to produce Makefile.in
+
+-backendnet_bindir = /usr/lib/cups/backend
++backendnet_bindir = /usr/libexec/cups/backend
+ backendnet_bin_PROGRAMS = cnijnet
+ transform =
+
diff --git a/net-print/cnijfilter/files/cnijfilter-3.70-libexec-cups.patch b/net-print/cnijfilter/files/cnijfilter-3.70-libexec-cups.patch
new file mode 100644
index 00000000..858343f4
--- /dev/null
+++ b/net-print/cnijfilter/files/cnijfilter-3.70-libexec-cups.patch
@@ -0,0 +1,9 @@
+diff -urN cnijfilter-source-3.70-1.old/pstocanonij/filter/Makefile.am cnijfilter-source-3.70-1/pstocanonij/filter/Makefile.am
+--- cnijfilter-source-3.70-1.old/pstocanonij/filter/Makefile.am 2012-12-21 17:27:54.370964561 +0100
++++ cnijfilter-source-3.70-1/pstocanonij/filter/Makefile.am 2012-12-21 18:22:48.804097963 +0100
+@@ -1,4 +1,4 @@
+-filterdir=$(libdir)/cups/filter
++filterdir=$(libexecdir)/cups/filter
+
+ filter_PROGRAMS= pstocanonij
+
diff --git a/net-print/cnijfilter/files/cnijfilter-3.70-png.patch b/net-print/cnijfilter/files/cnijfilter-3.70-png.patch
new file mode 100644
index 00000000..0e32f236
--- /dev/null
+++ b/net-print/cnijfilter/files/cnijfilter-3.70-png.patch
@@ -0,0 +1,22 @@
+--- cnijfilter-3.70/cnijfilter/src/bjfimage.c 2011-09-22 04:33:34.000000000 +0200
++++ cnijfilter-3.70/cnijfilter/src/bjfimage.c 2012-09-15 16:22:38.000000000 +0200
+@@ -1520,8 +1520,8 @@
+ short tmpformat;
+ short retbyte = 0;
+ short bpp = 3;
+- long width = 0;
+- long length = 0;
++ png_uint_32 width = 0;
++ png_uint_32 length = 0;
+ long rstep = 0;
+ long RasterLength = 0;
+ long i;
+@@ -1574,7 +1574,7 @@
+ goto onErr;
+ }
+
+- if (setjmp (png_p->jmpbuf))
++ if (setjmp (png_jmpbuf(png_p)))
+ {
+ png_destroy_read_struct(&png_p, &info_p, (png_infopp)NULL);
+ goto onErr;
diff --git a/net-print/cnijfilter/files/cnijfilter-3.70-ppd.patch b/net-print/cnijfilter/files/cnijfilter-3.70-ppd.patch
new file mode 100644
index 00000000..a1d1ad23
--- /dev/null
+++ b/net-print/cnijfilter/files/cnijfilter-3.70-ppd.patch
@@ -0,0 +1,11 @@
+diff -urN cnijfilter-source-3.70-1.old/cngpijmon/src/bjcupsmon_cups.c cnijfilter-source-3.70-1/cngpijmon/src/bjcupsmon_cups.c
+--- cnijfilter-source-3.70-1.old/cngpijmon/src/bjcupsmon_cups.c 2012-12-21 17:27:54.599964570 +0100
++++ cnijfilter-source-3.70-1/cngpijmon/src/bjcupsmon_cups.c 2012-12-21 17:28:42.076966493 +0100
+@@ -20,6 +20,7 @@
+ /*** Includes ***/
+ #include <cups/cups.h>
+ #include <cups/language.h>
++#include <cups/ppd.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+ #include <pwd.h>
diff --git a/net-print/cnijfilter/files/cnijfilter-3.70-ppd2.patch b/net-print/cnijfilter/files/cnijfilter-3.70-ppd2.patch
new file mode 100644
index 00000000..8b1e6ae3
--- /dev/null
+++ b/net-print/cnijfilter/files/cnijfilter-3.70-ppd2.patch
@@ -0,0 +1,11 @@
+diff -urN cnijfilter-source-3.70-1.old/backend/src/cnij_backend_common.c cnijfilter-source-3.70-1/backend/src/cnij_backend_common.c
+--- cnijfilter-source-3.70-1.old/backend/src/cnij_backend_common.c 2012-12-22 11:09:21.674631729 +0100
++++ cnijfilter-source-3.70-1/backend/src/cnij_backend_common.c 2012-12-22 11:11:31.903619656 +0100
+@@ -38,6 +38,7 @@
+ // CUPS Header
+ #include <cups/cups.h>
+ #include <cups/ipp.h>
++#include <cups/ppd.h>
+
+ // Header file for CANON
+ #include "cnij_backend_common.h"
diff --git a/net-print/cnijfilter/files/cnijfilter-3.80-cups1.6.patch b/net-print/cnijfilter/files/cnijfilter-3.80-cups1.6.patch
new file mode 100644
index 00000000..8971d067
--- /dev/null
+++ b/net-print/cnijfilter/files/cnijfilter-3.80-cups1.6.patch
@@ -0,0 +1,90 @@
+diff -ur cnijfilter-source-3.80-1/cngpij/cngpij/bjcups.c cnijfilter-source-3.80-1.new/cngpij/cngpij/bjcups.c
+--- cnijfilter-source-3.80-1/cngpij/cngpij/bjcups.c
++++ cnijfilter-source-3.80-1.new/cngpij/cngpij/bjcups.c
+@@ -66,6 +66,27 @@
+
+ char* g_printer_name = NULL;
+
++#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
++#define HAVE_CUPS_1_6 1
++#endif
++
++#ifndef HAVE_CUPS_1_6
++
++#define ippSetOperation(ipp_request, ipp_op_id) ipp_request->request.op.operation_id = ipp_op_id
++#define ippSetRequestId(ipp_request, ipp_rq_id) ipp_request->request.op.request_id = ipp_rq_id
++#define ippGetStatusCode(ipp_request) ipp_request->request.status.status_code
++#define ippFirstAttribute(ipp) ipp->attrs /* simplistic */
++#define bjcups_ippNextAttribute(resp, attr) attr->next
++#define ippGetGroupTag(attr) attr->group_tag
++#define ippGetName(attr) attr->name
++#define ippGetString(attr, ind, lang) attr->values[ind].string.text
++#define ippGetValueTag(attr) attr->value_tag
++
++#else
++
++#define bjcups_ippNextAttribute(resp, attr) ippNextAttribute(resp)
++
++#endif
+
+ extern int GetIPCData(LPIPCU pipc, char *sname);
+ static short getDeviceURI( const char *pDestName, char *pDeviceURI, short bufSize);
+@@ -698,8 +719,8 @@
+ else {
+ pRequest = ippNew();
+
+- pRequest->request.op.operation_id = CUPS_GET_PRINTERS;
+- pRequest->request.op.request_id = 1;
++ ippSetOperation(pRequest, CUPS_GET_PRINTERS);
++ ippSetRequestId(pRequest, 1);
+
+ pLanguage = bjcupsLangDefault(); // cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19
+
+@@ -708,29 +729,29 @@
+ 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 = bjcups_ippNextAttribute(pResponse, pAttribute);
+ }
+ 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 = bjcups_ippNextAttribute(pResponse, pAttribute);
+ }
+
+ if (strcasecmp(pDestName, pPrinter) == 0) {
+@@ -739,7 +760,7 @@
+ }
+
+ if (pAttribute != NULL)
+- pAttribute = pAttribute->next;
++ pAttribute = bjcups_ippNextAttribute(pResponse, pAttribute);
+ }
+ }