Bug 229653 - graphics/sane-backends: Fix PORTVERSION 1.0.27 using 1.0.25 sources
Summary: graphics/sane-backends: Fix PORTVERSION 1.0.27 using 1.0.25 sources
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Tobias Kortkamp
URL:
Keywords: needs-qa
: 240205 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-07-09 18:20 UTC by Peter Wullinger
Modified: 2019-08-30 09:15 UTC (History)
4 users (show)

See Also:
tobik: merge-quarterly-


Attachments
make sane-backends build again (3.15 KB, patch)
2018-07-09 18:20 UTC, Peter Wullinger
no flags Details | Diff
Actually updates port to version listed; fixes build (41.57 KB, patch)
2018-08-27 06:01 UTC, Nathan
ndowens04: maintainer-approval+
Details | Diff
updated patch, includes Nathan's fixes (25.34 KB, patch)
2018-08-28 15:16 UTC, Peter Wullinger
no flags Details | Diff
again: updated patch (32.38 KB, patch)
2018-12-09 11:26 UTC, Peter Wullinger
no flags Details | Diff
update to 1.0.27 (3.15 KB, patch)
2018-12-10 21:43 UTC, Peter Wullinger
no flags Details | Diff
update to 1.0.27 (26.08 KB, patch)
2018-12-10 22:00 UTC, Peter Wullinger
no flags Details | Diff
update to 1.0.27 (26.12 KB, patch)
2018-12-17 06:42 UTC, Peter Wullinger
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Wullinger 2018-07-09 18:20:45 UTC
Created attachment 195006 [details]
make sane-backends build again

The ports tree currently contains an incomplete update attempt to 1.0.27 that does not build for me with incorrect patches.

The following patch makes the port build again.

