Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Nov 2013 16:07:52 +0000 (UTC)
From:      Philippe Audeoud <jadawin@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r335028 - in head/biology/avida: . files
Message-ID:  <201311271607.rARG7q2p031921@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jadawin
Date: Wed Nov 27 16:07:51 2013
New Revision: 335028
URL: http://svnweb.freebsd.org/changeset/ports/335028

Log:
  - Fix build with clang
  - Support STAGEDIR
  
  PR:		ports/184242
  Submitted by:	KATO Tsuguru <tkato432@yahoo.com>

Added:
  head/biology/avida/files/patch-avida-core__source__main__cGenomeUtil.cc   (contents, props changed)
  head/biology/avida/files/patch-libs__tcmalloc-1.4__src__malloc_extension.cc   (contents, props changed)
Deleted:
  head/biology/avida/files/patch-libs_apto_include_apto_core_Functor.h
  head/biology/avida/files/patch-libs_apto_utils_unittest_googletest_include_gtest_internal_gtest-port.h
Modified:
  head/biology/avida/Makefile

Modified: head/biology/avida/Makefile
==============================================================================
--- head/biology/avida/Makefile	Wed Nov 27 15:57:39 2013	(r335027)
+++ head/biology/avida/Makefile	Wed Nov 27 16:07:51 2013	(r335028)
@@ -8,13 +8,14 @@ CATEGORIES=	biology
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}-stable/${PORTVERSION}
 
 MAINTAINER=	ports@FreeBSD.org
-COMMENT=	An auto-adaptive genetic system designed for ALife research
+COMMENT=	Auto-adaptive genetic system designed for ALife research
 
 LICENSE=	GPLv3
 
 OPTIONS_DEFINE=	DOCS
 
 USES=		cmake:outsource ncurses
+CMAKE_ARGS=	-DAPTO_UNIT_TESTS:BOOL=OFF -DAVD_UNIT_TESTS:BOOL=OFF
 
 PORTDOCS=	*
 PLIST_FILES=	${BIN_FILES:S|^|bin/|} \
@@ -30,7 +31,6 @@ DATA_FILES=	analyze.cfg avida.cfg defaul
 		instset-heads-sex.cfg instset-heads.cfg instset-smt.cfg \
 		instset-transsmt.cfg
 
-NO_STAGE=	yes
 .include <bsd.port.pre.mk>
 
 .if ${ARCH} == "ia64" || ${ARCH} == "powerpc" || ${ARCH} == "sparc64"
@@ -41,7 +41,7 @@ post-patch:
 	@${FIND} ${WRKSRC} -name "CMakeLists.txt" | ${XARGS} \
 		${REINPLACE_CMD} -e \
 		's|-O[0-9]|| ; \
-		 s| pthread| ${PTHREAD_LIBS}|'
+		 s| pthread| -pthread|'
 	@${REINPLACE_CMD} -e '/long long int/s|std::abs|llabs|' \
 		${WRKSRC}/avida-core/source/main/cPopulationInterface.cc
 
@@ -52,20 +52,22 @@ pre-build:
 .endfor
 
 do-install:
-	@${MKDIR} ${PREFIX}/lib/${PORTNAME}
+	@${MKDIR} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}
 .for exec in ${BIN_FILES}
-	(cd ${WRKSRC} \
-		&& ${INSTALL_SCRIPT} ${exec}.sh ${PREFIX}/bin/${exec})
-	(cd ${BUILD_WRKSRC}/bin \
-		&& ${INSTALL_PROGRAM} ${exec} ${PREFIX}/lib/${PORTNAME})
+	(cd ${WRKSRC} && ${INSTALL_SCRIPT} ${exec}.sh \
+		${STAGEDIR}${PREFIX}/bin/${exec})
+	(cd ${BUILD_WRKSRC}/bin && ${INSTALL_PROGRAM} ${exec} \
+		${STAGEDIR}${PREFIX}/lib/${PORTNAME})
 .endfor
-	(cd ${WRKSRC}/avida-core/support/config \
-		&& ${INSTALL_DATA} *.cfg ${PREFIX}/lib/${PORTNAME} \
-		&& ${INSTALL_DATA} *.org ${PREFIX}/lib/${PORTNAME})
+	(cd ${WRKSRC}/avida-core/support/config && ${INSTALL_DATA} *.cfg \
+		${STAGEDIR}${PREFIX}/lib/${PORTNAME})
+	(cd ${WRKSRC}/avida-core/support/config && ${INSTALL_DATA} *.org \
+		${STAGEDIR}${PREFIX}/lib/${PORTNAME})
+
 .if ${PORT_OPTIONS:MDOCS}
-	@${MKDIR} ${DOCSDIR}
-	@(cd ${WRKSRC}/avida-core/documentation \
-		&& ${COPYTREE_SHARE} . ${DOCSDIR})
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	@(cd ${WRKSRC}/avida-core/documentation && ${COPYTREE_SHARE} . \
+		${STAGEDIR}${DOCSDIR})
 .endif
 
 .include <bsd.port.post.mk>

Added: head/biology/avida/files/patch-avida-core__source__main__cGenomeUtil.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/biology/avida/files/patch-avida-core__source__main__cGenomeUtil.cc	Wed Nov 27 16:07:51 2013	(r335028)
@@ -0,0 +1,18 @@
+--- avida-core/source/main/cGenomeUtil.cc.orig
++++ avida-core/source/main/cGenomeUtil.cc
+@@ -214,7 +214,14 @@
+  */
+ void cGenomeUtil::RandomShuffle(cAvidaContext& ctx, Sequence& genome) {
+ 	std::vector<int> idx(static_cast<std::size_t>(genome.GetSize()));
+-	std::iota(idx.begin(), idx.end(), 0);
++
++	std::vector<int>::iterator idx_it = idx.begin();
++	int value = 0;
++	while (idx_it != idx.end()) {
++		*idx_it++ = value;
++		++value;
++	}
++
+ 	cRandomStdAdaptor rng(ctx.GetRandom());
+ 	std::random_shuffle(idx.begin(), idx.end(), rng);
+ 	Sequence shuffled(genome.GetSize());

Added: head/biology/avida/files/patch-libs__tcmalloc-1.4__src__malloc_extension.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/biology/avida/files/patch-libs__tcmalloc-1.4__src__malloc_extension.cc	Wed Nov 27 16:07:51 2013	(r335028)
@@ -0,0 +1,10 @@
+--- libs/tcmalloc-1.4/src/malloc_extension.cc.orig
++++ libs/tcmalloc-1.4/src/malloc_extension.cc
+@@ -57,6 +57,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <pthread.h>
+ #if defined HAVE_STDINT_H
+ #include <stdint.h>
+ #elif defined HAVE_INTTYPES_H



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