diff options
author | Luigi Rizzo <luigi@FreeBSD.org> | 2008-12-31 12:02:50 +0000 |
---|---|---|
committer | Luigi Rizzo <luigi@FreeBSD.org> | 2008-12-31 12:02:50 +0000 |
commit | 960fa658eab548613c9c6fbbe5cbb2bdd85a97f5 (patch) | |
tree | 2cc00aaf4f4376b9a03a240e954657fe4174945c /graphics/sane-epkowa | |
parent | 3b36010c1a734669d1fb13360772b996ccfd5fd3 (diff) | |
download | ports-960fa658eab548613c9c6fbbe5cbb2bdd85a97f5.tar.gz ports-960fa658eab548613c9c6fbbe5cbb2bdd85a97f5.zip |
Notes
Diffstat (limited to 'graphics/sane-epkowa')
-rw-r--r-- | graphics/sane-epkowa/Makefile | 106 | ||||
-rw-r--r-- | graphics/sane-epkowa/distinfo | 3 | ||||
-rw-r--r-- | graphics/sane-epkowa/files/patch-01 | 117 | ||||
-rw-r--r-- | graphics/sane-epkowa/files/patch-02 | 21 | ||||
-rw-r--r-- | graphics/sane-epkowa/files/patch-03 | 10 | ||||
-rw-r--r-- | graphics/sane-epkowa/pkg-descr | 7 | ||||
-rw-r--r-- | graphics/sane-epkowa/pkg-plist | 4 |
7 files changed, 268 insertions, 0 deletions
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 <luigi@FreeBSD.org> +# $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 <bsd.port.pre.mk> + +.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 <bsd.port.post.mk> 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 <config.h> + #endif + ++#include <stdio.h> /* snprintf */ + #include <sane/sane.h> + + +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 <arpa/inet.h> ++#include <netinet/in.h> /* INADDR_LOOPBACK on FreeBSD */ + #include <errno.h> + #include <string.h> + #include <sys/socket.h> +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 <alloca.h> ++//#include <alloca.h> + #include <stdlib.h> + + #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 <fcntl.h> /* for u_char */ ++#include <sys/types.h> /* 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 <string.h> + #include <sys/types.h> + #include <sys/wait.h> ++#include <sys/signal.h> /* SIGHUP on FreeBSD */ + #include <unistd.h> + + #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 <cstdlib> +-#include <argz.h> ++//#include <argz.h> + + 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 $(<D); \ +- if md5sum --status -c $(<F); then \ ++ if true; then \ + : ; \ + else \ + echo "ERROR: inconsistent set of header file and libraries"; \ diff --git a/graphics/sane-epkowa/files/patch-02 b/graphics/sane-epkowa/files/patch-02 new file mode 100644 index 000000000000..42e77d488100 --- /dev/null +++ b/graphics/sane-epkowa/files/patch-02 @@ -0,0 +1,21 @@ +--- frontend/pisa_main.cc.orig 2008-12-08 02:11:49.000000000 +0100 ++++ frontend/pisa_main.cc 2008-12-26 00:42:07.000000000 +0100 +@@ -41,6 +41,18 @@ + + int g_gimp_plugin = 1; + ++extern "C" { ++int __errno_location; ++#undef stderr; ++FILE *stderr; ++void __assert_fail(const char * assertion, const char * file, unsigned int ++line, const char * function) ++{ ++ fprintf(stderr, "fail\n"); ++} ++} ++ ++ + /*----------------------------------------------------------*/ + int main ( int argc, char * argv [ ] ) + { diff --git a/graphics/sane-epkowa/files/patch-03 b/graphics/sane-epkowa/files/patch-03 new file mode 100644 index 000000000000..e016929409f9 --- /dev/null +++ b/graphics/sane-epkowa/files/patch-03 @@ -0,0 +1,10 @@ +--- backend/cfg-obj.c 2008-12-08 02:11:49.000000000 +0100 ++++ backend/cfg-obj.c 2008-12-26 22:17:45.000000000 +0100 +@@ -487,6 +487,7 @@ + static FILE * + _cfg_fopen_conf (const char *name) + { ++return sanei_config_open(name); + const char *default_path = "." PATH_SEP_STR SANE_CONFIG_DIR_NAME; + + char *path = getenv ("SANE_CONFIG_DIR"); diff --git a/graphics/sane-epkowa/pkg-descr b/graphics/sane-epkowa/pkg-descr new file mode 100644 index 000000000000..93fb96d520a4 --- /dev/null +++ b/graphics/sane-epkowa/pkg-descr @@ -0,0 +1,7 @@ +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/ diff --git a/graphics/sane-epkowa/pkg-plist b/graphics/sane-epkowa/pkg-plist new file mode 100644 index 000000000000..3e5ee042a2b6 --- /dev/null +++ b/graphics/sane-epkowa/pkg-plist @@ -0,0 +1,4 @@ +etc/sane.d/epkowa.conf +lib/sane/libsane-epkowa.so +lib/sane/libsane-epkowa.so.1 +@unexec sed -I -e '/^epkowa$/d' %D/etc/sane.d/dll.conf |