Control: tags -1 + patch

On 2016-04-02 11:17 +0200, Sven Joachim wrote:

> Package: screen
> Version: 4.3.1-2
> Severity: normal
>
> If libncurses5-dev is installed on the build system, screen is linked
> with -lcurses rather than -ltermcap or -ltinfo, giving an extraneous
> dependency on libncurses5.  This is because configure checks for
> -lcurses before trying -ltermcap or anything else.

I've seen that you added a Build-Conflicts with libncurses5-dev which is
rather suboptimal, since it prevents building screen in anything but the
most basic chroot.  Moreover, it's going to introduce an FTBFS after the
Jessie release when libncurses5-dev and libncursesw5-dev are likely
going to depend on the same package.

The right way to fix this bug is to change configure.ac to try -ltinfo
first, see the attached patch which can be dropped into debian/series
(you probably want to change the filename, edit the headers etc).

Cheers,
       Sven

>From 2cc497ad0c22057c42da115e9490dab284810903 Mon Sep 17 00:00:00 2001
From: Sven Joachim <svenj...@gmx.de>
Date: Sat, 2 Apr 2016 13:31:00 +0200
Subject: [PATCH] Prefer libtinfo over libcurses

Try to link with -ltinfo before -lcurses to avoid a spurious
dependency on systems where ncurses is built with "--with-termlib".
---
 configure.ac | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index ffe2e37..ccebe56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -657,6 +657,9 @@ dnl
 AC_CHECKING(for tgetent)
 AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
 olibs="$LIBS"
+LIBS="-ltinfo $olibs"
+AC_CHECKING(libtinfo)
+AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
 LIBS="-lcurses $olibs"
 AC_CHECKING(libcurses)
 AC_TRY_LINK(,[
@@ -681,9 +684,6 @@ AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
 LIBS="-lncurses $olibs"
 AC_CHECKING(libncurses)
 AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
-LIBS="-ltinfo $olibs"
-AC_CHECKING(libtinfo)
-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
 AC_MSG_ERROR(!!! no tgetent - no screen)))))))))
 
 AC_TRY_RUN([
-- 
2.8.0.rc3

Reply via email to