sys-libs/ncurses: fix mingw-w64 build and runtime
authorMarty E. Plummer <hanetzer@protonmail.com>
Wed, 20 Sep 2017 09:09:33 +0000 (04:09 -0500)
committerLars Wendler <polynomial-c@gentoo.org>
Wed, 28 Mar 2018 07:46:50 +0000 (09:46 +0200)
*.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
sys-libs/ncurses/ncurses-6.1-r2.ebuild

index 15d435938bc3456e0920cd95f30a9b3babcd0ea8..6587f1b72a6fa195073f28766c4be07971999cab 100644 (file)
@@ -135,6 +135,9 @@ do_configure() {
                # 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)
+               # Required for building  on mingw-w64, and possibly other windows
+               # platforms, bug #639670
+               $(use_enable kernel_Winnt term-driver)
                --disable-termcap
                --enable-symlinks
                --with-rcs-ids
@@ -240,7 +243,10 @@ multilib_src_install() {
                # Provide a link for -lcurses.
                ln -sf libncurses$(get_libname) "${ED}"/usr/$(get_libdir)/libcurses$(get_libname) || die
        fi
-       use static-libs || find "${ED}"/usr/ -name '*.a' -delete
+       # don't delete '*.dll.a', needed for linking #631468
+       if ! use static-libs; then
+               find "${ED}"/usr/ -name '*.a' ! -name '*.dll.a' -delete || die
+       fi
 
        # Build fails to create this ...
        dosym ../share/terminfo /usr/$(get_libdir)/terminfo
index 5ddb886675150807a4fc707b1871775f6c3ad53a..de2e221506756e25e744efe5d70db1da69f15ee1 100644 (file)
@@ -132,6 +132,9 @@ do_configure() {
                # 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)
+               # Required for building  on mingw-w64, and possibly other windows
+               # platforms, bug #639670
+               $(use_enable kernel_Winnt term-driver)
                --disable-termcap
                --enable-symlinks
                --with-rcs-ids
@@ -238,7 +241,10 @@ multilib_src_install() {
                # Provide a link for -lcurses.
                ln -sf libncurses$(get_libname) "${ED}"/usr/$(get_libdir)/libcurses$(get_libname) || die
        fi
-       use static-libs || find "${ED}"/usr/ -name '*.a' -delete
+       # don't delete '*.dll.a', needed for linking #631468
+       if ! use static-libs; then
+               find "${ED}"/usr/ -name '*.a' ! -name '*.dll.a' -delete || die
+       fi
 
        # Build fails to create this ...
        dosym ../share/terminfo /usr/$(get_libdir)/terminfo