Package: nethack
Version: 3.4.3-10.6
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu karmic ubuntu-patch

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

  * Fix FTBFS by building with -D__CORRECT_ISO_CPP_STRINGS_H_PROTO flag, 
    a hack from Gentoo (LP: #452858).

We thought you might be interested in doing the same. 

I believe this also affects current Debian version (3.4.3-12). The fix 
is taken from Gentoo, more information at:
http://bugs.gentoo.org/show_bug.cgi?id=286532
https://bugs.launchpad.net/bugs/452858

I don't quite understand the nature of the problem, so it may well be a
bug in Qt or eglibc, but I'm reporting it here so that you have a fix
at hand in case this becomes a problem for nethack (e.g. when eglibc
2.10 enters unstable).

The build fails with the following error:

g++ -O2 -I../include -g -Wall -DGCC_WARN -DQT_GRAPHICS -I. -I/usr/include/qt3 
-c ../win/Qt/qt_win.cpp
In file included from /usr/include/qt3/qcstring.h:49,
                 from /usr/include/qt3/qstring.h:45,
                 from /usr/include/qt3/qwindowdefs.h:47,
                 from /usr/include/qt3/qwidget.h:45,
                 from /usr/include/qt3/qdialog.h:45,
                 from ../include/qt_win.h:19,
                 from ../win/Qt/qt_win.cpp:78:
/usr/include/string.h: In function 'char* strchr(char*, int)':
/usr/include/string.h:474: error: redefinition of 'char* strchr(char*, int)'
/usr/include/string.h:220: error: 'char* strchr(char*, int)' previously defined 
here
/usr/include/string.h: In function 'const char* strchr(const char*, int)':
/usr/include/string.h:480: error: redefinition of 'const char* strchr(const 
char*, int)'
/usr/include/string.h:226: error: 'const char* strchr(const char*, int)' 
previously defined here
/usr/include/string.h: In function 'char* strrchr(char*, int)':
/usr/include/string.h:502: error: redefinition of 'char* strrchr(char*, int)'
/usr/include/string.h:247: error: 'char* strrchr(char*, int)' previously 
defined here
/usr/include/string.h: In function 'const char* strrchr(const char*, int)':
/usr/include/string.h:508: error: redefinition of 'const char* strrchr(const 
char*, int)'
/usr/include/string.h:253: error: 'const char* strrchr(const char*, int)' 
previously defined here
In file included from ../include/qt_win.h:36,
                 from ../win/Qt/qt_win.cpp:78:
/usr/include/qt3/qimage.h: In member function 'bool 
QImageTextKeyLang::operator<(const QImageTextKeyLang&) const':
/usr/include/qt3/qimage.h:61: warning: suggest parentheses around '&&' within 
'||'
../win/Qt/qt_win.cpp: In member function 'virtual void 
NetHackQtTextWindow::Display(bool)':
../win/Qt/qt_win.cpp:3367: warning: suggest parentheses around '&&' within '||'
make[2]: *** [qt_win.o] Error 1

http://launchpadlibrarian.net/32127072/buildlog_ubuntu-karmic-i386.nethack_3.4.3-10.6ubuntu1_FAILEDTOBUILD.txt.gz

-- System Information:
Debian Release: 5.0
  APT prefers jaunty-updates
  APT policy: (500, 'jaunty-updates'), (500, 'jaunty-security'), (500, 
'jaunty-proposed'), (500, 'jaunty-backports'), (500, 'jaunty')
Architecture: i386 (i686)

Kernel: Linux 2.6.28-15-generic (SMP w/2 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -u nethack-3.4.3/debian/rules nethack-3.4.3/debian/rules
--- nethack-3.4.3/debian/rules
+++ nethack-3.4.3/debian/rules
@@ -18,7 +18,7 @@
 	optimize := -O2
 endif
 
-export CFLAGS = $(optimize) -I../include -g -Wall -DGCC_WARN
+export CFLAGS = $(optimize) -I../include -g -Wall -DGCC_WARN -D__CORRECT_ISO_CPP_STRINGS_H_PROTO
 
 TARGETS = console lisp x11 qt
 

Reply via email to