Bug 284127 - graphics/epsonscan2: fix build on FreeBSD-15
Summary: graphics/epsonscan2: fix build on FreeBSD-15
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Vladimir Druzenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-18 02:26 UTC by J.R. Oldroyd
Modified: 2025-02-10 08:48 UTC (History)
3 users (show)

See Also:
fbsd: maintainer-feedback+


Attachments
patch to fix build on FreeBSD-15 (1.16 KB, patch)
2025-01-18 02:26 UTC, J.R. Oldroyd
fbsd: maintainer-approval+
Details | Diff
Proposed Makefile without many of the LIB_DEPENDS (1.16 KB, text/plain)
2025-01-18 23:57 UTC, J.R. Oldroyd
no flags Details
Proposed Makefile without many of the LIB_DEPENDS (1.12 KB, text/plain)
2025-01-19 00:21 UTC, J.R. Oldroyd
no flags Details
Improve port v1 (1.85 KB, patch)
2025-01-31 22:21 UTC, Vladimir Druzenko
vvd: maintainer-approval?
Details | Diff
upgrade epsonscan2 to 6.7.70.0 (93.58 KB, patch)
2025-02-05 15:04 UTC, Daniel Tameling
no flags Details | Diff
upgrade epsonscan2-non-free-plugin to 6.7.70 (6.36 KB, patch)
2025-02-05 15:05 UTC, Daniel Tameling
no flags Details | Diff
tar file of epsonscan2-6.7.70 and epsonscan2-non-free-plugin-6.7.70 (24.35 KB, application/octet-stream)
2025-02-10 01:55 UTC, J.R. Oldroyd
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description J.R. Oldroyd 2025-01-18 02:26:49 UTC
Created attachment 256767 [details]
patch to fix build on FreeBSD-15
Comment 1 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-18 18:22:07 UTC
1. LIB_DEPENDS=libGL.so:graphics/libglvnd
=>
USES=gl
USE_GL=gl

