diff options
author | Christoph Willing <chris.willing@linux.com> | 2019-03-13 23:18:43 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2019-03-16 06:53:24 +0700 |
commit | 04d6bd90beea253c7b9c9495c7095d4593f12f9e (patch) | |
tree | bb99108ada2b3823108476f06b2d98770b4d4964 | |
parent | fb6af3b81666a81eab4ef3e363d4af4843cd2e9d (diff) | |
download | slackbuilds-04d6bd90beea253c7b9c9495c7095d4593f12f9e.tar.gz |
system/pixma: Added (Canon PIXMA printer driver).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | system/pixma/00_IPP_PRIVATE_STRUCTURES.diff | 20 | ||||
-rw-r--r-- | system/pixma/04_ppd_h.diff | 10 | ||||
-rw-r--r-- | system/pixma/README | 24 | ||||
-rw-r--r-- | system/pixma/pixma.SlackBuild | 176 | ||||
-rw-r--r-- | system/pixma/pixma.info | 10 | ||||
-rw-r--r-- | system/pixma/slack-desc | 19 |
6 files changed, 259 insertions, 0 deletions
diff --git a/system/pixma/00_IPP_PRIVATE_STRUCTURES.diff b/system/pixma/00_IPP_PRIVATE_STRUCTURES.diff new file mode 100644 index 0000000000..6aa7c3afa7 --- /dev/null +++ b/system/pixma/00_IPP_PRIVATE_STRUCTURES.diff @@ -0,0 +1,20 @@ +--- cngpij/cngpij/bjcups.c.orig 2013-07-17 11:33:45.000000000 +1000 ++++ cngpij/cngpij/bjcups.c 2019-03-05 21:47:19.748034963 +1000 +@@ -21,6 +21,7 @@ + #include <config.h> + #endif // HAVE_CONFIG_H + ++#define _IPP_PRIVATE_STRUCTURES 1 + #include <cups/cups.h> + #include <cups/language.h> + #include <cups/ppd.h> +--- cngpijmnt/src/main.c.orig 2013-07-17 11:33:45.000000000 +1000 ++++ cngpijmnt/src/main.c 2019-03-05 21:53:32.803734632 +1000 +@@ -21,6 +21,7 @@ + #include <config.h> + #endif // HAVE_CONFIG_H + ++#define _IPP_PRIVATE_STRUCTURES 1 + #include <cups/cups.h> + #include <cups/language.h> + #include <cups/ppd.h> diff --git a/system/pixma/04_ppd_h.diff b/system/pixma/04_ppd_h.diff new file mode 100644 index 0000000000..f8f865d930 --- /dev/null +++ b/system/pixma/04_ppd_h.diff @@ -0,0 +1,10 @@ +--- backend/src/cnij_backend_common.c.orig 2013-07-17 11:33:45.000000000 +1000 ++++ backend/src/cnij_backend_common.c 2019-03-05 22:02:03.105361333 +1000 +@@ -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/system/pixma/README b/system/pixma/README new file mode 100644 index 0000000000..ca242db0f9 --- /dev/null +++ b/system/pixma/README @@ -0,0 +1,24 @@ +Driver & PPD files for Canon PIXMA printers. + +By default, this SlackBuild supports all the following Canon PIXMA printer +families: + cnijfilter-mg2500-429 + cnijfilter-mg2400-428 + cnijfilter-mg3500-427 + cnijfilter-mg5500-426 + cnijfilter-mg6400-425 + cnijfilter-mg6500-424 + cnijfilter-mg7100-423 + cnijfilter-p200-430 + +Support for only certain printers may be built by specifying one/some of the +listed printer families in the MODELS environment variable. + +For example to support only the MG2522 printer, run: + MODELS="cnijfilter-mg2500-429" sh pixma.SlackBuild + +To support both the MG2522 and MG7164 printers, run: + MODELS="cnijfilter-mg2500-429 cnijfilter-mg7100-423" sh pixma.SlackBuild + +To support all available printers, don't specify any MODELS; just run: + sh pixma.SlackBuild diff --git a/system/pixma/pixma.SlackBuild b/system/pixma/pixma.SlackBuild new file mode 100644 index 0000000000..841d93ca88 --- /dev/null +++ b/system/pixma/pixma.SlackBuild @@ -0,0 +1,176 @@ +#!/bin/sh + +# Slackware build script for pixma + +# Copyright 2019 Christoph Willing Brisbane, Australia +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=pixma +SRCNAM=cnijfilter-source +SRCVERSION=${SRCVERSION:-4.00-1} +VERSION=${SRCVERSION/-/.} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$SRCNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +PRINTER_PKG_PROGRAM="ppd cnijfilter" +MODELS=${MODELS:-} +if [ -z $MODELS ]; then + PRINTER_DEPEND_PKG="cnijfilter-mg2500-429 cnijfilter-mg2400-428 cnijfilter-mg3500-427 cnijfilter-mg5500-426 cnijfilter-mg6400-425 cnijfilter-mg6500-424 cnijfilter-mg7100-423 cnijfilter-p200-430" + echo "PRINTER_DEPEND_PKG = $PRINTER_DEPEND_PKG" +else + PRINTER_DEPEND_PKG="" + for m in $MODELS ; do + PRINTER_DEPEND_PKG="$PRINTER_DEPEND_PKG $m" + done + echo "PRINTER_DEPEND_PKG = $PRINTER_DEPEND_PKG" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $SRCNAM-$SRCVERSION +tar xvf $CWD/$SRCNAM-$SRCVERSION.tar.gz +cd $SRCNAM-$SRCVERSION + +# Cups >= 1.6 +patch -p0 < $CWD/00_IPP_PRIVATE_STRUCTURES.diff +patch -p0 < $CWD/04_ppd_h.diff + +# Correct cups directory location +sed -i -e "s/lib\/cups/lib$LIBDIRSUFFIX\/cups/" cnijbe/src/Makefile.am +sed -i -e "s/lib\/cups/lib$LIBDIRSUFFIX\/cups/" backend/src/Makefile.am +sed -i -e "s/lib\/cups/lib$LIBDIRSUFFIX\/cups/" backendnet/backend/Makefile.am + +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +(cd ./libs; CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" ./autogen.sh --prefix=/usr ) +(cd ./bscc2sts; CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" ./autogen.sh ) +(cd ./cnijnpr; CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" ./autogen.sh --prefix=/usr --enable-libpath=/usr/lib$LIBDIRSUFFIX/bjlib ) +(cd ./cngpij; CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" ./autogen.sh --prefix=/usr --enable-progpath=/usr/bin ) +(cd ./cngpijmnt; CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" ./autogen.sh --prefix=/usr --enable-progpath=/usr/bin ) +(cd ./pstocanonij; CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" ./autogen.sh --libdir=/usr/lib$LIBDIRSUFFIX --enable-progpath=/usr/bin ) +(cd ./backend; CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" ./autogen.sh --prefix=/usr --enable-progpath=/usr/bin ) +(cd ./backendnet; CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" ./autogen.sh --prefix=/usr --enable-progpath=/usr/bin LDFLAGS="-L../../com/libs_bin$LIBDIRSUFFIX" ) +(cd ./cmdtocanonij; CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" ./autogen.sh --prefix=/usr --libdir=/usr/lib$LIBDIRSUFFIX ) +(cd ./cnijbe; CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" ./autogen.sh --prefix=/usr --enable-progpath=/usr/bin ) +(cd ./lgmon2; CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" ./autogen.sh --prefix=/usr --enable-progpath=/usr/bin LDFLAGS="-L../../com/libs_bin$LIBDIRSUFFIX" ) + +(cd ./ppd; CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" ./autogen.sh --prefix=/usr --enable-ppdpath=/usr/share/ppd --program-suffix=CN_IJ_MODEL ) +(cd ./cnijfilter; CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" ./autogen.sh --prefix=/usr --enable-libpath=/usr/lib$LIBDIRSUFFIX/bjlib --enable-binpath=/usr/bin --program-suffix=CN_IJ_MODEL ) + +for pkg in $PRINTER_DEPEND_PKG ; do + model_name=`echo ${pkg} | cut -d- -f2` && \ + comm_name=`echo ${pkg} | cut -d- -f1` && \ + model_num=`echo ${pkg} | cut -d- -f3` && \ + model_dir=${comm_name}-${model_name}series && \ + for pg_name in $PRINTER_PKG_PROGRAM ; do + pushd ./$pg_name + find . -name Makefile -print > file_lists; \ + find . -name config.h -print >> file_lists; \ + for fn in $(cat file_lists) ; do + if [ ! -f ${fn}.org ]; then + cp ${fn} ${fn}.org + fi + sed -e s/CN_IJ_MODEL_NUM/${model_num}/g ${fn}.org | sed -e s/CN_IJ_MODEL/${model_name}/ > cn_ij_tmp; mv cn_ij_tmp ${fn} + done + make clean; make; make install DESTDIR=$PKG + popd + done + mkdir -p ${PKG}/usr/lib${LIBDIRSUFFIX} + install -m 755 ${model_num}/libs_bin${LIBDIRSUFFIX}/libcnbpcmcm${model_num}.so.* ${PKG}/usr/lib${LIBDIRSUFFIX}/ + install -m 755 ${model_num}/libs_bin${LIBDIRSUFFIX}/libcnbpcnclapi${model_num}.so.* ${PKG}/usr/lib${LIBDIRSUFFIX}/ + install -m 755 ${model_num}/libs_bin${LIBDIRSUFFIX}/libcnbpcnclbjcmd${model_num}.so.* ${PKG}/usr/lib${LIBDIRSUFFIX}/ + install -m 755 ${model_num}/libs_bin${LIBDIRSUFFIX}/libcnbpcnclui${model_num}.so.* ${PKG}/usr/lib${LIBDIRSUFFIX}/ + install -m 755 ${model_num}/libs_bin${LIBDIRSUFFIX}/libcnbpess${model_num}.so.* ${PKG}/usr/lib${LIBDIRSUFFIX}/ + install -m 755 ${model_num}/libs_bin${LIBDIRSUFFIX}/libcnbpo${model_num}.so.* ${PKG}/usr/lib${LIBDIRSUFFIX}/ + mkdir -p ${PKG}/usr/lib${LIBDIRSUFFIX}/bjlib + install -m 644 ${model_num}/database/cif${model_name}.conf ${PKG}/usr/lib${LIBDIRSUFFIX}/bjlib + install -m 644 ${model_num}/database/cnb_${model_num}0.tbl ${PKG}/usr/lib${LIBDIRSUFFIX}/bjlib + install -m 644 ${model_num}/database/cnbpname${model_num}.tbl ${PKG}/usr/lib${LIBDIRSUFFIX}/bjlib + if [ -f ${model_num}/database/cif${model_name}.bscc ]; then + install -m 644 -o lp -g lp ${model_num}/database/cif${model_name}.bscc ${PKG}/usr/lib${LIBDIRSUFFIX}/bjlib || true + fi +done + +( cd ./libs; make clean; make ) +( cd ./bscc2sts; make clean; make ) +( cd ./cnijnpr; make clean; make; make install DESTDIR=$PKG ) +( cd ./cngpij; make clean; make; make install DESTDIR=$PKG) +( cd ./cngpijmnt; make clean; make; make install DESTDIR=$PKG) +( cd ./pstocanonij; make clean; make; make install DESTDIR=$PKG ) +( cd ./backend; make clean; make; make install DESTDIR=$PKG ) +( cd ./backendnet; make clean; make; make install DESTDIR=$PKG ) +( cd ./cmdtocanonij; make clean; make; make install DESTDIR=$PKG ) +( cd ./cnijbe; make clean; make; make install DESTDIR=$PKG ) +( cd ./lgmon2; make clean; make; make install DESTDIR=$PKG ) + +install -m 755 com/libs_bin${LIBDIRSUFFIX}/libcnnet.so.* ${PKG}/usr/lib${LIBDIRSUFFIX}/ +install -m 755 com/libs_bin${LIBDIRSUFFIX}/libcnbpcnclapicom.so.* ${PKG}/usr/lib${LIBDIRSUFFIX}/ +install -m 644 -o lp -g lp com/ini/cnnet.ini ${PKG}/usr/lib${LIBDIRSUFFIX}/bjlib/ || true + +mkdir -p $PKG/etc/udev/rules.d +install -m 644 etc/*.rules ${PKG}/etc/udev/rules.d/ + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a LICENSE-cnijfilter-4*.txt $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/system/pixma/pixma.info b/system/pixma/pixma.info new file mode 100644 index 0000000000..faff1ae9ba --- /dev/null +++ b/system/pixma/pixma.info @@ -0,0 +1,10 @@ +PRGNAM="pixma" +VERSION="4.00.1" +HOMEPAGE="https://www.canon-wireless.com/2018/11/canon-pixma-mg2522-driver-download.html" +DOWNLOAD="http://gdlp01.c-wss.com/gds/5/0100005515/01/cnijfilter-source-4.00-1.tar.gz" +MD5SUM="52e625dfa42459ead1929c07900b8e44" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Christoph Willing" +EMAIL="chris.willing@linux.com" diff --git a/system/pixma/slack-desc b/system/pixma/slack-desc new file mode 100644 index 0000000000..50f35ede2f --- /dev/null +++ b/system/pixma/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +pixma: pixma (Canon PIXMA printer driver) +pixma: +pixma: Driver & PPD files for Canon PIXMA family printers. +pixma: +pixma: +pixma: +pixma: +pixma: +pixma: +pixma: +pixma: |