From 960fa658eab548613c9c6fbbe5cbb2bdd85a97f5 Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Wed, 31 Dec 2008 12:02:50 +0000 Subject: A SANE scanner backend for various Epson scanners. This backend supports many more devices than the sane-epson included in graphics/sane-backends, including new multifunction devices such as the SX400. http://avasys.jp/english/ --- graphics/Makefile | 1 + graphics/sane-epkowa/Makefile | 106 ++++++++++++++++++++++++++++++++ graphics/sane-epkowa/distinfo | 3 + graphics/sane-epkowa/files/patch-01 | 117 ++++++++++++++++++++++++++++++++++++ graphics/sane-epkowa/files/patch-02 | 21 +++++++ graphics/sane-epkowa/files/patch-03 | 10 +++ graphics/sane-epkowa/pkg-descr | 7 +++ graphics/sane-epkowa/pkg-plist | 4 ++ 8 files changed, 269 insertions(+) create mode 100644 graphics/sane-epkowa/Makefile create mode 100644 graphics/sane-epkowa/distinfo create mode 100644 graphics/sane-epkowa/files/patch-01 create mode 100644 graphics/sane-epkowa/files/patch-02 create mode 100644 graphics/sane-epkowa/files/patch-03 create mode 100644 graphics/sane-epkowa/pkg-descr create mode 100644 graphics/sane-epkowa/pkg-plist (limited to 'graphics') diff --git a/graphics/Makefile b/graphics/Makefile index 4eeae52a3496..8f38338d88b4 100644 --- a/graphics/Makefile +++ b/graphics/Makefile @@ -744,6 +744,7 @@ SUBDIR += sage SUBDIR += sam2p SUBDIR += sane-backends + SUBDIR += sane-epkowa SUBDIR += sane-frontends SUBDIR += scale2x SUBDIR += sced diff --git a/graphics/sane-epkowa/Makefile b/graphics/sane-epkowa/Makefile new file mode 100644 index 000000000000..37d8c1a8b8cd --- /dev/null +++ b/graphics/sane-epkowa/Makefile @@ -0,0 +1,106 @@ +# New ports collection makefile for: epkowa +# Date created: Dec.23, 2008 +# Whom: luigi@FreeBSD.org +# +# Maintainers: Luigi Rizzo +# $FreeBSD$ +# +# This port builds version 2.11.0 of the sane-epkowa driver for SANE. +# (more recent versions do not work - read details below). +# +# The source for sane-epkowa is accessible through +# +# http://www.avasys.jp/lx-bin2/linux_e/spc/DL1.do#download +# +# Note that the download interface above requests to fill a form, +# and returns only the most recent version of the software. +# However the license of the software is GPL-like, and the documentation +# coming with the code (README, non-free/AVASYSPL.en.txt) explicitly +# mentions that source redistribution is allowed with no other conditions. +# +# Given that there is no other way for us to get version 2.11.0, +# and since this is allowed by the license, we go straight at the +# URL for the .tar.gz we need. +# The various versions of the code are at: +# +# http://lx1.avasys.jp/iscan/2.7.0/iscan-2.7.0-1.c2.tar.gz +# http://lx1.avasys.jp/iscan/2.8.0/iscan-2.8.0-1.c2.tar.gz +# -- unknown URL for version 2.9.0 +# http://lx1.avasys.jp/iscan/2.10.0/iscan_2.10.0-1.tar.gz +# http://lx1.avasys.jp/iscan/2.11.0/iscan_2.11.0-1.tar.gz +# http://lx1.avasys.jp/iscan/2.12.0/iscan_2.12.0-4.tar.gz +# --- version 2.13 never released +# http://lx1.avasys.jp/iscan/2.14.0/iscan_2.14.0-3.tar.gz +# http://linux.avasys.jp/drivers/iscan/2.15.0/iscan_2.15.0-3.tar.gz +# +# Version 2.7.0 to 2.11.0 build on FreeBSD without any patch. +# This port builds version 2.11.0, which is enough to detect the new +# multifunction SX400 scanner/printer that is not supported by the 'epson' +# backend coming with sane-backends. +# +# Version 2.15.0 builds with the patches included with this port, +# but does not work at runtime due to various issues not solved yet. + +PORTNAME= epkowa +PORTVERSION= 2.11.0 +CATEGORIES= graphics +MASTER_SITES= http://lx1.avasys.jp/iscan/${PORTVERSION}/ +DISTNAME= iscan_${PORTVERSION}-1 + +MAINTAINER= luigi@FreeBSD.org +COMMENT= The sane-epkowa driver for FreeBSD + +# use the following two lines for 2.15.0 +# MASTER_SITES=http://linux.avasys.jp/drivers/iscan/${PORTVERSION}/ +# DISTNAME= iscan_${PORTVERSION}-3 + +WRKSRC=${WRKDIR}/iscan-${PORTVERSION} + +MAN5= sane-epkowa.5 + +# We use LIB_DEPENDS, but the dependency is also at build time +LIB_DEPENDS+= ltdl:${PORTSDIR}/devel/libltdl15 +LIB_DEPENDS+= usb:${PORTSDIR}/devel/libusb +LIB_DEPENDS+= getline:${PORTSDIR}/devel/libgetline +LIB_DEPENDS+= sane.1:${PORTSDIR}/graphics/sane-backends + +#BUILD_DEPENDS+= ${LOCALBASE}/lib/libltdl.so:${PORTSDIR}/devel/libltdl15 + +# The original uses gmake and ./configure +# Also pass appropriate flags to configure to use FreeBSD locations. +USE_GMAKE= yes +GNU_CONFIGURE= yes +CONFIGURE_ARGS+= --prefix=${PREFIX} LDFLAGS="-L${PREFIX}/lib -lgetline" CPPFLAGS=-I${PREFIX}/include + +.include + +.if $(PORTVERSION) != "2.15.0" +do-patch: # nothing to do + +do-build: + ( cd ${WRKSRC}/libltdl ; ${GMAKE} ) + ( cd ${WRKSRC}/sanei ; ${GMAKE} ) + ( cd ${WRKSRC}/backend ; ${GMAKE} ) + ( cd ${WRKSRC}/doc ; ${GMAKE} ) +.else +.warning version 2.15.0 not working yet +# Remove versioned symbols to link with FreeBSD's [g]libc +post-patch: + ( cd ${WRKSRC}/non-free; ${CP} -p libesmod-i386.so x.so; \ + ${OBJCOPY} -R .gnu.version x.so libesmod-i386.so ) + +# only build the backend part +do-build: + ( cd ${WRKSRC}/backend ; ${GMAKE} ) + ( cd ${WRKSRC}/doc ; ${GMAKE} ) +.endif + +do-install: + @${INSTALL_MAN} ${WRKSRC}/doc/sane-epkowa.5 ${PREFIX}/man/man5 + @${INSTALL_DATA} ${WRKSRC}/backend/.libs/libsane-epkowa.so.1 \ + ${PREFIX}/lib/sane/ + @(cd ${PREFIX}/lib/sane; ${LN} -s libsane-epkowa.so.1 libsane-epkowa.so ) + @echo "usb /dev/uscanner0" > ${PREFIX}/etc/sane.d/epkowa.conf + @echo "epkowa" >> ${PREFIX}/etc/sane.d/dll.conf + +.include diff --git a/graphics/sane-epkowa/distinfo b/graphics/sane-epkowa/distinfo new file mode 100644 index 000000000000..0feab95b6a3f --- /dev/null +++ b/graphics/sane-epkowa/distinfo @@ -0,0 +1,3 @@ +MD5 (iscan_2.11.0-1.tar.gz) = 76991cb47dc8ff1269e47d4bce3d41b5 +SHA256 (iscan_2.11.0-1.tar.gz) = ae0a72647acfa4cedc320e280014d3cdf8d61c0f4e2a7e941697cf2f36bed0a8 +SIZE (iscan_2.11.0-1.tar.gz) = 1458880 diff --git a/graphics/sane-epkowa/files/patch-01 b/graphics/sane-epkowa/files/patch-01 new file mode 100644 index 000000000000..44b6ae2709a1 --- /dev/null +++ b/graphics/sane-epkowa/files/patch-01 @@ -0,0 +1,117 @@ +diff -ubwr ../iscan-2.15.0.orig/backend/backend.h ./backend/backend.h +--- ../iscan-2.15.0.orig/backend/backend.h 2008-12-08 02:11:49.000000000 +0100 ++++ ./backend/backend.h 2008-12-25 11:32:46.000000000 +0100 +@@ -74,6 +74,7 @@ + #include + #endif + ++#include /* snprintf */ + #include + + +diff -ubwr ../iscan-2.15.0.orig/backend/channel-net.c ./backend/channel-net.c +--- ../iscan-2.15.0.orig/backend/channel-net.c 2008-12-08 02:11:49.000000000 +0100 ++++ ./backend/channel-net.c 2008-12-25 11:35:29.000000000 +0100 +@@ -75,6 +75,7 @@ + #include "channel.h" + + #include ++#include /* INADDR_LOOPBACK on FreeBSD */ + #include + #include + #include +diff -ubwr ../iscan-2.15.0.orig/backend/defines.h ./backend/defines.h +--- ../iscan-2.15.0.orig/backend/defines.h 2008-12-08 02:11:49.000000000 +0100 ++++ ./backend/defines.h 2008-12-25 11:33:07.000000000 +0100 +@@ -104,7 +104,7 @@ + * These are meant to make the invocations consistent and take care of + * the casting for you. + */ +-#include ++//#include + #include + + #define t_alloca(sz,t) ((t *) alloca ((sz) * sizeof (t))) +diff -ubwr ../iscan-2.15.0.orig/backend/epkowa.h ./backend/epkowa.h +--- ../iscan-2.15.0.orig/backend/epkowa.h 2008-12-08 02:11:49.000000000 +0100 ++++ ./backend/epkowa.h 2008-12-25 11:34:09.000000000 +0100 +@@ -274,6 +274,7 @@ + typedef struct Epson_Scanner Epson_Scanner; + + #include /* for u_char */ ++#include /* for u_char */ + + typedef struct + { +diff -ubwr ../iscan-2.15.0.orig/backend/net-obj.c ./backend/net-obj.c +--- ../iscan-2.15.0.orig/backend/net-obj.c 2008-12-08 02:11:49.000000000 +0100 ++++ ./backend/net-obj.c 2008-12-25 11:34:47.000000000 +0100 +@@ -73,6 +73,7 @@ + #include + #include + #include ++#include /* SIGHUP on FreeBSD */ + #include + + #include "defines.h" +diff -ubwr ../iscan-2.15.0.orig/lib/basic-imgstream.cc ./lib/basic-imgstream.cc +--- ../iscan-2.15.0.orig/lib/basic-imgstream.cc 2008-12-08 02:11:49.000000000 +0100 ++++ ./lib/basic-imgstream.cc 2008-12-25 11:31:39.000000000 +0100 +@@ -34,7 +34,7 @@ + #include "basic-imgstream.hh" + + #include +-#include ++//#include + + namespace iscan + { +@@ -175,6 +175,7 @@ + + const char *path = NULL; + ++#if 0 + if ((path = lt_dlgetsearchpath ()) + && 0 != argz_add_sep (&pathz, &length, path, delimiter)) + { +@@ -195,6 +196,10 @@ + { + is_pathz_ok = false; + } ++#else ++is_pathz_ok = false; ++#define argz_next(a,b,c) NULL ++#endif + } + + if (is_pathz_ok) +@@ -204,7 +209,7 @@ + && (dir_name = argz_next (pathz, length, dir_name))) + { + struct dirent **match = NULL; +- int count = scandir (dir_name, &match, selector, reversionsort); ++ int count = scandir (dir_name, &match, (int (*)(dirent*))selector, reversionsort); + + for (int i = 0; !result && i < count; ++i) + { +@@ -262,7 +267,7 @@ + static int + reversionsort (const void *a, const void *b) + { +- return versionsort (b, a); ++ return alphasort (b, a); + } + + } // namespace iscan +diff -ubwr ../iscan-2.15.0.orig/non-free/Makefile.in ./non-free/Makefile.in +--- ../iscan-2.15.0.orig/non-free/Makefile.in 2008-12-08 02:12:08.000000000 +0100 ++++ ./non-free/Makefile.in 2008-12-25 11:36:04.000000000 +0100 +@@ -404,7 +404,7 @@ + + checksum: $(srcdir)/checksums.md5 + @(cd $(