Package: eboard
Version: 1.1.1-4
Severity: important
Tags: patch
Justification: fails to build from source
User: [email protected]
Usertags: origin-ubuntu karmic ubuntu-patch
Hi,
eboard is FTBFS with the following compilation error in Ubuntu:
g++ -O2 -g -fsigned-char -D_REENTRANT -I/usr/include/gtk-2.0
-I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo
-I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2
-I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -c ntext.cc -o ntext.o
ntext.cc: In member function 'void NText::append(const char*, int, int)':
ntext.cc:247: error: invalid conversion from 'const char*' to 'char*'
make[1]: *** [ntext.o] Error 1
make[1]: Leaving directory `/build/buildd/eboard-1.1.1'
make: *** [build-stamp] Error 2
This is fixed with the attached patch.
Thanks,
Fabrice
*** /tmp/tmpmV1puW
In Ubuntu, we've applied the attached patch to achieve the following:
* 95_ubuntu_gcc_4.4.dpatch: fix a "invalid conversion from 'const char*' to
'char*'" compilation error in ntext.cc
We thought you might be interested in doing the same.
-- System Information:
Debian Release: squeeze/sid
APT prefers karmic-updates
APT policy: (500, 'karmic-updates'), (500, 'karmic-security'), (500, 'karmic')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.28-15-generic (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
diff -u eboard-1.1.1/debian/patches/00list eboard-1.1.1/debian/patches/00list
--- eboard-1.1.1/debian/patches/00list
+++ eboard-1.1.1/debian/patches/00list
@@ -7,0 +8 @@
+95_ubuntu_gcc_4.4.dpatch
only in patch2:
unchanged:
--- eboard-1.1.1.orig/debian/patches/95_ubuntu_gcc_4.4.dpatch
+++ eboard-1.1.1/debian/patches/95_ubuntu_gcc_4.4.dpatch
@@ -0,0 +1,50 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 95_ubuntu_gcc_4.4.dpatch by Fabrice Coutadeur <[email protected]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix a compilation error due to invalid conversion from 'const char*' to
+## DP: 'char*'. This is achieved by copying the string before modifying it.
+
+...@dpatch@
+diff -urNad eboard-1.1.1~/ntext.cc eboard-1.1.1/ntext.cc
+--- eboard-1.1.1~/ntext.cc 2008-02-22 15:51:22.000000000 +0000
++++ eboard-1.1.1/ntext.cc 2009-10-20 04:35:42.000000000 +0000
+@@ -33,6 +33,7 @@
+ #include <gtk/gtkselection.h>
+ #include "ntext.h"
+ #include "global.h"
++#include <assert.h>
+
+ NLine::NLine() {
+ Text = NULL;
+@@ -238,23 +239,27 @@
+ int i;
+ NLine *nl;
+ char *p;
++ char *s;
+
+ if (len < 0) {
+ discardExcess();
+ return;
+ }
+
+- p = strchr(text, '\n');
++ s = strdup(text);
++ assert(s != NULL);
++ p = strchr(s, '\n');
+ if (p!=NULL) {
+ *p = 0;
+- i = strlen(text);
+- nl = new NLine(text, color);
++ i = strlen(s);
++ nl = new NLine(s, color);
+ *p = '\n';
+ lines.push_back(nl);
+ formatLine(lines.size()-1);
+ append(&p[1], len-(i+1), color);
+ return;
+ }
++ free (s);
+
+ // if search for \n failed, this is a single line
+ nl = new NLine(text, color);