summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 787db5a7874a8c8c6ce1160f73347a40637db905 (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.5.2.r34
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" "${pkgname}")
source=(
    "${pkgname}::git+${url}")
md5sums=(
    'SKIP')


pkgver() {
    cd "${pkgname}"
    printf "%s.r%s" "$(python setup.py --version)" "$(git rev-list --count HEAD)"
}


build() {
    cd "${pkgname}"
    cythonize -3 ctc_segmentation/ctc_segmentation_dyn.pyx
    python setup.py build
    # 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()"
}