ports/184841: games/glob2: Fix build on -current
KATO Tsuguru
tkato432 at yahoo.com
Mon Dec 16 18:10:11 UTC 2013
>Number: 184841
>Category: ports
>Synopsis: games/glob2: Fix build on -current
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Mon Dec 16 18:10:10 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator: KATO Tsuguru
>Release: FreeBSD 8.4-RELEASE-p4 i386
>Organization:
>Environment:
>Description:
- Fix build on -current
- Support STRIP properly
New file:
files/patch-src__Game.h
>How-To-Repeat:
>Fix:
diff -urN /usr/ports/games/glob2/Makefile games/glob2/Makefile
--- /usr/ports/games/glob2/Makefile 2013-11-06 22:00:59.000000000 +0900
+++ games/glob2/Makefile 2013-12-17 00:00:00.000000000 +0900
@@ -3,7 +3,7 @@
PORTNAME= glob2
PORTVERSION= 0.9.4.4
-PORTREVISION= 6
+PORTREVISION= 7
CATEGORIES= games
MASTER_SITES= SAVANNAH/${PORTNAME}/${PORTVERSION:R}/
@@ -17,44 +17,49 @@
libfribidi.so:${PORTSDIR}/converters/fribidi \
libboost_thread.so:${PORTSDIR}/devel/boost-libs \
libfreetype.so:${PORTSDIR}/print/freetype2
-# Should work with portaudio v19_20071207
-# Can be built with portaudio2 but does not run cleanly
-#LIB_DEPENDS+= libportaudio.so:${PORTSDIR}/audio/portaudio2
-USES= gmake
+OPTIONS_DEFINE= DOCS PORTAUDIO
+
+USES= pkgconfig scons
USE_SDL= image net sdl ttf
USE_GL= gl
-USE_SCONS= yes
-#SCONS_ARGS+= --portaudio=true
-#SCONS_BUILDENV= ${SCONS_ENV}
-SCONS_ARGS= CXXFLAGS+=" -g -pg" INSTALLDIR="${STAGEDIR}${PREFIX}/share"
-CFLAGS+= -Wno-return-type
-
+MAKE_ARGS= CCFLAGS="${CFLAGS}" \
+ LINKFLAGS="${LDFLAGS}" \
+ BINDIR="${STAGEDIR}${PREFIX}/bin" \
+ INSTALLDIR="${STAGEDIR}${PREFIX}/share" \
+ DATADIR="${DATADIR}"
INSTALLS_ICONS= yes
-ICON_SIZES= 16x16 24x24 32x32 48x48 64x64 128x128
-#CFLAGS+= ${PTHREAD_CFLAGS} -I. `pkg-config --cflags portaudio-2.0` -I${LOCALBASE}/include
-CFLAGS+= ${PTHREAD_CFLAGS} -I. -I${LOCALBASE}/include
-#LINKFLAGS= ${PTHREAD_LIBS} `pkg-config --libs portaudio-2.0` -L${LOCALBASE}/lib
-LINKFLAGS= ${PTHREAD_LIBS} -L${LOCALBASE}/lib
+CFLAGS+= ${PA2_CFLAGS} -I${LOCALBASE}/include -Wno-return-type
+LDFLAGS+= ${PA2_LDFLAGS} -L${LOCALBASE}/lib -pthread
-PORTDOCS= README
+SUB_FILES= pkg-message
-OPTIONS_DEFINE= DOCS
+.include <bsd.port.options.mk>
-SUB_FILES= pkg-message
+# Should work with portaudio v19_20071207
+# Can be built with portaudio2 but does not run cleanly
+.if ${PORT_OPTIONS:MPORTAUDIO}
+BUILD_DEPENDS+= portaudio2>0:${PORTSDIR}/audio/portaudio2
+RUN_DEPENDS+= portaudio2>0:${PORTSDIR}/audio/portaudio2
+MAKE_ARGS+= --portaudio=true
+PA2_CFLAGS+= -I${LOCALBASE}/include/portaudio2
+PA2_LDFLAGS+= -L${LOCALBASE}/lib/portaudio2
+.endif
post-patch:
- @${REINPLACE_CMD} -e 's|/usr/local/bin|${STAGEDIR}${PREFIX}/bin|' \
+ @${REINPLACE_CMD} -e \
+ 's|"-g"|""|' \
${WRKSRC}/SConstruct
- @${REINPLACE_CMD} -e 's|portaudio.h|portaudio2/portaudio.h|' ${WRKSRC}/src/VoiceRecorder.cpp
- @${REINPLACE_CMD} -e 's|^Icon.*|Icon=${PORTNAME}|' \
- ${WRKSRC}/data/${PORTNAME}.desktop
-
-.for s in 16 24 32 48 64 128
- @cd ${WRKSRC}/data/icons && \
- ${MV} glob2-icon-${s}x${s}.png ${PORTNAME}_${s}x${s}.png
-.endfor
+ @${REINPLACE_CMD} -e \
+ 's|portaudio.h|portaudio2/portaudio.h|' \
+ ${WRKSRC}/src/VoiceRecorder.cpp
+ @${REINPLACE_CMD} -e \
+ '/^Icon/s|=.*|=${PORTNAME}|' \
+ ${WRKSRC}/data/${PORTNAME}.desktop
+ @${REINPLACE_CMD} -e \
+ '/(PACKAGE_SOURCE_DIR)/s|^|//|' \
+ ${WRKSRC}/libgag/src/FileManager.cpp
manual-regression-test:
# Don't enable these tests on pointyhat, they take too long.
@@ -65,15 +70,15 @@
.endif
post-install:
-.for s in ${ICON_SIZES}
- @${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${s}/apps/
- ${INSTALL_DATA} ${WRKSRC}/data/icons/${PORTNAME}_${s}.png \
- ${STAGEDIR}${PREFIX}/share/icons/hicolor/${s}/apps/${PORTNAME}.png
+.for s in 16 24 32 48 64 128
+ @${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${s}x${s}/apps
+ (cd ${WRKSRC}/data/icons && ${INSTALL_DATA} glob2-icon-${s}x${s}.png \
+ ${STAGEDIR}${PREFIX}/share/icons/hicolor/${s}x${s}/apps/${PORTNAME}.png)
.endfor
${LN} -sf ${PREFIX}/share/icons/hicolor/48x48/apps/${PORTNAME}.png \
- ${STAGEDIR}${PREFIX}/share/pixmaps/
-
+ ${STAGEDIR}${PREFIX}/share/pixmaps
@${MKDIR} ${STAGEDIR}${DOCSDIR}
- ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
+ (cd ${WRKSRC} && ${INSTALL_DATA} README ${STAGEDIR}${DOCSDIR})
+ @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/glob2
.include <bsd.port.mk>
diff -urN /usr/ports/games/glob2/files/patch-src__Game.h games/glob2/files/patch-src__Game.h
--- /usr/ports/games/glob2/files/patch-src__Game.h 1970-01-01 09:00:00.000000000 +0900
+++ games/glob2/files/patch-src__Game.h 2013-12-17 00:00:00.000000000 +0900
@@ -0,0 +1,36 @@
+--- src/Game.h.orig
++++ src/Game.h
+@@ -82,6 +82,16 @@
+ DRAW_OVERLAY = 0x100,
+ };
+
++ struct BuildProject
++ {
++ int posX;
++ int posY;
++ int teamNumber;
++ int typeNum;
++ int unitWorking;
++ int unitWorkingFuture;
++ };
++
+ /// This method will prepare the game with this mapHeader
+ void setMapHeader(const MapHeader& mapHeader);
+
+@@ -149,16 +159,6 @@
+ BOTTOM_TO_TOP
+ };
+
+- struct BuildProject
+- {
+- int posX;
+- int posY;
+- int teamNumber;
+- int typeNum;
+- int unitWorking;
+- int unitWorkingFuture;
+- };
+-
+ ///Initiates Game
+ void init(GameGUI *gui, MapEdit* edit);
+
diff -urN /usr/ports/games/glob2/pkg-plist games/glob2/pkg-plist
--- /usr/ports/games/glob2/pkg-plist 2013-11-06 22:00:59.000000000 +0900
+++ games/glob2/pkg-plist 2013-12-17 00:00:00.000000000 +0900
@@ -1,5 +1,6 @@
bin/glob2
share/applications/glob2.desktop
+%%PORTDOCS%%%%DOCSDIR%%/README
%%DATADIR%%/campaigns/Tutorial_Campaign.txt
%%DATADIR%%/campaigns/tutorial-part1.map
%%DATADIR%%/campaigns/tutorial-part2.map
@@ -1754,3 +1755,4 @@
@dirrm %%DATADIR%%/data
@dirrm %%DATADIR%%/campaigns
@dirrm %%DATADIR%%
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list