summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Clausecker <fuz@FreeBSD.org>2023-04-15 14:50:27 +0200
committerRobert Clausecker <fuz@FreeBSD.org>2023-04-17 11:27:24 +0200
commit1092ffe19022aa17a164efc50b8b392d2a4e3f2e (patch)
tree6810788a3cd9a23845f58a41adc6837419b4a61c
parentdevel/goreleaser: update to 1.17.1 (diff)
games/uhexen: fix build with -fno-common, on big endian platforms
- turns a duplicate definition into a declaration - replace nonexisting byte swap functions with gcc/clang intrinsics - define LICENSE
-rw-r--r--games/uhexen/Makefile10
-rw-r--r--games/uhexen/files/patch-include__h2def.h17
-rw-r--r--games/uhexen/files/patch-src_i__fbsdvideo.c20
3 files changed, 40 insertions, 7 deletions
diff --git a/games/uhexen/Makefile b/games/uhexen/Makefile
index 59d3705b1cdb..1d3f136d5906 100644
--- a/games/uhexen/Makefile
+++ b/games/uhexen/Makefile
@@ -1,6 +1,6 @@
PORTNAME= uhexen
PORTVERSION= 0.601
-PORTREVISION= 11
+PORTREVISION= 12
CATEGORIES= games
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/U-hexen%20version%20${PORTVERSION}
@@ -8,10 +8,10 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Yet another port of Hexen, popular game from Raven Software
WWW= http://uhexen.sourceforge.net/
-BROKEN_FreeBSD_13= ld: error: duplicate symbol: mouse_scale_factor
-BROKEN_FreeBSD_14= ld: error: duplicate symbol: mouse_scale_factor
-BROKEN_powerpc= fails to compile
-BROKEN_powerpc64= fails to compile: m_misc.o: undefined reference to 'ShortSwap'
+LICENSE= ACTIVISION
+LICENSE_FILE= ${WRKSRC}/LICENSE
+LICENSE_NAME= Activision Software License Agreement
+LICENSE_PERMS= no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell auto-accept
USES= gmake sdl
USE_SDL= mixer sdl
diff --git a/games/uhexen/files/patch-include__h2def.h b/games/uhexen/files/patch-include__h2def.h
index ed1cf5f5edde..87a61ca4f3ff 100644
--- a/games/uhexen/files/patch-include__h2def.h
+++ b/games/uhexen/files/patch-include__h2def.h
@@ -1,5 +1,5 @@
---- include/h2def.h 2003/02/10 14:43:33 1.1
-+++ include/h2def.h 2003/02/10 14:46:37
+--- include/h2def.h.orig 2001-12-02 08:51:54 UTC
++++ include/h2def.h
@@ -26,7 +26,11 @@
/* XXX ifdefs */
@@ -12,3 +12,16 @@
// Uncomment, to enable all timebomb stuff
//#define TIMEBOMB
+@@ -894,10 +898,8 @@ fixed_t FixedDiv2 (fixed_t a, fixed_t b);
+ #endif
+
+ #ifdef __BIG_ENDIAN__
+-short ShortSwap(short);
+-long LongSwap(long);
+-#define SHORT(x) ShortSwap(x)
+-#define LONG(x) LongSwap(x)
++#define SHORT(x) __builtin_bswap16(x)
++#define LONG(x) __builtin_bswap32(x)
+ #else
+ #define SHORT(x) (x)
+ #define LONG(x) (x)
diff --git a/games/uhexen/files/patch-src_i__fbsdvideo.c b/games/uhexen/files/patch-src_i__fbsdvideo.c
new file mode 100644
index 000000000000..525f2ba0c2ff
--- /dev/null
+++ b/games/uhexen/files/patch-src_i__fbsdvideo.c
@@ -0,0 +1,20 @@
+--- src/i_fbsdvideo.c.orig 2023-04-15 12:37:20 UTC
++++ src/i_fbsdvideo.c
+@@ -8,7 +8,7 @@
+ #include <sys/fbio.h>
+ #include <sys/kbio.h>
+ #include <sys/consio.h>
+-#include <sys/termios.h>
++#include <termios.h>
+ #include <sys/mman.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+@@ -26,7 +26,7 @@
+ #define RestorePalette() SavRstPalette(FBIO_SETPALETTE)
+
+ extern int usemouse;
+-int mouse_scale_factor;
++extern int mouse_scale_factor;
+
+ static event_t event;
+