- Bump PORTREVISION.

- Use SF macro in MASTER_SITES.
- Clean up.
- Remove some useless comments from targets.
- Remove CVS directories before installing them instead of after.
- Tidy pkg-message.
- Remove IGNORE message for unsupported FreeBSD < 5.x.
- Fix building with GCC 4.x [1].

Reported by:	pointyhat [1]
This commit is contained in:
Alejandro Pulver 2007-04-08 04:00:04 +00:00
parent 5650140fa4
commit f1ff3aaa3f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=189462
6 changed files with 98 additions and 49 deletions

View File

@ -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 <bsd.port.pre.mk>
.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}

View File

@ -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:

View File

@ -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();

View File

@ -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 ***********************************/

View File

@ -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);

View File

@ -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
==============================================================================