When building sys-libs/ncurses-6.0-r1 using a crossdev created toolchain and portage tree there are a number of issues relating to the resultant libraries. 1. if the static-libs use flag is not set, all files matching '*.a' are deleted, which is problematic on mingw-w64 as for every lib*.dll file there is a matching lib*.dll.a file which is used for linking; with these deleted you cannot link to the dlls. 2. the ebuild unconditionally makes a symlink from $EPREFIX/usr/lib/libncurses.dll to $EPREFIX/usr/lib/libcurses.dll, which both actually live in $EPREFIX/usr/bin/libncurses6.dll and $EPREFIX/usr/bin/libcurses6.dll respectively.
In fact, after a little investigation it seems that the ncurses curses link is only a linktime convenience. Linking a test linux ncurses application with -lcurses and running ldd against it shows it to depend on libncurses.so.6, which would be libncurses6.dll on mingw-w64; so, that symlink should be as follows: $EPREFIX/usr/lib/libcurses.dll.a -> $EPREFIX/usr/lib/libncurses.dll.a
changing: find "${ED}"/usr/ -name '*.a' -delete to: find "${ED}"/usr/ -name '*.a' ! -name '*.dll.a' -delete will fix the static-libs issue, would that be an acceptable change?
There might be many packages which delete *.a files. Please discuss generic solution on gentoo-dev mailing list.
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #3) > There might be many packages which delete *.a files. > Please discuss generic solution on gentoo-dev mailing list. Yes, I've thought of that and I've been git grepping the portage tree to see what I can find regarding this. so far, I've only seen a few that may fall into this category. Mostly its packages which have no sane sort of --enable-static or the like setup to prevent them from being created/installed in the first place.
See also the following sys-libs/zlib bug, its effectively the same issue: https://bugs.gentoo.org/419645
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc3a9c5ebff98664ab50c9a8ff4e136bea9bd0db commit fc3a9c5ebff98664ab50c9a8ff4e136bea9bd0db Author: Marty E. Plummer <hanetzer@protonmail.com> AuthorDate: 2017-09-20 09:09:33 +0000 Commit: Lars Wendler <polynomial-c@gentoo.org> CommitDate: 2018-03-28 07:46:50 +0000 sys-libs/ncurses: fix mingw-w64 build and runtime *.dll.a files are required for linking on mingw-w64 targets, only delete normal static libraries. --enable-term-driver is required on mingw-w64, otherwise you get a host of undefined reference to `_nc_*' errors, and possibly other windows platforms/runtimes/toolchains. Bug: https://bugs.gentoo.org/631468 Bug: https://bugs.gentoo.org/639670 Package-Manager: Portage-2.3.10, Repoman-2.3.3 Signed-off-by: Marty E. Plummer <hanetzer@protonmail.com> Closes: https://github.com/gentoo/gentoo/pull/5734 sys-libs/ncurses/ncurses-6.0-r2.ebuild | 8 +++++++- sys-libs/ncurses/ncurses-6.1-r2.ebuild | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-)}
Hide the spam.