1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-26 09:46:09 +00:00

games/seabattle: update to 1.1 and unbreak on FreeBSD 13+

After having sent a number of FreeBSD patches to the author, he
updated the project and incorporated them.  So this is mainly a
patch release.

Port changes:
- remove patches incorporated by upstream
- unbreak build on FreeBSD 13+
- set LICENSE to MIT
- depend on audio/alsa-utils if audio output is desired
- take up maintainership of this unmaintained port

PR:		260633
Reported by:	Robert Clausecker <fuz@fuz.su> (new maintainer)
This commit is contained in:
Robert Clausecker 2021-12-25 11:34:39 +09:00 committed by Hiroki Tagato
parent ef43d9d12d
commit a7bca39bce
8 changed files with 18 additions and 146 deletions

View File

@ -1,27 +1,29 @@
# Created by: Andrey Zakhvatov
PORTNAME= seabattle
PORTVERSION= 1.0
PORTREVISION= 2
DISTVERSIONPREFIX= v
DISTVERSION= 1.1
CATEGORIES= games
MASTER_SITES= SUNSITE/games/strategy/ \
http://www.deater.net/weave/vmwprod/
MAINTAINER= ports@FreeBSD.org
MAINTAINER= fuz@fuz.su
COMMENT= Curses based battleship type game
BROKEN_FreeBSD_13= ld: error: duplicate symbol: current_player
BROKEN_FreeBSD_14= ld: error: duplicate symbol: current_player
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= ncurses
USES= gmake ncurses
USE_GITHUB= yes
GH_ACCOUNT= deater
OPTIONS_DEFINE= DOCS
OPTIONS_DEFINE= DOCS ALSA
OPTIONS_DEFAULT= ALSA
ALSA_RUN_DEPENDS= aplay:audio/alsa-utils
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/seabattle ${STAGEDIR}${PREFIX}/bin
@${MKDIR} ${STAGEDIR}${PREFIX}/share/seabattle
${INSTALL_DATA} ${WRKSRC}/*.au ${STAGEDIR}${DATADIR}
${INSTALL_DATA} ${WRKSRC}/share/seabattle/*.au ${STAGEDIR}${DATADIR}
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/readme.txt ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/readme.historical ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>

View File

@ -1,2 +1,3 @@
SHA256 (seabattle-1.0.tar.gz) = 080bb5706e67f9f1834016edc8ae30224e28417ea60ae86120f858cca0a3101e
SIZE (seabattle-1.0.tar.gz) = 39093
TIMESTAMP = 1640337906
SHA256 (deater-seabattle-v1.1_GH0.tar.gz) = 1f65ab9589e0df8552a19ad66f8239c66f1422ea7d6ef53bc9609b72cb8f0c44
SIZE (deater-seabattle-v1.1_GH0.tar.gz) = 42683

View File

@ -1,29 +0,0 @@
--- Makefile.orig 1997-05-13 17:53:34 UTC
+++ Makefile
@@ -8,7 +8,7 @@
##############################################################
#Your compiler. If gcc doesn't work, try CC
-CC = gcc
+#CC = gcc
#CC = cc
#On Suns, SGIs, and other Unix systems uncomment the following
@@ -17,12 +17,12 @@ CC = gcc
#C_OPTS =
#L_OPTS = -lcurses
-#On Linux, uncomment the following
+#On FreeBSD/Linux, uncomment the following
#
-PLATFORM = Linux
-C_OPTS = -O2 -Wall
-L_OPTS = -lncurses
-
+PLATFORM = FreeBSD/Linux
+DATADIR = ${PREFIX}/share/seabattle
+C_OPTS = ${CFLAGS} -DDATADIR=\"${DATADIR}\"
+L_OPTS = $(LDFLAGS) -lncurses
#For Dos/Windows DJGPP (you need the curses lib)
#PLATFORM = DOS_DJGPP

View File

@ -1,11 +0,0 @@
--- ./batt.c.orig 1997-05-13 15:45:51.000000000 +0000
+++ ./batt.c 2013-05-28 08:46:50.000000000 +0000
@@ -13,7 +13,7 @@
int salvo_play=0; /* paramaters uncluttered*/
int first_time=0;
-int main(int argc, char *argv)
+int main(int argc, char **argv)
{
MAIN_THINGY *main_thing;

View File

@ -1,20 +0,0 @@
--- batt.h.orig 1997-05-13 19:58:17 UTC
+++ batt.h
@@ -2,7 +2,7 @@
* batt.h Part of the SEABATTLE game by Vince Weaver *
************************************************************************/
-#include <curses.h> /* Slang support is good for rxvt in linux */
+#include <ncurses.h> /* Slang support is good for rxvt in linux */
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
@@ -54,7 +54,7 @@ DATA *current_player;
/* binp.c */
void init_curses(void); /* All the function declarations */
-void exit_curses(void);
+void exit_curses_(void);
void set_color(int color,int bold);
void printxy(int x,int y,char *tempst);
void draw_opening(void);

View File

@ -1,31 +0,0 @@
--- bdb.c.orig Wed May 14 04:49:59 1997
+++ bdb.c Fri Feb 2 04:22:00 2001
@@ -325,8 +325,8 @@
char names[10][100],text[100];
int ch,scores[10],i;
/* If not there, create one */
- if( (fff=fopen("hiscore.sea","r+"))==NULL ){
- if ( (fff=fopen("hiscore.sea","a+"))!=NULL) {
+ if( (fff=fopen(DATADIR "/hiscore.sea","r+"))==NULL ){
+ if ( (fff=fopen(DATADIR "/hiscore.sea","a+"))!=NULL) {
fprintf(fff,"Vince\n50\nMarie\n55\nJohn\n56\n");
fprintf(fff,"Gus\n57\nLizann\n58\nKevin\n59\n");
fprintf(fff,"Hal\n60\nHairold\n61\nChipper\n62\nBob\n63\n");
@@ -335,7 +335,7 @@
}
else fclose(fff);
- if ( (fff=fopen("hiscore.sea","r"))!=NULL) {
+ if ( (fff=fopen(DATADIR "/hiscore.sea","r"))!=NULL) {
for(i=0;i<10;i++)
fscanf(fff,"%s%i",names[i],&scores[i]);
fclose(fff);
@@ -355,7 +355,7 @@
set_color(C_WHITE,C_BOLD);
sprintf(text,"%s got a new High Score, #%i",name,i+1);
printxy(20,1,text);
- if ( (fff=fopen("hiscore.sea","w+"))!=NULL) {
+ if ( (fff=fopen(DATADIR "/hiscore.sea","w+"))!=NULL) {
for(i=0;i<10;i++) fprintf(fff,"%s\n%i",names[i],scores[i]);
fclose(fff);
}

View File

@ -1,41 +0,0 @@
--- binp.c.orig 1997-05-13 17:51:00 UTC
+++ binp.c
@@ -42,7 +42,7 @@ void printxy(int x,int y,char *tempst) /* Simple f
}
-void exit_curses(void) /* Shutdown curses nicely so the */
+void exit_curses_(void) /* Shutdown curses nicely so the */
{ /* terminal works properly */
clear();
refresh();
@@ -129,15 +129,15 @@ void do_sound(int which_one) /* Plays ap
/* Incomplete as of yet */
if (which_one==1)
if (sound_device)
- if(rand()%2) system("cat hit1.au > /dev/audio ");
- else system("cat hit2.au > /dev/audio ");
+ if(rand()%2) system("cat " DATADIR "/hit1.au > /dev/audio ");
+ else system("cat " DATADIR "/hit2.au > /dev/audio ");
else beep();
if (which_one==2)
if (sound_device)
- if(rand()%2) system("cat miss1.au > /dev/audio ");
- else system("cat miss2.au > /dev/audio ");
+ if(rand()%2) system("cat " DATADIR "/miss1.au > /dev/audio ");
+ else system("cat " DATADIR "/miss2.au > /dev/audio ");
if (which_one==3)
- if (sound_device) system("cat sunkit.au > /dev/audio ");
+ if (sound_device) system("cat " DATADIR "/sunkit.au > /dev/audio ");
else beep();
}
@@ -330,7 +330,7 @@ void quit(void) /* Create a
wclear(quit_window);
wrefresh(quit_window);
delwin(quit_window);
- if ((ch=='Y') || (ch=='y')) {exit_curses(); exit(0); }
+ if ((ch=='Y') || (ch=='y')) {exit_curses_(); exit(0); }
#ifndef BROKEN_CURSES
redrawwin(stdscr);
#endif

View File

@ -1,5 +1,6 @@
bin/seabattle
%%PORTDOCS%%%%DOCSDIR%%/readme.txt
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/readme.historical
%%DATADIR%%/hit1.au
%%DATADIR%%/hit2.au
%%DATADIR%%/miss1.au