summaryrefslogtreecommitdiffstats
path: root/source/xap/gnuchess
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2010-05-19 08:58:23 +0000
committer Eric Hameleers <alien@slackware.com>2018-05-31 22:43:05 +0200
commitb76270bf9e6dd375e495fec92140a79a79415d27 (patch)
tree3dbed78b2279bf9f14207a16dc634b90995cbd40 /source/xap/gnuchess
parent5a12e7c134274dba706667107d10d231517d3e05 (diff)
downloadcurrent-b76270bf9e6dd375e495fec92140a79a79415d27.tar.gz
current-b76270bf9e6dd375e495fec92140a79a79415d27.tar.xz
Slackware 13.1slackware-13.1
Wed May 19 08:58:23 UTC 2010 Slackware 13.1 x86_64 stable is released! Lots of thanks are due -- see the RELEASE_NOTES and the rest of the ChangeLog for credits. The ISOs are on their way to replication, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. We are taking pre-orders now at store.slackware.com, and offering a discount if you sign up for a subscription. Consider picking up a copy to help support the project. Thanks again to the Slackware community for testing, contributing, and generally holding us to a high level of quality. :-) Enjoy!
Diffstat (limited to 'source/xap/gnuchess')
-rw-r--r--source/xap/gnuchess/eboard.assert.diff41
-rwxr-xr-xsource/xap/gnuchess/gnuchess.SlackBuild29
-rw-r--r--source/xap/gnuchess/gnuchess.getline.glibc.diff39
-rw-r--r--source/xap/gnuchess/xboard.buffer_overflow_fix.diff95
-rw-r--r--source/xap/gnuchess/xboard.infodir.diff11
5 files changed, 101 insertions, 114 deletions
diff --git a/source/xap/gnuchess/eboard.assert.diff b/source/xap/gnuchess/eboard.assert.diff
new file mode 100644
index 000000000..182359318
--- /dev/null
+++ b/source/xap/gnuchess/eboard.assert.diff
@@ -0,0 +1,41 @@
+--- ./ntext.cc.orig 2008-02-22 09:51:22.000000000 -0600
++++ ./ntext.cc 2010-02-19 21:53:58.000000000 -0600
+@@ -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);
diff --git a/source/xap/gnuchess/gnuchess.SlackBuild b/source/xap/gnuchess/gnuchess.SlackBuild
index 2b236ae40..99cb5c067 100755
--- a/source/xap/gnuchess/gnuchess.SlackBuild
+++ b/source/xap/gnuchess/gnuchess.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,10 +23,19 @@
VERGNUCHESS=5.07
VERSJENG=11.2
-VEREBOARD=1.0.3
-VERXBOARD=4.2.7
-ARCH=${ARCH:-x86_64}
-BUILD=${BUILD:-4}
+VEREBOARD=1.1.1
+VERXBOARD=4.4.2
+BUILD=${BUILD:-5}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
NUMJOBS=${NUMJOBS:-" -j7 "}
@@ -36,6 +45,8 @@ elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
+else
+ SLKCFLAGS="-O2"
fi
CWD=$(pwd)
@@ -52,6 +63,7 @@ tar xvf $CWD/gnuchess-$VERGNUCHESS.tar.bz2 || exit 1
cd gnuchess-$VERGNUCHESS || exit 1
# make gnuchess compile with gcc4
zcat $CWD/gnuchess.gcc4_fix.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
+zcat $CWD/gnuchess.getline.glibc.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -101,6 +113,7 @@ cd $TMP
rm -rf eboard-$VEREBOARD
tar xvf $CWD/eboard-$VEREBOARD.tar.bz2 || exit 1
cd eboard-$VEREBOARD || exit 1
+zcat $CWD/eboard.assert.diff.gz | patch -p1 --verbose || exit 1
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -122,7 +135,7 @@ cp -a \
### XBoard
cd $TMP
rm -rf xboard-$VERXBOARD
-tar xvf $CWD/xboard-$VERXBOARD.tar.bz2 || exit 1
+tar xvf $CWD/xboard-$VERXBOARD.tar.?z* || exit 1
cd xboard-$VERXBOARD || exit 1
chown -R root:root .
find . \
@@ -132,10 +145,10 @@ find . \
-exec chmod 644 {} \;
# --infodir is fubar.
-zcat $CWD/xboard.infodir.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
+#zcat $CWD/xboard.infodir.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
# Taken from Debian to fix CVE-2004-2552
# FOR WHICH THERE IS NO ATTACK VECTOR!!!
-zcat $CWD/xboard.buffer_overflow_fix.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
+#zcat $CWD/xboard.buffer_overflow_fix.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
diff --git a/source/xap/gnuchess/gnuchess.getline.glibc.diff b/source/xap/gnuchess/gnuchess.getline.glibc.diff
new file mode 100644
index 000000000..51a45df1d
--- /dev/null
+++ b/source/xap/gnuchess/gnuchess.getline.glibc.diff
@@ -0,0 +1,39 @@
+--- ./src/input.c.orig 2010-02-19 21:34:10.000000000 -0600
++++ ./src/input.c 2010-02-19 21:36:33.000000000 -0600
+@@ -127,7 +127,7 @@
+ (RealGameCnt+1)/2 + 1 );
+ }
+ pthread_mutex_lock(&input_mutex);
+- getline(prompt);
++ chess_getline(prompt);
+ input_status = INPUT_AVAILABLE;
+ pthread_cond_signal(&input_cond);
+ pthread_mutex_unlock(&input_mutex);
+@@ -173,13 +173,13 @@
+ {
+ #ifdef HAVE_LIBREADLINE
+ if (isatty(STDIN_FILENO)) {
+- getline = getline_readline;
++ chess_getline = getline_readline;
+ using_history();
+ } else {
+- getline = getline_standard;
++ chess_getline = getline_standard;
+ }
+ #else
+- getline = getline_standard;
++ chess_getline = getline_standard;
+ #endif
+ /* Start input thread */
+ pthread_create(&input_thread, NULL, input_func, NULL);
+--- ./src/common.h.orig 2003-06-30 06:28:38.000000000 -0500
++++ ./src/common.h 2010-02-19 21:35:33.000000000 -0600
+@@ -745,7 +745,7 @@
+ * Input routine, initialized to one of the specific
+ * input routines. The given argument is the prompt.
+ */
+-void (*getline) (char *);
++void (*chess_getline) (char *);
+
+ #define MAXSTR 128
+ extern char inputstr[MAXSTR];
diff --git a/source/xap/gnuchess/xboard.buffer_overflow_fix.diff b/source/xap/gnuchess/xboard.buffer_overflow_fix.diff
deleted file mode 100644
index f36d36bad..000000000
--- a/source/xap/gnuchess/xboard.buffer_overflow_fix.diff
+++ /dev/null
@@ -1,95 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 09_fix_-icshost_buffer_overflow.dpatch by Florian Ernst <florian@debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Of minor importance, though, as there is probably no attack vector
-## DP: See bug#343560
-
-@DPATCH@
-diff -urNad xboard-4.2.7~/backend.c xboard-4.2.7/backend.c
---- xboard-4.2.7~/backend.c 2003-11-28 10:37:36.000000000 +0100
-+++ xboard-4.2.7/backend.c 2005-12-16 22:19:16.000000000 +0100
-@@ -692,7 +692,7 @@
- sprintf(buf, "Could not open comm port %s",
- appData.icsCommPort);
- } else {
-- sprintf(buf, "Could not connect to host %s, port %s",
-+ snprintf(buf, sizeof(buf), "Could not connect to host %s, port %s",
- appData.icsHost, appData.icsPort);
- }
- DisplayFatalError(buf, err, 1);
-@@ -869,18 +869,18 @@
- } else if (*appData.gateway != NULLCHAR) {
- if (*appData.remoteShell == NULLCHAR) {
- /* Use the rcmd protocol to run telnet program on a gateway host */
-- sprintf(buf, "%s %s %s",
-+ snprintf(buf, sizeof(buf), "%s %s %s",
- appData.telnetProgram, appData.icsHost, appData.icsPort);
- return OpenRcmd(appData.gateway, appData.remoteUser, buf, &icsPR);
-
- } else {
- /* Use the rsh program to run telnet program on a gateway host */
- if (*appData.remoteUser == NULLCHAR) {
-- sprintf(buf, "%s %s %s %s %s", appData.remoteShell,
-+ snprintf(buf, sizeof(buf), "%s %s %s %s %s", appData.remoteShell,
- appData.gateway, appData.telnetProgram,
- appData.icsHost, appData.icsPort);
- } else {
-- sprintf(buf, "%s %s -l %s %s %s %s",
-+ snprintf(buf, sizeof(buf), "%s %s -l %s %s %s %s",
- appData.remoteShell, appData.gateway,
- appData.remoteUser, appData.telnetProgram,
- appData.icsHost, appData.icsPort);
-@@ -1684,7 +1684,7 @@
-
- if (loggedOn && !have_set_title && ics_handle[0] != NULLCHAR) {
- char buf[MSG_SIZ];
-- sprintf(buf, "%s@%s", ics_handle, appData.icsHost);
-+ snprintf(buf, sizeof(buf), "%s@%s", ics_handle, appData.icsHost);
- DisplayIcsInteractionTitle(buf);
- have_set_title = TRUE;
- }
-@@ -4882,7 +4882,7 @@
- SendToProgram(buf, cps);
- }
- if (cps->sendICS) {
-- sprintf(buf, "ics %s\n", appData.icsActive ? appData.icsHost : "-");
-+ snprintf(buf, sizeof(buf), "ics %s\n", appData.icsActive ? appData.icsHost : "-");
- SendToProgram(buf, cps);
- }
- cps->maybeThinking = FALSE;
-diff -urNad xboard-4.2.7~/xboard.c xboard-4.2.7/xboard.c
---- xboard-4.2.7~/xboard.c 2003-11-19 09:42:18.000000000 +0100
-+++ xboard-4.2.7/xboard.c 2005-12-16 22:19:16.000000000 +0100
-@@ -6734,8 +6734,8 @@
- strcpy(icon, text);
- strcpy(title, text);
- } else if (appData.icsActive) {
-- sprintf(icon, "%s", appData.icsHost);
-- sprintf(title, "%s: %s", programName, appData.icsHost);
-+ snprintf(icon, sizeof(icon), "%s", appData.icsHost);
-+ snprintf(title, sizeof(title), "%s: %s", programName, appData.icsHost);
- } else if (appData.cmailGameName[0] != NULLCHAR) {
- sprintf(icon, "%s", "CMail");
- sprintf(title, "%s: %s", programName, "CMail");
-@@ -6804,7 +6804,7 @@
- } else {
- fprintf(stderr, "%s: %s: %s\n",
- programName, message, strerror(error));
-- sprintf(buf, "%s: %s", message, strerror(error));
-+ snprintf(buf, sizeof(buf), "%s: %s", message, strerror(error));
- message = buf;
- }
- if (appData.popupExitMessage && boardWidget && XtIsRealized(boardWidget)) {
-@@ -7488,9 +7488,9 @@
- char cmdLine[MSG_SIZ];
-
- if (port[0] == NULLCHAR) {
-- sprintf(cmdLine, "%s %s", appData.telnetProgram, host);
-+ snprintf(cmdLine, sizeof(cmdLine), "%s %s", appData.telnetProgram, host);
- } else {
-- sprintf(cmdLine, "%s %s %s", appData.telnetProgram, host, port);
-+ snprintf(cmdLine, sizeof(cmdLine), "%s %s %s", appData.telnetProgram, host, port);
- }
- return StartChildProcess(cmdLine, "", pr);
- }
diff --git a/source/xap/gnuchess/xboard.infodir.diff b/source/xap/gnuchess/xboard.infodir.diff
deleted file mode 100644
index 5c18bb026..000000000
--- a/source/xap/gnuchess/xboard.infodir.diff
+++ /dev/null
@@ -1,11 +0,0 @@
---- ./Makefile.in.orig 2003-11-28 13:12:57.000000000 -0800
-+++ ./Makefile.in 2004-06-26 15:47:07.000000000 -0700
-@@ -21,7 +21,7 @@
- # Yuck; the autoconf generated configure script sets an infodir variable
- # and provides a command-line flag to change it, but the default is
- # /usr/info instead of /usr/share/info.
--infodir = $(prefix)/share/info
-+infodir = /usr/info
-
- CC = @CC@
- CFLAGS = @CFLAGS@ @CPPFLAGS@ -DINFODIR=\"$(infodir)\"