Bug 184242 - biology/avida: Fix build with clang
Summary: biology/avida: Fix build with clang
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-24 18:10 UTC by tkato432
Modified: 2013-11-27 16:10 UTC (History)
0 users

See Also:


Attachments
file.diff (5.44 KB, patch)
2013-11-24 18:10 UTC, tkato432
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tkato432 2013-11-24 18:10:07 UTC
- Fix build with clang

New file:
files/patch-avida-core__source__main__cGenomeUtil.cc
files/patch-libs__tcmalloc-1.4__src__malloc_extension.cc

Remove file:
files/patch-libs_apto_include_apto_core_Functor.h
files/patch-libs_apto_utils_unittest_googletest_include_gtest_internal_gtest-por
t.h
Comment 1 dfilter service freebsd_committer freebsd_triage 2013-11-27 16:07:59 UTC
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
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 2 Philippe Audeoud freebsd_committer freebsd_triage 2013-11-27 16:08:07 UTC
State Changed
From-To: open->closed

Committed, with minor changes. Thanks!