aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--games/cake/Makefile24
-rw-r--r--games/cake/distinfo5
-rw-r--r--games/cake/files/patch-Makefile28
-rw-r--r--games/cake/files/patch-cake_render.cpp25
4 files changed, 56 insertions, 26 deletions
diff --git a/games/cake/Makefile b/games/cake/Makefile
index 45f98ec4e48a..b4e5d11825be 100644
--- a/games/cake/Makefile
+++ b/games/cake/Makefile
@@ -6,11 +6,11 @@
#
PORTNAME= cake
-PORTVERSION= 2004.07.09
+PORTVERSION= 2005.10.23
CATEGORIES= games
MASTER_SITES= http://www.calodox.scene.org:8080/morbac/cake/download/ \
http://freebsd.nsu.ru/distfiles/
-DISTNAME= ${PORTNAME}_src
+DISTNAME= ${PORTNAME}_src_${PORTVERSION:S/.//g}
MAINTAINER= danfe@FreeBSD.org
COMMENT= Quake3 map viewer
@@ -22,13 +22,17 @@ LIB_DEPENDS= glut.3:${PORTSDIR}/graphics/libglut
.endif
LIB_DEPENDS+= jpeg.9:${PORTSDIR}/graphics/jpeg
+# Need to pass `-l', but PATCH_ARGS+= won't work because of PATCH_ARGS?=
+# in bsd.port.mk.
+PATCH_ARGS= -d ${PATCH_WRKSRC} -N -s -E ${PATCH_STRIP} -l
USE_GMAKE= yes
USE_REINPLACE= yes
USE_X_PREFIX= yes
USE_ZIP= yes
ALL_TARGET= main
-MAKE_ARGS+= PTHREAD_LIBS=${PTHREAD_LIBS}
+MAKE_ARGS+= CXX=${CXX} PTHREAD_LIBS=${PTHREAD_LIBS}
+WRKSRC= ${WRKDIR}/cake_src
PLIST_FILES= bin/cake
@@ -38,22 +42,10 @@ pre-everything::
.endif
post-extract:
- @${FIND} -E ${WRKDIR} -type f -iregex ".*\.(cpp|h)" \
+ @${FIND} -E ${WRKDIR} -type f \( -iregex ".*\.(cpp|h)" -or -name Makefile \) \
-exec ${REINPLACE_CMD} -E -e 's/[[:cntrl:]]*$$//' \
-e 's/#pragma[[:blank:]]+pack[[:blank:]]*\([[:blank:]]*push[[:blank:]]*,[[:blank:]]*1[[:blank:]]*\)/#pragma pack(1)/g' \
-e 's/#pragma[[:blank:]]+pack[[:blank:]]*\([[:blank:]]*pop[[:blank:]]*\)/#pragma pack()/g' '{}' \;
- @${REINPLACE_CMD} -e 's/checkGLError/CheckGLError/g' \
- ${WRKSRC}/cake/glsetup/glutils.cpp ${WRKSRC}/cake/q3bsp.cpp
- @${REINPLACE_CMD} -e 's/get_nstart_pos/GetNumStartPos/g' \
- -e 's/set_start_pos/SetStartPos/g' \
- -e 's/moveMouseXY/MoveMouseXY/g' \
- -e 's/moveForward/MoveForward/g' \
- -e 's/moveBackward/MoveBackward/g' \
- -e 's/moveRight/MoveRight/g' \
- -e 's/moveLeft/MoveLeft/g' \
- -e 's/moveUp/MoveUp/g' \
- -e 's/moveDown/MoveDown/g' \
- -e 's/report/Report/g' ${WRKSRC}/main.cpp
@${REINPLACE_CMD} -e 's/ENABLE_SOUND 1/ENABLE_SOUND 0/' \
${WRKSRC}/cake/sound.h
diff --git a/games/cake/distinfo b/games/cake/distinfo
index e6964f98ba86..ec3b38d762a1 100644
--- a/games/cake/distinfo
+++ b/games/cake/distinfo
@@ -1,2 +1,3 @@
-MD5 (cake_src.zip) = 7d8cebc93526b3541684d43bc4eebd5e
-SIZE (cake_src.zip) = 645893
+MD5 (cake_src_20051023.zip) = ff0a0995ab932c94ae07420d9e54fb60
+SHA256 (cake_src_20051023.zip) = 3584eb7275ca537b2d44fbfc98d33ec7eb122f4bdd2a71cb8ee19246af4678e5
+SIZE (cake_src_20051023.zip) = 649774
diff --git a/games/cake/files/patch-Makefile b/games/cake/files/patch-Makefile
index 1b1d518dd90e..1433f8646444 100644
--- a/games/cake/files/patch-Makefile
+++ b/games/cake/files/patch-Makefile
@@ -4,26 +4,38 @@
-INCLUDES = -I/usr/include -I/usr/local/include
-CC = g++
-CXXFLAGS += -g -Wall -W -O2 $(INCLUDES)
-+INCLUDES = -I/usr/include -I$(LOCALBASE)/include -I$(X11BASE)/include
-+CC ?= g++
-+CXXFLAGS += -Wall $(INCLUDES)
-
+-
-LDFLAGS += -L/usr/lib -lglut -lGLU -lGL -L/usr/X11R6/lib -lm -ldl
-LDFLAGS += -lpthread -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE
-LDFLAGS += -lcurses -ljpeg -lz -lfmod-3.63
-+LDFLAGS += -L/usr/lib -L$(LOCALBASE)/lib -L$(X11BASE)/lib -lglut -lGLU -lGL -lm
++INCLUDES = -I/usr/include -I$(LOCALBASE)/include -I$(X11BASE)/include
++CXX ?= g++
++CXXFLAGS += -Wall $(INCLUDES)
++
++LDFLAGS += -L/usr/lib -L$(LOCALBASE)/lib -L$(X11BASE)/lib -lglut -lGLU -lGL
+LDFLAGS += $(PTHREAD_LIBS) -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE
+#LDFLAGS += -lcurses -ljpeg -lz -lfmod-3.63
+LDFLAGS += -ljpeg
EXE = main
SRC_FILES = $(wildcard cake/*.cpp cake/glsetup/*.cpp cake/zip/*.cpp) main.cpp
-@@ -17,7 +18,7 @@
- $(CC) -c $(CXXFLAGS) -o $@ $<
+@@ -14,16 +15,16 @@
+ VPATH = ./
+
+ %.cpp%.o:
+- $(CC) -c $(CXXFLAGS) -o $@ $<
++ $(CXX) -c $(CXXFLAGS) -o $@ $<
$(EXE): $(OBJECTS)
- g++ -o $@ $(OBJECTS) $(LDFLAGS)
-+ $(CC) -o $@ $(OBJECTS) $(LDFLAGS)
++ $(CXX) -o $@ $(OBJECTS) $(LDFLAGS)
clean:
rm -f $(EXE) $(OBJECTS) $(DEPEND)
+
+ $(DEPEND):
+- $(CC) -MM $(CXXFLAGS) $(SRC_FILES) > $@
++ $(CXX) -MM $(CXXFLAGS) $(SRC_FILES) > $@
+
+ include $(DEPEND)
+
diff --git a/games/cake/files/patch-cake_render.cpp b/games/cake/files/patch-cake_render.cpp
new file mode 100644
index 000000000000..574c4eb03861
--- /dev/null
+++ b/games/cake/files/patch-cake_render.cpp
@@ -0,0 +1,25 @@
+--- cake/render.cpp.orig Fri Dec 9 04:12:40 2005
++++ cake/render.cpp Fri Dec 9 13:13:58 2005
+@@ -21,6 +21,7 @@
+ #ifdef WIN32
+ #include "glsetup/glext.h"
+ #else
++ #define GLX_GLXEXT_LEGACY
+ #include <GL/glx.h>
+ #include <GL/glext.h>
+ #endif
+@@ -36,13 +37,7 @@
+ // size of float may change from one platform to one other
+ #define XYZ_OFFSET 16 // 4 * sizeof(float)
+ #else
+- #if !defined(GLX_VERSION_1_4)
+- #define lglGetProcAddress(p) glXGetProcAddressARB((byte*) p);
+- #else
+- #define lglGetProcAddress(p) glXGetProcAddress((byte*) p);
+- #define glActiveTextureARB glActiveTexture
+- #define glClientActiveTextureARB glClientActiveTexture
+- #endif
++ #define lglGetProcAddress(p) glXGetProcAddressARB((byte*) p);
+
+ // size of float may change from one platform to one other
+ #define XYZ_OFFSET 16 // 4 * sizeof(float)