--- /var/db/portage/local/sys-libs/ncurses/ncurses-6.4_p20230401.ebuild 2023-05-13 10:31:51.314898367 +0200 +++ /var/db/portage/gentoo/sys-libs/ncurses/ncurses-6.4_p20230401.ebuild 2023-05-13 10:04:39.442342312 +0200 @@ -149,6 +149,11 @@ # bug #214642 BUILD_CPPFLAGS+=" -D_GNU_SOURCE" + # bug #852665 + if [[ ${CHOST} == *-cygwin* ]]; then + BUILD_CPPFLAGS+=" -DBUILDING_NCURSES" + fi + # Build the various variants of ncurses -- narrow, wide, and threaded. #510440 # Order matters here -- we want unicode/thread versions to come last so that the # binaries in /usr/bin support both wide and narrow. @@ -177,7 +182,7 @@ echo "int main() {}" | \ $(tc-getCC) -o x -x c - ${lbuildflags} -pipe >& /dev/null \ || lbuildflags="${dbuildflags}" - lbuildflags="" + # We can't re-use the multilib BUILD_DIR because we run outside of it. BUILD_DIR="${WORKDIR}" \ CC=${BUILD_CC} \ @@ -294,17 +299,7 @@ src_compile() { # See comments in src_configure. if ! has_version -b "~sys-libs/${P}:0" ; then - # We could possibly merge these two branches but opting to be - # conservative when merging some of the Prefix changes. - - if [[ ${CHOST} == *-cygwin* ]] && ! multilib_is_native_abi ; then - # We make 'tic$(x)' here, for Cygwin having x=".exe". - BUILD_DIR="${WORKDIR}" \ - do_compile cross -C progs all PROGS='tic$(x)' - else - BUILD_DIR="${WORKDIR}" \ - do_compile cross -C progs tic - fi + BUILD_DIR="${WORKDIR}" do_compile cross -C progs tic$(get_exeext) fi multilib-minimal_src_compile