avida: basically fixed

This commit is contained in:
sukanka 2022-07-08 11:29:49 +08:00
parent b63ddb5631
commit 6dc67d106d
4 changed files with 121 additions and 52 deletions

View file

@ -2,51 +2,64 @@
# Contributor: Dmitriy Morozov <archlinux@foxcub.org>
pkgname=avida
pkgver=2.12.4
pkgver=2.14.0
pkgrel=1
pkgdesc="A software platform to study evolution of digital organisms"
arch=('i686' 'x86_64')
url="http://avida.devosoft.org/"
url="https://github.com/devosoft/avida"
license=('GPL3' 'custom')
depends=('gcc-libs' 'ncurses')
makedepends=('cmake')
source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver-src.tar.gz"
avida.patch)
md5sums=('db4a687190f9fcc8b8ae84613d536d0a'
'a7ac844269d3f169f53e8e30005755f5')
makedepends=('cmake' 'git')
source=("avida-$pkgver.tar.gz::${url}/archive/refs/tags/${pkgver}.tar.gz"
"apto::git+https://github.com/dmbryson/apto.git"
"documentation::git+https://github.com/devosoft/avida.wiki.git"
'avida.patch'
'apto.patch'
)
sha256sums=('65f141a0835d251f6d51dc6c949d34fd1db799512c805516caa3cac68fc73062'
'SKIP'
'SKIP'
'ee332d5ee62b88be57592d5fb512c086284b3ebc93c57bb71c6d1751932bae1f'
'76789e7fccce71edf676bbb3c5a7724c3cf2abf18ebf3a747dbe6b43cc7ad0c8')
prepare() {
cd "$srcdir/avida-$pkgver-src"
patch -p 1 < ../avida.patch
prepare(){
cd "${srcdir}"
cd avida-$pkgver
patch --strip=1 < ../${pkgname}.patch
# Fix depreciation -mno-fused-madd
# sed -i 's|-mno-fused-madd|-std=c89|g' avida-core/CMakeLists.txt
cd ../apto
patch --strip=1 < ../apto.patch
cd ..
cp -rf apto/* avida-$pkgver/libs/apto
rm -rf avida-$pkgver/libs/pdcurses
cp -rf documentation/* avida-$pkgver/documentation
}
build() {
cd "$srcdir/avida-$pkgver-src"
cmake .
cd "$srcdir"
test -d out && rm -rf out
mkdir out
cd out
# disable unit tests for apto
# console interface ON
cmake ../avida-$pkgver -DCMAKE_INSTALL_PREFIX=/usr \
-DAPTO_UNIT_TESTS=OFF \
-DAVD_UNIT_TESTS=OFF \
-DAVD_GUI_NCURSES=ON \
-DCMAKE_BUILD_TYPE=Release
make
}
package() {
cd "$srcdir/avida-$pkgver-src"
# Install binaries and config files
mkdir -p "${pkgdir}/opt/${pkgname}"
install -m755 bin/avida* "${pkgdir}/opt/${pkgname}"
install -m664 -g users avida-core/support/config/*.{cfg,org} "${pkgdir}/opt/${pkgname}"
# Install headers and libraries
mkdir -p "${pkgdir}/usr/"{include,lib}
cp -r libs/apto/include/* "${pkgdir}/usr/include"
cp -r lib/* "${pkgdir}/usr/lib"
# Install launchers
mkdir -p "${pkgdir}/usr/bin"
echo 'cd /opt/avida && ./avida' > "${pkgdir}/usr/bin/avida"
echo 'cd /opt/avida && ./avida-viewer' > "${pkgdir}/usr/bin/avida-viewer"
chmod 755 "${pkgdir}/usr/bin/"{avida,avida-viewer}
cd $srcdir/out
make install DESTDIR="$pkgdir"
# Install documentation and Apto license
cd "$srcdir/avida-$pkgver"
mkdir -p "${pkgdir}/usr/share/doc/${pkgname}"
cp -r avida-core/documentation/* "${pkgdir}/usr/share/doc/${pkgname}"
cp -r documentation/* "${pkgdir}/usr/share/doc/${pkgname}"
install -Dm644 libs/apto/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE_APTO"
mv ${pkgdir}/usr/work ${pkgdir}/usr/lib/${pkgname}
}

19
fail/avida/apto.patch Normal file
View file

@ -0,0 +1,19 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 949804e..02b3fa4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,12 +3,14 @@ PROJECT(APTO CXX)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
# Default location for installed software/configs/ docs is the build directory.
+IF(NOT CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX
"${PROJECT_BINARY_DIR}"
CACHE PATH
"Install path prefix, prepended onto install directories."
FORCE
)
+ENDIF(NOT CMAKE_INSTALL_PREFIX)
# Final software is built directly into the work subdirectory.
SET(EXECUTABLE_OUTPUT_PATH

View file

@ -1,20 +1,57 @@
--- avida-2.12.3-src.orig/avida-core/source/analyze/cAnalyzeTreeStats_Gamma.cc 2012-02-02 22:50:29.000000000 +0600
+++ avida-2.12.3-src/avida-core/source/analyze/cAnalyzeTreeStats_Gamma.cc 2012-05-08 19:32:18.793044457 +0600
@@ -27,6 +27,7 @@
#include <math.h>
#include <iostream>
+#include <cstdlib>
using namespace std;
--- avida-2.12.3-src.orig/avida-core/source/tools/tArray.h 2012-02-02 22:50:29.000000000 +0600
+++ avida-2.12.3-src/avida-core/source/tools/tArray.h 2012-05-08 19:33:04.783042892 +0600
@@ -24,6 +24,7 @@
#define tArray_h
#include <cassert>
+#include <cstdlib>
#ifndef NULL
#define NULL 0
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 30008d6..c9f1912 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,10 +23,11 @@ ENDIF(NOT WIN32)
ADD_SUBDIRECTORY(avida-core)
# Default location for installed software/configs/ docs is the build directory.
+IF(NOT CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX
"${PROJECT_BINARY_DIR}"
CACHE PATH
"Install path prefix, prepended onto install directories."
FORCE
)
-
+ENDIF(NOT CMAKE_INSTALL_PREFIX)
diff --git a/avida-core/CMakeLists.txt b/avida-core/CMakeLists.txt
index d9d063e..30c4f6a 100644
--- a/avida-core/CMakeLists.txt
+++ b/avida-core/CMakeLists.txt
@@ -12,13 +12,14 @@ ENDIF(COMMAND cmake_policy)
# PROJECT_BINARY_DIR, since the project didn't exist yet.
# Default location for installed software/configs/ docs is the build directory.
+IF(NOT CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX
"${PROJECT_BINARY_DIR}"
CACHE PATH
"Install path prefix, prepended onto install directories."
FORCE
)
-
+ENDIF(NOT CMAKE_INSTALL_PREFIX)
# Final software is built directly into the work subdirectory.
SET(EXECUTABLE_OUTPUT_PATH
"${PROJECT_BINARY_DIR}/bin"
diff --git a/libs/tcmalloc-1.4/CMakeLists.txt b/libs/tcmalloc-1.4/CMakeLists.txt
index 59f8f1a..54873b1 100644
--- a/libs/tcmalloc-1.4/CMakeLists.txt
+++ b/libs/tcmalloc-1.4/CMakeLists.txt
@@ -3,13 +3,14 @@ PROJECT(TCMALLOC CXX)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
# Default location for installed software/configs/ docs is the build directory.
+IF(NOT CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX
"${PROJECT_BINARY_DIR}"
CACHE PATH
"Install path prefix, prepended onto install directories."
FORCE
)
-
+ENDIF(NOT CMAKE_INSTALL_PREFIX)
# Final software is built directly into the work subdirectory.
SET(EXECUTABLE_OUTPUT_PATH
"${PROJECT_BINARY_DIR}/bin"

View file

@ -3,5 +3,5 @@ maintainers:
email: starsareintherose@outlook.com
build_prefix: extra-x86_64
update_on:
- source: cmd
cmd: curl -sS "https://sourceforge.net/projects/avida/rss?path=/avida-stable" | grep '<link>' | grep 'src.zip' | sed 's/-/ /g' | awk '{print $3}' | head -n 1
- source: github
- github: devosoft/avida