summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 481740ba6a9163bbcf49a11ce40cf8317b451116 (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.6
pkgrel=1
pkgdesc='A gradient processing and optimization library for JAX'
arch=('any')
url='https://github.com/google-deepmind/optax'
license=('Apache')
groups=('jax')
depends=('python-absl' 'python-chex' '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=('f9bf8e7c59435ea3b2a932ee4c4d05a50adfe6bf0cd564a5d7cfff298931a84c')

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
}