]> git.pld-linux.org Git - packages/crafty.git/blame - crafty-paths.patch
- fix building on x32
[packages/crafty.git] / crafty-paths.patch
CommitLineData
f86d9ab9
JB
1--- chess.h.orig 2019-11-14 18:45:24.015435698 +0100
2+++ chess.h 2019-11-14 18:52:10.289901387 +0100
3@@ -62,17 +62,20 @@
4 # endif
c2d7e4a2 5 # endif
6 # if !defined(BOOKDIR)
f86d9ab9
JB
7-# define BOOKDIR "."
8+# define BOOKDIR "/usr/share/crafty"
c2d7e4a2 9 # endif
10 # if !defined(LOGDIR)
f86d9ab9 11 # define LOGDIR "."
c2d7e4a2 12 # endif
13 # if !defined(TBDIR)
f86d9ab9
JB
14-# define TBDIR "./syzygy"
15+# define TBDIR "/usr/share/crafty/syzygy"
c2d7e4a2 16 # endif
17 # if !defined(RCDIR)
f86d9ab9 18 # define RCDIR "."
c2d7e4a2 19 # endif
f86d9ab9
JB
20+# if !defined(SPEAK_CMD)
21+# define SPEAK_CMD "/usr/bin/crafty-speak"
22+# endif
23 # include "lock.h"
24 # define MAXPLY 129
25 # define MAX_TC_NODES 3000000
c2d7e4a2 26--- option.c.orig 2010-03-04 03:11:14.000000000 +0100
27+++ option.c 2010-03-06 22:15:00.000000000 +0100
28@@ -1038,7 +1038,7 @@
29 char *readstat = (char *) -1;
30 int lines = 0;
31
32- helpfile = fopen("crafty.hlp", "r");
33+ helpfile = fopen("/usr/share/crafty/crafty.hlp", "r");
34 if (!helpfile) {
35 printf("ERROR. Unable to open \"crafty.hlp\" -- help unavailable\n");
36 return (1);
f86d9ab9
JB
37--- analyze.c.orig 2019-11-14 18:56:09.495272167 +0100
38+++ analyze.c 2019-11-14 18:56:11.901925796 +0100
39@@ -146,10 +146,7 @@
40 Print(32, "%s\n", outmove);
41 if (speech) {
42 char announce[64];
43-
44- strcpy(announce, "./speak ");
45- strcat(announce, outmove);
46- strcat(announce, " &");
47+ snprintf(announce, sizeof(announce), "%s %s &", SPEAK_CMD, outmove);
48 v = system(announce);
49 if (v != 0)
50 perror("Analyze() system() error: ");
51--- main.c.orig 2016-10-27 22:11:42.000000000 +0200
52+++ main.c 2019-11-14 19:06:40.188522076 +0100
53@@ -4698,8 +4698,7 @@
54 if (audible_alarm)
55 printf("%c", audible_alarm);
56 if (speech) {
57- strcpy(announce, "./speak ");
58- strcat(announce, "Drawaccept");
59+ snprintf(announce, sizeof(announce), "%s Drawaccept", SPEAK_CMD);
60 v = system(announce);
61 if (v != 0)
62 perror("main() system() error: ");
63@@ -4711,8 +4710,7 @@
64 if (!xboard) {
65 Print(1, "Draw declined.\n");
66 if (speech) {
67- strcpy(announce, "./speak ");
68- strcat(announce, "Drawdecline");
69+ snprintf(announce, sizeof(announce), "%s Drawdecline", SPEAK_CMD);
70 v = system(announce);
71 if (v != 0)
72 perror("main() system() error: ");
73@@ -4748,8 +4746,7 @@
74 strcpy(pgn_result, "1-0");
75 }
76 if (speech) {
77- strcpy(announce, "./speak ");
78- strcat(announce, "Checkmate");
79+ snprintf(announce, sizeof(announce), "%s Checkmate", SPEAK_CMD);
80 v = system(announce);
81 if (v != 0)
82 perror("main() system() error: ");
83@@ -4759,8 +4756,7 @@
84 if (!xboard) {
85 Print(1, "stalemate\n");
86 if (speech) {
87- strcpy(announce, "./speak ");
88- strcat(announce, "Stalemate");
89+ snprintf(announce, sizeof(announce), "%s Stalemate", SPEAK_CMD);
90 v = system(announce);
91 if (v != 0)
92 perror("main() system() error: ");
93@@ -4802,9 +4798,7 @@
94 if (speech) {
95 char *moveptr = OutputMove(tree, 0, game_wtm, last_pv.path[1]);
96
97- strcpy(announce, "./speak ");
98- strcat(announce, moveptr);
99- strcat(announce, " &");
100+ snprintf(announce, sizeof(announce), "%s %s &", SPEAK_CMD, moveptr);
101 v = system(announce);
102 if (v != 0)
103 perror("main() system() error: ");
104--- resign.c.orig 2016-10-27 22:11:42.000000000 +0200
105+++ resign.c 2019-11-14 19:08:06.374721832 +0100
106@@ -109,8 +109,7 @@
107 if (speech) {
108 char announce[128];
109
110- strcpy(announce, "./speak ");
111- strcat(announce, "Resign");
112+ snprintf(announce, sizeof(announce), "%s Resign", SPEAK_CMD);
113 v = system(announce);
114 if (v <= 0)
115 perror("ResignOrDraw() system() error: ");
116@@ -132,8 +131,7 @@
117 if (speech) {
118 char announce[128];
119
120- strcpy(announce, "./speak ");
121- strcat(announce, "Drawoffer");
122+ snprintf(announce, sizeof(announce), "%s Drawoffer", SPEAK_CMD);
123 v = system(announce);
124 if (v <= 0)
125 perror("ResignOrDraw() system() error: ");
126--- annotate.c.orig 2016-10-27 22:11:42.000000000 +0200
127+++ annotate.c 2019-11-15 21:38:33.684414406 +0100
128@@ -557,7 +557,7 @@
129 fprintf(annotate_out, "</HTML>\n");
130 }
131 void AnnotatePositionHTML(TREE * RESTRICT tree, int wtm, FILE * annotate_out) {
132- char filename[32], html_piece;
133+ char filename[64], html_piece;
134 char alt[32];
135 int rank, file;
136
137@@ -567,7 +567,7 @@
138 for (rank = RANK8; rank >= RANK1; rank--) {
139 fprintf(annotate_out, "<TR>\n");
140 for (file = FILEA; file <= FILEH; file++) {
141- strcpy(filename, "bitmaps/");
142+ strcpy(filename, "/usr/share/crafty/bitmaps/");
143 if ((rank + file) % 2)
144 strcat(filename, "w");
145 else
146--- make_books.orig 2003-02-15 13:10:34.000000000 +0100
147+++ make_books 2019-11-15 19:08:06.169987317 +0100
148@@ -7,4 +7,7 @@
149 echo "books create start.pgn 60" | ./crafty
150
151 # create book.bin (opening book)
152-echo "book create small.txt 60 3" | ./crafty
153+echo "book create book.pgn 60 3" | ./crafty
154+
155+# create bookc.bin (computer opening book)
156+echo "bookc create startc.pgn 60 3" | ./crafty
This page took 0.076347 seconds and 4 git commands to generate.