# Maintainer of this PKBGUILD file: Martino Pilia _name=pyca pkgname=python2-pyca-git pkgver=0.01.r434.gf31ab43 pkgrel=11 pkgdesc="Python for Computational Anatomy" arch=('x86_64') url="http://bitbucket.org/scicompanat/pyca" license=('BSD') depends=('python2-numpy') makedepends=('cmake' 'git' 'python2' 'swig>=3.0.10' 'fftw' 'boost') optdepends=('insight-toolkit: ITK file support' 'cuda: for GPU computing' 'python2-matplotlib: for full functionality in PyCA.Display and reading/writing png images' 'python2-scipy: some additional image/linear algebra functionality') source=('git+https://bitbucket.org/scicompanat/pyca.git') md5sums=('SKIP') pkgver() { cd "$srcdir/$_name" git describe --long --tags | \ sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' } prepare() { cd "$srcdir/$_name" # I think that CUDA architecture is not supported anymore # by the AUR cuda package sed -i 's/"20"/"30"/g' CMakeLists.txt mkdir build || : cd build # temporary bugfix, a PR has already been submitted upstream sed -i 's/<< std::cout </dev/null | grep 'Version'`" ]; then _cc="/opt/cuda/bin/gcc" _use_cuda="ON" else _cc="" _use_cuda="OFF" fi CC="$_cc" cmake \ -DCMAKE_INSTALL_PREFIX:PATH="/usr" \ -DCMAKE_BUILD_TYPE=Release \ -DPYTHON_EXECUTABLE=/usr/bin/python2 \ -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 \ -DBUILD_SHARED_LIBS=ON \ -DUSE_ITK=ON \ -DUSE_CUDA=$_use_cuda \ -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so \ -DPYTHON_INSTALL_DIR=/usr/lib/python2.7/site-packages \ .. # Do not include Python 3 stuff for f in `grep -nr . | grep 'python3\.6' | cut -f1 -d':'` do sed -i 's/[^ ;]\+python3\.[^ ;]\+//g' $f done } build() { cd "$srcdir/$_name/build" make if [ "$_use_cuda" == "ON" ]; then make CUDA_TPL_DEPS # Do not include Python 3 stuff for f in `grep -nr . | grep 'python3\.6' | cut -f1 -d':'` do sed -i 's/[^ ;]\+python3\.[^ ;]\+//g' $f done fi } package() { cd "$srcdir/$_name/build" make install DESTDIR="$pkgdir" install -D -m644 $srcdir/$_name/Copyright.txt \ "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" }