summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fd93b99cf6bd43ebbec50ecc74f9c31341a46a63 (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
# Maintainer: Daniel Bershatsky <bepshatsky@yandex.ru>

pkgname='python-jax'
pkgver=0.9.0
pkgrel=1
pkgdesc='Composable transformations of Python+NumPy programs'
arch=('any')
url='https://github.com/jax-ml/jax/'
license=('Apache-2.0')
groups=('jax')
depends=(
    'python-jaxlib>=0.9.0'
    'python-ml-dtypes'
    'python-numpy'
    'python-opt_einsum'
    'python-scipy'
)
optdepends=(
    'python-protobuf: Australis'
    'python-requests: Distributed computations'
    'python-kubernetes: Distributed support in k8s clusters'
)
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
source=("jax-${pkgver}.tar.gz::$url/archive/refs/tags/jax-v${pkgver}.tar.gz"
        'python-jax.diff')
sha256sums=('8525c72ac7ea01851297df5b25ca4622c65299c265c87dfe78420bb29e7b1bb3'
            'SKIP')

prepare() {
    cd jax-jax-v$pkgver
    patch -p 1 -i ../python-jax.diff
}

build() {
    JAX_RELEASE=$pkgver python -m build -nw jax-jax-v$pkgver
}

package() {
    cd jax-jax-v$pkgver
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    python -m installer --compile-bytecode=1 --destdir=$pkgdir \
        dist/jax-$pkgver-*.whl
}