[packages/crossfire] - added no-common patch (fixes build with -fno-common, gcc 10+ default) - support separate libexecdi

qboosh qboosh at pld-linux.org
Thu Feb 9 17:56:53 CET 2023


commit 8d84686707478eee99f32488719d178d2036d344
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Feb 9 17:58:22 2023 +0100

    - added no-common patch (fixes build with -fno-common, gcc 10+ default)
    - support separate libexecdir

 crossfire-no-common.patch | 111 ++++++++++++++++++++++++++++++++++++++++++++++
 crossfire.spec            |  13 ++++--
 2 files changed, 120 insertions(+), 4 deletions(-)
---
diff --git a/crossfire.spec b/crossfire.spec
index d35bd29..46bb8a0 100644
--- a/crossfire.spec
+++ b/crossfire.spec
@@ -16,6 +16,7 @@ Patch2:		%{name}-daemon.patch
 Patch3:		%{name}-python.patch
 Patch4:		%{name}-am.patch
 Patch5:		%{name}-libpng15.patch
+Patch6:		%{name}-no-common.patch
 URL:		https://crossfire.real-time.com/
 BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake
@@ -107,6 +108,7 @@ Wtyczka animacji dla serwera Crossfire.
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
 
 %build
 %{__libtoolize}
@@ -180,10 +182,13 @@ fi
 %attr(660,root,games) %config(noreplace) %verify(not md5 mtime size) /var/log/crossfire
 %dir %{_libdir}/crossfire
 %dir %{_libdir}/crossfire/plugins
-%attr(755,root,root) %{_libdir}/crossfire/add_throw.perl
-%attr(755,root,root) %{_libdir}/crossfire/metaserver.pl
-%attr(755,root,root) %{_libdir}/crossfire/mktable.script
-%attr(755,root,root) %{_libdir}/crossfire/random_map
+%if "%{_libexecdir}" != "%{_libdir}"
+%dir %{_libexecdir}/crossfire
+%endif
+%attr(755,root,root) %{_libexecdir}/crossfire/add_throw.perl
+%attr(755,root,root) %{_libexecdir}/crossfire/metaserver.pl
+%attr(755,root,root) %{_libexecdir}/crossfire/mktable.script
+%attr(755,root,root) %{_libexecdir}/crossfire/random_map
 
 %files editor
 %defattr(644,root,root,755)