Note that I have not tested the changes besides doing a package build, since I lack the actual hardware for real testing.
Comment 1 Steve Wills freebsd_committer 2018-07-27 14:12:47 UTC
I'm not seeing a build issue currently, can you share any details on the issue you're seeing?
Comment 2 Peter Wullinger 2018-07-27 21:30:47 UTC
(In reply to Steve Wills from comment #1)

Weirdly enough, I did have build problems when I was writing that bug report, but the (portsnap'd) version is now back to 1.0.25 on my machine.

However, HEAD still has these problems as far as I can tell:

https://svnweb.freebsd.org/ports/head/graphics/sane-backends/Makefile?revision=472451&view=markup

Makefile has:

    PORTVERSION= 1.0.27

but
    
    WRKSRC= ${WRKDIR}/${PORTNAME}-1.0.25

* distfile checksum is wrong for 1.0.27 (sha256 should be 293747bf37275c424ebb2c833f8588601a60b2f9653945d5a3194875355e36c9, upstream only provides md5, however)
* patches in files/ don't apply against 1.0.27
Comment 3 Nathan 2018-08-27 03:17:16 UTC
(In reply to Peter Wullinger from comment #2)
I can confirm,
 WRKSRC=         ${WRKDIR}/${PORTNAME}-1.0.25
Comment 4 Nathan 2018-08-27 03:27:06 UTC
(In reply to Nathan from comment #3)
Found out, first source is master_sites downloads 1.0.25
Revising Makefile and will submit here
Comment 5 Nathan 2018-08-27 04:56:29 UTC
(In reply to Nathan from comment #4)
Update so far I've got it building, except video4linux option, it's giving me issues; trying to fix it
Comment 6 Nathan 2018-08-27 06:01:59 UTC
Created attachment 196585 [details]
Actually updates port to version listed; fixes build

graphics/sane-backends:

* IEEE1284 only available on i386
* debian mirror was providing older version
Comment 7 Nathan 2018-08-27 06:05:51 UTC
(In reply to Nathan from comment #6)
What i mean about IEEE1284 only available on i386, is the dependency
Comment 8 Peter Wullinger 2018-08-27 20:44:04 UTC
(In reply to Nathan from comment #6)

With your patch I get

epsonds.c:234:4: warning: implicit declaration of function 'setsockopt' is invalid in C99 [-Wimplicit-function-declaration]
                        setsockopt(s->fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv,  sizeof(tv));
                        ^
epsonds.c:234:22: error: use of undeclared identifier 'SOL_SOCKET'
                        setsockopt(s->fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv,  sizeof(tv));
                                          ^
epsonds.c:234:34: error: use of undeclared identifier 'SO_RCVTIMEO'
                        setsockopt(s->fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv,  sizeof(tv));

for me. Presumably, because the patch missing the respective changes to include sys/socket.h:

https://bugs.freebsd.org/bugzilla/attachment.cgi?id=195006&action=diff#graphics/sane-backends/files/patch-backend__epsonds.c_sec1
Comment 9 Nathan 2018-08-27 20:45:45 UTC
(In reply to Peter Wullinger from comment #8)
Weird. I had it working and added that header file but will look at it ASAP
Comment 10 Nathan 2018-08-27 21:42:08 UTC
(In reply to Peter Wullinger from comment #8)
	--- backend/epsonds.c.orig	2018-07-09 20:06:33.428965000 +0200-
2	+++ backend/epsonds.c	2018-07-09 20:06:49.979599000 +0200
3	@@ -40,6 +40,8 @@
4	 
5	 #include "sane/config.h"
6	 
7	+#include <sys/types.h>
8	+#include <sys/socket.h> Here's the "missing header" in patch part
9	 #include <ctype.h>
10	 #include <unistd.h>
Comment 11 Peter Wullinger 2018-08-27 22:11:30 UTC
(In reply to Nathan from comment #10)

Yes, that does it. However, I now get errors from pkg-static, since pkg-message and saned (the script) have been removed but are still referenced from Makefile.

Was the removal intentional, i.e. is saned no longer needed/working?

If so:
--- graphics/sane-backends/Makefile     (Revision 478257)
+++ graphics/sane-backends/Makefile     (Arbeitskopie)
@@ -3,10 +3,9 @@

 PORTNAME=      sane-backends
 PORTVERSION=   1.0.27
-PORTREVISION=  3
+PORTREVISION=  4
 CATEGORIES=    graphics
-MASTER_SITES=  https://alioth.debian.org/frs/download.php/file/4146/ \
-               http://fossies.org/linux/misc/
+MASTER_SITES=  http://fossies.org/linux/misc/

 MAINTAINER=    ports@FreeBSD.org
 COMMENT=       API for access to scanners, digitals camera, frame grabbers etc
@@ -26,17 +25,14 @@
                --without-systemd
 INSTALL_TARGET=        install-strip
 USE_LDCONFIG=  yes
-USE_RC_SUBR=   saned
-WRKSRC=                ${WRKDIR}/${PORTNAME}-1.0.25

-SUB_FILES=     pkg-message
-
 USERS= saned
 GROUPS=        saned

 PORTDOCS=      *

-OPTIONS_DEFINE=                AVAHI DOCS GPHOTO IEEE1284 IPV6 NLS SNMP USB V4L
+OPTIONS_DEFINE=                AVAHI DOCS GPHOTO IPV6 NLS SNMP USB V4L
+OPTIONS_DEFINE_i386=   IEEE1284
 OPTIONS_DEFAULT=       USB
 OPTIONS_SUB=           yes
Comment 12 Nathan 2018-08-27 22:17:56 UTC
Are you using patch of svn patch
Comment 13 Peter Wullinger 2018-08-28 12:02:05 UTC
(In reply to Nathan from comment #12)

I'm reading the raw diff and that seems to empty out saned.in (https://bugs.freebsd.org/bugzilla/attachment.cgi?id=196585&action=diff#graphics/sane-backends/files/saned.in_sec1)

Am I interpreting something wrong?
Comment 14 Nathan 2018-08-28 12:03:14 UTC
(In reply to Peter Wullinger from comment #13)
I’ll take a look ASAP
Comment 15 Peter Wullinger 2018-08-28 15:16:41 UTC
Created attachment 196647 [details]
updated patch, includes Nathan's fixes

incorporate changes from Nathan Dowens, but resurrect pkg-message and rc.d/saned
Comment 16 Nathan 2018-08-28 16:09:39 UTC
(In reply to Peter Wullinger from comment #15)
Thanks. Was working on it when I could at work and on iPhone which takes longer
Comment 17 Peter Wullinger 2018-12-09 11:26:47 UTC
Created attachment 199973 [details]
again: updated patch

Make sane-backends build with 10.0.27

Add additional patches for backend/epsonds.c
Comment 18 Tobias Kortkamp freebsd_committer 2018-12-09 20:39:32 UTC
- It does not patch:
===>  Applying FreeBSD patches for sane-backends-1.0.27_4
Ignoring previously applied (or reversed) patch.
1 out of 1 hunks ignored--saving rejects to sanei/sanei_pa4s2.c.rej
=> FreeBSD patch patch-sanei_sanei_pa4s2.c failed to apply cleanly.
=> Patch(es)  patch-backend__Makefile.in patch-backend__epson2-ops.c patch-backend__epsonds.c patch-backend__kvs40xx_opt.c patch-backend__v4l.c patch-include__sane__sane.h patch-include__sane__sanei_backend.h patch-sanei_sanei__pa4s2.c applied cleanly.

Looks like a duplicated patch:
patch-sanei_sanei__pa4s2.c and patch-sanei_sanei_pa4s2.c

- The pkg-plist update is bad.  Please sort it by filename just like `make 
  makeplist` does it.

- What happened to all the files that were installed by IEEE1284?

- The NLS option should probably also have NLS_CONFIGURE_ENABLE=nls not
  'translations':

  configure: WARNING: unrecognized options: --with-docdir, --disable-latex,
  --disable-translations, --enable-libusb_1_0
Comment 19 Tobias Kortkamp freebsd_committer 2018-12-09 20:42:09 UTC
Why are all config files no longer installed with @sample?
Comment 20 Peter Wullinger 2018-12-10 21:43:03 UTC
Created attachment 200013 [details]
update to 1.0.27

Sorry about the last one. I probably was tired or whatever.

Here we go again:
Incorporate tobik@'s reports and suggestions.

- resurrect @sample for dist configuration files
- resurrect GPHOTO, IEEE1284, NLS and V4L packaging
- bring back IEEE1284
- add proper (and correctly named) patch for sanei/sanei_ir.c
- add %%PORTDOCS%% 
- sort plist
- update configure arguments to what ./configure actually expects

Patch now applies cleanly after svn revert -R; svn patch sane-backends-10.0.27.diff

Note: For lack of a host and cross-build ability, I have not tested IEEE1284.
Comment 21 Peter Wullinger 2018-12-10 22:00:37 UTC
Created attachment 200014 [details]
update to 1.0.27

upload proper file
Comment 22 Kubilay Kocak freebsd_committer freebsd_triage 2018-12-17 06:06:25 UTC
Needs PORTREVISION bump (sources changed, but PORTVERSION didn't/doesn't)
Comment 23 Peter Wullinger 2018-12-17 06:42:36 UTC
Created attachment 200178 [details]
update to 1.0.27

bump portrev
Comment 24 commit-hook freebsd_committer 2019-01-29 12:32:22 UTC
A commit references this bug:

Author: tobik
Date: Tue Jan 29 12:31:53 UTC 2019
New revision: 491557
URL: https://svnweb.freebsd.org/changeset/ports/491557

Log:
  graphics/sane-backends: Actually update to 1.0.27

  The current version is 1.0.25 with a wrongly named distfile which
  fails to fetch from the fossies.org mirror with a size mismatch.
  The update to 1.0.27 in r444767 also shows that the checksum and
  size have not changed in distinfo in that commit.  Full changes
  between the distfiles from 1.0.27_4 & 1.0.27_5 can be found at [1].

  - Remove dead alioth.debian.org mirror
  - Remove some no longer needed patches

  [1] https://people.freebsd.org/~tobik/logs/sane-backends-1.0.27.diff

  ABI:		https://abi-laboratory.pro/tracker/timeline/sane-backends/
  PR:		229653
  Submitted by:	Peter Wullinger <freebsd@dhke.de>

Changes:
  head/graphics/sane-backends/Makefile
  head/graphics/sane-backends/distinfo
  head/graphics/sane-backends/files/patch-backend__Makefile.in
  head/graphics/sane-backends/files/patch-backend__epsonds.c
  head/graphics/sane-backends/files/patch-backend__kodakaio.c
  head/graphics/sane-backends/files/patch-backend__kvs40xx.h
  head/graphics/sane-backends/files/patch-backend__pieusb_buffer.c
  head/graphics/sane-backends/files/patch-backend__v4l.c
  head/graphics/sane-backends/files/patch-include__sane__sanei_backend.h
  head/graphics/sane-backends/files/patch-sanei__sanei_ir.c
  head/graphics/sane-backends/files/patch-sanei_sanei__pa4s2.c
  head/graphics/sane-backends/files/patch-sanei_sanei_pa4s2.c
  head/graphics/sane-backends/pkg-plist
Comment 25 Tobias Kortkamp freebsd_committer 2019-01-29 12:32:53 UTC
Committed. Thanks!

There are about two years worth of changes in 1.0.27 when compared
to 1.0.25, so I'm not going to MFH it.  Let's see if somebody
complains first.
Comment 26 Tobias Kortkamp freebsd_committer 2019-08-30 09:15:53 UTC
*** Bug 240205 has been marked as a duplicate of this bug. ***