Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Dec 2013 12:15:23 +0000 (UTC)
From:      Pawel Pekala <pawel@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r337408 - in head/games/glob2: . files
Message-ID:  <201312251215.rBPCFNGs009716@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pawel
Date: Wed Dec 25 12:15:23 2013
New Revision: 337408
URL: http://svnweb.freebsd.org/changeset/ports/337408

Log:
  - Fix build on -current
  - Convert to new options framework, add PORTAUDIO option
  - Strip glob2 binary
  
  PR:		ports/184841
  Submitted by:	KATO Tsuguru <tkato432@yahoo.com>

Added:
  head/games/glob2/files/patch-src__Game.h   (contents, props changed)
Modified:
  head/games/glob2/Makefile   (contents, props changed)

Modified: head/games/glob2/Makefile
==============================================================================
--- head/games/glob2/Makefile	Wed Dec 25 11:34:50 2013	(r337407)
+++ head/games/glob2/Makefile	Wed Dec 25 12:15:23 2013	(r337408)
@@ -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,50 @@ LIB_DEPENDS=	libvorbis.so:${PORTSDIR}/au
 		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 +71,15 @@ manual-regression-test:
 .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>

Added: head/games/glob2/files/patch-src__Game.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/glob2/files/patch-src__Game.h	Wed Dec 25 12:15:23 2013	(r337408)
@@ -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);
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312251215.rBPCFNGs009716>