git: 9024df6abe7c - main - games/opentyrian: update 2.1.20130907 → 2.1.20220309

From: Dmitry Marakasov <amdmi3_at_FreeBSD.org>
Date: Thu, 10 Mar 2022 11:57:47 UTC
The branch main has been updated by amdmi3:

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

commit 9024df6abe7c4fa2ad1f6a2dccd6de3f1da11f6d
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2022-03-10 11:15:41 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2022-03-10 11:40:46 +0000

    games/opentyrian: update 2.1.20130907 → 2.1.20220309
    
    - Switch to GitHub, SDL2, use upstream installation
---
 games/opentyrian/Makefile                     | 40 +++++++------------------
 games/opentyrian/distinfo                     |  6 ++--
 games/opentyrian/files/patch-Makefile         | 31 -------------------
 games/opentyrian/files/patch-src_arg__parse.c | 30 +++++++++++++++++++
 games/opentyrian/files/patch-src_opl.c        | 32 --------------------
 games/opentyrian/files/patch-src_opl.h        | 43 ---------------------------
 games/opentyrian/pkg-descr                    |  2 +-
 games/opentyrian/pkg-plist                    |  2 +-
 8 files changed, 45 insertions(+), 141 deletions(-)

diff --git a/games/opentyrian/Makefile b/games/opentyrian/Makefile
index e893c0f4c127..65fb23acd145 100644
--- a/games/opentyrian/Makefile
+++ b/games/opentyrian/Makefile
@@ -1,11 +1,7 @@
 PORTNAME=	opentyrian
-PORTVERSION=	2.1.20130907
-PORTREVISION=	2
+DISTVERSIONPREFIX=	v
+DISTVERSION=	2.1.20220309
 CATEGORIES=	games
-MASTER_SITES=	https://bitbucket.org/opentyrian/opentyrian/get/ \
-		http://mirror.amdmi3.ru/distfiles/${DIST_SUBDIR}/
-DISTNAME=	${PORTVERSION}
-DIST_SUBDIR=	opentyrian
 
 MAINTAINER=	amdmi3@FreeBSD.org
 COMMENT=	Arcade-style vertical scrolling shooter
@@ -13,41 +9,25 @@ COMMENT=	Arcade-style vertical scrolling shooter
 LICENSE=	GPLv2+
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-USES=		gmake sdl tar:bzip2
-USE_SDL=	sdl
+USES=		gmake pkgconfig sdl
+USE_GITHUB=	yes
+USE_SDL=	sdl2 net2
 
-MAKE_ENV=	ALL_CFLAGS="${CFLAGS}"
+MAKE_ENV=	VCS_IDREV="${DISTVERSION}" \
+		gamesdir="${PREFIX}/share"
 
 DATADIR=	${PREFIX}/share/tyrian
 PORTSCOUT=	skipv:11402-phase-0.8
 SUB_FILES=	pkg-message
 
-WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTNAME}-77a8715634e3
+PORTDOCS=	*
 
-PORTDOCS=	CREDITS NEWS README
+OPTIONS_DEFINE=	DOCS
 
-OPTIONS_DEFINE=	NETWORK DOCS
-
-NETWORK_DESC=	Enable network support
-NETWORK_USE=		SDL=net
-NETWORK_MAKE_ARGS=	WITH_NETWORK=true
-NETWORK_MAKE_ARGS_OFF=	WITH_NETWORK=false
-
-post-patch:
-	@${REINPLACE_CMD} -e '/custom_data_dir/ s|"."|"${DATADIR}"|' ${WRKSRC}/src/file.c
-
-do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/
+post-install:
 	${INSTALL_DATA} ${WRKSRC}/linux/${PORTNAME}.desktop ${STAGEDIR}${PREFIX}/share/applications/
 	${INSTALL_DATA} ${WRKSRC}/linux/icons/tyrian-32.png ${STAGEDIR}${PREFIX}/share/pixmaps/${PORTNAME}.png
-	${INSTALL_MAN} ${WRKSRC}/linux/man/${PORTNAME}.6 ${STAGEDIR}${MAN6PREFIX}/man/man6/
 	@${MKDIR} ${STAGEDIR}${DATADIR}
 	${TOUCH} ${STAGEDIR}${DATADIR}/.keepme
 
