summaryrefslogtreecommitdiff
path: root/graphics/sane-airscan
diff options
context:
space:
mode:
authorryoon <ryoon@pkgsrc.org>2020-12-09 12:05:58 +0000
committerryoon <ryoon@pkgsrc.org>2020-12-09 12:05:58 +0000
commit62638189a2c91aecf21512072afeaed8c2aeb822 (patch)
tree7f2633be6d4f8eaf1f0ebf2030a0883ffcd6783f /graphics/sane-airscan
parentaaea940d352ef8c17864c604891354da1e077cb6 (diff)
downloadpkgsrc-62638189a2c91aecf21512072afeaed8c2aeb822.tar.gz
graphics/sane-airscan: import sane-airscan-0.99.21
SANE backend for Apple AirScan (eSCL) and WSD scanners.
Diffstat (limited to 'graphics/sane-airscan')
-rw-r--r--graphics/sane-airscan/DESCR1
-rw-r--r--graphics/sane-airscan/Makefile32
-rw-r--r--graphics/sane-airscan/PLIST8
-rw-r--r--graphics/sane-airscan/distinfo9
-rw-r--r--graphics/sane-airscan/patches/patch-airscan-netif.c21
-rw-r--r--graphics/sane-airscan/patches/patch-airscan-os.c30
-rw-r--r--graphics/sane-airscan/patches/patch-meson.build15
7 files changed, 116 insertions, 0 deletions
diff --git a/graphics/sane-airscan/DESCR b/graphics/sane-airscan/DESCR
new file mode 100644
index 00000000000..aead74dccb4
--- /dev/null
+++ b/graphics/sane-airscan/DESCR
@@ -0,0 +1 @@
+SANE backend for Apple AirScan (eSCL) and WSD scanners.
diff --git a/graphics/sane-airscan/Makefile b/graphics/sane-airscan/Makefile
new file mode 100644
index 00000000000..34702aa82b7
--- /dev/null
+++ b/graphics/sane-airscan/Makefile
@@ -0,0 +1,32 @@
+# $NetBSD: Makefile,v 1.1 2020/12/09 12:05:58 ryoon Exp $
+
+GITHUB_PROJECT= sane-airscan
+GITHUB_TAG= 0.99.21
+DISTNAME= sane-airscan-0.99.21
+CATEGORIES= graphics
+MASTER_SITES= ${MASTER_SITE_GITHUB:=alexpevzner/}
+
+MAINTAINER= ryoon@NetBSD.org
+HOMEPAGE= https://github.com/alexpevzner/sane-airscan/
+COMMENT= SANE backend for Apple AirScan (eSCL) and WSD
+LICENSE= gnu-gpl-v2
+
+USE_LANGUAGES= c c++
+
+SUBST_CLASSES+= prefix
+SUBST_STAGE.prefix= pre-configure
+SUBST_MESSAGE.prefix= Fix config install path
+SUBST_FILES.prefix= meson.build
+SUBST_VARS.prefix= PREFIX
+
+EGDIR= ${PREFIX}/share/examples/
+CONF_FILES= ${EGDIR}/airscan.conf ${PREFIX}/etc/sane.d/airscan.conf
+
+
+.include "../../devel/meson/build.mk"
+.include "../../graphics/sane-backends/buildlink3.mk"
+.include "../../net/avahi/buildlink3.mk"
+.include "../../security/gnutls/buildlink3.mk"
+.include "../../textproc/libxml2/buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/graphics/sane-airscan/PLIST b/graphics/sane-airscan/PLIST
new file mode 100644
index 00000000000..d398f782dd9
--- /dev/null
+++ b/graphics/sane-airscan/PLIST
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST,v 1.1 2020/12/09 12:05:58 ryoon Exp $
+bin/airscan-discover
+etc/sane.d/dll.d/airscan
+lib/sane/libsane-airscan.so
+lib/sane/libsane-airscan.so.1
+man/man1/airscan-discover.1
+man/man5/sane-airscan.5
+share/examples/airscan.conf
diff --git a/graphics/sane-airscan/distinfo b/graphics/sane-airscan/distinfo
new file mode 100644
index 00000000000..c883b7fd127
--- /dev/null
+++ b/graphics/sane-airscan/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1 2020/12/09 12:05:58 ryoon Exp $
+
+SHA1 (sane-airscan-0.99.21.tar.gz) = 679a0be46117b053c2479c57faaec358df2e742a
+RMD160 (sane-airscan-0.99.21.tar.gz) = cf2124e9bb4bc777ca56cd104ce621090d8a2fcc
+SHA512 (sane-airscan-0.99.21.tar.gz) = ab713995cfba6df4f627cf4bdf16222ddab64010c254d20b6a48f4aed22aef911c0b25c432983eee8ddf4b9d517224c62b032c02769943f2cca3dbdc6cf38010
+Size (sane-airscan-0.99.21.tar.gz) = 191255 bytes
+SHA1 (patch-airscan-netif.c) = 3b06cf883514c8804e2854a5e00ccd9fae957b7c
+SHA1 (patch-airscan-os.c) = 46e65e141d97356d2e6c7b16a4e78f53a83e9ec8
+SHA1 (patch-meson.build) = 0a8ff042c8baaa7be486d923d9ed67bd8edf4443
diff --git a/graphics/sane-airscan/patches/patch-airscan-netif.c b/graphics/sane-airscan/patches/patch-airscan-netif.c
new file mode 100644
index 00000000000..cefd8bfb96a
--- /dev/null
+++ b/graphics/sane-airscan/patches/patch-airscan-netif.c
@@ -0,0 +1,21 @@
+$NetBSD: patch-airscan-netif.c,v 1.1 2020/12/09 12:05:58 ryoon Exp $
+
+* Support NetBSD.
+
+--- airscan-netif.c.orig 2020-11-23 19:47:02.000000000 +0000
++++ airscan-netif.c
+@@ -578,9 +578,14 @@ netif_init (void)
+ return SANE_STATUS_IO_ERROR;
+ }
+
++#if defined(__NetBSD__)
++ unsigned char rtfilter[] = { RTM_NEWADDR, RTM_DELADDR };
++ if (setsockopt(netif_rtnetlink_sock, AF_ROUTE, RO_MSGFILTER,
++#else
+ unsigned int rtfilter =
+ ROUTE_FILTER(RTM_NEWADDR) | ROUTE_FILTER(RTM_DELADDR);
+ if (setsockopt(netif_rtnetlink_sock, AF_ROUTE, ROUTE_MSGFILTER,
++#endif
+ &rtfilter, sizeof(rtfilter)) < 0) {
+ log_debug(NULL, "can't set ROUTE_MSGFILTER: %s", strerror(errno));
+ return SANE_STATUS_IO_ERROR;
diff --git a/graphics/sane-airscan/patches/patch-airscan-os.c b/graphics/sane-airscan/patches/patch-airscan-os.c
new file mode 100644
index 00000000000..3cfec730895
--- /dev/null
+++ b/graphics/sane-airscan/patches/patch-airscan-os.c
@@ -0,0 +1,30 @@
+$NetBSD: patch-airscan-os.c,v 1.1 2020/12/09 12:05:58 ryoon Exp $
+
+* Support NetBSD.
+
+--- airscan-os.c.orig 2020-11-23 19:47:02.000000000 +0000
++++ airscan-os.c
+@@ -17,7 +17,7 @@
+ #include <unistd.h>
+ #include <sys/stat.h>
+
+-#ifdef __OpenBSD__
++#if defined(__OpenBSD__) || defined(__NetBSD__)
+ # include <sys/types.h>
+ # include <sys/sysctl.h>
+ #endif
+@@ -92,6 +92,14 @@ os_progname_init (void)
+ return;
+ }
+ memmove(os_progname_buf, kp.p_comm, KI_MAXCOMLEN);
++#elif defined(__NetBSD__)
++ struct kinfo_proc2 kp;
++ int mib[] = {CTL_KERN, KERN_PROC2, KERN_PROC_PID, getpid(), sizeof(kp), 1};
++ size_t len = sizeof(kp);
++ int rc = sysctl(mib, 6, &kp, &len, NULL, 0);
++ if (rc == -1) {
++ return;
++ }
+ #else
+ /* This is nice to have but not critical. The caller already has
+ to handle os_progname returning NULL. The error is left as a
diff --git a/graphics/sane-airscan/patches/patch-meson.build b/graphics/sane-airscan/patches/patch-meson.build
new file mode 100644
index 00000000000..787df4cf1c4
--- /dev/null
+++ b/graphics/sane-airscan/patches/patch-meson.build
@@ -0,0 +1,15 @@
+$NetBSD: patch-meson.build,v 1.1 2020/12/09 12:05:58 ryoon Exp $
+
+* Install configuration file under share/examples for pkgsrc.
+
+--- meson.build.orig 2020-11-23 19:47:02.000000000 +0000
++++ meson.build
+@@ -91,7 +91,7 @@ endforeach
+ install_man('sane-airscan.5')
+ install_man('airscan-discover.1')
+ install_data('airscan.conf',
+- install_dir: join_paths(get_option('sysconfdir'), 'sane.d')
++ install_dir: '@PREFIX@/share/examples'
+ )
+ install_data(dll_file,
+ install_dir: join_paths(get_option('sysconfdir'), 'sane.d', 'dll.d')