summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b5b982ae41a24c6f90182007adee34ae9def0baf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Maintainer of this PKBGUILD file: Martino Pilia <martino.pilia@gmail.com>
_name=pyca
pkgname=python2-pyca-git
pkgver=0.01.r434.gf31ab43
pkgrel=2
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"

    mkdir build || :
    cd build

	# temporary bugfix, a PR has already been submitted upstream
	sed -i 's/<< std::cout <</<</g' "$srcdir/$_name/Code/Cxx/src/alg/MultiscaleManager.cxx"

    cmake -D CMAKE_BUILD_TYPE=Release \
        -D PYTHON_EXECUTABLE=/usr/bin/python2 \
        -D PYTHON_INCLUDE_DIR=/usr/include/python2.7 \
        -D BUILD_SHARED_LIBS=ON \
        -D USE_ITK=OFF \
        -D USE_CUDA=OFF \
        -D PYTHON_LIBRARY=/usr/lib/libpython2.7.so \
        -D PYTHON_INSTALL_DIR=/usr/lib/python2.7/site-packages \
        -D CUDA_NVCC_FLAGS_RELEASE=--pre-include\ $srcdir/$_gitname/preinc.h \
		..
}

build() {
    cd "$srcdir/$_name/build"
    make
}

package() {
    cd "$srcdir/$_name/build"
    make install DESTDIR="$pkgdir"

	install -D -m644 $srcdir/$_name/Copyright.txt \
                     "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}