summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGergely Imreh2020-09-19 19:47:45 +0100
committerGergely Imreh2020-09-19 19:50:34 +0100
commit227bda202359028cb863808f9e32529d386f80d2 (patch)
treecdc233bca7e4bb336d6580ab188a6edf264de15b
parentcd6ff27df0edd841aecde4c78e711ad9a260abea (diff)
downloadaur-227bda202359028cb863808f9e32529d386f80d2.tar.gz
fix GCC 10 compilation issues using Debian patch
Patch from https://salsa.debian.org/debian/gnushogi/-/commit/ae9ff5c5d4a047e895030add12cc0e75480026b5 Signed-off-by: Gergely Imreh <imrehg@gmail.com>
-rw-r--r--.SRCINFO6
-rw-r--r--.gitignore3
-rw-r--r--PKGBUILD13
-rw-r--r--gcc-10-globals.patch84
4 files changed, 100 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0a617f3973ab..27e47ed37f7f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,7 @@
-# Generated by mksrcinfo v8
-# Mon Apr 3 10:55:53 UTC 2017
pkgbase = gnushogi
pkgdesc = A computer program that plays the game of Shogi, also known as Japanese Chess.
pkgver = 1.4.2
- pkgrel = 2
+ pkgrel = 3
url = https://www.gnu.org/software/gnushogi/
arch = i686
arch = x86_64
@@ -12,7 +10,9 @@ pkgbase = gnushogi
makedepends = gcc
depends = glibc
source = http://ftp.gnu.org/gnu/gnushogi/gnushogi-1.4.2.tar.gz
+ source = gcc-10-globals.patch
sha256sums = 1ecc48a866303c63652552b325d685e7ef5e9893244080291a61d96505d52b29
+ sha256sums = bc4818c5ca20aab50f684d1dcf13745310980ba00932f34babb45388258c97dd
pkgname = gnushogi
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..5409240218d9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+gnushogi-*
+pkg/
+src/
diff --git a/PKGBUILD b/PKGBUILD
index c79f7a0987fb..71661684ee70 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,15 +1,22 @@
# Maintainer: Gergely Imreh <imrehg@gmail.com>
pkgname=gnushogi
pkgver=1.4.2
-pkgrel=2
+pkgrel=3
pkgdesc="A computer program that plays the game of Shogi, also known as Japanese Chess."
arch=('i686' 'x86_64')
url="https://www.gnu.org/software/gnushogi/"
license=('GPL')
depends=('glibc')
makedepends=('autoconf' 'gcc')
-source=("http://ftp.gnu.org/gnu/gnushogi/gnushogi-${pkgver}.tar.gz")
-sha256sums=('1ecc48a866303c63652552b325d685e7ef5e9893244080291a61d96505d52b29')
+source=("http://ftp.gnu.org/gnu/gnushogi/gnushogi-${pkgver}.tar.gz"
+ "gcc-10-globals.patch")
+sha256sums=('1ecc48a866303c63652552b325d685e7ef5e9893244080291a61d96505d52b29'
+ 'bc4818c5ca20aab50f684d1dcf13745310980ba00932f34babb45388258c97dd')
+
+prepare() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch --forward --strip=1 --input="${srcdir}/gcc-10-globals.patch"
+}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
diff --git a/gcc-10-globals.patch b/gcc-10-globals.patch
new file mode 100644
index 000000000000..3d7533352f3f
--- /dev/null
+++ b/gcc-10-globals.patch
@@ -0,0 +1,84 @@
+Index: gnushogi-1.4.2/gnushogi/commondsp.c
+===================================================================
+--- gnushogi-1.4.2.orig/gnushogi/commondsp.c
++++ gnushogi-1.4.2/gnushogi/commondsp.c
+@@ -53,6 +53,7 @@ char mvstr[4][6];
+ char *InPtr;
+ int InBackground = false;
+
++unsigned short MV[MAXDEPTH];
+
+ #if defined(BOOKTEST)
+
+@@ -2034,7 +2035,7 @@ InputCommand(char *command)
+ {
+ int i;
+
+- printf(" %6d ", MSCORE);
++ printf(" %6d ", 0);
+
+ for (i = 1; MV[i] > 0; i++)
+ {
+Index: gnushogi-1.4.2/gnushogi/cursesdsp.c
+===================================================================
+--- gnushogi-1.4.2.orig/gnushogi/cursesdsp.c
++++ gnushogi-1.4.2/gnushogi/cursesdsp.c
+@@ -62,18 +62,12 @@
+
+ #define FLUSH_SCANW fflush(stdout), scanw
+
+-int mycnt1, mycnt2;
+-
+ #define MARGIN (5)
+ #define TAB (58)
+
+ #define VIR_C(s) ((flag.reverse) ? (NO_COLS - 1 - column(s)) : column(s))
+ #define VIR_R(s) ((flag.reverse) ? (NO_ROWS - 1 - row(s)) : row(s))
+
+-unsigned short MV[MAXDEPTH];
+-int MSCORE;
+-char *DRAW;
+-
+ /* Forward declarations. */
+ /* FIXME: change this name, puh-leeze! */
+
+Index: gnushogi-1.4.2/gnushogi/globals.c
+===================================================================
+--- gnushogi-1.4.2.orig/gnushogi/globals.c
++++ gnushogi-1.4.2/gnushogi/globals.c
+@@ -201,3 +201,6 @@ char *DRAW;
+ char *DRAW_REPETITION = "Repetition";
+ char *DRAW_MAXMOVES = "Max Moves";
+ char *DRAW_JUSTDRAW = "Drawn game!";
++
++int mycnt1, mycnt2;
++
+Index: gnushogi-1.4.2/gnushogi/gnushogi.h
+===================================================================
+--- gnushogi-1.4.2.orig/gnushogi/gnushogi.h
++++ gnushogi-1.4.2/gnushogi/gnushogi.h
+@@ -685,8 +685,6 @@ extern long znodes;
+ extern char ColorStr[2][10];
+
+ extern char mvstr[4][6];
+-extern unsigned short MV[MAXDEPTH];
+-extern int MSCORE;
+ extern int mycnt1, mycnt2;
+ extern short ahead;
+ extern struct leaf rootnode;
+Index: gnushogi-1.4.2/gnushogi/rawdsp.c
+===================================================================
+--- gnushogi-1.4.2.orig/gnushogi/rawdsp.c
++++ gnushogi-1.4.2/gnushogi/rawdsp.c
+@@ -44,11 +44,6 @@
+ #include "gnushogi.h"
+ #include "rawdsp.h"
+
+-unsigned short MV[MAXDEPTH];
+-int MSCORE;
+-
+-int mycnt1, mycnt2;
+-char *DRAW;
+ extern char *InPtr;
+ extern short pscore[];
+