Add Epson scanner plugin and utilities
authorHugo Villeneuve <hugo@hugovil.com>
Tue, 30 Dec 2014 03:52:18 +0000 (22:52 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Tue, 30 Dec 2014 03:52:35 +0000 (22:52 -0500)
config/packages-list
stage5/hv-install-1
stage5/packages-update
stage5/patches/common/iscan-2.30.0-libpng-1.5.patch [new file with mode: 0644]
stage5/pkg/iscan [new file with mode: 0644]
stage5/pkg/iscan-plugin-gt-s600 [new file with mode: 0644]

index 02fb349..ce62e8b 100644 (file)
@@ -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"
index e236cf1..4213e25 100755 (executable)
@@ -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}
index cf1c2b5..6e2dc2a 100755 (executable)
@@ -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 (file)
index 0000000..9c38f26
--- /dev/null
@@ -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 (file)
index 0000000..efd85a6
--- /dev/null
@@ -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 (file)
index 0000000..966e959
--- /dev/null
@@ -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
+}