Package: nauty
Version: 2.4~b7-2
Severity: important
Tags: patch
Justification: fails to build from source
User: [email protected]
Usertags: origin-ubuntu karmic ubuntu-patch


https://bugs.launchpad.net/ubuntu/+source/nauty/+bug/521190

http://launchpadlibrarian.net/39035800/buildlog_ubuntu-lucid-i386.nauty_2.4~b7-2_FAILEDTOBUILD.txt.gz

gcc -c -g -O2 gtools.c
In file included from gtools.c:6:
gtools.h:159: error: conflicting types for 'getline'
/usr/include/stdio.h:651: note: previous declaration of 'getline' was here
gtools.c:375: error: conflicting types for 'getline'
/usr/include/stdio.h:651: note: previous declaration of 'getline' was here
gtools.c: In function 'gt_abort':
gtools.c:1835: warning: format not a string literal and no format arguments
make[2]: *** [gtools.o] Error 1


-----

In Ubuntu, we've applied the attached patch to achieve the following:

  * Fix FTBFS: gtools.c getline renamed to gtools_getline. (LP: #521190)

We thought you might be interested in doing the same. 
diff -u nauty-2.4~b7/debian/patches/series nauty-2.4~b7/debian/patches/series
--- nauty-2.4~b7/debian/patches/series
+++ nauty-2.4~b7/debian/patches/series
@@ -1,0 +2 @@
+gtools_getline.diff
only in patch2:
unchanged:
--- nauty-2.4~b7.orig/debian/patches/gtools_getline.diff
+++ nauty-2.4~b7/debian/patches/gtools_getline.diff
@@ -0,0 +1,113 @@
+Index: nauty/checks6.c
+===================================================================
+--- nauty.orig/checks6.c	2010-02-12 13:50:52.000000000 -0800
++++ nauty/checks6.c	2010-02-12 14:00:56.000000000 -0800
+@@ -211,7 +211,7 @@
+ 	else                maxin = pval2 - pval1 + 1;
+ 	while (nin < maxin || maxin == NOLIMIT)
+ 	{
+-	    if ((s = getline(infile)) == NULL) break;
++	    if ((s = gtools_getline(infile)) == NULL) break;
+ 	    ++nin;
+ 
+ 	    if (seemsbad(s)) ++nerr;
+Index: nauty/gtools-h.in
+===================================================================
+--- nauty.orig/gtools-h.in	2010-02-12 13:50:52.000000000 -0800
++++ nauty/gtools-h.in	2010-02-12 14:00:56.000000000 -0800
+@@ -156,7 +156,7 @@
+ extern void gtools_check(int,int,int,int);
+ extern FILE *opengraphfile(char*,int*,boolean,long);
+ extern void writeline(FILE*,char*);
+-extern char *getline(FILE*);
++extern char *gtools_getline(FILE*);
+ extern int graphsize(char*);
+ extern void stringcounts(char*,int*,size_t*);
+ extern void stringtograph(char*,graph*,int);
+Index: nauty/gtools.c
+===================================================================
+--- nauty.orig/gtools.c	2010-02-12 13:50:52.000000000 -0800
++++ nauty/gtools.c	2010-02-12 14:00:56.000000000 -0800
+@@ -370,23 +370,26 @@
+    changed at compile time to avoid conflict with the GNU function of
+    that name.
+ */
++/* Changed name to gtools_getline to avoid this name conflict, as nothing
++   in the build system does so.
++ */
+ 
+ char*
+-getline(FILE *f)     /* read a line with error checking */
++gtools_getline(FILE *f)     /* read a line with error checking */
+ /* includes \n (if present) and \0.  Immediate EOF causes NULL return. */
+ {
+     DYNALLSTAT(char,s,s_sz);
+     int c;
+     long i;
+ 
+-    DYNALLOC1(char,s,s_sz,5000,"getline");
++    DYNALLOC1(char,s,s_sz,5000,"gtools_getline");
+ 
+     FLOCKFILE(f);
+     i = 0;
+     while ((c = GETC(f)) != EOF && c != '\n')
+     {
+         if (i == s_sz-2)
+-            DYNREALLOC(char,s,s_sz,3*(s_sz/2)+10000,"getline");
++            DYNREALLOC(char,s,s_sz,3*(s_sz/2)+10000,"gtools_getline");
+         s[i++] = c;
+     }
+     FUNLOCKFILE(f);
+@@ -735,7 +738,7 @@
+     char *s,*p;
+     int m,n;
+ 
+-    if ((readg_line = getline(f)) == NULL) return NULL;
++    if ((readg_line = gtools_getline(f)) == NULL) return NULL;
+ 
+     s = readg_line;
+     if (s[0] == ':')
+@@ -1018,7 +1021,7 @@
+     char *s,*p;
+     int n,loops;
+ 
+-    if ((readg_line = getline(f)) == NULL) return NULL;
++    if ((readg_line = gtools_getline(f)) == NULL) return NULL;
+ 
+     s = readg_line;
+     if (s[0] == ':')
+@@ -1652,7 +1655,7 @@
+ 
+ void
+ writelast(FILE *f)
+-/* write last graph read by readg() assuming no intervening getline() */
++/* write last graph read by readg() assuming no intervening gtools_getline() */
+ {
+     writeline(f,readg_line);
+ }
+Index: nauty/shortg.c
+===================================================================
+--- nauty.orig/shortg.c	2010-02-12 13:50:52.000000000 -0800
++++ nauty/shortg.c	2010-02-12 14:00:56.000000000 -0800
+@@ -218,7 +218,7 @@
+         int j;
+         char *s;
+ 
+-	if ((s = getline(f)) == NULL) return FALSE;
++	if ((s = gtools_getline(f)) == NULL) return FALSE;
+ 
+ 	*cdstr = s;
+         for (j = 0; s[j] != ' ' && s[j] != '\t' && s[j] != '\n'; ++j) {}
+Index: nauty/debian/libnauty0d.symbols
+===================================================================
+--- nauty.orig/debian/libnauty0d.symbols	2010-02-12 14:01:23.000000000 -0800
++++ nauty/debian/libnauty0d.symbols	2010-02-12 14:01:32.000000000 -0800
+@@ -55,7 +55,7 @@
+  getbigce...@base 2.4~b7
+  getecl...@base 2.4~b7
+  get...@base 2.4~b7
+- getl...@base 2.4~b7
++ gtools_getl...@base 2.4~b7
+  gi...@base 2.4~b7
+  graphs...@base 2.4~b7
+  groupautomp...@base 2.4~b7

Reply via email to