2. LIB_DEPENDS=libintl.so:devel/gettext-runtime don't need - port already have USES=gettext-runtime.
Comment 2 J.R. Oldroyd 2025-01-18 20:14:50 UTC
(In reply to Vladimir Druzenko from comment #1)

Both noted, thanks.
Comment 3 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-18 20:32:29 UTC
====> Running Q/A tests (stage-qa)
Warning: you might not need LIB_DEPENDS on libboost_serialization.so
Warning: you might not need LIB_DEPENDS on libdouble-conversion.so
Warning: you might not need LIB_DEPENDS on libfreetype.so
Warning: you might not need LIB_DEPENDS on libglib-2.0.so
Warning: you might not need LIB_DEPENDS on libgraphite2.so
Warning: you might not need LIB_DEPENDS on libicuuc.so
Warning: you might not need LIB_DEPENDS on libiconv.so
Warning: you might not need LIB_DEPENDS on libharfbuzz.so
Warning: you might not need LIB_DEPENDS on libpcre.so
Warning: you might not need LIB_DEPENDS on libpcre2-16.so
Warning: you might not need LIB_DEPENDS on libzstd.so
Warning: you might not need LIB_DEPENDS on libintl.so
Warning: you might not need LIB_DEPENDS on libGL.so
Warning: you might not need LIB_DEPENDS on libglib-2.0.so
Warning: you might not need LIB_DEPENDS on libintl.so

The port does not link with these libraries.
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-18 20:46:43 UTC
Build without errors in poudriere 13.4 and 14.2 amd64:

BUILD_DEPENDS=  sane-config:graphics/sane-backends \
                boost-libs>0:devel/boost-libs
LIB_DEPENDS=    libpng.so:graphics/png \
                libtiff.so:graphics/tiff
RUN_DEPENDS=    avahi-browse:net/avahi-app

USES=           cmake jpeg localbase qt:5 xorg
USE_LDCONFIG=   ${PREFIX}/lib/epsonscan2
USE_QT=         buildtools:build core gui qmake:build widgets
USE_XORG=       x11 xau xcb xdmcp

Port link with libdl.so.1, so possible it dynamically load some of libraries from this list:
libdouble-conversion.so
libfreetype.so
libglib-2.0.so
libgraphite2.so
libicuuc.so
libiconv.so
libharfbuzz.so
libpcre.so
libpcre2-16.so
libzstd.so
libintl.so
libGL.so
libglib-2.0.so
If so then add to RUN_DEPENDS something like:
${LOCALBASE}/lib/libfreetype.so:print/freetype2
Comment 5 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-18 21:02:27 UTC
I haven't found a single use of these libraries.
Comment 6 J.R. Oldroyd 2025-01-18 23:55:40 UTC
I appreciate your attention to this detail, Vladimir.

Unfortunately, I have no idea whether these library dependencies are still needed.  The background is that I did this port three years ago in January 2022; my only work was to plough through the code and come up with the 50+ patches to get it to work.  I have not looked at it since.  The scanner here works, now on FreeBSD-14.1, and is in regular use.

I presume that these dependencies were needed back then (FreeBSD-12? or maybe FreeBSD-13.0).  If it seems they weren't even needed then, I have no idea any more why I would've added them.

I cannot really take the scanner here out of service while I test removal of all these dependencies on the server-side scanner driver code.

However, I have built it without the dependencies and the GUI client tool (bin/epsonscan2) does seem to work without them.

I'm uploading a version of the Makefile without all those library dependencies.  If anyone else is able to test the server-side code with their scanner and report back, that would be appreciated.
Comment 7 J.R. Oldroyd 2025-01-18 23:57:19 UTC
Created attachment 256784 [details]
Proposed Makefile without many of the LIB_DEPENDS
Comment 8 J.R. Oldroyd 2025-01-19 00:21:29 UTC
Created attachment 256786 [details]
Proposed Makefile without many of the LIB_DEPENDS
Comment 9 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-19 20:19:50 UTC
Comment on attachment 256786 [details]
Proposed Makefile without many of the LIB_DEPENDS

1. LIB_DEPENDS=	libboost_serialization.so:devel/boost-libs
Where it use boost in runtime? I see that it is only for build.

2. What do you think about add default option AVAHI:
OPTIONS_DEFINE=         AVAHI
OPTIONS_DEFAULT=        AVAHI
AVAHI_DESC=             Use avahi to find scanners
AVAHI_RUN_DEPENDS=      avahi-browse:net/avahi-app
Comment 10 commit-hook freebsd_committer freebsd_triage 2025-01-22 13:01:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=abf9862fa9c98bd68956aa9573d97399ae5e0f7d

commit abf9862fa9c98bd68956aa9573d97399ae5e0f7d
Author:     J.R. Oldroyd <fbsd@opal.com>
AuthorDate: 2025-01-22 12:59:16 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2025-01-22 12:59:16 +0000

    graphics/epsonscan2: Fix build on FreeBSD 15

    PR:     284127

 graphics/epsonscan2/Makefile                                  |  2 +-
 .../files/patch-src_ES2Command_Src_Utils_ESAccessor.h (new)   | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
Comment 11 commit-hook freebsd_committer freebsd_triage 2025-01-22 13:03:40 UTC
A commit in branch 2025Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4e8dacd288c62ff082f3bef87069fbab3ac8e745

commit 4e8dacd288c62ff082f3bef87069fbab3ac8e745
Author:     J.R. Oldroyd <fbsd@opal.com>
AuthorDate: 2025-01-22 12:59:16 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2025-01-22 13:02:43 +0000

    graphics/epsonscan2: Fix build on FreeBSD 15

    PR:     284127
    (cherry picked from commit abf9862fa9c98bd68956aa9573d97399ae5e0f7d)

 graphics/epsonscan2/Makefile                                  |  2 +-
 .../files/patch-src_ES2Command_Src_Utils_ESAccessor.h (new)   | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
Comment 12 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-22 13:05:54 UTC
Fix build on 15 committed.

Lets "work" on "improve port".
Comment 13 Rainer Hurling freebsd_committer freebsd_triage 2025-01-25 12:52:56 UTC
(In reply to commit-hook from comment #11)

The build and installation went well. Unfortunately, epsonscan2 aborts at startup with a core dump:

    Illegal instruction (core dump)

This happens on a recent 15.0-CURRENT amd64.
Comment 14 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-31 22:18:06 UTC
I see there is newer versions: https://repology.org/project/epsonscan2/versions
Comment 15 Vladimir Druzenko freebsd_committer freebsd_triage 2025-01-31 22:21:24 UTC
Created attachment 257152 [details]
Improve port v1
Comment 16 Daniel Tameling 2025-02-05 15:03:24 UTC
I had to update the port as my scanner wasn't supported. I will attach my patches. They were tested with an Epson Perfection V39II on FreeBSD 14.1 with linux_base-c7. (I didn't test this on a clean system, but on my daily driver.)

I mostly just adapted the existing patches. Just a few notes:
- They changed the download URLs. They stopped putting new releases at the same places as the old ones.
- They included some build artifacts in the source distribution, so I had to add a pre-configure to the Makefile to remove an offending CMakeCache.txt
- I removed the dependency on pcre. It wasn't necessary and it is EOL.
- I included the two patches from Arch Linux that fix crashes. I didn't include the xdg-open patch that replaces the probing of the various file managers.
- I also stole the method to stop building the included zlib and use the one on the system. (done by removing the zlib files from src/Controller/CMakeLists.txt)
- I *didn't* update the Read_me.FreeBSD file
Comment 17 Daniel Tameling 2025-02-05 15:04:23 UTC
Created attachment 257261 [details]
upgrade epsonscan2 to 6.7.70.0
Comment 18 Daniel Tameling 2025-02-05 15:05:08 UTC
Created attachment 257262 [details]
upgrade epsonscan2-non-free-plugin to 6.7.70
Comment 19 J.R. Oldroyd 2025-02-05 15:58:52 UTC
Thanks, Daniel, for sending these updates.  That's a great amount of work.  Thank you.

Since you say you worked on 14.1 and that's what I have too, Rainer, would you be able to test this on 15-cur, please?  Maybe the SIGILL you had will be gone after this version update?
Comment 20 Rainer Hurling freebsd_committer freebsd_triage 2025-02-09 19:56:47 UTC
(In reply to J.R. Oldroyd from comment #19)
>Since you say you worked on 14.1 and that's what I have too, Rainer,
>would you be able to test this on 15-cur, please?  Maybe the SIGILL
>you had will be gone after this version update?
@Daniel: thanks from me too for this patch with current version update.

@J.R.: I finally got around to testing the latest patches #257261 and #257262 under a current 15.0-CURRENT amd64. Both build and install fine. With this version 6.7.70.0 epsonscan2 runs as usual again! I tested with an Epson Perfection V600 Photo.

LGTM, from my side a go for the commit.

Thank you very much! And please let me know if this short response is not sufficient.
Comment 21 J.R. Oldroyd 2025-02-10 00:27:17 UTC
Great news, thanks for testing, Rainer.

I have also tested the 6.7.70 client on 14.2 and it is working here talking to the scanner over a network connection.

I do get the following when I install the 6.7.70 version:

# make install
===>  Installing for epsonscan2-6.7.70.0
===>  Checking if epsonscan2 is already installed
===>   Registering installation for epsonscan2-6.7.70.0
pkg-static: duplicate file listing: /usr/local/libdata/ldconfig/epsonscan2, ignoring
Installing epsonscan2-6.7.70.0...

There is only one instance of "libdata/ldconfig/epsonscan2" in pkg-plist.  Should it not be there?

Other than that, looks like this is good to go.

Thanks, again, for this update, Daniel.
Comment 22 Vladimir Druzenko freebsd_committer freebsd_triage 2025-02-10 00:52:00 UTC
(In reply to Daniel Tameling from comment #17)
Can you attach tarball (tar.xz) with port graphics/epsonscan2?

Also I want to improve port: fix dependencies and add option AVAHI.
(https://bugs.freebsd.org/bugzilla/attachment.cgi?id=257152&action=diff)
Comment 23 J.R. Oldroyd 2025-02-10 01:55:56 UTC
Created attachment 257370 [details]
tar file of epsonscan2-6.7.70 and epsonscan2-non-free-plugin-6.7.70

Attached is a tar of both ports (epsonscan2-6.7.70 and epsonscan2-non-free-plugin) with both Daniel's changes and yours, Vladimir.

I removed the ldconfig from the pkg-plist because that failed check-plist.
Comment 24 Daniel Tameling 2025-02-10 08:48:45 UTC
(In reply to J.R. Oldroyd from comment #21)

That was my mistake. Sorry about that.

Glad the update improved the general situation.