summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8019cbab4de74f4b69de109d951d4c885b89d37a (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Maintainer: Thomas Roos (Roosted7) <mail [at] thomasroos [dot] nl>
# Maintainer: Christian Holme (Nordwin) <hcmh [at] kolabnow [dot] com>

pkgname=bart-git
_pkgname=bart
pkgver=0.8.00.r512.g2d6ec2d3
pkgrel=1
pkgdesc="Berkeley Advanced Reconstruction Toolbox (BART) for Computational Magnetic Resonance Imaging"
arch=('x86_64')
url="https://mrirecon.github.io/bart/"
license=('BSD')
makedepends=('git' 'gcc>=11.2.0')
depends=('gcc-libs' 'blas-openblas' 'fftw' 'libpng')
optdepends=('octave: MATLAB/Octave wrapper'
	    'python: Python wrapper'
	    'python-numpy: Python wrapper'
	    'python-matplotlib: Python scripts')
source=('bart::git+https://github.com/mrirecon/bart.git'
	'Makefile.local')
sha512sums=('SKIP'
            '4ab4bb30e696dd262ecf59a64ec2ae5fa8f4832153816b4966c6af6e33fcf3981a5a4083d963cd3e470cd6000df32bfff4db146e9e34672f94962b5b329f4846')
provides=('bart')
conflicts=('bart')

pkgver() {
    cd "$_pkgname"
    # cutting off 'v' prefix that presents in the git tag
    # but also use the last tag actually describing a version, which is the latest
    # tag starting with v (for now)
    git describe --match v\* --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    cd "$_pkgname"

    # set path for openblas/lapacke/cblas headers
    ln -sf "${srcdir}/Makefile.local"

}

build() {
    cd "$_pkgname"

    make
    make doc/commands.txt
}

check() {
    cd "$_pkgname"

    make utest
    # takes far too long:
#    make test
}

package() {
    cd "$_pkgname"
    make PREFIX="$pkgdir"/usr install
    install commands/* "$pkgdir"/usr/lib/bart/commands/

    # Also install the libs, the viewer needs this and its not done by the Makefile atm
    install -d "$pkgdir"/usr/lib/bart
    install -m644 lib/* "$pkgdir"/usr/lib/bart

    # Also install the headers, the viewer needs this and its not done by the Makefile atm
    install -d "$pkgdir"/usr/include/bart
    cd src
    for file in $(find ./ -type f -name "*.h"); do
        install -D ${file} "$pkgdir"/usr/include/bart/${file}
    done
    cd ..

    install -d "$pkgdir"/usr/share/bart/matlab
    install matlab/* "$pkgdir"/usr/share/bart/matlab

    install -d "$pkgdir"/usr/share/bart/python
    install python/* "$pkgdir"/usr/share/bart/python

    install -d "$pkgdir"/usr/share/bart/scripts
    install scripts/* "$pkgdir"/usr/share/bart

    # Install license, since each BSD license is technically a custom license
    install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}