Skip to content

Commit be1bd4b

Browse files
authored
xpilot-ng: fix build (NixOS#369672)
2 parents c9482a5 + f3f3f7b commit be1bd4b

File tree

2 files changed

+171
-0
lines changed

2 files changed

+171
-0
lines changed

pkgs/games/xpilot/default.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ stdenv.mkDerivation rec {
3232
zlib
3333
libXxf86misc
3434
];
35+
36+
patches = [ ./xpilot-ng-gcc-14-fix.patch ];
37+
3538
meta = with lib; {
3639
description = "Multiplayer X11 space combat game";
3740
homepage = "http://xpilot.sf.net/";
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
diff -r -U3 -x '.*.sw?' xpilot-ng-4.7.3/src/mapedit/proto.h xpilot-ng-4.7.3-fixed/src/mapedit/proto.h
2+
--- xpilot-ng-4.7.3/src/mapedit/proto.h 2010-03-05 02:03:49.000000000 +0100
3+
+++ xpilot-ng-4.7.3-fixed/src/mapedit/proto.h 2024-12-31 14:25:55.790083767 +0100
4+
@@ -73,15 +73,15 @@
5+
int ResizeWidth(HandlerInfo_t info);
6+
int ResizeHeight(HandlerInfo_t info);
7+
int OpenPreferencesPopup(HandlerInfo_t info);
8+
-int OpenMapInfoPopup(void);
9+
-int OpenRobotsPopup(void);
10+
-int OpenVisibilityPopup(void);
11+
-int OpenCannonsPopup(void);
12+
-int OpenRoundsPopup(void);
13+
-int OpenInitItemsPopup(void);
14+
-int OpenMaxItemsPopup(void);
15+
-int OpenProbsPopup(void);
16+
-int OpenScoringPopup(void);
17+
+int OpenMapInfoPopup(HandlerInfo_t info);
18+
+int OpenRobotsPopup(HandlerInfo_t info);
19+
+int OpenVisibilityPopup(HandlerInfo_t info);
20+
+int OpenCannonsPopup(HandlerInfo_t info);
21+
+int OpenRoundsPopup(HandlerInfo_t info);
22+
+int OpenInitItemsPopup(HandlerInfo_t info);
23+
+int OpenMaxItemsPopup(HandlerInfo_t info);
24+
+int OpenProbsPopup(HandlerInfo_t info);
25+
+int OpenScoringPopup(HandlerInfo_t info);
26+
int ValidateCoordHandler(HandlerInfo_t info);
27+
int ShowHoles(HandlerInfo_t info);
28+
char MapData(int x, int y);
29+
diff -r -U3 -x '.*.sw?' xpilot-ng-4.7.3/src/mapedit/tools.c xpilot-ng-4.7.3-fixed/src/mapedit/tools.c
30+
--- xpilot-ng-4.7.3/src/mapedit/tools.c 2010-03-05 02:03:49.000000000 +0100
31+
+++ xpilot-ng-4.7.3-fixed/src/mapedit/tools.c 2024-12-31 14:26:29.168082279 +0100
32+
@@ -747,7 +747,7 @@
33+
/* Arguments : */
34+
/* Purpose : */
35+
/***************************************************************************/
36+
-int OpenMapInfoPopup()
37+
+int OpenMapInfoPopup(HandlerInfo_t info)
38+
{
39+
Window *temp;
40+
41+
@@ -790,7 +790,7 @@
42+
/* Arguments : */
43+
/* Purpose : */
44+
/***************************************************************************/
45+
-int OpenRobotsPopup()
46+
+int OpenRobotsPopup(HandlerInfo_t info)
47+
{
48+
XMapWindow(display, robots);
49+
return 0;
50+
@@ -801,7 +801,7 @@
51+
/* Arguments : */
52+
/* Purpose : */
53+
/***************************************************************************/
54+
-int OpenVisibilityPopup()
55+
+int OpenVisibilityPopup(HandlerInfo_t info)
56+
{
57+
XMapWindow(display, visibility);
58+
return 0;
59+
@@ -812,7 +812,7 @@
60+
/* Arguments : */
61+
/* Purpose : */
62+
/***************************************************************************/
63+
-int OpenCannonsPopup()
64+
+int OpenCannonsPopup(HandlerInfo_t info)
65+
{
66+
XMapWindow(display, cannons);
67+
return 0;
68+
@@ -823,7 +823,7 @@
69+
/* Arguments : */
70+
/* Purpose : */
71+
/***************************************************************************/
72+
-int OpenRoundsPopup()
73+
+int OpenRoundsPopup(HandlerInfo_t info)
74+
{
75+
XMapWindow(display, rounds);
76+
return 0;
77+
@@ -834,7 +834,7 @@
78+
/* Arguments : */
79+
/* Purpose : */
80+
/***************************************************************************/
81+
-int OpenInitItemsPopup()
82+
+int OpenInitItemsPopup(HandlerInfo_t info)
83+
{
84+
XMapWindow(display, inititems);
85+
return 0;
86+
@@ -845,7 +845,7 @@
87+
/* Arguments : */
88+
/* Purpose : */
89+
/***************************************************************************/
90+
-int OpenMaxItemsPopup()
91+
+int OpenMaxItemsPopup(HandlerInfo_t info)
92+
{
93+
XMapWindow(display, maxitems);
94+
return 0;
95+
@@ -856,7 +856,7 @@
96+
/* Arguments : */
97+
/* Purpose : */
98+
/***************************************************************************/
99+
-int OpenProbsPopup()
100+
+int OpenProbsPopup(HandlerInfo_t info)
101+
{
102+
XMapWindow(display, probs);
103+
return 0;
104+
@@ -867,7 +867,7 @@
105+
/* Arguments : */
106+
/* Purpose : */
107+
/***************************************************************************/
108+
-int OpenScoringPopup()
109+
+int OpenScoringPopup(HandlerInfo_t info)
110+
{
111+
XMapWindow(display, scoring);
112+
return 0;
113+
diff -r -U3 -x '.*.sw?' xpilot-ng-4.7.3/src/server/suibotdef.c xpilot-ng-4.7.3-fixed/src/server/suibotdef.c
114+
--- xpilot-ng-4.7.3/src/server/suibotdef.c 2010-03-05 02:03:49.000000000 +0100
115+
+++ xpilot-ng-4.7.3-fixed/src/server/suibotdef.c 2024-12-31 14:07:28.316133143 +0100
116+
@@ -338,12 +338,6 @@
117+
118+
/* } */
119+
120+
-struct collans {
121+
- int line;
122+
- int point;
123+
- clvec_t moved;
124+
-};
125+
-
126+
static bool Wall_in_between_points(int cx1, int cy1, int cx2, int cy2);
127+
static bool Wall_in_between_points(int cx1, int cy1, int cx2, int cy2){ /* Wall between two given points?*/
128+
129+
@@ -405,7 +399,7 @@
130+
/* ignore if there is enough time to deal with this object later */
131+
if((time_until_closest < 0) || (time_until_closest > maxtime))
132+
/*option instead of fixed value: options.dodgetime))*/
133+
- return;
134+
+ return false;
135+
136+
/* get the square of the distance */
137+
sqdistance =
138+
diff -r -U3 -x '.*.sw?' xpilot-ng-4.7.3/src/server/walls.c xpilot-ng-4.7.3-fixed/src/server/walls.c
139+
--- xpilot-ng-4.7.3/src/server/walls.c 2010-03-05 02:03:49.000000000 +0100
140+
+++ xpilot-ng-4.7.3-fixed/src/server/walls.c 2024-12-31 14:09:46.086127001 +0100
141+
@@ -54,12 +54,6 @@
142+
#error "This code assumes that negative numbers round upwards."
143+
#endif
144+
145+
-struct collans {
146+
- int line;
147+
- int point;
148+
- clvec_t moved;
149+
-};
150+
-
151+
struct tl2 {
152+
int base;
153+
int x;
154+
diff -r -U3 -x '.*.sw?' xpilot-ng-4.7.3/src/server/walls.h xpilot-ng-4.7.3-fixed/src/server/walls.h
155+
--- xpilot-ng-4.7.3/src/server/walls.h 2010-03-05 02:03:49.000000000 +0100
156+
+++ xpilot-ng-4.7.3-fixed/src/server/walls.h 2024-12-31 14:04:50.198140193 +0100
157+
@@ -187,4 +187,11 @@
158+
159+
extern int num_polys, num_pstyles, num_estyles, num_bstyles;
160+
161+
+struct collans {
162+
+ int line;
163+
+ int point;
164+
+ clvec_t moved;
165+
+};
166+
+
167+
+extern void Move_point(const move_t *move, struct collans *answer);
168+
#endif

0 commit comments

Comments
 (0)