From [1]: ``` NAPS2 is free and open source scanning software for Windows, Mac and Linux. Easily scan with devices from Canon, Brother, HP, Epson, Fujitsu, and more. Then save to PDF, TIFF, JPEG, or PNG with a single click. ``` The project offers .deb, .rpm, flatpak, .msi and .pkg binaries. Sources can be found in [2]. Build instructions are in [3], although I'm not sure how translatable they are to an ebuild (I'd be happy with a binary-only package). [1] https://naps2.com [2] https://github.com/cyanfish/naps2 [3] https://github.com/cyanfish/naps2/wiki/1.-Building-&-Development-Environment
https://repology.org/project/naps2/versions
Created attachment 901527 [details, diff] Working ebuild for naps2-7.5.1 I have a working ebuild for this pacakge (attached). One lingering issue with it is this hack to remove libhostfxr.so in src_compile. That's necessary for the launcher script to work properly (see comment), but probably something cleaner needs to be done before this ebuild can be considered fully baked. I'll try to follow up on this and post a better version in the next few days.
Thanks a lot ppw0 and Axel! I solved the issue of libhostfxr.so, as was suggested on IRC - if NETCore.App is in the package references then dotnet will copy libhostfxr. One last thing I could not figure was which and where is the icon for the desktop file. Will push it to Gentoo repo soon.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c85989e2151228f85b0d7e6d325bada5e6991e78 commit c85989e2151228f85b0d7e6d325bada5e6991e78 Author: Maciej Barć <xgqt@gentoo.org> AuthorDate: 2024-08-29 09:07:44 +0000 Commit: Maciej Barć <xgqt@gentoo.org> CommitDate: 2024-08-29 09:09:57 +0000 app-office/naps2: new package; add 7.5.1 Closes: https://bugs.gentoo.org/916780 Signed-off-by: Maciej Barć <xgqt@gentoo.org> app-office/naps2/Manifest | 274 ++++++++++++++++++++++++++ app-office/naps2/metadata.xml | 25 +++ app-office/naps2/naps2-7.5.1.ebuild | 371 ++++++++++++++++++++++++++++++++++++ 3 files changed, 670 insertions(+)
Added. Please test. Thanks in advance!
About the icon, that can be sorted out by adding the following to src_install: newicon -s 128 ./NAPS2.Lib/Icons/scanner-128.png com.naps2.Naps2.png That might seem like a generic icon, but that's the one upstream uses in their .deb packages, see: https://github.com/cyanfish/naps2/blob/master/NAPS2.Tools/Project/Packaging/DebPackager.cs#L50 Other than that, I tested the ebuild on ~amd64 and it works perfectly. I tried testing it on ~arm64 too, but csharp-gentoodotnetinfo fails to build there, for some unrelated reasons. If I get that sorted out I'll update this bug, perhaps we can mark the ebuild ~arm64 too. Thanks Maciej for the help and work here!
Ah, my issue with csharp-gentoodotnetinfo was caused by some unrelated issue in my environment. The ebuild works properly on ~arm64 as well (tested on an M2 Mac Mini).
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f04d63b2c834afee524ff8753cc02d3da7eb4d7a commit f04d63b2c834afee524ff8753cc02d3da7eb4d7a Author: Maciej Barć <xgqt@gentoo.org> AuthorDate: 2024-08-30 08:34:19 +0000 Commit: Maciej Barć <xgqt@gentoo.org> CommitDate: 2024-08-30 23:52:52 +0000 app-office/naps2: install com.naps2.Naps2 icon Bug: https://bugs.gentoo.org/916780 Bug: https://github.com/cyanfish/naps2/discussions/443 Signed-off-by: Maciej Barć <xgqt@gentoo.org> app-office/naps2/{naps2-7.5.1.ebuild => naps2-7.5.1-r1.ebuild} | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
One thing I've noticed is that the running application (not the shortcut) doesn't have its own icon (only the "generic binary" one).
(In reply to ppw0 from comment #9) > One thing I've noticed is that the running application (not the shortcut) > doesn't have its own icon (only the "generic binary" one). Hmm, no idea what could be causing this but it might be a upstream code issue. Does it work otherwise on other systems? (I think we are talking about how the icon would show up on the window decoration. For task bar it shows fine.)
(In reply to Maciej Barć from comment #10) > (In reply to ppw0 from comment #9) > > One thing I've noticed is that the running application (not the shortcut) > > doesn't have its own icon (only the "generic binary" one). > > Hmm, no idea what could be causing this but it might be a upstream code > issue. > > Does it work otherwise on other systems? > > (I think we are talking about how the icon would show up on the window > decoration. For task bar it shows fine.) No, I do mean the taskbar. Well, it's a GNOME extension. Maybe it's something to do with GNOME, I don't know. I have only one Gentoo machine so I can't test it on other systems that easily. Also, I keep getting this after scanning a document: System.ComponentModel.Win32Exception (13): An error occurred trying to start process '/usr/share/naps2-7.5.1/_linux/tesseract' with working directory '/home/ppw'. Permission denied at bool System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, string resolvedFilename, string[] argv, string[] envp, string cwd, bool setCredentials, uint userId, uint groupId, uint[] groups, out int stdinFd, out int stdoutFd, out int stderrFd, bool usesTerminal, bool throwOnNoExec) at bool System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at Process System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at async Task<OcrResult> NAPS2.Ocr.TesseractOcrEngine.ProcessImage(ScanningContext scanningContext, string imagePath, OcrParams ocrParams, CancellationToken cancelToken) in /var/tmp/portage/app-office/naps2-7.5.1-r1/work/naps2-7.5.1/NAPS2.Sdk/Ocr/TesseractOcrEngine.cs:line 99
(In reply to ppw0 from comment #11) > System.ComponentModel.Win32Exception (13): An error occurred trying to start > process '/usr/share/naps2-7.5.1/_linux/tesseract' with working directory > '/home/ppw'. Permission denied Well, THAT IS a bug, I will work on that.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=501f57bed5e038b5782f1cdbfb3bfc3a2168122d commit 501f57bed5e038b5782f1cdbfb3bfc3a2168122d Author: Maciej Barć <xgqt@gentoo.org> AuthorDate: 2024-09-28 12:55:31 +0000 Commit: Maciej Barć <xgqt@gentoo.org> CommitDate: 2024-09-28 15:00:35 +0000 app-office/naps2: fix permissions Bug: https://bugs.gentoo.org/916780 Signed-off-by: Maciej Barć <xgqt@gentoo.org> app-office/naps2/{naps2-7.5.1-r1.ebuild => naps2-7.5.1-r2.ebuild} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Why is media-fonts/noto-cjk a hard dep in this?
media-fonts/noto-cjk is listed as a dep because upstream claims it is a prerequisite here: https://github.com/cyanfish/naps2/wiki/1.-Building-&-Development-Environment#getting-started Now, will the package build fine / gracefully degrade without it? Perhaps. :) But I haven't tested it. Feel free to try without it and if it works without it we could drop it or add a USE flag or something.