Package: cvsgraph
Version: 1.7.0-3
Severity: important
Tags: patch
User: [email protected]
Usertags: origin-ubuntu ubuntu-patch saucy

cvsgraph fails to build with a linker that defaults to --as-needed when
gdlib-config is present, as shown in this Ubuntu build log:

  
https://launchpadlibrarian.net/140260800/buildlog_ubuntu-saucy-i386.cvsgraph_1.7.0-3build1_FAILEDTOBUILD.txt.gz

When gdlib-config is present, the AX_CHECK_GD macro forgets all previous
entries in LIBS, presumably in an attempt to avoid overlinking.
However, the atan2 function in libm is used independently of libgd, and
therefore must be linked regardless of how libgd is configured.

The following patch should fix this.  I used dh-autoreconf since that's
the easiest and generally most reliable way to apply changes to
autotools input files, but it's worth noting that if you build your
binary package in the same tree where you build your source package (as
opposed to building the binary package with sbuild or similar) then this
may eventually cause the generated configure et al to disappear from
your source package; this is probably OK since despite the use of the
3.0 (native) source format you seem to have an independent upstream.

  * Make configure test for -lm after testing for GD (which may discard
    prior additions to LIBS).  We need -lm for atan2 regardless of whether
    we have gdlib-config.
  * Use dh-autoreconf to help apply this change.

diff -Nru cvsgraph-1.7.0/configure.in cvsgraph-1.7.0/configure.in
--- cvsgraph-1.7.0/configure.in 2008-05-21 13:09:44.000000000 +0100
+++ cvsgraph-1.7.0/configure.in 2013-05-20 10:25:55.000000000 +0100
@@ -73,8 +73,6 @@
 AC_PROG_YACC
 AC_PATH_PROG(ac_prog_pkg_config, pkg-config)
 
-AC_CHECK_LIB(m, sqrt)
-
 AC_CHECK_LIB(freetype, FT_Load_Glyph)
 if test "$ac_cv_lib_freetype_FT_Load_Glyph" != "yes"
 then
@@ -84,6 +82,8 @@
 # find out what the GD library uses
 AX_CHECK_GD
 
+AC_CHECK_LIB(m, atan2)
+
 # Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS([getopt.h sys/wait.h gd.h])
diff -Nru cvsgraph-1.7.0/debian/control cvsgraph-1.7.0/debian/control
--- cvsgraph-1.7.0/debian/control       2013-05-03 14:37:13.000000000 +0100
+++ cvsgraph-1.7.0/debian/control       2013-05-20 10:29:28.000000000 +0100
@@ -2,7 +2,7 @@
 Section: devel
 Priority: optional
 Maintainer: Mark Brown <[email protected]>
-Build-Depends: debhelper (>> 9), dpkg-dev (>= 1.16.1), libgd2-noxpm-dev | 
libgd2-xpm-dev, bison | byacc, flex, libfreetype6-dev
+Build-Depends: debhelper (>> 9), dpkg-dev (>= 1.16.1), libgd2-noxpm-dev | 
libgd2-xpm-dev, bison | byacc, flex, libfreetype6-dev, dh-autoreconf
 Standards-Version: 3.9.4
 
 Package: cvsgraph
diff -Nru cvsgraph-1.7.0/debian/rules cvsgraph-1.7.0/debian/rules
--- cvsgraph-1.7.0/debian/rules 2013-05-06 22:30:31.000000000 +0100
+++ cvsgraph-1.7.0/debian/rules 2013-05-20 10:27:37.000000000 +0100
@@ -11,6 +11,7 @@
 configure: configure-stamp
 configure-stamp:
        dh_testdir
+       dh_autoreconf
        # Add here commands to configure the package.
        ./configure --prefix=/usr --mandir=\$${prefix}/share/man 
--infodir=\$${prefix}/share/info --sysconfdir=/etc/cvsgraph
 
@@ -34,6 +35,7 @@
 
        if [ -f Makefile ]; then $(MAKE) distclean ; fi
 
+       dh_autoreconf_clean
        dh_clean
 
 install: build

Cheers,

-- 
Colin Watson                                       [[email protected]]


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to