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

pkgname='python-optax'
_pkgname=${pkgname#python-}
pkgver=0.2.7
pkgrel=1
pkgdesc='A gradient processing and optimization library for JAX'
arch=('any')
url='https://github.com/google-deepmind/optax'
license=('Apache-2.0')
groups=('jax')
depends=('python-absl' 'python-jax' 'python-numpy')
makedepends=('python-build' 'python-installer' 'python-flit-core' 'python-wheel')
optdepends=('python-dm-haiku: Deep learning framework from DeepMind'
            'python-flax: Deep learning framework from Google')
source=("${_pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('7f40861598c3794be052908c15f8f9afc71c37a2ba2f411e1c3596ce66975fda')

prepare() {
    cd "$_pkgname-$pkgver"
    sed -i "s/^__version__.*/__version__ = '$pkgver'/" optax/__init__.py
}

build() {
    python -m build -n -w "$_pkgname-$pkgver"
}

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