diff options
author | danfe <danfe@FreeBSD.org> | 2015-09-02 20:29:09 +0800 |
---|---|---|
committer | danfe <danfe@FreeBSD.org> | 2015-09-02 20:29:09 +0800 |
commit | c964c692ce9a40aa4445b3075db02e2bdd1e6a4e (patch) | |
tree | 79a3a7a48dec9674e22a8d639a5418fe3e074992 /biology/avida | |
parent | f4682f58ebc43148fb847139e7601b8b5ec2ee6c (diff) | |
download | freebsd-ports-gnome-c964c692ce9a40aa4445b3075db02e2bdd1e6a4e.tar.gz freebsd-ports-gnome-c964c692ce9a40aa4445b3075db02e2bdd1e6a4e.tar.zst freebsd-ports-gnome-c964c692ce9a40aa4445b3075db02e2bdd1e6a4e.zip |
- Unbreak on PowerPC by using atomicops implementation for Linux and GCC
__sync_* functions family
- Remove BROKEN_ia64: it never had been first-class architecture, killed
officially in -CURRENT for a while now
- Sanitize installation commands and sort the knobs while I am here
Diffstat (limited to 'biology/avida')
-rw-r--r-- | biology/avida/Makefile | 24 | ||||
-rw-r--r-- | biology/avida/files/patch-libs_apto_include_apto_core_Atomic.h | 28 |
2 files changed, 40 insertions, 12 deletions
diff --git a/biology/avida/Makefile b/biology/avida/Makefile index eabcb09fb2d8..6ba9b2abca10 100644 --- a/biology/avida/Makefile +++ b/biology/avida/Makefile @@ -12,7 +12,7 @@ COMMENT= Auto-adaptive genetic system designed for ALife research LICENSE= GPLv3 -OPTIONS_DEFINE= DOCS +BROKEN_sparc64= missing atomics implementation USES= cmake:outsource ncurses CMAKE_ARGS= -DAPTO_UNIT_TESTS:BOOL=OFF -DAVD_UNIT_TESTS:BOOL=OFF @@ -30,9 +30,7 @@ DATA_FILES= analyze.cfg avida.cfg default-gx.org \ instset-heads-sex.cfg instset-heads.cfg instset-smt.cfg \ instset-transsmt.cfg -BROKEN_ia64= Does not compile: invokes i386 asm -BROKEN_powerpc= Does not compile: invokes i386 asm -BROKEN_sparc64= Does not compile: invokes i386 asm +OPTIONS_DEFINE= DOCS post-patch: @${FIND} ${WRKSRC} -name "CMakeLists.txt" | ${XARGS} \ @@ -41,6 +39,8 @@ post-patch: s| pthread| -pthread|' @${REINPLACE_CMD} -e '/long long int/s|std::abs|llabs|' \ ${WRKSRC}/avida-core/source/main/cPopulationInterface.cc + @${REINPLACE_CMD} -e '/__PPC__/s|linux|${OPSYS}|' \ + ${WRKSRC}/libs/tcmalloc-1.4/src/atomicops.h pre-build: .for exec in ${BIN_FILES} @@ -51,15 +51,15 @@ pre-build: do-install: @${MKDIR} ${STAGEDIR}${PREFIX}/lib/${PORTNAME} .for exec in ${BIN_FILES} - (cd ${WRKSRC} && ${INSTALL_SCRIPT} ${exec}.sh \ - ${STAGEDIR}${PREFIX}/bin/${exec}) - (cd ${BUILD_WRKSRC}/bin && ${INSTALL_PROGRAM} ${exec} \ - ${STAGEDIR}${PREFIX}/lib/${PORTNAME}) + ${INSTALL_SCRIPT} ${WRKSRC}/${exec}.sh \ + ${STAGEDIR}${PREFIX}/bin/${exec} + ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/bin/${exec} \ + ${STAGEDIR}${PREFIX}/lib/${PORTNAME} .endfor - (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}) + ${INSTALL_DATA} \ + ${WRKSRC}/avida-core/support/config/*.cfg \ + ${WRKSRC}/avida-core/support/config/*.org \ + ${STAGEDIR}${PREFIX}/lib/${PORTNAME} do-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} diff --git a/biology/avida/files/patch-libs_apto_include_apto_core_Atomic.h b/biology/avida/files/patch-libs_apto_include_apto_core_Atomic.h new file mode 100644 index 000000000000..0c1ef0eeb909 --- /dev/null +++ b/biology/avida/files/patch-libs_apto_include_apto_core_Atomic.h @@ -0,0 +1,28 @@ +--- libs/apto/include/apto/core/Atomic.h.orig 2012-09-29 03:33:38 UTC ++++ libs/apto/include/apto/core/Atomic.h +@@ -88,6 +88,25 @@ inline void Apto::Atomic::Set(volatile i + *atomic = value; + } + ++#elif defined __GNUC__ ++ ++inline int Apto::Atomic::Add(volatile int* atomic, int value) ++{ ++ return __sync_add_and_fetch(atomic, value); ++} ++ ++inline int Apto::Atomic::Get(volatile int* atomic) ++{ ++ __sync_synchronize(); ++ return *atomic; ++} ++ ++inline void Apto::Atomic::Set(volatile int* atomic, int value) ++{ ++ __sync_synchronize(); ++ *atomic = value; ++} ++ + #else + + // Assuming x86 |