Index: head/games/apricots/Makefile =================================================================== --- head/games/apricots/Makefile (revision 394782) +++ head/games/apricots/Makefile (revision 394783) @@ -1,56 +1,52 @@ # Created by: Dmitry Marakasov # $FreeBSD$ PORTNAME= apricots PORTVERSION= 0.2.6 PORTREVISION= 6 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 USE_SDL= sdl USES= dos2unix DOS2UNIX_GLOB= *.cpp SUB_FILES= ${PORTNAME} PLIST_FILES= bin/${PORTNAME} libexec/${PORTNAME} PORTDATA= * PORTDOCS= * CPPFLAGS+= -DAP_PATH="\"${DATADIR}/\"" DESKTOP_ENTRIES="Apricots" \ "${COMMENT}" \ "" \ "${PORTNAME}" \ "Game;ArcadeGame;" \ false OPTIONS_DEFINE= DOCS OPENAL OPTIONS_DEFAULT=OPENAL -.include - -.if ${PORT_OPTIONS:MOPENAL} -USES+= openal:al,alut -CPPFLAGS+= -DAP_AUDIO_OPENAL -LDFLAGS+= -L${LOCALBASE}/lib -lopenal -lalut -.endif +OPENAL_USES= openal:al,alut +OPENAL_CPPFLAGS=-DAP_AUDIO_OPENAL +OPENAL_LDFLAGS= -L${LOCALBASE}/lib -lopenal -lalut 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 ${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR} .include Index: head/games/apricots/files/patch-apricots-init.cpp =================================================================== --- head/games/apricots/files/patch-apricots-init.cpp (revision 394782) +++ head/games/apricots/files/patch-apricots-init.cpp (revision 394783) @@ -1,11 +1,29 @@ ---- apricots/init.cpp.orig 2013-10-18 03:20:08.162773332 +0400 -+++ apricots/init.cpp 2013-10-18 03:21:49.134378818 +0400 -@@ -275,7 +275,7 @@ +--- 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; Index: head/games/apricots/files/patch-apricots-sampleio.cpp =================================================================== --- head/games/apricots/files/patch-apricots-sampleio.cpp (revision 394782) +++ head/games/apricots/files/patch-apricots-sampleio.cpp (revision 394783) @@ -1,46 +1,45 @@ -Patch to build with newer openal. Not sure whether it doesn't leak memory ---- apricots/sampleio.cpp.orig 2003-08-06 03:21:22.000000000 +0400 -+++ apricots/sampleio.cpp 2010-04-07 18:32:05.000000000 +0400 -@@ -74,28 +74,21 @@ +--- 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 @@ +@@ -107,8 +100,6 @@ void sampleio :: init(int nsamples, char alSourcefv(sources[j], AL_ORIENTATION, back ); } - free(data); - } // Clearup routine