Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 952915 - app-office/naps2: Does not build on arm64
Summary: app-office/naps2: Does not build on arm64
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: dotnet project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-29 18:30 UTC by benoit.dufour
Modified: 2025-03-31 21:33 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
NAPS2 fails to build. (2025-03-29_sr_hc_lx2_naps2_build.log,9.94 KB, text/x-log)
2025-03-29 18:30 UTC, benoit.dufour
Details
emerge --info (emerge_info_sr_hc_lx2.txt,9.30 KB, text/plain)
2025-03-29 19:04 UTC, benoit.dufour
Details
tree /var/tmp/portage/app-office/naps2-7.5.3/work (2025-03-29_sr_hc_lx2_naps2_work_tree.txt,160.91 KB, text/plain)
2025-03-29 20:42 UTC, benoit.dufour
Details

Note You need to log in before you can comment on or make changes to this bug.
Description benoit.dufour 2025-03-29 18:30:08 UTC
Created attachment 923266 [details]
NAPS2 fails to build.

According to the readme, it should work on arm64.
https://github.com/cyanfish/naps2
Linux (x64, arm64) (GTK 3.20+, glibc 2.27+, libsane)
Somehow, it fails to build on arm64.

See the logs.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-29 18:47:18 UTC
```
[A[138C [34;01m[ [32;01mok[34;01m ][0m
>>> Source compiled.
>>> Test phase [not enabled]: app-office/naps2-7.5.3

>>> Install app-office/naps2-7.5.3 into /var/tmp/portage/app-office/naps2-7.5.3/image
find: ‘/var/tmp/portage/app-office/naps2-7.5.3/image/usr/share/naps2-7.5.3/_linux’: No such file or directory
 [31;01m*[0m ERROR: app-office/naps2-7.5.3::gentoo failed (install phase):
 [31;01m*[0m   (no error message)
```

Please also include emerge --info.
Comment 2 benoit.dufour 2025-03-29 19:04:54 UTC
Created attachment 923267 [details]
emerge --info
Comment 3 benoit.dufour 2025-03-29 19:06:04 UTC
>>> Source compiled.
So yes, there's this "Source compiled." message appearing in the logs, but I don't see actual compilation logs, which is strange.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-29 19:10:09 UTC
(In reply to benoit.dufour from comment #3)
> >>> Source compiled.
> So yes, there's this "Source compiled." message appearing in the logs, but I
> don't see actual compilation logs, which is strange.

I don't think it's strange. It uses dotnet and there's the normal build messages there above it (unless xgqt says there's some messages that are normal for dotnet missing there). The "Source compiled." bit is just what Portage says when whatever is defined in src_compile completes.
Comment 5 Maciej Barć gentoo-dev 2025-03-29 20:20:14 UTC
> Does not build on arm64 

In terms of ::gentoo repo sanity - everything is fine as naps2 is NOT keyworded on ARM 64.

Thanks for testing on ARM btw... now we know that the _linux dir that naps2 creates will either be in different location on not exist at all.

I believe that the _linux dir has (on AMD build) a pre-compield OCR tool that could be not available for ARM.


> but I don't see actual compilation logs

Those are:

> NAPS2.Internals -> /var/tmp/portage/app-office/naps2-7.5.3/work/naps2-7.5.3_net8.0_Release/NAPS2.Internals.dll

It tells you that project "X -> (produces a) DLL in given path".

(You could even enable move verbose compilation log but that will not help in this issue.)
Comment 6 Maciej Barć gentoo-dev 2025-03-29 20:21:11 UTC
This is currently kinda out of scope but might help if we  want to keyword naps2 for ARM.
Comment 7 benoit.dufour 2025-03-29 20:42:31 UTC
Created attachment 923271 [details]
tree /var/tmp/portage/app-office/naps2-7.5.3/work

It seems to me that folder is called _linuxarm
See:
tree /var/tmp/portage/app-office/naps2-7.5.3/work
Comment 8 benoit.dufour 2025-03-29 21:05:26 UTC
That patch isn't perfect, but with it, I got the package to emerge properly:

src_install() {
	dotnet-pkg_src_install
	echo "${ARCH}";
	if [[ "${ARCH}" == "amd64" || "${ARCH}" == "x86" ]]; then
		find "${ED}/usr/share/${P}/_linux" -type f -exec chmod a+x {} + || die
	elif [[ "${ARCH}" == "arm64" || "${ARCH}" == "arm" ]]; then
		find "${ED}/usr/share/${P}/_linuxarm" -type f -exec chmod a+x {} + || die
	else
		die
	fi

	newicon --size 128 ./NAPS2.Lib/Icons/scanner-128.png com.naps2.Naps2.png
	domenu ./NAPS2.Setup/config/linux/com.naps2.Naps2.desktop

	insinto /usr/share/metainfo
	doins ./NAPS2.Setup/config/linux/com.naps2.Naps2.metainfo.xml

	einstalldocs
}

tux ~ # 
emerge --ask --verbose app-office/naps2

 * IMPORTANT: 1 news items need reading for repository 'haskell'.
 * IMPORTANT: 6 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.


These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 12.75 s (backtrack: 0/20).

[ebuild  N    *] app-office/naps2-7.5.3::gentoo  USE="-debug" 0 KiB

Total: 1 package (1 new), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No] yes 
>>> Verifying ebuild manifests
>>> Emerging (1 of 1) app-office/naps2-7.5.3::gentoo
>>> Installing (1 of 1) app-office/naps2-7.5.3::gentoo
>>> Recording app-office/naps2 in "world" favorites file...
>>> Completed (1 of 1) app-office/naps2-7.5.3::gentoo
>>> Jobs: 1 of 1 complete                                               Load avg: 1.37, 1.42, 0.80

 * GNU info directory index is up-to-date.

 * IMPORTANT: 1 news items need reading for repository 'haskell'.
 * IMPORTANT: 6 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.
Comment 9 Maciej Barć gentoo-dev 2025-03-29 21:07:26 UTC
maybe we could do 

> find "${ED}/usr/share/${P}/_linux"* -type f -exec chmod a+x {} +

But the best solution would be to patch naps2's .csproj(s).
Comment 10 Larry the Git Cow gentoo-dev 2025-03-31 21:33:26 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8417b7d4e40d2f46b355cb5c0f4d78c99033eb43

commit 8417b7d4e40d2f46b355cb5c0f4d78c99033eb43
Author:     Maciej Barć <xgqt@gentoo.org>
AuthorDate: 2025-03-31 20:42:37 +0000
Commit:     Maciej Barć <xgqt@gentoo.org>
CommitDate: 2025-03-31 21:33:22 +0000

    app-office/naps2: fix for ARM; use system tesseract
    
    Closes: https://bugs.gentoo.org/952915
    Signed-off-by: Maciej Barć <xgqt@gentoo.org>

 .../{naps2-8.1.1.ebuild => naps2-8.1.1-r1.ebuild}      | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)