summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 219e859867cfe68490b4670955945d49a714037b (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
# Maintainer: Lumaku <lumaku@mailbox.org>
pkgname=python-ctc-segmentation-git
pkgver=1.7.4
pkgrel=1
pkgdesc='Determine and align utterance segments within audio files using CTC'
arch=('any')
url='https://github.com/lumaku/ctc-segmentation'
license=('Apache License 2.0')
depends=('python>=3.7' 'python-numpy' 'cython')
optdepends=('sox: listen to audio segments')
makedepends=('git' 'cython' 'python-setuptools')
provides=('python-ctc-segmentation')
conflicts=("python-ctc-segmentation")
source=(
    "${pkgname}::git+${url}")
md5sums=(
    'SKIP')


pkgver() {
    cd "${pkgname}"
    printf "%s" "$(python setup.py --version)"
}


build() {
    cd "${pkgname}"
    cythonize -3 ctc_segmentation/ctc_segmentation_dyn.pyx 2>&1 > /dev/null # discarding the ouptut prevents any stdout leaking to pkgver()
    python setup.py build 2>&1
    # echo " --> Warnings of a deprected numpy API can be safely ignored."
}


package() {
    cd "${pkgname}"
    export PYTHONHASHSEED=0
    python setup.py install --root="$pkgdir" --optimize=1 --skip-build
}


check() {
    cd "${pkgname}"
    python -c "import tests.test_ctc_segmentation as test; test.test_ctc_segmentation()"
	python -c "import tests.test_ctc_segmentation as test; test.test_determine_utterance_segments()"
	python -c "import tests.test_ctc_segmentation as test; test.test_prepare_text()"
}