Search This Blog

Saturday, April 18, 2026

Crux cnijfilter2 package (Canon cups drivers)

I don't longer have a Canon printer, so I remove the cnijfilter2 package from my repo. To help any potential Canon printer user the Pkgfile is below. There is also a patch required by the build process.

Pkgfile

# Description: Drivers for Canon printers
# URL: https://www.canon-europe.com/support/consumer_products/operating_system_information/#linux
# Maintainer: Wawrzek Niewodniczanski, main at wawrzek dot name
# Depends on: cups

name=cnijfilter2
version=6.80-1
release=1
source=(https://gdlp01.c-wss.com/gds/2/0100012302/02/$name-source-$version.tar.gz
	add-missing-import.patch
	)

dirs="cmdtocanonij2 cmdtocanonij3 cnijbe2 lgmon3 rastertocanonij tocanonij tocnpwg"
build() {
	patch -p0 -i add-missing-import.patch
	cd $name-source-$version
	sed -i '/po\/Makefile.in/d' lgmon3/configure.in
	sed -i /SUBDIRS/s/po// lgmon3/Makefile.am
	sed -i '/GET_PROTOCOL/s/^int /static int/' lgmon3/src/cnij{lgmon3,ifnet2}.c
	export LDFLAGS="-L../../com/libs_bin_x86_64"
	for dir in $dirs
	do
	        cd $dir
	        ./autogen.sh \
		                --prefix=/usr \
		                --enable-progpath=/usr/bin \
		                --datadir=/usr/share
	        make
	        make DESTDIR=$PKG install
	        cd ../
	done
	rm -rf $PKG/usr/share/locale
	cd com/libs_bin_x86_64/
	rm lib*.so
	install -c lib*.so* $PKG/usr/lib
	declare -a libs
	libs=$(ls -1 lib*.so.*)
	for baselib in $libs
	do
	        shortlib=$baselib
	        while extn=$(echo $shortlib | sed -n '/\.[0-9][0-9]*$/s/.*\(\.[0-9][0-9]*\)$/\1/p')
	        [ -n "$extn" ]
	        do
		                shortlib=$(basename $shortlib $extn)
		                ln -s $baselib $PKG/usr/lib/$shortlib
	        done
	done
	cd -
	mkdir -p $PKG/usr/lib/bjlib2
	install -c -m 644 com/ini/cnnet.ini $PKG/usr/lib/bjlib2
	mkdir -p $PKG/usr/share/ppd/$name
	install -c -m 644 ppd/*.ppd $PKG/usr/share/ppd/$name
}
Patch

--- cnijfilter2-source-6.80-1/lgmon3/src/keytext.c	2024-09-20 07:28:40.000000000 +0100
+++ cnijfilter2-source-6.80-1/lgmon3/src/keytext.c.fix	2025-06-11 23:21:28.361664234 +0100
@@ -37,6 +37,7 @@
 #include <unistd.h>
 #include <libxml/parser.h>  /* Ver.2.80 */
 #include <string.h>
+#include <stdlib.h>

 #include "keytext.h"

No comments: