summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6df692ab7f135e7f48f24a389b0cb982986690fb (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
# Maintainer: dobedobedo <dobe0331 at gmail dot com>
_pkgname='spectral'
pkgname=("python-$_pkgname")
pkgver=r550.1b25497
pkgrel=1
pkgdesc="A Python module for hyperspectral image processing."
arch=('x86_64')
depends=('python'
         'python-numpy'
	    )
makedepends=('git' 
             'python-setuptools'
             'python-pytest')
optdepends=('python-pillow: Required if displaying or saving images'
            'python-wxpython: Required if calling view_cube or view_nd'
            'python-matplotlib: Required if rendering raster displays or spectral plots'
            'ipython: Required for interactive, non-blocking GUI windows'
            'python-opengl: Required if calling view_cube or view_nd'
           )
url='http://www.spectralpython.net/'
license=('MIT')
source=("https://github.com/spectralpython/spectral/archive/refs/tags/$pkgver.tar.gz")
source=("${_pkgname}::git+https://github.com/spectralpython/spectral.git#branch=develop")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd "$srcdir/$_pkgname"
    # Change the call due to API change in Python 3.10
    find -name "*.py*" -exec sed -i 's/collections.Callable/collections.abc.Callable/' '{}' \;
}

build() {
    cd "$srcdir/$_pkgname"
    python setup.py build
}

check(){
    cd "$srcdir/$_pkgname"
    # Download sample dataset
    rm -Rf ./spectral_data
    git clone https://github.com/spectralpython/sample-data.git ./spectral_data
    SPECTRAL_DATA=./spectral_data python -m spectral.tests.run
}

package() {
    cd "$srcdir/$_pkgname"
    python setup.py install --root="$pkgdir" --optimize=1 --skip-build
}