summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a0b959dbd0df3ff011da8b8f754a6c4b3d56e9fc (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
50
51
52
53
54
# Maintainer: Marco Pompili <marcs DOT pompili AT gmail DOT com>
# Contributor: Ben Duffield <bavardage AT archlinux.us>

pkgname=pocketsphinx
pkgver=5prealpha
pkgrel=4
pkgdesc='Lightweight speech recognition engine, specifically tuned for handheld and mobile devices, though it works equally well on the desktop.'
arch=('i686' 'x86_64')
url='http://cmusphinx.sourceforge.net'
license=('BSD')
makedepends=('swig')
depends=('sphinxbase=5prealpha' 'python2' 'python' 'gstreamer0.10-base' 'gst-plugins-base-libs')
source=("http://downloads.sourceforge.net/cmusphinx/$pkgname-$pkgver.tar.gz"
        "https://raw.githubusercontent.com/cmusphinx/pocketsphinx/master/LICENSE")
md5sums=('2c4fb3a1318bb2470997ab7eb98ef69a'
         '93bfe6b712fe592d844ef581e1e53d47')
options=('!libtool')

prepare() {
  cp -R "$pkgname-$pkgver" "$pkgname-$pkgver-py2"
  cp -R "$pkgname-$pkgver" "$pkgname-$pkgver-py3"
}

build() {

  msg2 "Building python3 environment"
  cd "$pkgname-$pkgver-py3"
  ./configure --prefix=/usr
  make


  msg2 "Building python2 environment"
	cd "../$pkgname-$pkgver-py2"
	export PYTHON=/usr/bin/python2
  ./configure --prefix=/usr
	make
}

package() {
	cd "$pkgname-$pkgver-py3"

	make DESTDIR="$pkgdir" install

  cd "../$pkgname-$pkgver-py2/swig"
  make DESTDIR="$pkgdir" install

	install -d -m755 "$pkgdir/usr/share/licenses/$pkgname"
	install -D -m644 "${srcdir}/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  libtool --finish "$pkgdir/usr/lib"
  libtool --finish "$pkgdir/usr/lib/gstreamer-1.0"
  libtool --finish "$pkgdir/usr/lib/python2.7/site-packages/pocketsphinx"
  libtool --finish "$pkgdir/usr/lib/python3.5/site-packages/pocketsphinx"
}