diff --git a/games/airrox/Makefile b/games/airrox/Makefile index 8172f412d98a..37e271350bba 100644 --- a/games/airrox/Makefile +++ b/games/airrox/Makefile @@ -7,10 +7,9 @@ PORTNAME= airrox PORTVERSION= 0.0.4 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= games -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} -MASTER_SITE_SUBDIR= ${PORTNAME} +MASTER_SITES= SF DISTNAME= ${PORTNAME}-0.04 MAINTAINER= alepulver@FreeBSD.org @@ -22,73 +21,37 @@ USE_GMAKE= yes USE_SDL= mixer net sdl USE_GL= yes REINPLACE_ARGS= -i '' - +ALL_TARGET= linux WRKSRC= ${WRKDIR}/${PORTNAME}/source OPTIONS= OPTIMIZED_CFLAGS "Enable compilation optimizations" on SUB_FILES= pkg-message -ALL_TARGET= linux - DIRS= audio icones imagens meshs texturas .include -.if ${OSVERSION} < 500000 -IGNORE= needs sscanf() interface in libc +.if !defined(WITHOUT_OPTIMIZED_CFLAGS) +MAKE_ENV+= OPTIMIZED_CFLAGS=yes .endif +post-extract: + @${FIND} ${WRKDIR} -type d -name CVS -print0 | ${XARGS} -0 ${RM} -rf + post-patch: -# Fix Makefile. - @${REINPLACE_CMD} -e 's|/usr/X11R6|${X11BASE}|g ; \ - s|-lSDL ||g ; \ - s|-lpthread||g ; \ - s|sdl-config|${SDL_CONFIG}|g ; \ - s|\(-O2\)|${CFLAGS} -I${X11BASE}/include \ - `${SDL_CONFIG} --cflags` \1| ; \ - s|$$(INCLUDEWIN)||g ; \ - s|g++|${CXX}|g' \ - ${WRKSRC}/${MAKEFILE} - -# Fix SDL include statement. -.for f in *.cpp *.h - @${FIND} ${WRKSRC} -type f -name "${f}" -print0 | \ - ${XARGS} -0 ${REINPLACE_CMD} -e \ - 's|\(#include.*\)SDL/\(SDL.*\)|\1\2|' -.endfor - -# Fix paths to ${DATADIR}. .for d in ${DIRS} @${REINPLACE_CMD} -e 's|../\(${d}/\)|${DATADIR}/\1|' \ ${WRKSRC}/*.cpp ${WRKSRC}/*.h .endfor -# Enable/disable compilation optimizations. -.if defined(WITHOUT_OPTIMIZED_CFLAGS) - @${REINPLACE_CMD} -e 's|-O2||g' ${WRKSRC}/${MAKEFILE} -.endif - do-install: -# Program. ${INSTALL_PROGRAM} ${WRKSRC}/air ${PREFIX}/bin/${PORTNAME} - -# Data. ${MKDIR} ${DATADIR} - -# Data: directories. .for d in ${DIRS} ${CP} -R ${WRKDIR}/${PORTNAME}/${d} ${DATADIR} .endfor - -# Data: config.txt. ${INSTALL_DATA} ${WRKSRC}/config.txt ${DATADIR} - -# Remove CVS directories. - @${FIND} ${DATADIR} -type d -name "CVS" -print0 | \ - ${XARGS} -0 ${RM} -rf - -# Documentation (optional). .if !defined(NOPORTDOCS) ${MKDIR} ${DOCSDIR} ${INSTALL_DATA} ${FILESDIR}/readme.txt ${DOCSDIR} diff --git a/games/airrox/files/patch-Makefile b/games/airrox/files/patch-Makefile new file mode 100644 index 000000000000..0c4df5ee3676 --- /dev/null +++ b/games/airrox/files/patch-Makefile @@ -0,0 +1,51 @@ +--- ./Makefile.orig Fri Oct 8 17:20:57 2004 ++++ ./Makefile Sun Apr 8 00:36:49 2007 +@@ -55,20 +55,26 @@ + # comunicacao.o \ + # + ++CXX ?= g++ ++X11BASE ?= /usr/X11R6 ++ + # bibliotecas para Linux +-LIBSLINUX = -L/usr/X11R6/lib -lGL -lGLU -lglut -L/usr/lib -lSDL_mixer -lSDL -lpthread `sdl-config --cflags --libs` -lSDL_net ++LIBSLINUX = -L$(X11BASE)/lib -lGL -lGLU -lglut `sdl-config --libs` -lSDL_mixer -lSDL_net + + # bibliotecas para Windows + LIBSWIN = -lopengl32 -lglu32 -lglut32 -lmingw32 -lSDLmain -lSDL -lSDL_mixer -mwindows -L$(DEVCPP_PATH)\lib -lSDL_net + +- + # executavel gerado pelo Linux + BINLINUX = air + # executavel gerado pelo Windows + BINWIN = $(BINLINUX).exe + + # flags (otimizacao e nao exibir warnings) +-FLAGS = -O2 -DREENTRANT -DHAVE_OPENGL #-g ++FLAGS = $(CFLAGS) -DREENTRANT -DHAVE_OPENGL -I$(X11BASE)/include ++ ++ifdef OPTIMIZED_CFLAGS ++FLAGS += -O2 ++endif + + INCLUDEWIN = -I$(DEVCPP_PATH)\include -I$(DEVCPP_PATH)\include\c++ -I$(DEVCPP_PATH)\include\c++\mingw32 -I$(DEVCPP_PATH)\include\c++\backward + +@@ -77,15 +83,15 @@ + + # Linkagem: Linux (target padrao) + linux: $(OBJS) +- g++ $? -o $(BINLINUX) -L/usr/X11R6/lib $(LIBSLINUX) $(FLAGS) ++ $(CXX) $? -o $(BINLINUX) -L/usr/X11R6/lib $(LIBSLINUX) $(FLAGS) + + # Linkagem: Windows + win: $(OBJS) +- g++ $? -o $(BINWIN) $(LIBSWIN) $(FLAGS) ++ $(CXX) $? -o $(BINWIN) $(LIBSWIN) $(FLAGS) + + # Compilacao (Linux e Windows) + $(OBJS): %.o: %.cpp +- g++ -c $< -o $@ $(FLAGS) $(INCLUDEWIN) ++ $(CXX) -c $< -o $@ $(FLAGS) + + # Apagar objetos pra comecar do zero + clean: diff --git a/games/airrox/files/patch-conexao.h b/games/airrox/files/patch-conexao.h new file mode 100644 index 000000000000..cf059c30cb82 --- /dev/null +++ b/games/airrox/files/patch-conexao.h @@ -0,0 +1,11 @@ +--- ./conexao.h.orig Tue Sep 28 20:48:00 2004 ++++ ./conexao.h Tue Mar 27 14:57:10 2007 +@@ -46,7 +46,7 @@ + + + Conexao(Jogo *j); +- Conexao::~Conexao(); ++ ~Conexao(); + void servidor(int porta, void (*eventos) (void *,void*)); + void cliente(string enderecoservidor, int porta, void (*eventos) (void *,void *)); + void limparMsg(); diff --git a/games/airrox/files/patch-visual.cpp b/games/airrox/files/patch-visual.cpp new file mode 100644 index 000000000000..ded875649914 --- /dev/null +++ b/games/airrox/files/patch-visual.cpp @@ -0,0 +1,11 @@ +--- ./visual.cpp.orig Tue Mar 27 14:57:10 2007 ++++ ./visual.cpp Tue Mar 27 15:10:12 2007 +@@ -219,7 +219,7 @@ + return 1; + } + +-GLvoid Visual::matarJanela(GLvoid) {} ++void Visual::matarJanela(void) {} + + /**************** Metodos auxiliares ***********************************/ + diff --git a/games/airrox/files/patch-visual.h b/games/airrox/files/patch-visual.h new file mode 100644 index 000000000000..17edbca7615f --- /dev/null +++ b/games/airrox/files/patch-visual.h @@ -0,0 +1,11 @@ +--- ./visual.h.orig Tue Mar 27 14:57:10 2007 ++++ ./visual.h Tue Mar 27 15:00:26 2007 +@@ -70,7 +70,7 @@ + int setarTelaCheia(void); + int aumentarResolucao(void); + int diminuirResolucao(void); +- GLvoid matarJanela(GLvoid); ++ void matarJanela(void); + + void Escrita2D(void); + void EscreveString(float x, float y, void *font, const char *string); diff --git a/games/airrox/files/pkg-message.in b/games/airrox/files/pkg-message.in index d42e1f828321..0093d7bc6a42 100644 --- a/games/airrox/files/pkg-message.in +++ b/games/airrox/files/pkg-message.in @@ -1,6 +1,8 @@ -To play airrox you have to copy the file %%DATADIR%%/config.txt to your -home directory, with the name ".airrox". +============================================================================== -Example: +To play airrox you have to copy the file "%%DATADIR%%/config.txt" +to "~/.airrox" (file, not directory). For example: -cp %%DATADIR%%/config.txt ~/.airrox +% cp %%DATADIR%%/config.txt ~/.airrox + +==============================================================================