parent
051bbbd60f
commit
1b8d7c319d
@ -1 +0,0 @@
|
||||
DIST cnijfilter-source-3.80-1.tar.gz 8923054 BLAKE2B f0984efbbca21b6b6c80207359062f32858cdaa8f15d68aebd65d8fbdb21b0ed5d19ae2392ae05b019b5eaadf2854eedcad8c1a6f76a02337f7964f006389901 SHA512 95a16e3b4fc38ce0b7a12bd74466d97e726bc410b59bf6d1963fa52b16a8cc67f6a993a5ef945107201f860d8ac6734c462bc0bf6d2160d6c85c5f61aff040c1
|
@ -1,113 +0,0 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
|
||||
EAPI=7
|
||||
|
||||
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
|
||||
)
|
||||
!net-print/cnijfilter: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 ""
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
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 =
|
||||
|
@ -1,9 +0,0 @@
|
||||
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
|
||||
|
@ -1,22 +0,0 @@
|
||||
--- 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;
|
@ -1,11 +0,0 @@
|
||||
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>
|
@ -1,11 +0,0 @@
|
||||
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"
|
@ -1,90 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue