summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f45b855cad7ad5df3d2d9b8486a8ec4f49604a65 (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
# Maintainer: Leo Mao <leomaoyw at gmail dot com>
pkgname=python-torchaudio-git
_pkgname=audio
pkgver=r830.9d50acf3
pkgrel=1
pkgdesc="Data manipulation and transformation for audio signal processing, powered by PyTorch"
arch=('x86_64')
url="https://github.com/pytorch/audio"
license=('BSD')
depends=('python' 'sox' 'python-pytorch')
optdepends=('python-kaldi-io' 'python-soundfile')
makedepends=('git' 'python-setuptools' 'cmake' 'ninja')
provides=('python-torchaudio')
conflicts=('python-torchaudio')
source=("git+$url"
        "git+https://github.com/kaldi-asr/kaldi.git")
sha256sums=('SKIP'
            'SKIP')

pkgver () {
  cd "${_pkgname}"
  (
    set -o pipefail
    git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

prepare() {
  cd "${_pkgname}"
  git config submodule.kaldi.url "$srcdir/kaldi"
  git submodule update third_party/kaldi/submodule
}

build() {
  msg "Building Python 3"
  cd "${srcdir}/${_pkgname}"
  CUDA_HOME=/opt/cuda \
  BUILD_SOX=1 \
  python setup.py build
}

package() {
  cd "${srcdir}/${_pkgname}"
  python setup.py install --root="${pkgdir}"/ --optimize=1 --skip-build
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

# vim:set ts=2 sw=2 et: