git: e19be2d61bfb - main - games/rocksndiamonds: fix build with -fno-common

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Fri, 14 Apr 2023 14:18:04 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e19be2d61bfbee1d5b8975fc8e223385beb9cf5c

commit e19be2d61bfbee1d5b8975fc8e223385beb9cf5c
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-04-13 13:39:11 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-04-14 14:16:09 +0000

    games/rocksndiamonds: fix build with -fno-common
    
    Same changes as to games/rnd_jue:  Turn redefinitions of a bunch of
    symbols into declarations.  This fixes the build on FreeBSD 13.
    While we are at it, use RLN to avoid a link to an absolute path.
---
 games/rocksndiamonds/Makefile               |  9 +++-----
 games/rocksndiamonds/files/patch-src_main.c | 36 +++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/games/rocksndiamonds/Makefile b/games/rocksndiamonds/Makefile
index 4f2a5e918fb3..93e8c473eb7c 100644
--- a/games/rocksndiamonds/Makefile
+++ b/games/rocksndiamonds/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	rocksndiamonds
-PORTVERSION=	3.3.1.2
-PORTREVISION=	5
+DISTVERSION=	3.3.1.2
+PORTREVISION=	6
 CATEGORIES=	games
 MASTER_SITES=	http://www.artsoft.org/RELEASES/unix/rocksndiamonds/:game \
 		http://www.artsoft.org/RELEASES/rocksndiamonds/levels/:levels_artsoft \
@@ -24,9 +24,6 @@ WWW=		https://www.artsoft.org/rocksndiamonds/
 LICENSE=	GPLv2
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-BROKEN_FreeBSD_13=	ld: error: duplicate symbol: setup
-BROKEN_FreeBSD_14=	ld: error: duplicate symbol: setup
-
 LIB_DEPENDS=	libsmpeg.so:multimedia/smpeg
 EXTRACT_DEPENDS=${UNZIP_CMD}:archivers/unzip
 
@@ -102,7 +99,7 @@ do-install:
 	${INSTALL_DATA} ${WRKDIR}/${PORTNAME}_${s}.png \
 		${STAGEDIR}${PREFIX}/share/icons/hicolor/${s}/apps/${PORTNAME}.png
 .endfor
-	${LN} -sf ${PREFIX}/share/icons/hicolor/48x48/apps/${PORTNAME}.png \
+	${RLN} ${STAGEDIR}${PREFIX}/share/icons/hicolor/48x48/apps/${PORTNAME}.png \
 		${STAGEDIR}${PREFIX}/share/pixmaps/
 
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
diff --git a/games/rocksndiamonds/files/patch-src_main.c b/games/rocksndiamonds/files/patch-src_main.c
new file mode 100644
index 000000000000..01d8b5a15c09
--- /dev/null
+++ b/games/rocksndiamonds/files/patch-src_main.c
@@ -0,0 +1,36 @@
+--- src/main.c.orig	2013-11-19 20:09:56 UTC
++++ src/main.c
+@@ -42,12 +42,12 @@ int			key_joystick_mapping = 0;
+ 
+ #if 1
+ #if NEW_SCROLL
+-boolean			redraw[2 + MAX_LEV_FIELDX + 2][2 + MAX_LEV_FIELDY + 2];
++extern boolean		redraw[2 + MAX_LEV_FIELDX + 2][2 + MAX_LEV_FIELDY + 2];
+ #else
+-boolean			redraw[MAX_LEV_FIELDX + 2][MAX_LEV_FIELDY + 2];
++extern boolean		redraw[MAX_LEV_FIELDX + 2][MAX_LEV_FIELDY + 2];
+ #endif
+ #else
+-boolean			redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
++extern boolean		redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
+ #endif
+ int			redraw_x1 = 0, redraw_y1 = 0;
+ 
+@@ -79,7 +79,7 @@ short			ExplodeDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+ int			RunnerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+ int			PlayerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+ 
+-int			GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
++extern int		GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+ int 			GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+ int 			GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+ int			GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+@@ -140,7 +140,7 @@ struct LevelInfo	level, level_template;
+ struct PlayerInfo	stored_player[MAX_PLAYERS], *local_player = NULL;
+ struct HiScore		highscore[MAX_SCORE_ENTRIES];
+ struct TapeInfo		tape;
+-struct SetupInfo	setup;
++extern struct SetupInfo	setup;
+ struct GameInfo		game;
+ struct GlobalInfo	global;
+ struct BorderInfo	border;