push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
{
lib,
stdenv,
fetchurl,
libX11,
SDL,
libGLU,
libGL,
expat,
zlib,
SDL_ttf,
SDL_image,
}:
stdenv.mkDerivation rec {
version = "1.5.0";
pname = "bloodspilot-client";
src = fetchurl {
url = "mirror://sourceforge/project/bloodspilot/client-sdl/v${version}/bloodspilot-client-sdl-${version}.tar.gz";
sha256 = "1qwl95av5an2zl01m7saj6fyy49xpixga7gbn4lwbpgpqs1rbwxj";
};
patches = [ ./bloodspilot-sdl-window-fix.patch ];
buildInputs = [
libX11
SDL
SDL_ttf
SDL_image
libGLU
libGL
expat
zlib
];
NIX_LDFLAGS = "-lX11";
meta = {
description = "Multiplayer space combat game (client part)";
mainProgram = "bloodspilot-client-sdl";
homepage = "http://bloodspilot.sf.net/";
license = lib.licenses.gpl2Plus;
maintainers = [ lib.maintainers.raskin ];
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,95 @@
--- a/src/client/sdl/scrap.c 2012-09-02 11:25:23.000000000 +0200
+++ b/src/client/sdl/scrap.c 2025-03-23 12:01:51.968751308 +0100
@@ -71,13 +71,13 @@
#if defined(X11_SCRAP)
/* * */
static Display *SDL_Display;
-static Window SDL_Window;
+static Window BloodsPilot_SDL_Window;
static void (*Lock_Display) (void);
static void (*Unlock_Display) (void);
#elif defined(WIN_SCRAP)
/* * */
-static HWND SDL_Window;
+static HWND BloodsPilot_SDL_Window;
#elif defined(QNX_SCRAP)
/* * */
@@ -274,7 +274,7 @@
/* * */
if (info.subsystem == SDL_SYSWM_X11) {
SDL_Display = info.info.x11.display;
- SDL_Window = info.info.x11.window;
+ BloodsPilot_SDL_Window = info.info.x11.window;
Lock_Display = info.info.x11.lock_func;
Unlock_Display = info.info.x11.unlock_func;
@@ -290,7 +290,7 @@
#elif defined(WIN_SCRAP)
/* * */
- SDL_Window = info.window;
+ BloodsPilot_SDL_Window = info.window;
retval = 0;
#elif defined(QNX_SCRAP)
@@ -310,12 +310,12 @@
#if defined(X11_SCRAP)
/* * */
Lock_Display();
- retval = (XGetSelectionOwner(SDL_Display, XA_PRIMARY) != SDL_Window);
+ retval = (XGetSelectionOwner(SDL_Display, XA_PRIMARY) != BloodsPilot_SDL_Window);
Unlock_Display();
#elif defined(WIN_SCRAP)
/* * */
- retval = (GetClipboardOwner() != SDL_Window);
+ retval = (GetClipboardOwner() != BloodsPilot_SDL_Window);
#elif defined(QNX_SCRAP)
/* * */
@@ -346,14 +346,14 @@
(unsigned char *) dst, dstlen);
free(dst);
if (lost_scrap())
- XSetSelectionOwner(SDL_Display, XA_PRIMARY, SDL_Window,
+ XSetSelectionOwner(SDL_Display, XA_PRIMARY, BloodsPilot_SDL_Window,
CurrentTime);
Unlock_Display();
}
#elif defined(WIN_SCRAP)
/* * */
- if (OpenClipboard(SDL_Window)) {
+ if (OpenClipboard(BloodsPilot_SDL_Window)) {
HANDLE hMem;
hMem = GlobalAlloc((GMEM_MOVEABLE | GMEM_DDESHARE), dstlen);
@@ -441,7 +441,7 @@
Lock_Display();
owner = XGetSelectionOwner(SDL_Display, XA_PRIMARY);
Unlock_Display();
- if ((owner == None) || (owner == SDL_Window)) {
+ if ((owner == None) || (owner == BloodsPilot_SDL_Window)) {
owner = DefaultRootWindow(SDL_Display);
selection1 = XA_CUT_BUFFER0;
}
@@ -449,7 +449,7 @@
int selection_response = 0;
SDL_Event event;
- owner = SDL_Window;
+ owner = BloodsPilot_SDL_Window;
Lock_Display();
selection1 = XInternAtom(SDL_Display, "SDL_SELECTION", False);
XConvertSelection(SDL_Display, XA_PRIMARY, format,
@@ -485,7 +485,7 @@
#elif defined(WIN_SCRAP)
/* * */
- if (IsClipboardFormatAvailable(format) && OpenClipboard(SDL_Window)) {
+ if (IsClipboardFormatAvailable(format) && OpenClipboard(BloodsPilot_SDL_Window)) {
HANDLE hMem;
char *src;

View File

@@ -0,0 +1,40 @@
Fortify catches a possible strcpy overcopy, throw more space at it
--- a/src/server/contact.c 2010-05-24 14:51:41.000000000 +0200
+++ b/src/server/contact.c 2025-03-23 12:15:36.426805646 +0100
@@ -58,11 +58,11 @@
struct queued_player {
struct queued_player *next;
- char real_name[MAX_CHARS];
- char nick_name[MAX_CHARS];
- char disp_name[MAX_CHARS];
- char host_name[MAX_CHARS];
- char host_addr[24];
+ char real_name[MAX_CHARS + 32];
+ char nick_name[MAX_CHARS + 32];
+ char disp_name[MAX_CHARS + 32];
+ char host_name[MAX_CHARS + 32];
+ char host_addr[1056];
int32_t port;
team_t *team;
uint32_t version;
@@ -271,12 +271,12 @@
uint32_t my_magic;
uint16_t port;
char ch;
- char real_name[MAX_CHARS];
- char disp_name[MAX_CHARS];
- char nick_name[MAX_CHARS];
- char host_name[MAX_CHARS];
- char host_addr[24];
- char str[MSG_LEN];
+ char real_name[MAX_CHARS + 32 ];
+ char disp_name[MAX_CHARS + 32 ];
+ char nick_name[MAX_CHARS + 32 ];
+ char host_name[MAX_CHARS + 32 ];
+ char host_addr[1056];
+ char str[MSG_LEN + 32];
/*
* Someone connected to us, now try and decipher the message :)

View File

@@ -0,0 +1,34 @@
{
lib,
stdenv,
fetchurl,
expat,
}:
stdenv.mkDerivation rec {
pname = "bloodspilot-xpilot-fxi-server";
version = "1.4.6";
src = fetchurl {
url = "mirror://sourceforge/project/bloodspilot/server/server%20v${version}/xpilot-${version}fxi.tar.gz";
sha256 = "0d7hnpshifq6gy9a0g6il6h1hgqqjyys36n8w84hr8d4nhg4d1ji";
};
buildInputs = [
expat
];
patches = [
./server-gcc5.patch
./bloodspilot-server-strcpy-fix.patch
];
meta = with lib; {
description = "Multiplayer X11 space combat game (server part)";
mainProgram = "xpilots";
homepage = "http://bloodspilot.sf.net/";
license = licenses.gpl2Plus;
maintainers = [ maintainers.raskin ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,50 @@
{
lib,
stdenv,
fetchurl,
libX11,
libSM,
libXext,
SDL,
libGLU,
libGL,
expat,
SDL_ttf,
SDL_image,
zlib,
libXxf86misc,
}:
stdenv.mkDerivation rec {
pname = "xpilot-ng";
version = "4.7.3";
src = fetchurl {
url = "mirror://sourceforge/xpilot/xpilot_ng/${pname}-${version}/${pname}-${version}.tar.gz";
sha256 = "02a7pnp88kh88fzda5q8mzlckk6y9r5fw47j00h26wbsfly0k1zj";
};
buildInputs = [
libX11
libSM
libXext
SDL
SDL_ttf
SDL_image
libGLU
libGL
expat
zlib
libXxf86misc
];
patches = [
./xpilot-ng-gcc-14-fix.patch
./xpilot-ng-sdl-window-fix.patch
];
meta = with lib; {
description = "Multiplayer X11 space combat game";
homepage = "http://xpilot.sf.net/";
license = licenses.gpl2Plus;
maintainers = [ maintainers.raskin ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,65 @@
--- xpilot-1.4.6fxi/src/common/net.c 2016-02-09 00:20:43.531714342 +0000
+++ xpilot-1.4.6fxi/src/common/net.c 2016-02-09 00:21:15.301331053 +0000
@@ -608,9 +608,9 @@
}
#if STDVA
-inline int32_t Packet_scanf(sockbuf_t *sbuf, const char *fmt, ...)
+extern int32_t Packet_scanf(sockbuf_t *sbuf, const char *fmt, ...)
#else
-inline int32_t Packet_scanf(va_alist)
+extern int32_t Packet_scanf(va_alist)
va_dcl
#endif
{
--- xpilot-1.4.6fxi/src/server/collision.c 2016-02-09 00:22:29.581784405 +0000
+++ xpilot-1.4.6fxi/src/server/collision.c 2016-02-09 00:22:38.152952500 +0000
@@ -71,7 +71,7 @@
* p: first object, q: second object
*/
-inline int32_t Collision_occured(int32_t p1x, int32_t p1y, int32_t p2x, int32_t p2y,
+extern int32_t Collision_occured(int32_t p1x, int32_t p1y, int32_t p2x, int32_t p2y,
int32_t q1x, int32_t q1y, int32_t q2x, int32_t q2y, int32_t r)
{
int32_t fac1, fac2; /* contraction between the distance between the x and y coordinates of objects */
--- xpilot-1.4.6fxi/src/server/player.c 2016-02-09 00:25:29.546313808 +0000
+++ xpilot-1.4.6fxi/src/server/player.c 2016-02-09 00:25:40.464527932 +0000
@@ -1411,12 +1411,12 @@
return NULL;
}
-inline bool Player_idle_timed_out(player_t *pl)
+extern bool Player_idle_timed_out(player_t *pl)
{
return (frame_loops - pl->frame_last_busy > MAX_PLAYER_IDLE_TICKS && (NumPlayers > 1)) ? true : false;
}
-inline bool Player_is_recovered(player_t *pl)
+extern bool Player_is_recovered(player_t *pl)
{
return (pl->recovery_count <= 0.0) ? true : false;
}
--- xpilot-1.4.6fxi/src/server/score.c 2016-02-09 00:21:45.659923025 +0000
+++ xpilot-1.4.6fxi/src/server/score.c 2016-02-09 00:22:07.224345939 +0000
@@ -24,17 +24,17 @@
char msg[MSG_LEN];
-inline double Get_Score(player_t *pl)
+extern double Get_Score(player_t *pl)
{
return pl->score;
}
-inline void Score_set(player_t * pl, double score)
+extern void Score_set(player_t * pl, double score)
{
pl->score = score;
}
-inline void Score_add(player_t * pl, double score)
+extern void Score_add(player_t * pl, double score)
{
pl->score += score;
}

View File

@@ -0,0 +1,168 @@
diff -r -U3 -x '.*.sw?' xpilot-ng-4.7.3/src/mapedit/proto.h xpilot-ng-4.7.3-fixed/src/mapedit/proto.h
--- xpilot-ng-4.7.3/src/mapedit/proto.h 2010-03-05 02:03:49.000000000 +0100
+++ xpilot-ng-4.7.3-fixed/src/mapedit/proto.h 2024-12-31 14:25:55.790083767 +0100
@@ -73,15 +73,15 @@
int ResizeWidth(HandlerInfo_t info);
int ResizeHeight(HandlerInfo_t info);
int OpenPreferencesPopup(HandlerInfo_t info);
-int OpenMapInfoPopup(void);
-int OpenRobotsPopup(void);
-int OpenVisibilityPopup(void);
-int OpenCannonsPopup(void);
-int OpenRoundsPopup(void);
-int OpenInitItemsPopup(void);
-int OpenMaxItemsPopup(void);
-int OpenProbsPopup(void);
-int OpenScoringPopup(void);
+int OpenMapInfoPopup(HandlerInfo_t info);
+int OpenRobotsPopup(HandlerInfo_t info);
+int OpenVisibilityPopup(HandlerInfo_t info);
+int OpenCannonsPopup(HandlerInfo_t info);
+int OpenRoundsPopup(HandlerInfo_t info);
+int OpenInitItemsPopup(HandlerInfo_t info);
+int OpenMaxItemsPopup(HandlerInfo_t info);
+int OpenProbsPopup(HandlerInfo_t info);
+int OpenScoringPopup(HandlerInfo_t info);
int ValidateCoordHandler(HandlerInfo_t info);
int ShowHoles(HandlerInfo_t info);
char MapData(int x, int y);
diff -r -U3 -x '.*.sw?' xpilot-ng-4.7.3/src/mapedit/tools.c xpilot-ng-4.7.3-fixed/src/mapedit/tools.c
--- xpilot-ng-4.7.3/src/mapedit/tools.c 2010-03-05 02:03:49.000000000 +0100
+++ xpilot-ng-4.7.3-fixed/src/mapedit/tools.c 2024-12-31 14:26:29.168082279 +0100
@@ -747,7 +747,7 @@
/* Arguments : */
/* Purpose : */
/***************************************************************************/
-int OpenMapInfoPopup()
+int OpenMapInfoPopup(HandlerInfo_t info)
{
Window *temp;
@@ -790,7 +790,7 @@
/* Arguments : */
/* Purpose : */
/***************************************************************************/
-int OpenRobotsPopup()
+int OpenRobotsPopup(HandlerInfo_t info)
{
XMapWindow(display, robots);
return 0;
@@ -801,7 +801,7 @@
/* Arguments : */
/* Purpose : */
/***************************************************************************/
-int OpenVisibilityPopup()
+int OpenVisibilityPopup(HandlerInfo_t info)
{
XMapWindow(display, visibility);
return 0;
@@ -812,7 +812,7 @@
/* Arguments : */
/* Purpose : */
/***************************************************************************/
-int OpenCannonsPopup()
+int OpenCannonsPopup(HandlerInfo_t info)
{
XMapWindow(display, cannons);
return 0;
@@ -823,7 +823,7 @@
/* Arguments : */
/* Purpose : */
/***************************************************************************/
-int OpenRoundsPopup()
+int OpenRoundsPopup(HandlerInfo_t info)
{
XMapWindow(display, rounds);
return 0;
@@ -834,7 +834,7 @@
/* Arguments : */
/* Purpose : */
/***************************************************************************/
-int OpenInitItemsPopup()
+int OpenInitItemsPopup(HandlerInfo_t info)
{
XMapWindow(display, inititems);
return 0;
@@ -845,7 +845,7 @@
/* Arguments : */
/* Purpose : */
/***************************************************************************/
-int OpenMaxItemsPopup()
+int OpenMaxItemsPopup(HandlerInfo_t info)
{
XMapWindow(display, maxitems);
return 0;
@@ -856,7 +856,7 @@
/* Arguments : */
/* Purpose : */
/***************************************************************************/
-int OpenProbsPopup()
+int OpenProbsPopup(HandlerInfo_t info)
{
XMapWindow(display, probs);
return 0;
@@ -867,7 +867,7 @@
/* Arguments : */
/* Purpose : */
/***************************************************************************/
-int OpenScoringPopup()
+int OpenScoringPopup(HandlerInfo_t info)
{
XMapWindow(display, scoring);
return 0;
diff -r -U3 -x '.*.sw?' xpilot-ng-4.7.3/src/server/suibotdef.c xpilot-ng-4.7.3-fixed/src/server/suibotdef.c
--- xpilot-ng-4.7.3/src/server/suibotdef.c 2010-03-05 02:03:49.000000000 +0100
+++ xpilot-ng-4.7.3-fixed/src/server/suibotdef.c 2024-12-31 14:07:28.316133143 +0100
@@ -338,12 +338,6 @@
/* } */
-struct collans {
- int line;
- int point;
- clvec_t moved;
-};
-
static bool Wall_in_between_points(int cx1, int cy1, int cx2, int cy2);
static bool Wall_in_between_points(int cx1, int cy1, int cx2, int cy2){ /* Wall between two given points?*/
@@ -405,7 +399,7 @@
/* ignore if there is enough time to deal with this object later */
if((time_until_closest < 0) || (time_until_closest > maxtime))
/*option instead of fixed value: options.dodgetime))*/
- return;
+ return false;
/* get the square of the distance */
sqdistance =
diff -r -U3 -x '.*.sw?' xpilot-ng-4.7.3/src/server/walls.c xpilot-ng-4.7.3-fixed/src/server/walls.c
--- xpilot-ng-4.7.3/src/server/walls.c 2010-03-05 02:03:49.000000000 +0100
+++ xpilot-ng-4.7.3-fixed/src/server/walls.c 2024-12-31 14:09:46.086127001 +0100
@@ -54,12 +54,6 @@
#error "This code assumes that negative numbers round upwards."
#endif
-struct collans {
- int line;
- int point;
- clvec_t moved;
-};
-
struct tl2 {
int base;
int x;
diff -r -U3 -x '.*.sw?' xpilot-ng-4.7.3/src/server/walls.h xpilot-ng-4.7.3-fixed/src/server/walls.h
--- xpilot-ng-4.7.3/src/server/walls.h 2010-03-05 02:03:49.000000000 +0100
+++ xpilot-ng-4.7.3-fixed/src/server/walls.h 2024-12-31 14:04:50.198140193 +0100
@@ -187,4 +187,11 @@
extern int num_polys, num_pstyles, num_estyles, num_bstyles;
+struct collans {
+ int line;
+ int point;
+ clvec_t moved;
+};
+
+extern void Move_point(const move_t *move, struct collans *answer);
#endif

View File

@@ -0,0 +1,96 @@
XPilot-NG uses SDL_Window (now an SDL type name) as a variable name
--- a/src/client/sdl/scrap.c 2025-03-23 11:48:45.045699445 +0100
+++ b.src/client/sdl/scrap.c 2025-03-23 11:48:48.773699690 +0100
@@ -57,13 +57,13 @@
#if defined(X11_SCRAP)
/* * */
static Display *SDL_Display;
-static Window SDL_Window;
+static Window XPilot_SDL_Window;
static void (*Lock_Display)(void);
static void (*Unlock_Display)(void);
#elif defined(WIN_SCRAP)
/* * */
-static HWND SDL_Window;
+static HWND XPilot_SDL_Window;
#elif defined(QNX_SCRAP)
/* * */
@@ -285,7 +285,7 @@
if ( info.subsystem == SDL_SYSWM_X11 )
{
SDL_Display = info.info.x11.display;
- SDL_Window = info.info.x11.window;
+ XPilot_SDL_Window = info.info.x11.window;
Lock_Display = info.info.x11.lock_func;
Unlock_Display = info.info.x11.unlock_func;
@@ -302,7 +302,7 @@
#elif defined(WIN_SCRAP)
/* * */
- SDL_Window = info.window;
+ XPilot_SDL_Window = info.window;
retval = 0;
#elif defined(QNX_SCRAP)
@@ -323,12 +323,12 @@
#if defined(X11_SCRAP)
/* * */
Lock_Display();
- retval = ( XGetSelectionOwner(SDL_Display, XA_PRIMARY) != SDL_Window );
+ retval = ( XGetSelectionOwner(SDL_Display, XA_PRIMARY) != XPilot_SDL_Window );
Unlock_Display();
#elif defined(WIN_SCRAP)
/* * */
- retval = ( GetClipboardOwner() != SDL_Window );
+ retval = ( GetClipboardOwner() != XPilot_SDL_Window );
#elif defined(QNX_SCRAP)
/* * */
@@ -360,13 +360,13 @@
XA_CUT_BUFFER0, format, 8, PropModeReplace, (unsigned char *)dst, dstlen);
free(dst);
if ( lost_scrap() )
- XSetSelectionOwner(SDL_Display, XA_PRIMARY, SDL_Window, CurrentTime);
+ XSetSelectionOwner(SDL_Display, XA_PRIMARY, XPilot_SDL_Window, CurrentTime);
Unlock_Display();
}
#elif defined(WIN_SCRAP)
/* * */
- if ( OpenClipboard(SDL_Window) )
+ if ( OpenClipboard(XPilot_SDL_Window) )
{
HANDLE hMem;
@@ -461,7 +461,7 @@
Lock_Display();
owner = XGetSelectionOwner(SDL_Display, XA_PRIMARY);
Unlock_Display();
- if ( (owner == None) || (owner == SDL_Window) )
+ if ( (owner == None) || (owner == XPilot_SDL_Window) )
{
owner = DefaultRootWindow(SDL_Display);
selection1 = XA_CUT_BUFFER0;
@@ -471,7 +471,7 @@
int selection_response = 0;
SDL_Event event;
- owner = SDL_Window;
+ owner = XPilot_SDL_Window;
Lock_Display();
selection1 = XInternAtom(SDL_Display, "SDL_SELECTION", False);
XConvertSelection(SDL_Display, XA_PRIMARY, format,
@@ -511,7 +511,7 @@
#elif defined(WIN_SCRAP)
/* * */
- if ( IsClipboardFormatAvailable(format) && OpenClipboard(SDL_Window) )
+ if ( IsClipboardFormatAvailable(format) && OpenClipboard(XPilot_SDL_Window) )
{
HANDLE hMem;
char *src;