git: 2a8fed7897c7 - main - games/mirrormagic: update 2.0.2 → 3.0.0

From: Dmitry Marakasov <amdmi3_at_FreeBSD.org>
Date: Wed, 16 Mar 2022 13:22:43 UTC
The branch main has been updated by amdmi3:

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

commit 2a8fed7897c79d491bbead041574488999483e53
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2022-03-15 21:05:01 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2022-03-16 12:57:31 +0000

    games/mirrormagic: update 2.0.2 → 3.0.0
---
 games/mirrormagic/Makefile                         | 59 ++++++++--------------
 games/mirrormagic/distinfo                         |  5 +-
 games/mirrormagic/files/patch-src-main.h           | 10 ----
 games/mirrormagic/files/patch-src_Makefile         | 31 ++++++++++++
 games/mirrormagic/files/patch-src_libgame_system.c | 10 ++++
 games/mirrormagic/files/patch-src_main.c           | 20 ++++++++
 6 files changed, 85 insertions(+), 50 deletions(-)

diff --git a/games/mirrormagic/Makefile b/games/mirrormagic/Makefile
index ede639c69356..12fbd4879930 100644
--- a/games/mirrormagic/Makefile
+++ b/games/mirrormagic/Makefile
@@ -1,22 +1,21 @@
-# Created by: Andrey Zakhvatov
-
 PORTNAME=	mirrormagic
-PORTVERSION=	2.0.2
-PORTREVISION=	21
+PORTVERSION=	3.0.0
 CATEGORIES=	games
-MASTER_SITES=	http://www.artsoft.org/RELEASES/unix/mirrormagic/ \
-		http://mirror.amdmi3.ru/distfiles/
+MASTER_SITES=	https://www.artsoft.org/RELEASES/unix/mirrormagic/
 
 MAINTAINER=	amdmi3@FreeBSD.org
 COMMENT=	Arcade style game with stereo sound for X Window System
 
 LICENSE=	GPLv2
+LICENSE_FILE=	${WRKSRC}/COPYING
 
-USES=		gmake
-MAKE_ARGS=	CC="${CC}" MAKE="${MAKE_CMD}" OPTIONS="${CFLAGS}" \
-		RO_GAME_DIR="${DATADIR}" RW_GAME_DIR="${DATADIR}/scores" \
-		X11_PATH="${LOCALBASE}"
-USE_GCC=	yes # doesn't start otherwise (UB?)
+USES=		gmake perl5 sdl
+USE_SDL=	sdl2 mixer2 image2 net2
+USE_PERL5=	build
+BUILD_WRKSRC=	${WRKSRC}/src
+MAKE_ARGS=	TARGET=sdl2 \
+		RO_GAME_DIR="${DATADIR}" \
+		RW_GAME_DIR="/var/games/${PORTNAME}"
 
 PORTDATA=	*
 PORTDOCS=	*
@@ -28,36 +27,20 @@ DESKTOP_ENTRIES="Mirror Magic" \
 		"Game;LogicGame;" \
 		""
 
