# Maintainer: Sukanka <su975853527 [AT] gmail.com>
pkgname=yade
pkgver=2021.01a
pkgrel=4
pkgdesc="Yade project, free software for particle based simulations"
arch=("x86_64")
url='https://yade-dem.org/doc/index.html'
license=('GPL2')
depends=('ipython' 'python-matplotlib' 'python-pygraphviz' 'python-xlib' 'python-future' 'tk'
'python-mpmath' # RealHP<N>
'mpfrc++'
'vtk'
'libqglviewer'
'cgal'
'python-mpi4py'
'gl2ps' # opt
'coin-or-coinutils'
)
makedepends=('cmake')
provides=('yade')
source=("https://gitlab.com/yade-dev/trunk/-/archive/${pkgver}/trunk-${pkgver}.tar.bz2")
sha512sums=('b6bda1ffb56c6f03838700bca9b7576927497ea1246715d9357ad77ea3fcf62eed987d0aaf409c4bc306c900f778e90a2429515de67e9a98b58ade30dcf4b3e3')
prepare(){
# Follow https://yade-dem.org/doc/installation.html#compilation
_cmakedir=$(ls /usr/share/cmake* | grep cmake | cut -d ':' -f1)
cd "$srcdir"
test -d trunk || mv trunk-${pkgver} trunk
test -d build || mkdir build
# correct cuda and clp path
sed -i 's|/usr/local/cuda/lib64|/opt/cuda/lib64|g' trunk/cMake/FindCuBlas.cmake
sed -i 's|/usr/lib/x86_64-linux-gnu|/usr/lib|g' trunk/cMake/FindCLP.cmake
# fix openmp
for dir in $_cmakedir;
do
sed -i "N;102 a set(CMAKE_MODULE_PATH \$\{CMAKE_MODULE_PATH\} ${dir}/Modules/)" trunk/CMakeLists.txt;
done;
}
build(){
# WARNING: Package contains reference to $srcdir, but all to "$srcdir"/trunk, I think it's safe.
# Anyway, I still want to deal with this, but need help.
cd build
cmake ../trunk \
-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DNOSUFFIX=ON -DPYTHON_VERSION=-1 \
-DENABLE_SPH=ON -DENABLE_PROFILING=ON -DCHOLMOD_GPU=ON -DENABLE_LIQMIGRATION=ON -DENABLE_MASK_ARBITRARY=ON -DENABLE_DEFORM=ON -DVECTORIZE=ON -DENABLE_OAR=ON \
-DENABLE_MPFR=ON -DENABLE_PARTIALSAT=ON\
-DruntimePREFIX=/usr -DCHUNKSIZE=50 -DOpenGL_GL_PREFERENCE=GLVND\
-DENABLE_USEFUL_ERRORS=ON -DENABLE_POTENTIAL_BLOCKS=ON # or build will fail! comment the line above to compile with almost default configuration
make -j17
}
package(){
cd "$srcdir"/build
make install DESTDIR="${pkgdir}"
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}