Resurrect graphics/sane-epkowa@r363261.

Stagify.

Take ownership for now.
This commit is contained in:
Cy Schubert
2016-01-15 05:39:45 +00:00
parent adb36533d8
commit 0c3ff6c0a1
9 changed files with 274 additions and 1 deletions

1
MOVED
View File

@@ -6609,7 +6609,6 @@ graphics/mingplot||2014-09-01|Not staged
graphics/orca||2014-09-01|Not staged
graphics/php5-chartdirector||2014-09-01|Not staged
graphics/ruby-rmagick||2014-09-01|Not staged
graphics/sane-epkowa||2014-09-01|Not staged
graphics/uDrawGraph||2014-09-01|Not staged
graphics/visionworkbench||2014-09-01|Not staged
irc/bobot++||2014-09-01|Not staged

View File

@@ -954,6 +954,7 @@
SUBDIR += sam2p
SUBDIR += sampleicc
SUBDIR += sane-backends
SUBDIR += sane-epkowa
SUBDIR += sane-frontends
SUBDIR += scale2x
SUBDIR += scantailor

View File

@@ -0,0 +1,109 @@
# Created by: luigi@FreeBSD.org
# $FreeBSD$
# Maintainers: Luigi Rizzo <luigi@FreeBSD.org>
#
# 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
PORTREVISION= 5
CATEGORIES= graphics
MASTER_SITES= http://lx1.avasys.jp/iscan/${PORTVERSION}/
DISTNAME= iscan_${PORTVERSION}-1
MAINTAINER= cy@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}
# We use LIB_DEPENDS, but the dependency is also at build time
LIB_DEPENDS+= libltdl.so:${PORTSDIR}/devel/libltdl
LIB_DEPENDS+= libgetline.so:${PORTSDIR}/devel/libgetline
LIB_DEPENDS+= libsane.so:${PORTSDIR}/graphics/sane-backends
#BUILD_DEPENDS+= ${LOCALBASE}/lib/libltdl.so:${PORTSDIR}/devel/libltdl
# gtk libraries are used by the frontend, which we do not build, however
# the configure script relies on that and fails if not present, so as
# a quick fix we set USE_GNOME
USE_GNOME= gtk20
# The original uses gmake and ./configure
# Also pass appropriate flags to configure to use FreeBSD locations.
USES= gmake pkgconfig
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 ; ${MAKE_CMD} )
( cd ${WRKSRC}/sanei ; ${MAKE_CMD} )
( cd ${WRKSRC}/backend ; ${MAKE_CMD} )
( cd ${WRKSRC}/doc ; ${MAKE_CMD} )
@${GZIP_CMD} ${WRKSRC}/doc/sane-epkowa.5
.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 ; ${MAKE_CMD} )
( cd ${WRKSRC}/doc ; ${MAKE_CMD} )
@${GZIP_CMD} ${WRKSRC}/doc/sane-epkowa.5
.endif
do-install:
@${INSTALL_MAN} ${WRKSRC}/doc/sane-epkowa.5.gz ${STAGEDIR}${PREFIX}/man/man5
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/sane ${STAGEDIR}${PREFIX}/etc/sane.d
@${INSTALL_DATA} ${WRKSRC}/backend/.libs/libsane-epkowa.so.1 \
${STAGEDIR}${PREFIX}/lib/sane/
@(cd ${STAGEDIR}${PREFIX}/lib/sane; ${LN} -s libsane-epkowa.so.1 libsane-epkowa.so )
@echo "usb /dev/uscanner0" > ${STAGEDIR}${PREFIX}/etc/sane.d/epkowa.conf.sample
.include <bsd.port.post.mk>

View File

@@ -0,0 +1,2 @@
SHA256 (iscan_2.11.0-1.tar.gz) = ae0a72647acfa4cedc320e280014d3cdf8d61c0f4e2a7e941697cf2f36bed0a8
SIZE (iscan_2.11.0-1.tar.gz) = 1458880

View File

@@ -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");

View File

@@ -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 [ ] )
{

View File

@@ -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"; \

View File

@@ -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.
WWW: http://avasys.jp/english/

View File

@@ -0,0 +1,7 @@
lib/sane/libsane-epkowa.so
lib/sane/libsane-epkowa.so.1
man/man5/sane-epkowa.5.gz
@postexec echo "epkowa" >> %D/etc/sane.d/dll.conf
@postexec echo "usb /dev/uscanner0" > %D/etc/sane.d/epkowa.conf.sample
@preunexec sed -i "" -e '/^epkowa$/d' %D/etc/sane.d/dll.conf
@sample etc/sane.d/epkowa.conf.sample