-OPTIONS_DEFINE=	SDL DOCS
-OPTIONS_DEFAULT=SDL
-
-SDL_USES=		sdl
-SDL_USE=		SDL=image,mixer,sdl
-SDL_ALL_TARGET=		sdl
-SDL_USES_OFF=		xorg
-SDL_USE_OFF=		XORG=x11,xt
-SDL_ALL_TARGET_OFF=	x11
-
-post-patch:
-	@${REINPLACE_CMD} -e 's|sdl-config|$$(SDL_CONFIG)|g' \
-		${WRKSRC}/src/Makefile
-	@${REINPLACE_CMD} -e 's|machine/soundcard.h|sys/soundcard.h|' \
-		${WRKSRC}/src/libgame/sound.h
-	@${REINPLACE_CMD} -e 's|machine/joystick.h|sys/joystick.h|' \
-		${WRKSRC}/src/tools.c
-	@${REINPLACE_CMD} -e 's|inline||' ${WRKSRC}/src/libgame/*.[ch]
+OPTIONS_DEFINE=	DOCS
+
+post-extract:
+	@${RM} -r ${WRKSRC}/lib ${WRKSRC}/mirrormagic # linux binaries
 
 do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/mirrormagic ${STAGEDIR}${PREFIX}/bin
-	@${MKDIR} ${STAGEDIR}${DATADIR}
-	cd ${WRKSRC} && ${COPYTREE_SHARE} "graphics levels music scores sounds" \
+	${INSTALL_PROGRAM} ${WRKSRC}/rocksndiamonds \
+		${STAGEDIR}${PREFIX}/bin/mirrormagic
+	cd ${WRKSRC} && ${COPYTREE_SHARE} "conf docs graphics levels music sounds" \
 		${STAGEDIR}${DATADIR}
-	${RMDIR} ${STAGEDIR}${DATADIR}/scores
-	${LN} -s /var/games/${PORTNAME} ${STAGEDIR}${DATADIR}/scores
+	@${MKDIR} ${STAGEDIR}/var/games/${PORTNAME}
+
+do-install-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
-.for file in CHANGES CREDITS README
-	${INSTALL_DATA} ${WRKSRC}/${file} ${STAGEDIR}${DOCSDIR}
-.endfor
-	${MKDIR} ${STAGEDIR}/var/games/${PORTNAME}
+	${INSTALL_DATA} ${WRKSRC}/CREDITS ${STAGEDIR}${DOCSDIR}
 
 .include <bsd.port.mk>
diff --git a/games/mirrormagic/distinfo b/games/mirrormagic/distinfo
index a0a98d4d26c4..3e7b0c29c038 100644
--- a/games/mirrormagic/distinfo
+++ b/games/mirrormagic/distinfo
@@ -1,2 +1,3 @@
-SHA256 (mirrormagic-2.0.2.tar.gz) = 79b3f13d493523438eeb988beffc272c804bc7a4361b83167a082c77e74b3ce2
-SIZE (mirrormagic-2.0.2.tar.gz) = 1168098
+TIMESTAMP = 1647375691
+SHA256 (mirrormagic-3.0.0.tar.gz) = c79ad19d461c080011e12f5b9e6b1d3de4b8325e452ef4bb6e8a63a62ce9ffec
+SIZE (mirrormagic-3.0.0.tar.gz) = 4052452
diff --git a/games/mirrormagic/files/patch-src-main.h b/games/mirrormagic/files/patch-src-main.h
deleted file mode 100644
index a2fa3e69df56..000000000000
--- a/games/mirrormagic/files/patch-src-main.h
+++ /dev/null
@@ -1,10 +0,0 @@
---- src/main.h.orig	Sat Jun  7 20:04:37 2003
-+++ src/main.h	Thu Nov  1 02:12:04 2007
-@@ -459,7 +459,6 @@
- #endif
- extern struct HiScore		highscore[];
- extern struct TapeInfo		tape;
--extern struct JoystickInfo	joystick[];
- extern struct SetupInfo		setup;
- extern struct GameInfo		game;
- extern struct LaserInfo		laser;
diff --git a/games/mirrormagic/files/patch-src_Makefile b/games/mirrormagic/files/patch-src_Makefile
new file mode 100644
index 000000000000..1ec43eaa7df0
--- /dev/null
+++ b/games/mirrormagic/files/patch-src_Makefile
@@ -0,0 +1,31 @@
+--- src/Makefile.orig	2018-04-10 19:44:08 UTC
++++ src/Makefile
+@@ -101,7 +101,7 @@ endif
+ 
+ CONFIG = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR) $(JOYSTICK)
+ 
+-DEBUG = -DDEBUG -g
++DEBUG = 
+ 
+ # PROFILING = $(PROFILING_FLAGS)
+ 
+@@ -119,8 +119,8 @@ SYS_LDFLAGS := $(shell echo $(SYS_LDFLAGS) |	\
+ OPTIONS = -O3 -Wall
+ endif
+ 
+-CFLAGS = $(OPTIONS) $(SYS_CFLAGS)  $(EXTRA_CFLAGS) $(CONFIG)
+-LDFLAGS =           $(SYS_LDFLAGS) $(EXTRA_LDFLAGS) -lm
++CFLAGS += $(OPTIONS) $(SYS_CFLAGS)  $(EXTRA_CFLAGS) $(CONFIG)
++LDFLAGS +=           $(SYS_LDFLAGS) $(EXTRA_LDFLAGS) -lm
+ 
+ 
+ SRCS =	main.c		\
+@@ -221,7 +221,7 @@ GRAPHICS_DIR = ../graphics
+ all: $(AUTOCONF) libgame_dir game_em_dir game_sp_dir game_mm_dir $(PROGNAME) graphics_dir
+ 
+ $(PROGNAME): $(RNDLIBS) $(TIMESTAMP_FILE) $(OBJS) $(ICON)
+-	$(CC) $(PROFILING) $(OBJS) $(ICON) $(RNDLIBS) $(LDFLAGS) -o $(PROGNAME)
++	$(CC) $(PROFILING) $(RNDLIBS) $(OBJS) $(ICON) $(LDFLAGS) -o $(PROGNAME)
+ ifdef BUILD_DIST
+ 	strip $(PROGNAME)
+ endif
diff --git a/games/mirrormagic/files/patch-src_libgame_system.c b/games/mirrormagic/files/patch-src_libgame_system.c
new file mode 100644
index 000000000000..dffd7522d0f4
--- /dev/null
+++ b/games/mirrormagic/files/patch-src_libgame_system.c
@@ -0,0 +1,10 @@
+--- src/libgame/system.c.orig	2018-04-10 19:44:08 UTC
++++ src/libgame/system.c
+@@ -1579,6 +1579,7 @@ void SetAudioMode(boolean enabled)
+ 
+ boolean PendingEvent(void)
+ {
++  SDL_PumpEvents();
+   return (SDL_PollEvent(NULL) ? TRUE : FALSE);
+ }
+ 
diff --git a/games/mirrormagic/files/patch-src_main.c b/games/mirrormagic/files/patch-src_main.c
new file mode 100644
index 000000000000..d76e7a8686c5
--- /dev/null
+++ b/games/mirrormagic/files/patch-src_main.c
@@ -0,0 +1,20 @@
+--- src/main.c.orig	2018-04-10 19:44:08 UTC
++++ src/main.c
+@@ -69,7 +69,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];
+@@ -138,7 +138,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;