summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmiel Wiedijk2018-02-23 16:58:58 +0100
committerEmiel Wiedijk2018-02-23 17:41:48 +0100
commit6a9de643e055f90dd8d9b8cf15d66ffe0d562d03 (patch)
treee99c22c405c5913e09653635aadf4f78f08e0a5b
parentc0db8ed95f1989fa6b4a4f1248a8a180b4e7adac (diff)
downloadaur-6a9de643e055f90dd8d9b8cf15d66ffe0d562d03.tar.gz
Build python2 version (credits to NicoHood).
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD49
2 files changed, 44 insertions, 18 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 51645c821c6c..5cd8ee3fec50 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,20 +1,25 @@
pkgbase = python-snowboy-git
pkgdesc = A hotword detection engine - Python bindings
- pkgver = v1.2.0.r134.g7d20d7f
+ pkgver = v1.3.0.r3.g75ef4f5
pkgrel = 1
url = https://snowboy.kitt.ai/
arch = x86_64
license = Apache
makedepends = git
makedepends = python-setuptools
+ makedepends = python2-setuptools
makedepends = swig
- depends = cblas
- depends = lapack
- depends = python-pyaudio
+ makedepends = cblas
provides = python-snowboy
conflicts = python-snowboy
source = git+https://github.com/Kitt-AI/snowboy.git
md5sums = SKIP
pkgname = python-snowboy-git
+ depends = cblas
+ depends = python-pyaudio
+
+pkgname = python2-snowboy-git
+ depends = cblas
+ depends = python2-pyaudio
diff --git a/PKGBUILD b/PKGBUILD
index d30c3a1cdccb..b6396d5d66fd 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,21 +1,19 @@
# Maintainer: aimileus <me at aimileus dot nl>
-pkgname=python-snowboy-git
+pkgname=('python-snowboy-git' 'python2-snowboy-git')
+pkgbase=python-snowboy-git
_pkgname=snowboy
-pkgver=v1.2.0.r134.g7d20d7f
+pkgver=v1.3.0.r3.g75ef4f5
pkgrel=1
pkgdesc="A hotword detection engine - Python bindings"
arch=('x86_64')
url="https://snowboy.kitt.ai/"
license=('Apache')
-depends=(
- 'cblas'
- 'lapack'
- 'python-pyaudio'
-)
makedepends=(
'git'
'python-setuptools'
+ 'python2-setuptools'
'swig'
+ 'cblas'
)
conflicts=('python-snowboy')
provides=('python-snowboy')
@@ -28,17 +26,40 @@ pkgver() {
}
prepare() {
- cd "$_pkgname"
- sed -i "s|-lf77blas -lcblas -llapack -latlas|-lcblas -llapack|g" \
- swig/Python3/Makefile
+ cp -a "${_pkgname}"{,-py2}
+
+ sed -i -e "s|-lf77blas -lcblas -llapack -latlas|-lcblas|g" \
+ -e 's| -shared| -Wl,-O1,--as-needed\0|g' \
+ "${_pkgname}/swig/Python3/Makefile"
+ sed -i -e "s|-lf77blas -lcblas -llapack -latlas|-lcblas|g" \
+ -e 's| -shared| -Wl,-O1,--as-needed\0|g' \
+ "${_pkgname}-py2/swig/Python/Makefile"
}
build() {
- cd "$_pkgname"
+ cd "$srcdir/${_pkgname}"
python setup.py build
+
+ cd "$srcdir/${_pkgname}-py2"
+ python2 setup.py build
}
-package() {
- cd "$_pkgname"
- python setup.py install --root="$pkgdir/" --prefix=/usr
+package_python-snowboy-git() {
+ depends=('cblas' 'python-pyaudio')
+
+ cd "${_pkgname}"
+ python setup.py install \
+ --root="$pkgdir" \
+ --optimize=1 \
+ --skip-build
+}
+
+package_python2-snowboy-git() {
+ depends=('cblas' 'python2-pyaudio')
+
+ cd "$_pkgname-py2"
+ python2 setup.py install \
+ --root="$pkgdir" \
+ --optimize=1 \
+ --skip-build
}