summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e04dfccc9a7409e9619fdbbac0c807f386dd53fd (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
# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.

# Maintainer: Your Name <youremail@domain.com>
_name=xhistogram
pkgname=python-${_name}
pkgver=0.3.2
pkgrel=1
epoch=
pkgdesc="fast, flexible, label-aware histograms for numpy and xarray"
arch=("any")
url="https://github.com/xgcm/xhistogram"
license=('Apache-2.0')
groups=()
depends=("python" "python-numpy" "python-xarray" "python-dask")
makedepends=(
    "python-build" "python-installer"  "python-wheel"
    # "python-setuptools" "python-setuptools-scm"
)
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=(
    "${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz"
    "versioneer.patch"
    "fix_prod_arg.patch"
    "fix_reshape.patch"
)
noextract=()
sha256sums=(
    'f46ea6af5ef3fbafb999f5ca3a99332f8296cb8f1f09dfffa2c599bfcaf7c5d2'
    '7e7da17ed7a0a2d0e25180600bdd5e4e0da191d72bb4af6c69702e5179c39adb'
    'f841ab6b0d148ea0f6e7b1eaef1cd8d4665992f39155c7d99a6d90e0de9dbd1c'
    '799a4a5e2de2fd8302e120ffd2bc1e80432e50fcb39b5029e904705f711ea619'
)
validpgpkeys=()

prepare() {
	cd "${srcdir}/${_name}-${pkgver}"
    # scince python 3.12:
    # - class SafeConfigParser was instead by ConfigParser
    # - method readfd was instead by read_file
    patch -Np1 -i ../versioneer.patch
    patch -Np1 -i ../fix_prod_arg.patch
    patch -Np1 -i ../fix_reshape.patch
}

build() {
	cd "${srcdir}/${_name}-${pkgver}"
    python -m build --wheel --no-isolation
    # python setup.py build
}

check() {
	cd "${srcdir}/${_name}-${pkgver}"
    pytest
}

package() {
	cd "${srcdir}/${_name}-${pkgver}"
    python -m installer --destdir="$pkgdir" dist/*.whl
    # python setup.py install --root="$pkgdir" --optimize=1
}