games/apricots: update 0.2.6 → 0.2.7

This commit is contained in:
Dmitry Marakasov 2022-03-16 00:13:36 +03:00
parent 2a8fed7897
commit 663461e41e
10 changed files with 73 additions and 129 deletions

View File

@ -1,53 +1,41 @@
PORTNAME= apricots
PORTVERSION= 0.2.6
PORTREVISION= 6
DISTVERSIONPREFIX= v
DISTVERSION= 0.2.7
CATEGORIES= games
MASTER_SITES= http://www.fishies.org.uk/ \
http://mirror.amdmi3.ru/distfiles/
MAINTAINER= amdmi3@FreeBSD.org
COMMENT= Fly a little plane around and shoot things and drop bombs
USES= dos2unix sdl
USE_SDL= sdl
USE_CXXSTD= c++98
DOS2UNIX_GLOB= *.cpp
SUB_FILES= ${PORTNAME}
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
USES= autoreconf compiler:c++17-lang gmake openal:al,alut sdl
USE_GITHUB= yes
GH_ACCOUNT= moggers87
GNU_CONFIGURE= yes
USE_SDL= sdl2
PLIST_FILES= bin/${PORTNAME} libexec/${PORTNAME}
PORTDATA= *
PORTDOCS= *
CPPFLAGS+= -DAP_PATH="\"${DATADIR}/\""
LDFLAGS_i386= -Wl,-znotext
DESKTOP_ENTRIES="Apricots" \
"${COMMENT}" \
"" \
"${PORTNAME}" \
"Game;ArcadeGame;" \
false
PORTDATA= *
PORTDOCS= *
OPTIONS_DEFINE= DOCS OPENAL
OPTIONS_DEFAULT=OPENAL
OPTIONS_DEFINE= DOCS
OPENAL_USES= compiler:c++11-lang openal:al,alut
OPENAL_CPPFLAGS=-DAP_AUDIO_OPENAL
OPENAL_LDFLAGS= -L${LOCALBASE}/lib -lopenal -lalut
post-patch:
@${REINPLACE_CMD} -e 's|$$(pkgdatadir)|$${DESTDIR}&|' \
${WRKSRC}/apricots/Makefile.am
do-build:
cd ${WRKSRC}/apricots && ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} \
`${SDL_CONFIG} --cflags --libs` *.cpp -o ${PORTNAME}
do-install:
${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/apricots/${PORTNAME} ${STAGEDIR}${PREFIX}/libexec
@${MKDIR} ${STAGEDIR}${DATADIR}
.for ext in wav shapes psf cfg
${INSTALL_DATA} ${WRKSRC}/apricots/*.${ext} ${STAGEDIR}${DATADIR}
.endfor
post-install:
${INSTALL_DATA} ${WRKSRC}/contrib/apricots.desktop \
${STAGEDIR}${PREFIX}/share/applications/
${INSTALL_DATA} ${WRKSRC}/contrib/desktop-icon.png \
${STAGEDIR}${PREFIX}/share/pixmaps/apricots.png
do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}
.for f in AUTHORS NEWS README.md
${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}/
.endfor
.include <bsd.port.mk>

View File

@ -1,2 +1,3 @@
SHA256 (apricots-0.2.6.tar.gz) = 9c408722abbb0cb925384f12a65fe4f6e2b3373d5ce5d0e5afe3aeb738b9cd8f
SIZE (apricots-0.2.6.tar.gz) = 768568
TIMESTAMP = 1647376396
SHA256 (moggers87-apricots-v0.2.7_GH0.tar.gz) = 82b993f5f0a3ed0f3b0e07a11bc955cd175b3738eb66769c01d0e1faacb5a44c
SIZE (moggers87-apricots-v0.2.7_GH0.tar.gz) = 330430

View File

@ -1,16 +0,0 @@
#!/bin/sh
if [ -z "$XDG_CONFIG_HOME" ]; then
XDG_CONFIG_HOME=$HOME/.config
fi
DOTDIR="$XDG_CONFIG_HOME/apricots"
mkdir -p "$DOTDIR"
cd "$DOTDIR" || exit 1
if [ ! -f apricots.cfg ]; then
cp %%DATADIR%%/apricots.cfg .
fi
exec %%PREFIX%%/libexec/apricots "$@"

View File

@ -1,29 +0,0 @@
--- apricots/init.cpp.orig 2015-08-19 14:00:09 UTC
+++ apricots/init.cpp
@@ -218,7 +218,7 @@ void init_gameconstants(gamedata &g){
string getConfig(string config, string name, string defval)
{
// Pull out just the name line
- unsigned int ndx = config.find(name);
+ size_t ndx = config.find(name);
if (ndx == string::npos)
{
@@ -241,7 +241,7 @@ string getConfig(string config, string n
int getConfig(string config, string name, int defval, int min, int max)
{
// Pull out just the name line
- unsigned int ndx = config.find(name);
+ size_t ndx = config.find(name);
if (ndx == string::npos)
{
@@ -275,7 +275,7 @@ int getConfig(string config, string name
void init_gamedata(gamedata &g){
//--JAM: Read from config file
- string filename(AP_PATH);
+ string filename;
filename += "apricots.cfg";
ifstream config_stream(filename.c_str());
string config;

View File

@ -1,45 +0,0 @@
--- apricots/sampleio.cpp.orig 2015-08-19 14:00:09 UTC
+++ apricots/sampleio.cpp
@@ -74,28 +74,21 @@ void sampleio :: init(int nsamples, char
alListenerfv(AL_ORIENTATION, front );
// Load in samples
- ALvoid* data = malloc(5 * (512 * 3) * 1024);
+ ALvoid* data;
alGenBuffers(numsamples, samples);
for (int i = 0; i < numsamples; i++){
- ALsizei freq;
+ ALfloat freq;
ALboolean fileok;
// Evil OpenAL portability fix done here
-#ifdef _WIN32
ALenum format;
- ALboolean trash;
- alutLoadWAVFile(filenames[i],&format,&data,&filelen,&freq,&trash);
- fileok = (alGetError() == AL_NO_ERROR);
-#else
- ALsizei format;
- ALsizei trash;
- fileok = alutLoadWAV(filenames[i],&data,&format,&filelen,&trash,&freq);
-#endif
- if (!fileok){
+ data = alutLoadMemoryFromFile(filenames[i], &format, &filelen, &freq);
+ if (!data){
cerr << "sampleio: could not open " << filenames[i] << endl;
exit(1);
}
alBufferData(samples[i], format, data, filelen, freq);
+ free(data);
}
// Generate Sources
@@ -107,8 +100,6 @@ void sampleio :: init(int nsamples, char
alSourcefv(sources[j], AL_ORIENTATION, back );
}
- free(data);
-
}
// Clearup routine

View File

@ -0,0 +1,11 @@
--- apricots/all.cpp.orig 2021-02-12 23:45:58 UTC
+++ apricots/all.cpp
@@ -18,7 +18,7 @@ int wrap(int n, int min, int max) { return ((((n - min
// Sign function
-inline int sign(int n) { return (0 < n) - (n < 0); }
+int sign(int n) { return (0 < n) - (n < 0); }
// Error message for switch statements that shouldn't ever get to default

View File

@ -0,0 +1,20 @@
--- apricots/init.cpp.orig 2021-02-12 23:45:58 UTC
+++ apricots/init.cpp
@@ -219,7 +219,7 @@ void init_gameconstants(gamedata &g) {
string getConfig(string config, string name, string defval) {
// Pull out just the name line
- unsigned int ndx = config.find(name);
+ size_t ndx = config.find(name);
if (ndx == string::npos) {
return defval;
@@ -240,7 +240,7 @@ string getConfig(string config, string name, string de
int getConfig(string config, string name, int defval, int min, int max) {
// Pull out just the name line
- unsigned int ndx = config.find(name);
+ size_t ndx = config.find(name);
if (ndx == string::npos) {
return defval;

View File

@ -0,0 +1,11 @@
--- configure.ac.orig 2021-02-12 23:45:58 UTC
+++ configure.ac
@@ -6,7 +6,7 @@ AC_INIT([apricots], [0.2.7], [moggers87+git@moggers87.
AC_CONFIG_SRCDIR([apricots/game.cpp])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE([-Wall -Werror subdir-objects])
+AM_INIT_AUTOMAKE([-Wall subdir-objects])
AX_IS_RELEASE([git-directory])
AX_CHECK_ENABLE_DEBUG()
AX_GENERATE_CHANGELOG

View File

@ -17,4 +17,4 @@ Please take a look at apricots.cfg file. You will found some good
options there. (currently this is the only way of changing game
options)
WWW: http://www.fishies.org.uk/apricots.html
WWW: https://github.com/moggers87/apricots

3
games/apricots/pkg-plist Normal file
View File

@ -0,0 +1,3 @@
bin/apricots
share/applications/apricots.desktop
share/pixmaps/apricots.png