Github messages for voidlinux
 help / color / mirror / Atom feed
From: amak79 <amak79@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] sane: update to 1.0.32, add libcurl for escl backend, add runit service
Date: Fri, 23 Jul 2021 03:58:24 +0200	[thread overview]
Message-ID: <20210723015824.SYtNPsfUHMhbsIAlpvJ61l9pbwwL5AN0Ru5vjuqTOSk@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-31851@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 4694 bytes --]

There is an updated pull request by amak79 against master on the void-packages repository

https://github.com/amak79/void-packages sane
https://github.com/void-linux/void-packages/pull/31851

sane: update to 1.0.32, add libcurl for escl backend, add runit service
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->
Changes

* Update SANE to 1.0.32
* Make Avahi support optional
* Add libcurl for eSCL (AirScan) backend when Avahi is enabled
* Add `_saned` user/group
* Add a runit service for `saned`

There is an issue with the runit service when SANE is built with Avahi support. `saned` will spawn a second process (pid 1429) which can be seen below:
```
$ ps
1428 _saned   _saned    0.0  0.0  16164  6088 ?        S    18:57:06 00:00:00 saned -l -u _saned -d128
1429 _saned   _saned    0.0  0.0  16164   548 ?        S    18:57:06 00:00:00 saned -l -u _saned -d128
```
```
$ svlogtail
2021-07-08T08:57:06.35901 daemon.debug: Jul  8 18:57:06 saned[1428]: read_config: searching for config file
2021-07-08T08:57:06.35906 daemon.debug: Jul  8 18:57:06 saned[1428]: read_config: done reading config
2021-07-08T08:57:06.35909 daemon.debug: Jul  8 18:57:06 saned[1428]: saned (AF-indep+IPv6) from sane-backends 1.0.32 starting up
2021-07-08T08:57:06.35911 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: trying to get port for service "sane-port" (getaddrinfo)
2021-07-08T08:57:06.36066 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [1] socket () using IPv6
2021-07-08T08:57:06.36069 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [1] setsockopt ()
2021-07-08T08:57:06.36066 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [1] socket () using IPv6
2021-07-08T08:57:06.36069 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [1] setsockopt ()
2021-07-08T08:57:06.36070 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [1] bind () to port 6566
2021-07-08T08:57:06.36072 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [1] listen ()
2021-07-08T08:57:06.36076 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [0] socket () using IPv4
2021-07-08T08:57:06.36077 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [0] setsockopt ()
2021-07-08T08:57:06.36079 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [0] bind () to port 6566
2021-07-08T08:57:06.36080 daemon.debug: Jul  8 18:57:06 saned[1428]: do_bindings: [0] bind failed: Address already in use
2021-07-08T08:57:06.36083 daemon.debug: Jul  8 18:57:06 saned[1428]: Dropped privileges to uid 993 gid 990
2021-07-08T08:57:06.36084 daemon.debug: Jul  8 18:57:06 saned[1428]: run_standalone: spawning Avahi process
2021-07-08T08:57:06.36101 daemon.debug: Jul  8 18:57:06 saned[1428]: run_standalone: waiting for control connection
2021-07-08T08:57:06.36204 daemon.debug: Jul  8 18:57:06 saned[1429]: saned_avahi_callback: AVAHI_CLIENT_CONNECTING
```
The second process is related to Avahi functionality. `sv` will stop the main process (pid 1428) but the second process remains. This doesn’t occur when SANE is built without Avahi support. This is why I made Avahi support optional.

I don't know how to properly fix this other than to have a `./finish` script clean up any lingering `saned` processes, but I’m not sure how safe that is. If there is no acceptable solution I can drop the runit service from this PR.

A patch file from https://github.com/void-linux/void-packages/pull/31851.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sane-31851.patch --]
[-- Type: text/x-diff, Size: 3135 bytes --]

From c3065df44ec52d21ce6134e521a60e29cbe8ec0f Mon Sep 17 00:00:00 2001
From: amak <amak.git@outlook.com>
Date: Thu, 8 Jul 2021 18:42:06 +1000
Subject: [PATCH] sane: update to 1.0.32, add libcurl for escl backend, add
 runit service

Avahi support is now optional. The escl backend is only available
if Avahi is enabled.

When SANE is built with Avahi support, saned will spawn a second
process that sv can't stop. This issue should be taken upstream.
---
 srcpkgs/sane/files/saned/run |  3 +++
 srcpkgs/sane/template        | 28 ++++++++++++++++++++--------
 2 files changed, 23 insertions(+), 8 deletions(-)
 create mode 100644 srcpkgs/sane/files/saned/run

