summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d392363ff646fc966c91a4605cbc621a06a0c01a (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
# Arch User repository PKGBUILD file
# Builds the pyshtools library (split file)
# Maintainer: Roelof Rietbroek <roelof@wobbly.earth>
pkgbase=python-shtools
pkgname=(shtools python-shtools)
pkgver=4.13.1
pkgrel=0
pkgdesc="SHTOOLS: Tools for working with spherical harmonics"
arch=('any')
url="https://shtools.github.io/SHTOOLS/"
license=('BSD 3-clause')
depends=("fftw" "blas" "lapack")
makedepends=("gcc-fortran" "meson")
source=("https://github.com/SHTOOLS/SHTOOLS/archive/v$pkgver.tar.gz" )
sha256sums=('d5890049fb915604f25576cbbb9f18980a3fc88d28fe380809e3c3497448dacb')


prepare(){
   cd ${srcdir}/SHTOOLS-${pkgver}/
   #i We need to explicitly add the version to pyproject.toml because we're not working from the git tree
   sed -i -e "/\[project\]/a version = \"${pkgver}\"" -e "/^dynamic/,+3d" pyproject.toml
   #create a temporary pip environment for building the package
   cd ${_startdir}
}


package_python-shtools() {
   provides=(python-shtools)
   pkgdesc="Python interface for SHTOOLS (pyshtools)"
   depends+=( "python-numpy" "python-astropy" "python-pooch" "python-xarray" )
   cd ${srcdir}/SHTOOLS-${pkgver}/
   #create a temporary pip enviroment for building the python package
   python -m venv pyshtmp
   pyshtmp/bin/pip install --root "${pkgdir}" --no-deps --prefix=usr . 
   cd ${_startdir}
}


package_shtools(){
   provides=(shtools)
   pkgdesc="Fortran interface for SHTOOLS "
   cd ${srcdir}/SHTOOLS-${pkgver}/
   export MAKEFLAGS="-j1"
   make fortran fortran-mp
   make DESTDIR="$pkgdir/" PREFIX=usr/ install
   install -Dm 644 LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
   cd ${_startdir}
}