diff options
author | Matteo Bernardini <ponce@slackbuilds.org> | 2019-10-08 12:29:03 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2021-04-17 23:31:01 -0500 |
commit | a637840703703d7c27d03ee43042b21d2fc638e2 (patch) | |
tree | 29ca910ff4fbe8ec649a5ef31afa2208dda28f7f /system/iscan | |
parent | 803ae2a4bf0ffbfecf802d2169297108652b3f9a (diff) | |
download | slackbuilds-a637840703703d7c27d03ee43042b21d2fc638e2.tar.gz |
system/iscan: Added (front-end for EPSON all-in-one devices).
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'system/iscan')
-rw-r--r-- | system/iscan/README | 4 | ||||
-rw-r--r-- | system/iscan/doinst.sh | 29 | ||||
-rw-r--r-- | system/iscan/iscan.SlackBuild | 144 | ||||
-rw-r--r-- | system/iscan/iscan.info | 10 | ||||
-rw-r--r-- | system/iscan/patches/iscan-2.30.3_x86-unknown-types.patch | 12 | ||||
-rw-r--r-- | system/iscan/patches/iscan_png15.patch | 52 | ||||
-rw-r--r-- | system/iscan/patches/jpegstream.cc.patch | 21 | ||||
-rw-r--r-- | system/iscan/slack-desc | 19 |
8 files changed, 291 insertions, 0 deletions
diff --git a/system/iscan/README b/system/iscan/README new file mode 100644 index 0000000000..3ae47041b7 --- /dev/null +++ b/system/iscan/README @@ -0,0 +1,4 @@ +EPSON Image Scan! for Linux enables you to print to a networked +all-in-one EPSON printer. A SANE 'epkowa' backend is provided +as well; scanning over the network requires the additional +iscan-network-nt package which contains a protocol driver. diff --git a/system/iscan/doinst.sh b/system/iscan/doinst.sh new file mode 100644 index 0000000000..25f34e1d3a --- /dev/null +++ b/system/iscan/doinst.sh @@ -0,0 +1,29 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/sane.d/epkowa.conf.new + +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -x /usr/bin/update-mime-database ]; then + /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1 +fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi + diff --git a/system/iscan/iscan.SlackBuild b/system/iscan/iscan.SlackBuild new file mode 100644 index 0000000000..33276ad0c0 --- /dev/null +++ b/system/iscan/iscan.SlackBuild @@ -0,0 +1,144 @@ +#!/bin/sh + +# Slackware build script for iscan + +# Copyright 2019 Matteo Bernardini <ponce@slackbuilds.org>, Pisa, Italy +# 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. + +# Shamelessly ripped from Alien Bob's script: thank him for all the hard work! + +PRGNAM=iscan +VERSION=${VERSION:-2.30.4} +ADDVER=${ADDVER:-2} +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-$PRGNAM +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 + +# Minor library version of libpng on our system: +PNGMINOR=$(pkg-config --modversion libpng |cut -d'.' -f2) +if [ $PNGMINOR -gt 5 ]; then + PNG_LDFLAGS="-lpng16" +elif [ $PNGMINOR -eq 4 ]; then + PNG_LDFLAGS="-lpng14" +fi + +DOCS="COPYING INSTALL NEWS README non-free/COPYING*.txt" + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/${PRGNAM}_${VERSION}-${ADDVER}.tar.gz +cd $PRGNAM-$VERSION +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 {} \; + +# Apply ArchLinux patches: +# Allow linking against libpng15 and newer: +patch -p0 < $CWD/patches/iscan_png15.patch +# Patch for ambiguous div in jpegstream.cc: +patch -p0 < $CWD/patches/jpegstream.cc.patch +# Fix compilation error 'unknown type name u_char' on 32bit: +patch -p1 < $CWD/patches/iscan-2.30.3_x86-unknown-types.patch +# Add fix for CXX ABI different than 1002: +ln -s libesmod-x86_64.c2.so non-free/libesmod-x86_64.so + +LDFLAGS="-ldl $PNG_LDFLAGS" \ +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --enable-dependency-reduction \ + --enable-frontend \ + --enable-jpeg \ + --enable-tiff \ + --enable-png \ + --enable-gimp \ + --build=$ARCH-slackware-linux + +make +make install DESTDIR=$PKG + +# Install the SANE backend configuration: +mkdir -p $PKG/etc/sane.d/dll.d +install -m0644 backend/epkowa.conf $PKG/etc/sane.d/epkowa.conf.new +echo "epkowa" > $PKG/etc/sane.d/dll.d/epkowa.conf + +# Create the forgotten desktop menu: +mkdir -p $PKG/usr/share/applications +install -m0644 $PRGNAM.desktop $PKG/usr/share/applications/$PRGNAM.desktop + +# Make the GIMP aware of the iscan plugin: +mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/gimp/2.0/plug-ins +ln -s /usr/bin/$PRGNAM $PKG/usr/lib$LIBDIRSUFFIX/gimp/2.0/plug-ins/ + +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 + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $DOCS $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 +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/system/iscan/iscan.info b/system/iscan/iscan.info new file mode 100644 index 0000000000..a299693821 --- /dev/null +++ b/system/iscan/iscan.info @@ -0,0 +1,10 @@ +PRGNAM="iscan" +VERSION="2.30.4" +HOMEPAGE="http://epson.net" +DOWNLOAD="http://support.epson.net/linux/src/scanner/iscan/iscan_2.30.4-2.tar.gz" +MD5SUM="b79c73341fcd7dd930381d50952b88c8" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="iscan-data" +MAINTAINER="Matteo Bernardini" +EMAIL="ponce@slackbuilds.org" diff --git a/system/iscan/patches/iscan-2.30.3_x86-unknown-types.patch b/system/iscan/patches/iscan-2.30.3_x86-unknown-types.patch new file mode 100644 index 0000000000..9bb856ff83 --- /dev/null +++ b/system/iscan/patches/iscan-2.30.3_x86-unknown-types.patch @@ -0,0 +1,12 @@ +diff -ru a/sanei/sanei_pio.c b/sanei/sanei_pio.c +--- a/sanei/sanei_pio.c 2019-03-01 10:44:36.723260142 -0600 ++++ b/sanei/sanei_pio.c 2019-03-01 10:48:47.660693036 -0600 +@@ -73,6 +73,7 @@ + #elif HAVE_SYS_HW_H + # include <sys/hw.h> + #elif defined(__i386__) && defined (__GNUC__) ++#include <sys/types.h> + + static __inline__ void + outb (u_char value, u_long port) + diff --git a/system/iscan/patches/iscan_png15.patch b/system/iscan/patches/iscan_png15.patch new file mode 100644 index 0000000000..8220ac4af3 --- /dev/null +++ b/system/iscan/patches/iscan_png15.patch @@ -0,0 +1,52 @@ +# +# Thanks to Fabio Castelli, ArchLinux: +# https://projects.archlinux.org/svntogit/community.git/tree/trunk/libpng15.patch?h=packages/iscan +# +--- lib/pngstream.cc 2011-12-01 02:30:53.000000000 +0100 ++++ lib/pngstream.cc 2012-02-06 03:06:22.000000000 +0100 +@@ -83,7 +83,12 @@ + #if HAVE_PNG_H + set_error_handler (_png, _info); + ++/* when not interlacing (ie, only one pass), number of rows is image height: _v_sz */ ++#if PNG_LIBPNG_VER > 10499 ++ if (!_footer && _v_sz == lib->get_current_row_number(_png)) ++#else + if (_header && !_footer && _png->num_rows == _png->flush_rows) ++#endif + { + lib->write_end (_png, _info); + _footer = true; +@@ -167,6 +172,9 @@ + funcsym (write_row); + funcsym (write_flush); + funcsym (write_end); ++#if PNG_LIBPNG_VER > 10499 ++ funcsym (get_current_row_number); ++#endif + + if (lib->access_version_number + && lib->create_write_struct +@@ -176,6 +184,9 @@ + && lib->set_IHDR + && lib->set_pHYs + && lib->set_invert_mono ++#if PNG_LIBPNG_VER > 10499 ++ && lib->get_current_row_number ++#endif + && lib->write_info + && lib->write_row + && lib->write_flush +--- lib/pngstream.hh 2011-12-01 02:30:53.000000000 +0100 ++++ lib/pngstream.hh 2012-02-06 03:09:09.000000000 +0100 +@@ -108,6 +108,10 @@ + png_structp); + fundecl (void, write_end, + png_structp, png_infop); ++#if PNG_LIBPNG_VER > 10499 ++ fundecl (png_uint_32, get_current_row_number, ++ png_structp); ++#endif + #endif /* HAVE_PNG_H */ + }; + static png_lib_handle *lib; diff --git a/system/iscan/patches/jpegstream.cc.patch b/system/iscan/patches/jpegstream.cc.patch new file mode 100644 index 0000000000..988a25daea --- /dev/null +++ b/system/iscan/patches/jpegstream.cc.patch @@ -0,0 +1,21 @@ +--- lib/jpegstream.cc.orig 2016-06-20 06:10:38.000000000 +0200 ++++ lib/jpegstream.cc 2016-07-10 18:45:40.511301054 +0200 +@@ -33,7 +33,7 @@ + + #include "jpegstream.hh" + +-#include <cstdlib> ++// #include <cstdlib> + #include <ios> + + namespace iscan +@@ -82,7 +82,8 @@ + // only that _bits != 8. + for (unsigned int i = 0; i < _h_sz; ++i) + { +- div_t index = div (i, 8 * sizeof (JSAMPLE)); ++ div_t index = div (static_cast<int>(i), ++ static_cast<int>(8 * sizeof (JSAMPLE))); + int offset = 8 * sizeof (JSAMPLE) - 1 - index.rem; + _scanline[i] = ((line[index.quot] & (1 << offset)) + ? 0 : ~0); diff --git a/system/iscan/slack-desc b/system/iscan/slack-desc new file mode 100644 index 0000000000..56fcd9b5c0 --- /dev/null +++ b/system/iscan/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------------------------------------------------------| +iscan: iscan (front-end for EPSON all-in-one devices) +iscan: +iscan: EPSON Image Scan! for Linux enables you to print to a networked +iscan: all-in-one EPSON printer. A SANE 'epkowa' backend is provided +iscan: as well; scanning over the network requires the additional +iscan: iscan-network-nt package which contains a protocol driver. +iscan: +iscan: homepage: http://epson.net +iscan: +iscan: +iscan: |