# Maintainer: Sukanka 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 '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}" }