From 2c6a0d0cf11cf5ac99f0397357d3b6612bacd6e7 Mon Sep 17 00:00:00 2001 From: Robert Clausecker Date: Sun, 5 Dec 2021 11:56:09 +0100 Subject: [PATCH] games/freesweep: patch and unbreak with -fno-common While we are at it: - make portlint happy - move scores file to hier(7) directory - fix plist issues and move plist to a plist file - remove --disable-debug-log which had the opposite effect --- games/freesweep/Makefile | 17 ++++++----------- games/freesweep/files/patch-config.h.in | 4 ++-- games/freesweep/files/patch-game.c | 11 +++++++++++ games/freesweep/files/patch-sweep.h.in | 11 +++++++++++ games/freesweep/pkg-plist | 4 ++++ 5 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 games/freesweep/files/patch-game.c create mode 100644 games/freesweep/files/patch-sweep.h.in create mode 100644 games/freesweep/pkg-plist diff --git a/games/freesweep/Makefile b/games/freesweep/Makefile index d54da11fafb1..4977676943cb 100644 --- a/games/freesweep/Makefile +++ b/games/freesweep/Makefile @@ -3,6 +3,7 @@ PORTNAME= freesweep PORTVERSION= 1.0.1 DISTVERSIONPREFIX= v +PORTREVISION= 1 CATEGORIES= games MAINTAINER= rwestlun@gmail.com @@ -11,30 +12,24 @@ COMMENT= Minesweeper-style game for text-mode terminals LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING -BROKEN_FreeBSD_13= ld: error: duplicate symbol: CharSet -BROKEN_FreeBSD_14= ld: error: duplicate symbol: CharSet - +USES= gmake ncurses USE_GITHUB= yes GH_ACCOUNT= rwestlund -USES= gmake ncurses GNU_CONFIGURE= yes CONFIGURE_ARGS= --with-prefsdir=${DATADIR} \ - --with-scoresdir=${DATADIR} \ - --disable-debug-log + --with-scoresdir=/var/games + ALL_TARGET= ${PORTNAME} PORTDOCS= README.md -PLIST_FILES= "@(,games,2555) bin/${PORTNAME}" man/man6/${PORTNAME}.6.gz \ - %%DATADIR%%/sweeprc "@(,games,0664) %%DATADIR%%/sweeptimes" -PLIST_DIRS= %%DATADIR%% OPTIONS_DEFINE= DOCS do-install: ${INSTALL_PROGRAM} ${WRKSRC}/freesweep ${STAGEDIR}${PREFIX}/bin - @${MKDIR} ${STAGEDIR}${DATADIR} - ${TOUCH} ${STAGEDIR}${DATADIR}/sweeptimes + ${MKDIR} ${STAGEDIR}${DATADIR} ${STAGEDIR}/var/games + ${TOUCH} ${STAGEDIR}/var/games/sweeptimes.sample ${INSTALL_DATA} ${WRKSRC}/sweeprc ${STAGEDIR}${DATADIR} ${INSTALL_MAN} ${WRKSRC}/freesweep.6 ${STAGEDIR}${PREFIX}/man/man6 diff --git a/games/freesweep/files/patch-config.h.in b/games/freesweep/files/patch-config.h.in index d58b997c8884..01211ff0ef6c 100644 --- a/games/freesweep/files/patch-config.h.in +++ b/games/freesweep/files/patch-config.h.in @@ -1,5 +1,5 @@ ---- config.h.in.orig Wed Nov 12 04:24:48 2003 -+++ config.h.in Wed Nov 12 04:25:07 2003 +--- config.h.in.orig 2016-02-14 22:00:30 UTC ++++ config.h.in @@ -25,7 +25,7 @@ #undef SCORESDIR diff --git a/games/freesweep/files/patch-game.c b/games/freesweep/files/patch-game.c new file mode 100644 index 000000000000..018c5920bc9e --- /dev/null +++ b/games/freesweep/files/patch-game.c @@ -0,0 +1,11 @@ +--- game.c.orig 2021-12-05 10:38:06 UTC ++++ game.c +@@ -10,6 +10,8 @@ + + #include "sweep.h" + ++DrawChars CharSet; ++ + /* The various Check* functions. Each returns 1 if a valid input, else -1 */ + + int CheckHeight(int NewVal) diff --git a/games/freesweep/files/patch-sweep.h.in b/games/freesweep/files/patch-sweep.h.in new file mode 100644 index 000000000000..a8f65e312128 --- /dev/null +++ b/games/freesweep/files/patch-sweep.h.in @@ -0,0 +1,11 @@ +--- sweep.h.in.orig 2021-12-05 10:36:56 UTC ++++ sweep.h.in +@@ -246,7 +246,7 @@ struct FileBuf + FILE* DebugLog; + #endif /* DEBUG_LOG */ + +-DrawChars CharSet; ++extern DrawChars CharSet; + + /* These are the functions defined in files.c */ + int SourceHomeFile(GameStats* Game); diff --git a/games/freesweep/pkg-plist b/games/freesweep/pkg-plist new file mode 100644 index 000000000000..b64441aebfae --- /dev/null +++ b/games/freesweep/pkg-plist @@ -0,0 +1,4 @@ +@(,games,2555) bin/freesweep +man/man6/freesweep.6.gz +%%DATADIR%%/sweeprc +@sample(,games,0664) /var/games/sweeptimes.sample -- 2.32.0