-do-install-DOCS-on:
-	@${MKDIR} ${STAGEDIR}${DOCSDIR}
-.for f in ${PORTDOCS}
-	${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}/
-.endfor
-
 .include <bsd.port.mk>
diff --git a/games/opentyrian/distinfo b/games/opentyrian/distinfo
index 9e753c4a4780..e83443ef1392 100644
--- a/games/opentyrian/distinfo
+++ b/games/opentyrian/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1474071784
-SHA256 (opentyrian/2.1.20130907.tar.bz2) = b46b2ad5645f156393a6a79266e40e409a68fd6be2d324960c268e88ee3d1c64
-SIZE (opentyrian/2.1.20130907.tar.bz2) = 249267
+TIMESTAMP = 1646909236
+SHA256 (opentyrian-opentyrian-v2.1.20220309_GH0.tar.gz) = 6df44ca9b36acf9ba67099621b2fb1baa5f7b4ad2ec924ed943b87ff9061dbd2
+SIZE (opentyrian-opentyrian-v2.1.20220309_GH0.tar.gz) = 298329
diff --git a/games/opentyrian/files/patch-Makefile b/games/opentyrian/files/patch-Makefile
deleted file mode 100644
index 48b7adbbc238..000000000000
--- a/games/opentyrian/files/patch-Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
---- Makefile.orig	2013-09-07 23:56:16 UTC
-+++ Makefile
-@@ -8,8 +8,6 @@ endif
- 
- TARGET := opentyrian
- 
--WITH_NETWORK := true
--
- ############################################################
- 
- STRIP := strip
-@@ -21,19 +19,9 @@ OBJS := $(SRCS:src/%.c=obj/%.o)
- 
- # FLAGS ####################################################
- 
--ifneq ($(MAKECMDGOALS), release)
--    EXTRA_CFLAGS += -g3 -O0 -Werror
--else
--    EXTRA_CFLAGS += -g0 -O2 -DNDEBUG
--endif
- EXTRA_CFLAGS += -MMD -pedantic -Wall -Wextra -Wno-missing-field-initializers
- ifeq ($(WITH_NETWORK), true)
-     EXTRA_CFLAGS += -DWITH_NETWORK
--endif
--
--HG_REV := $(shell hg id -ib && touch src/hg_revision.h)
--ifneq ($(HG_REV), )
--    EXTRA_CFLAGS += '-DHG_REV="$(HG_REV)"'
- endif
- 
- EXTRA_LDLIBS += -lm
diff --git a/games/opentyrian/files/patch-src_arg__parse.c b/games/opentyrian/files/patch-src_arg__parse.c
new file mode 100644
index 000000000000..9496fe636066
--- /dev/null
+++ b/games/opentyrian/files/patch-src_arg__parse.c
@@ -0,0 +1,30 @@
+--- src/arg_parse.c.orig	2022-03-10 02:50:47 UTC
++++ src/arg_parse.c
+@@ -27,6 +27,7 @@ static void permute( const char *argv[], int *first_no
+ static int parse_short_opt( int argc, const char *const argv[], const Options *options, Option *option );
+ static int parse_long_opt( int argc, const char *const argv[], const Options *options, Option *option );
+ 
++#ifndef __FreeBSD__
+ /*!
+  * \brief Locate a character in a a string.
+  * 
+@@ -36,6 +37,7 @@ static int parse_long_opt( int argc, const char *const
+  *         otherwise the pointer to the terminating NUL character of \p s
+  */
+ static char *strchrnul( const char *s, int c );
++#endif
+ 
+ Option parse_args( int argc, const char *argv[], const Options *options )
+ {
+@@ -251,9 +253,11 @@ static int parse_long_opt( int argc, const char *const
+ 	return argn;  // which arg in argv that parse_args() should examine when called again
+ }
+ 
++#ifndef __FreeBSD__
+ static char *strchrnul( const char *s, int c )
+ {
+ 	for (; *s != c && *s != '\0'; ++s)
+ 		;
+ 	return (char *)s;
+ }
++#endif
diff --git a/games/opentyrian/files/patch-src_opl.c b/games/opentyrian/files/patch-src_opl.c
deleted file mode 100644
index 0201a19e7234..000000000000
--- a/games/opentyrian/files/patch-src_opl.c
+++ /dev/null
@@ -1,32 +0,0 @@
---- src/opl.c.orig	2013-09-07 23:56:16 UTC
-+++ src/opl.c
-@@ -145,6 +145,29 @@ static fltype decrelconst[4] = {
- 	(fltype)(1/22.44608)
- };
- 
-+// per-chip variables
-+Bitu chip_num;
-+op_type op[MAXOPERATORS];
-+
-+Bits int_samplerate;
-+	
-+Bit8u status;
-+Bit32u opl_index;
-+#if defined(OPLTYPE_IS_OPL3)
-+Bit8u adlibreg[512];	// adlib register set (including second set)
-+Bit8u wave_sel[44];		// waveform selection
-+#else
-+Bit8u adlibreg[256];	// adlib register set
-+Bit8u wave_sel[22];		// waveform selection
-+#endif
-+
-+
-+// vibrato/tremolo increment/counter
-+Bit32u vibtab_pos;
-+Bit32u vibtab_add;
-+Bit32u tremtab_pos;
-+Bit32u tremtab_add;
-+
- 
- void operator_advance(op_type* op_pt, Bit32s vib) {
- 	op_pt->wfpos = op_pt->tcount;						// waveform position
diff --git a/games/opentyrian/files/patch-src_opl.h b/games/opentyrian/files/patch-src_opl.h
deleted file mode 100644
index 966c6075a2af..000000000000
--- a/games/opentyrian/files/patch-src_opl.h
+++ /dev/null
@@ -1,43 +0,0 @@
---- src/opl.h.orig	2013-09-07 23:56:16 UTC
-+++ src/opl.h
-@@ -149,27 +149,27 @@ typedef struct operator_struct {
- } op_type;
- 
- // per-chip variables
--Bitu chip_num;
--op_type op[MAXOPERATORS];
-+extern Bitu chip_num;
-+extern op_type op[MAXOPERATORS];
- 
--Bits int_samplerate;
-+extern Bits int_samplerate;
- 	
--Bit8u status;
--Bit32u opl_index;
-+extern Bit8u status;
-+extern Bit32u opl_index;
- #if defined(OPLTYPE_IS_OPL3)
--Bit8u adlibreg[512];	// adlib register set (including second set)
--Bit8u wave_sel[44];		// waveform selection
-+extern Bit8u adlibreg[512];	// adlib register set (including second set)
-+extern Bit8u wave_sel[44];		// waveform selection
- #else
--Bit8u adlibreg[256];	// adlib register set
--Bit8u wave_sel[22];		// waveform selection
-+extern Bit8u adlibreg[256];	// adlib register set
-+extern Bit8u wave_sel[22];		// waveform selection
- #endif
- 
- 
- // vibrato/tremolo increment/counter
--Bit32u vibtab_pos;
--Bit32u vibtab_add;
--Bit32u tremtab_pos;
--Bit32u tremtab_add;
-+extern Bit32u vibtab_pos;
-+extern Bit32u vibtab_add;
-+extern Bit32u tremtab_pos;
-+extern Bit32u tremtab_add;
- 
- 
- // enable an operator
diff --git a/games/opentyrian/pkg-descr b/games/opentyrian/pkg-descr
index 0886065361e2..6dabc1f258c5 100644
--- a/games/opentyrian/pkg-descr
+++ b/games/opentyrian/pkg-descr
@@ -7,4 +7,4 @@ Tyrian is an arcade-style vertical scrolling shooter. The story is
 set in 20,031 where you play as Trent Hawkins, a skilled fighter-pilot
 employed to fight Microsol and save the galaxy.
 
-WWW: https://bitbucket.org/opentyrian/opentyrian/wiki/Home
+WWW: https://github.com/opentyrian/opentyrian
diff --git a/games/opentyrian/pkg-plist b/games/opentyrian/pkg-plist
index a895391d6c28..3df2ab02ea50 100644
--- a/games/opentyrian/pkg-plist
+++ b/games/opentyrian/pkg-plist
@@ -1,5 +1,5 @@
 bin/opentyrian
-man/man6/opentyrian.6.gz
 share/applications/opentyrian.desktop
+share/man/man6/opentyrian.6.gz
 share/pixmaps/opentyrian.png
 %%DATADIR%%/.keepme