diff --git a/crossfire-no-common.patch b/crossfire-no-common.patch
new file mode 100644
index 0000000..de245d6
--- /dev/null
+++ b/crossfire-no-common.patch
@@ -0,0 +1,111 @@
+--- crossfire-1.10.0/include/global.h.orig	2007-03-19 07:48:19.000000000 +0100
++++ crossfire-1.10.0/include/global.h	2023-02-09 17:31:29.185751281 +0100
+@@ -189,7 +189,7 @@ EXTERN godlink *first_god;
+ EXTERN racelink *first_race;
+ 
+ #define NROF_COMPRESS_METHODS 4
+-EXTERN const char *uncomp[NROF_COMPRESS_METHODS][3];
++extern const char *uncomp[NROF_COMPRESS_METHODS][3];
+ /*
+  * The editor uses these (will get them out of here later):
+  */
+--- crossfire-1.10.0/random_maps/room_gen_onion.c.orig	2007-03-19 07:48:22.000000000 +0100
++++ crossfire-1.10.0/random_maps/room_gen_onion.c	2023-02-09 17:33:56.719291087 +0100
+@@ -55,8 +55,6 @@ centered, linear onion        bottom/rig
+ */
+ 
+ 
+-int *free_x_list;
+-int *free_y_list;
+ #include <global.h>
+ #include <random_map.h>
+ 
+--- crossfire-1.10.0/random_maps/room_gen_spiral.c.orig	2007-03-19 07:48:22.000000000 +0100
++++ crossfire-1.10.0/random_maps/room_gen_spiral.c	2023-02-09 17:33:40.613233533 +0100
+@@ -39,9 +39,6 @@ char **map_gen_spiral(int xsize, int ysi
+ #define MAX_SPIRAL_OPT 8  /* this should be 2x the last real option */
+ #include <math.h>
+ 
+-int *free_x_list;
+-int *free_y_list;
+-
+ #ifndef MIN
+ #define MIN(x,y) (((x)<(y))? (x):(y))
+ #endif
+--- crossfire-1.10.0/include/timers.h.orig	2007-03-19 07:48:19.000000000 +0100
++++ crossfire-1.10.0/include/timers.h	2023-02-09 17:43:24.871986328 +0100
+@@ -57,7 +57,7 @@ typedef struct _cftimer
+ 
+ #define MAX_TIMERS 1000
+ 
+-cftimer timers_table[MAX_TIMERS];
++extern cftimer timers_table[MAX_TIMERS];
+ 
+ #define TIMER_ERR_NONE      0
+ #define TIMER_ERR_ID       -1
+--- crossfire-1.10.0/server/timers.c.orig	2007-03-19 07:48:12.000000000 +0100
++++ crossfire-1.10.0/server/timers.c	2023-02-09 17:43:24.859623858 +0100
+@@ -3,6 +3,8 @@
+ #include <sproto.h>
+ #endif
+ 
++cftimer timers_table[MAX_TIMERS];
++
+ static void cftimer_process_event(tag_t ob_tag);
+ 
+ /*****************************************************************************/
+--- crossfire-1.10.0/include/material.h.orig	2007-03-19 07:48:19.000000000 +0100
++++ crossfire-1.10.0/include/material.h	2023-02-09 17:25:30.487836297 +0100
+@@ -66,7 +66,7 @@ typedef struct _materialtype {
+     struct _materialtype *next;
+ } materialtype_t;
+ 
+-EXTERN materialtype_t *materialt;
++extern materialtype_t *materialt;
+ 
+ #endif	/* MATERIAL_H */
+ 
+--- crossfire-1.10.0/common/utils.c.orig	2023-02-09 17:28:35.687293865 +0100
++++ crossfire-1.10.0/common/utils.c	2023-02-09 17:26:39.287314780 +0100
+@@ -250,6 +250,8 @@ void decay_objects(mapstruct *m)
+ 
+ /* convert materialname to materialtype_t */
+ 
++materialtype_t *materialt;
++
+ materialtype_t *name_to_material(const char *name)
+ {
+     materialtype_t *mt, *nmt;
+--- crossfire-1.10.0/server/init.c.orig	2007-03-19 07:48:12.000000000 +0100
++++ crossfire-1.10.0/server/init.c	2023-02-09 17:28:32.903944361 +0100
+@@ -215,8 +215,6 @@ static void parse_args(int argc, char *a
+     }
+ }
+ 
+-materialtype_t *materialt;
+-
+ static materialtype_t *get_empty_mat(void) {
+     materialtype_t *mt;
+     int i;
+--- crossfire-1.10.0/plugins/cfpython/include/cfpython.h.orig	2007-03-19 07:48:18.000000000 +0100
++++ crossfire-1.10.0/plugins/cfpython/include/cfpython.h	2023-02-09 17:38:17.190671400 +0100
+@@ -88,7 +88,7 @@ typedef struct PythonCmdStruct
+ 
+ /* This plugin allows up to 1024 custom commands.                            */
+ #define NR_CUSTOM_CMD 1024
+-PythonCmd CustomCommand[NR_CUSTOM_CMD];
++extern PythonCmd CustomCommand[NR_CUSTOM_CMD];
+ #include <cfpython_proto.h>
+ 
+ #endif /* PLUGIN_PYTHON_H */
+--- crossfire-1.10.0/plugins/cfpython/cfpython.c.orig	2007-03-19 07:48:18.000000000 +0100
++++ crossfire-1.10.0/plugins/cfpython/cfpython.c	2023-02-09 17:38:17.327338859 +0100
+@@ -63,6 +63,8 @@
+ #define PYTHON_DEBUG   /* give us some general infos out */
+ #define PYTHON_CACHE_SIZE 16    /* number of python scripts to store the bytecode of at a time */
+ 
++PythonCmd CustomCommand[NR_CUSTOM_CMD];
++
+ typedef struct {
+     char *file;
+     PyCodeObject *code;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/crossfire.git/commitdiff/8d84686707478eee99f32488719d178d2036d344



More information about the pld-cvs-commit mailing list