games/xonotic: Fix 15.0 build.

Signed-off-by: B. Watson <yalhcru@gmail.com>
This commit is contained in:
B. Watson 2022-02-21 16:56:32 -05:00 committed by Robby Workman
parent ab33ed895d
commit 932430f5c0
2 changed files with 99 additions and 6 deletions

89
games/xonotic/gcc11.diff Normal file
View File

@ -0,0 +1,89 @@
--- a/dpsoftrast.c 2013-02-07 11:40:40.000000000 +0000
+++ a/dpsoftrast.c 2021-04-30 04:45:31.276607019 +0000
@@ -21,6 +21,7 @@
#if defined(__APPLE__)
#include <libkern/OSAtomic.h>
#define ALIGN(var) var __attribute__((__aligned__(16)))
+ #define ALIGN_STRUCT(def) struct __attribute__((__aligned__(16))) def
#define ATOMIC(var) var __attribute__((__aligned__(4)))
#define MEMORY_BARRIER (_mm_sfence())
#define ATOMIC_COUNTER volatile int32_t
@@ -29,6 +30,7 @@
#define ATOMIC_ADD(counter, val) ((void)OSAtomicAdd32Barrier((val), &(counter)))
#elif defined(__GNUC__) && defined(WIN32)
#define ALIGN(var) var __attribute__((__aligned__(16)))
+ #define ALIGN_STRUCT(def) struct __attribute__((__aligned__(16))) def
#define ATOMIC(var) var __attribute__((__aligned__(4)))
#define MEMORY_BARRIER (_mm_sfence())
//(__sync_synchronize())
@@ -43,6 +45,7 @@
#define ATOMIC_ADD(counter, val) ((void)InterlockedExchangeAdd((LONG *) &(counter), (val)))
#elif defined(__GNUC__)
#define ALIGN(var) var __attribute__((__aligned__(16)))
+ #define ALIGN_STRUCT(def) struct __attribute__((__aligned__(16))) def
#define ATOMIC(var) var __attribute__((__aligned__(4)))
#define MEMORY_BARRIER (_mm_sfence())
//(__sync_synchronize())
@@ -52,6 +55,7 @@
#define ATOMIC_ADD(counter, val) ((void)__sync_fetch_and_add(&(counter), (val)))
#elif defined(_MSC_VER)
#define ALIGN(var) __declspec(align(16)) var
+ #define ALIGN_STRUCT(def) ALIGN(struct def)
#define ATOMIC(var) __declspec(align(4)) var
#define MEMORY_BARRIER (_mm_sfence())
//(MemoryBarrier())
@@ -65,6 +69,9 @@
#ifndef ALIGN
#define ALIGN(var) var
#endif
+#ifndef ALIGN_STRUCT
+#define ALIGN_STRUCT(def) def
+#endif
#ifndef ATOMIC
#define ATOMIC(var) var
#endif
@@ -163,7 +170,7 @@
#define DPSOFTRAST_DRAW_MAXCOMMANDPOOL 2097152
#define DPSOFTRAST_DRAW_MAXCOMMANDSIZE 16384
-typedef ALIGN(struct DPSOFTRAST_State_Command_Pool_s
+typedef ALIGN_STRUCT(DPSOFTRAST_State_Command_Pool_s
{
int freecommand;
int usedcommands;
@@ -171,7 +178,7 @@
}
DPSOFTRAST_State_Command_Pool);
-typedef ALIGN(struct DPSOFTRAST_State_Triangle_s
+typedef ALIGN_STRUCT(DPSOFTRAST_State_Triangle_s
{
unsigned char mip[DPSOFTRAST_MAXTEXTUREUNITS]; // texcoord to screen space density values (for picking mipmap of textures)
float w[3];
@@ -198,7 +205,7 @@
#define DPSOFTRAST_DRAW_MAXSUBSPAN 16
-typedef ALIGN(struct DPSOFTRAST_State_Span_s
+typedef ALIGN_STRUCT(DPSOFTRAST_State_Span_s
{
int triangle; // triangle this span was generated by
int x; // framebuffer x coord
@@ -236,7 +243,7 @@
}
DPSOFTRAST_BLENDMODE;
-typedef ALIGN(struct DPSOFTRAST_State_Thread_s
+typedef ALIGN_STRUCT(DPSOFTRAST_State_Thread_s
{
void *thread;
int index;
@@ -302,7 +309,7 @@
}
DPSOFTRAST_State_Thread);
-typedef ALIGN(struct DPSOFTRAST_State_s
+typedef ALIGN_STRUCT(DPSOFTRAST_State_s
{
int fb_width;
int fb_height;

View File

@ -22,6 +22,8 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# 20220221 bkw: Modified by SlackBuilds.org: fix build on 15.0.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=xonotic
@ -38,9 +40,6 @@ if [ -z "$ARCH" ]; then
esac
fi
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@ -76,9 +75,9 @@ cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
-o -perm 511 \) -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
mkdir -p \
$PKG/usr/bin \
@ -88,8 +87,13 @@ mkdir -p \
# Fix -version-info as requested by Hunter Sezen
patch -p1 < $CWD/0d3d1f2655901776b2fc3e911eb78478412f789a.diff source/d0_blind_id/Makefile.am
cd source/d0_blind_id
# 20220221 bkw: fix compile with gcc 11. patch came from:
# https://bugs.gentoo.org/show_bug.cgi?id=786288
cd source/darkplaces
patch -p1 < $CWD/gcc11.diff
cd -
cd source/d0_blind_id
autoreconf -fi
CFLAGS="$SLKCFLAGS" \
./configure \