diff --git a/srcpkgs/sane/files/saned/run b/srcpkgs/sane/files/saned/run
new file mode 100644
index 000000000000..18016ad066c4
--- /dev/null
+++ b/srcpkgs/sane/files/saned/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+[ -r ./conf ] && . ./conf
+exec saned -l -u _saned ${OPTS}
diff --git a/srcpkgs/sane/template b/srcpkgs/sane/template
index 35dac1cc846a..11f1929d26d6 100644
--- a/srcpkgs/sane/template
+++ b/srcpkgs/sane/template
@@ -1,28 +1,38 @@
 # Template file for 'sane'
 pkgname=sane
-_gitlab_release_hash=8bf1cae2e1803aefab9e5331550e5d5d
-version=1.0.31
-revision=3
+_gitlab_release_hash=104f09c07d35519cc8e72e604f11643f
+version=1.0.32
+revision=1
 wrksrc="sane-backends-${version}"
 build_style=gnu-configure
 configure_args="--disable-locking --enable-ipv6 --enable-pthread
  --with-usb --docdir=/usr/share/doc/sane ac_cv_func_mmap_fixed_mapped=yes
  $(vopt_with snmp)"
 hostmakedepends="pkg-config"
-makedepends="avahi-libs-devel libjpeg-turbo-devel tiff-devel libgphoto2-devel
- v4l-utils-devel libusb-devel openssl-devel libxml2-devel
- $(vopt_if snmp net-snmp-devel)"
+makedepends="libjpeg-turbo-devel tiff-devel libgphoto2-devel v4l-utils-devel
+ libusb-devel openssl-devel libxml2-devel $(vopt_if snmp net-snmp-devel)
+ $(vopt_if avahi 'avahi-libs-devel libcurl-devel')"
 depends="$(vopt_if snmp net-snmp)"
 conf_files="/etc/sane.d/*.conf"
 short_desc="Scanner Access Now Easy"
 maintainer="Piraty <piraty1@inbox.ru>"
 license="GPL-2.0-or-later, SANE-exception"
 homepage="http://www.sane-project.org/"
+changelog="https://gitlab.com/sane-project/backends/-/raw/master/NEWS"
 distfiles="https://gitlab.com/sane-project/backends/uploads/${_gitlab_release_hash}/sane-backends-${version}.tar.gz"
-checksum=4a3b10fcb398ed854777d979498645edfe66fcac2f2fd2b9117a79ff45e2a5aa
+checksum=3a28c237c0a72767086202379f6dc92dbb63ec08dfbab22312cba80e238bb114
 noshlibprovides="avoid false detection of device drivers"
 
-build_options="snmp"
+# additional group 'lp' is required by saned to access some all-in-one devices
+system_accounts="_saned"
+_saned_groups="lp,scanner"
+
+build_options="avahi snmp"
+build_options_default="avahi"
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" python3"
+fi
 
 post_build() {
 	# generate udev file
@@ -40,6 +50,8 @@ post_install() {
 	vlicense LICENSE # License clarification
 	vlicense COPYING # GPL-2.0
 	sed -n "1,43 p" "${wrksrc}/backend/dll.c" > "${DESTDIR}/usr/share/licenses/sane/SANE-EXCEPTION"
+
+	vsv saned
 }
 
 libsane_package() {

  parent reply	other threads:[~2021-07-23  1:58 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08  9:45 [PR PATCH] " amak79
2021-07-08 10:07 ` [PR PATCH] [Updated] " amak79
2021-07-08 11:24 ` amak79
2021-07-09 20:47 ` [PR REVIEW] " Piraty
2021-07-09 20:54 ` Piraty
2021-07-10  0:45 ` [PR PATCH] [Updated] " amak79
2021-07-14  5:30 ` amak79
2021-07-17  4:04 ` ericonr
2021-07-17  7:29 ` amak79
2021-07-18  2:38 ` [PR PATCH] [Updated] " amak79
2021-07-20 19:20 ` [PR REVIEW] " ericonr
2021-07-20 19:20 ` ericonr
2021-07-21  0:56 ` [PR PATCH] [Updated] " amak79
2021-07-21 21:27 ` ericonr
2021-07-22  3:36 ` amak79
2021-07-22 18:53 ` ericonr
2021-07-23  1:58 ` amak79 [this message]
2021-07-23  2:06 ` amak79
2021-07-23 13:13 ` [PR PATCH] [Updated] " amak79
2021-08-13  2:27 ` amak79
2021-08-13  2:29 ` amak79
2021-08-24  8:01 ` [PR PATCH] [Updated] " amak79
2021-10-26  9:49 ` amak79
2021-10-28  4:20 ` [PR PATCH] [Merged]: sane: " ericonr
2021-10-28  4:20 ` ericonr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210723015824.SYtNPsfUHMhbsIAlpvJ61l9pbwwL5AN0Ru5vjuqTOSk@z \
    --to=amak79@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).