aboutsummaryrefslogtreecommitdiff
path: root/biology/avida
diff options
context:
space:
mode:
authorPhilippe Audeoud <jadawin@FreeBSD.org>2013-11-27 16:07:51 +0000
committerPhilippe Audeoud <jadawin@FreeBSD.org>2013-11-27 16:07:51 +0000
commitee7ae13fcabec9951a00e8f88d0b6ac7ff508194 (patch)
treeb2de40d65b3f12ed120987b1aabf30ded7c0f63e /biology/avida
parentacf2ffc8fb5a1e9c747b3281c633ee31a336d2e2 (diff)
- Fix build with clang
- Support STAGEDIR PR: ports/184242 Submitted by: KATO Tsuguru <tkato432@yahoo.com>
Notes
Notes: svn path=/head/; revision=335028
Diffstat (limited to 'biology/avida')
-rw-r--r--biology/avida/Makefile30
-rw-r--r--biology/avida/files/patch-avida-core__source__main__cGenomeUtil.cc18
-rw-r--r--biology/avida/files/patch-libs__tcmalloc-1.4__src__malloc_extension.cc10
-rw-r--r--biology/avida/files/patch-libs_apto_include_apto_core_Functor.h10
-rw-r--r--biology/avida/files/patch-libs_apto_utils_unittest_googletest_include_gtest_internal_gtest-port.h10
5 files changed, 44 insertions, 34 deletions
diff --git a/biology/avida/Makefile b/biology/avida/Makefile
index 4d283832b17e..79ba36776c62 100644
--- a/biology/avida/Makefile
+++ b/biology/avida/Makefile
@@ -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 default-gx.org \
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>
diff --git a/biology/avida/files/patch-avida-core__source__main__cGenomeUtil.cc b/biology/avida/files/patch-avida-core__source__main__cGenomeUtil.cc
new file mode 100644
index 000000000000..0aef270a88ce
--- /dev/null
+++ b/biology/avida/files/patch-avida-core__source__main__cGenomeUtil.cc
@@ -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());
diff --git a/biology/avida/files/patch-libs__tcmalloc-1.4__src__malloc_extension.cc b/biology/avida/files/patch-libs__tcmalloc-1.4__src__malloc_extension.cc
new file mode 100644
index 000000000000..7134dc16aea3
--- /dev/null
+++ b/biology/avida/files/patch-libs__tcmalloc-1.4__src__malloc_extension.cc
@@ -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
diff --git a/biology/avida/files/patch-libs_apto_include_apto_core_Functor.h b/biology/avida/files/patch-libs_apto_include_apto_core_Functor.h
deleted file mode 100644
index ae59b88cbf53..000000000000
--- a/biology/avida/files/patch-libs_apto_include_apto_core_Functor.h
+++ /dev/null
@@ -1,10 +0,0 @@
---- libs/apto/include/apto/core/Functor.h.orig 2012-09-29 03:33:38.000000000 +0000
-+++ libs/apto/include/apto/core/Functor.h
-@@ -38,6 +38,7 @@
-
- #include "apto/platform/Visibility.h"
-
-+#include <typeinfo>
- #include <cassert>
-
-
diff --git a/biology/avida/files/patch-libs_apto_utils_unittest_googletest_include_gtest_internal_gtest-port.h b/biology/avida/files/patch-libs_apto_utils_unittest_googletest_include_gtest_internal_gtest-port.h
deleted file mode 100644
index 83dd715504b6..000000000000
--- a/biology/avida/files/patch-libs_apto_utils_unittest_googletest_include_gtest_internal_gtest-port.h
+++ /dev/null
@@ -1,10 +0,0 @@
---- libs/apto/utils/unittest/googletest/include/gtest/internal/gtest-port.h.orig 2012-09-29 03:33:39.000000000 +0000
-+++ libs/apto/utils/unittest/googletest/include/gtest/internal/gtest-port.h
-@@ -173,6 +173,7 @@
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
-+#include <unistd.h>
- #ifndef _WIN32_WCE
- #include <sys/stat.h>
- #endif // !_WIN32_WCE