Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 932152 - sys-libs/ncurses needs --enable-term-driver to cross-compile for mingw
Summary: sys-libs/ncurses needs --enable-term-driver to cross-compile for mingw
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2024-05-18 11:35 UTC by Mark Harmstone
Modified: 2025-01-04 11:44 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Harmstone 2024-05-18 11:35:35 UTC
sys-libs/ncurses needs the config option --enable-term-driver set when cross-compiling for mingw, otherwise it fails saying that Sleep and DWORD aren't defined.

FWIW, vcpkg sets --enable-term-driver on mingw: https://github.com/microsoft/vcpkg/blob/master/ports/ncurses/portfile.cmake

--- a/ncurses-6.4_p20240414.ebuild  2024-05-11 17:12:18.000000000 +0100
+++ b/ncurses-6.4_p20240414.ebuild     2024-05-18 12:23:18.228532680 +0100
@@ -297,7 +297,6 @@
                # The configure script uses ldd to parse the linked output which
                # is flaky for cross-compiling/multilib/ldd versions/etc...
                $(use_with gpm gpm libgpm.so.1)
-               --disable-term-driver
                --disable-termcap
                --enable-symlinks
                --with-manpage-format=normal
@@ -318,6 +317,15 @@
                --disable-pkg-ldflags
        )
 
+       case ${CHOST} in
+               *-mingw32*)
+                       conf+=( --enable-term-driver )
+                       ;;
+               *)
+                       conf+=( --disable-term-driver )
+                       ;;
+       esac
+
        if [[ ${target} == ncurses*w ]] ; then
                conf+=( --enable-widec )
        else

Reproducible: Always

Steps to Reproduce:
1. crossdev -t x86_64-w64-mingw32
2. USE="libraries tools" emerge cross-x86_64-w64-mingw32/mingw64-runtime (so that we get pthreads.h)
3. x86_64-w64-mingw32-emerge sys-libs/ncurses
Comment 1 Larry the Git Cow gentoo-dev 2025-01-04 11:44:53 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4310c6008e8734af315a6ec67ed888ace5579829

commit 4310c6008e8734af315a6ec67ed888ace5579829
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-01-04 11:44:04 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-01-04 11:44:26 +0000

    sys-libs/ncurses: pass --enable-term-driver for mingw
    
    Closes: https://bugs.gentoo.org/932152
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-libs/ncurses/ncurses-6.5_p20241109.ebuild | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)