From a8f1664099bc2afa9e975a993e5809dccc1c9cf5 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Mon, 29 Dec 2014 22:52:18 -0500 Subject: [PATCH] Add Epson scanner plugin and utilities --- config/packages-list | 3 + stage5/hv-install-1 | 5 ++ stage5/packages-update | 3 + .../common/iscan-2.30.0-libpng-1.5.patch | 60 +++++++++++++++++++ stage5/pkg/iscan | 11 ++++ stage5/pkg/iscan-plugin-gt-s600 | 11 ++++ 6 files changed, 93 insertions(+) create mode 100644 stage5/patches/common/iscan-2.30.0-libpng-1.5.patch create mode 100644 stage5/pkg/iscan create mode 100644 stage5/pkg/iscan-plugin-gt-s600 diff --git a/config/packages-list b/config/packages-list index 02fb349..ce62e8b 100644 --- a/config/packages-list +++ b/config/packages-list @@ -191,6 +191,9 @@ INKSCAPE="inkscape-0.48.5" INTLTOOL="intltool-0.50.2" IPROUTE2="iproute2-3.3.0" IPTABLES="iptables-1.4.21" +ISCAN="iscan-2.30.0" +ISCAN_DATA="iscan-data-1.33.0" +ISCAN_PLUGIN="iscan-plugin-gt-s600-2.1.2" ISO_CODES="iso-codes-3.57" ISL="isl-0.12.2" ITSTOOL="itstool-2.0.2" diff --git a/stage5/hv-install-1 b/stage5/hv-install-1 index e236cf1..4213e25 100755 --- a/stage5/hv-install-1 +++ b/stage5/hv-install-1 @@ -120,6 +120,11 @@ fi if [ "x${SANE_SUPPORT}" = "xyes" ]; then ipkg -m acnb ${SANE_BACKENDS} ipkg -m acnb ${XSANE} + + # Epson scanners + ipkg -m noac ${ISCAN_PLUGIN} + ipkg ${ISCAN_DATA} + ipkg -m acnb ${ISCAN} "--localstatedir=/var" fi ipkg -m pm ${PERL_MOD_XML_SIMPLE} diff --git a/stage5/packages-update b/stage5/packages-update index cf1c2b5..6e2dc2a 100755 --- a/stage5/packages-update +++ b/stage5/packages-update @@ -104,6 +104,9 @@ fpkg -e "tar.xz" ${TEXLIVE_TEXMF} "ftp://tug.org/texlive/historic/2012" fpkg -e "tar.gz" ${SANE_BACKENDS} "http://fossies.org/linux/misc" fpkg -e "tar.gz" ${XSANE} "http://www.xsane.org/download" +fpkg -m hv ${ISCAN} +fpkg -m hv ${ISCAN_DATA} +fpkg -m hv ${ISCAN_PLUGIN} fpkg ${ICON_NAMING_UTILS} "http://tango.freedesktop.org/releases" fpkg ${TANGO_ICON_THEME} "http://tango.freedesktop.org/releases" diff --git a/stage5/patches/common/iscan-2.30.0-libpng-1.5.patch b/stage5/patches/common/iscan-2.30.0-libpng-1.5.patch new file mode 100644 index 0000000..9c38f26 --- /dev/null +++ b/stage5/patches/common/iscan-2.30.0-libpng-1.5.patch @@ -0,0 +1,60 @@ +Source: Rebased from https://bugs.gentoo.org/show_bug.cgi?id=302624 with more fixes +Upstream: no, proprietary upstream. +Reason: Fix build against libpng-1.5 + +diff --git a/lib/pngstream.cc b/lib/pngstream.cc +index b7a2a20..6cd011f 100644 +--- a/lib/pngstream.cc ++++ b/lib/pngstream.cc +@@ -83,7 +83,8 @@ namespace iscan + #if HAVE_PNG_H + set_error_handler (_png, _info); + +- if (_header && !_footer && _png->num_rows == _png->flush_rows) ++/* when not interlacing (ie, only one pass), number of rows is image height: _v_sz */ ++ if (!_footer && _v_sz == lib->get_current_row_number(_png)) + { + lib->write_end (_png, _info); + _footer = true; +@@ -167,6 +168,8 @@ namespace iscan + funcsym (write_row); + funcsym (write_flush); + funcsym (write_end); ++ funcsym (get_current_row_number); ++ funcsym (set_longjmp_fn); + + if (lib->access_version_number + && lib->create_write_struct +@@ -176,6 +179,8 @@ namespace iscan + && lib->set_IHDR + && lib->set_pHYs + && lib->set_invert_mono ++ && lib->get_current_row_number ++ && lib->set_longjmp_fn + && lib->write_info + && lib->write_row + && lib->write_flush +diff --git a/lib/pngstream.hh b/lib/pngstream.hh +index 77d4f54..91958bb 100644 +--- a/lib/pngstream.hh ++++ b/lib/pngstream.hh +@@ -108,6 +108,10 @@ namespace iscan + png_structp); + fundecl (void, write_end, + png_structp, png_infop); ++ fundecl (png_uint_32, get_current_row_number, ++ png_structp); ++ fundecl (jmp_buf*, set_longjmp_fn, ++ png_structp, png_longjmp_ptr, size_t); + #endif /* HAVE_PNG_H */ + }; + static png_lib_handle *lib; +@@ -130,7 +134,7 @@ namespace iscan + #if HAVE_PNG_H + #define set_error_handler(png, info) \ + { \ +- if (!png || !info || setjmp (png_jmpbuf (png))) \ ++ if (!png || !info || setjmp (*pngstream::lib->set_longjmp_fn(png, longjmp, sizeof (jmp_buf)))) \ + { \ + pngstream::lib->destroy_write_struct (&png, &info); \ + png = NULL; \ diff --git a/stage5/pkg/iscan b/stage5/pkg/iscan new file mode 100644 index 0000000..efd85a6 --- /dev/null +++ b/stage5/pkg/iscan @@ -0,0 +1,11 @@ +#!/bin/bash + +hvbuild_post() +{ + echo "epkowa" > /etc/sane.d/dll.conf + echo "usb" > /etc/sane.d/epkowa.conf + + # To register your scanner, run the following command: + # iscan-registry --add interpreter usb 0x04b8 0x012d \ + # /usr/lib/libesint66 /usr/share/iscan/esfw66.bin +} diff --git a/stage5/pkg/iscan-plugin-gt-s600 b/stage5/pkg/iscan-plugin-gt-s600 new file mode 100644 index 0000000..966e959 --- /dev/null +++ b/stage5/pkg/iscan-plugin-gt-s600 @@ -0,0 +1,11 @@ +#!/bin/bash + +hvbuild() +{ + # The path to the firmware file need to be /usr/share/iscan (hardcoded + # in iscan utilities) + install -dv -m 755 /usr/share/iscan + install -v -m 644 usr/share/iscan/* /usr/share/iscan + + cp -a usr/lib64/iscan/* /usr/lib +} -- 2.20.1