summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Gathoye2018-12-16 17:36:08 +0100
committerWilliam Gathoye2018-12-16 17:36:08 +0100
commit21e2f46e59716ceafa3a09b518e4479571752942 (patch)
tree8cbeb4a68258533ee56aad942a962359607ee4a2
parent1f5f9caafe8bd05405035aa3c4dc99ef4a4b7ebc (diff)
downloadaur-21e2f46e59716ceafa3a09b518e4479571752942.tar.gz
Make this package build again
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD169
2 files changed, 106 insertions, 79 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b7e4a785c05..5b8bf7fba62 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,18 +1,22 @@
-# Generated by mksrcinfo v8
-# Tue Jul 12 18:00:07 UTC 2016
pkgbase = python-pocketsphinx-git
pkgdesc = Python interface to CMU SphinxBase and PocketSphinx libraries
- pkgver = r68.24ab446
- pkgrel = 1
+ pkgver = r185.769492d
+ pkgrel = 2
url = https://github.com/bambocher/pocketsphinx-python
arch = i686
arch = x86_64
license = BSD
makedepends = git
+ makedepends = python
+ makedepends = python2
depends = python
depends = swig
- source = python-pocketsphinx::git+https://github.com/cmusphinx/pocketsphinx-python.git
- sha256sums = SKIP
+ source = python-pocketsphinx::git+https://github.com/bambocher/pocketsphinx-python.git
+ source = pocketsphinx::git+https://github.com/cmusphinx/pocketsphinx.git
+ source = sphinxbase::git+https://github.com/cmusphinx/sphinxbase.git
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
pkgname = python-pocketsphinx-git
diff --git a/PKGBUILD b/PKGBUILD
index d3302f51e16..50b2d79f46a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,110 +1,133 @@
-# Maintainer: Jameson Pugh <imntreal@gmail.com>
+# Maintainer: William Gathoye <william + aur at gathoye dot be>
+# Contributor: Jameson Pugh <imntreal at gmail dot com>
pkgname=python-pocketsphinx-git
pkgbase=python-pocketsphinx-git
pkgname=('python-pocketsphinx-git' 'python2-pocketsphinx-git' 'sphinxbase-git' 'pocketsphinx-git')
-pkgver=r68.24ab446
-pkgrel=1
+pkgver=r185.769492d
+pkgrel=2
pkgdesc='Python interface to CMU SphinxBase and PocketSphinx libraries'
arch=('i686' 'x86_64')
url='https://github.com/bambocher/pocketsphinx-python'
license=('BSD')
depends=('python' 'swig')
-makedepends=('git')
-source=('python-pocketsphinx::git+https://github.com/cmusphinx/pocketsphinx-python.git')
-sha256sums=('SKIP')
+makedepends=('git' 'python' 'python2')
+# The Python bindings to pocketsphinx are made by bambocher. Dependencies are
+# stored as git submodules and are maintained by the CMU Sphinx project.
+source=(
+ 'python-pocketsphinx::git+https://github.com/bambocher/pocketsphinx-python.git'
+ 'pocketsphinx::git+https://github.com/cmusphinx/pocketsphinx.git'
+ 'sphinxbase::git+https://github.com/cmusphinx/sphinxbase.git'
+)
+sha512sums=('SKIP' 'SKIP' 'SKIP')
_gitname='python-pocketsphinx'
pkgver() {
- cd "${_gitname}"
- printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
+ cd "${_gitname}"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}
prepare() {
- cd "${srcdir}/${_gitname}"
-
- # Should I do a status before init?
- git submodule init
- git submodule update
-
- cd "${srcdir}"
- cp -rf "${_gitname}" python2-pocketsphinx-git
+ cd "${srcdir}/${_gitname}"
+
+ git submodule init
+ git config submodule.deps/pocketsphinx.url ${srcdir}/pocketsphinx
+ git config submodule.deps/sphinxbase.url ${srcdir}/sphinxbase
+ git submodule update
+
+ # We want a python2 package as well. Let's copy the sources.
+ cd "${srcdir}"
+ cp -rf "${_gitname}" python2-pocketsphinx-git
}
build() {
- cd "${srcdir}/${_gitname}/sphinxbase"
- ./autogen.sh --prefix=/usr
- make
+ cd "${srcdir}/${_gitname}/deps/sphinxbase"
+ ./autogen.sh --prefix=/usr
+ make
+
+ cd "${srcdir}/${_gitname}/deps/pocketsphinx"
+ ./autogen.sh --prefix=/usr
+ make
- cd "${srcdir}/${_gitname}/pocketsphinx"
- ./autogen.sh --prefix=/usr
- make
+ cd "${srcdir}/${_gitname}"
+ python setup.py build
- cd "${srcdir}/${_gitname}"
- python setup.py build
+ export PYTHON=/usr/bin/python2
- export PYTHON=/usr/bin/python2
-
- cd "${srcdir}/python2-pocketsphinx-git/sphinxbase"
- ./autogen.sh --prefix=/usr --libdir=/garbage --bindir=/garbage --includedir=/garbage --datarootdir=/garbage
- make
+ cd "${srcdir}/python2-pocketsphinx-git/deps/sphinxbase"
+ ./autogen.sh --prefix=/usr --libdir=/garbage --bindir=/garbage --includedir=/garbage --datarootdir=/garbage
+ make
- cd "${srcdir}/python2-pocketsphinx-git/pocketsphinx"
- ./autogen.sh --prefix=/usr --libdir=/garbage --bindir=/garbage --includedir=/garbage --datarootdir=/garbage
- make
+ cd "${srcdir}/python2-pocketsphinx-git/deps/pocketsphinx"
+ ./autogen.sh --prefix=/usr --libdir=/garbage --bindir=/garbage --includedir=/garbage --datarootdir=/garbage
+ make
- cd "${srcdir}/python2-pocketsphinx-git"
- python2 setup.py build
+ cd "${srcdir}/python2-pocketsphinx-git"
+ python2 setup.py build
}
package_sphinxbase-git() {
- provides=('sphinxbase')
- conflicts=('sphinxbase')
-
- cd "${srcdir}/${_gitname}/sphinxbase"
-
- export PYTHON=/usr/bin/python
- make DESTDIR="${pkgdir}/" install
- rm -f "${pkgdir}/usr/lib/python3.5/site-packages/sphinxbase/__init__.py"
- rm -f "${pkgdir}/usr/lib/python3.5/site-packages/sphinxbase/sphinxbase.py"
- rm -rf "${pkgdir}/usr/lib/python3.5/site-packages/sphinxbase/__pycache__"
+ provides=('sphinxbase')
+ conflicts=('sphinxbase')
+
+ cd "${srcdir}/${_gitname}/deps/sphinxbase"
+ export PYTHON=/usr/bin/python
+ make DESTDIR="${pkgdir}/" install
+
+ pythonVersion="$(python -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')"
+ rm -f "${pkgdir}/usr/lib/python${pythonVersion}/site-packages/sphinxbase/__init__.py"
+ rm -f "${pkgdir}/usr/lib/python${pythonVersion}/site-packages/sphinxbase/sphinxbase.py"
+ rm -rf "${pkgdir}/usr/lib/python${pythonVersion}/site-packages/sphinxbase/__pycache__"
}
package_pocketsphinx-git() {
- provides=('pocketsphinx')
- conflicts=('procketsphinx')
- depends=('sphinxbase')
-
- cd "${srcdir}/${_gitname}/pocketsphinx"
-
- export PYTHON=/usr/bin/python
- make DESTDIR="${pkgdir}/" install
- rm -f "${pkgdir}/usr/lib/python3.5/site-packages/pocketsphinx/__init__.py"
- rm -f "${pkgdir}/usr/lib/python3.5/site-packages/pocketsphinx/pocketsphinx.py"
- rm -rf "${pkgdir}/usr/lib/python3.5/site-packages/pocketsphinx/__pycache__"
+ provides=('pocketsphinx')
+ conflicts=('procketsphinx')
+ depends=('sphinxbase')
+
+ # Pocketsphinx needs libpocketsphinx which is located in the other package
+ # (sphinxbase). Copy the libs temporarily just to allow linking. Then
+ # remove them.
+ mkdir -p "${pkgdir}/usr/lib"
+ cd "${pkgdir}/../sphinxbase-git"
+ files=""
+ for i in usr/lib/*.so*; do
+ files+="$i "
+ cp "$i" "${pkgdir}/usr/lib"
+ done
+
+ cd "${srcdir}/${_gitname}/deps/pocketsphinx"
+ export PYTHON=/usr/bin/python
+ make DESTDIR="${pkgdir}/" install
+
+ for i in $files; do
+ rm "${pkgdir}/$i"
+ done
+ pythonVersion="$(python -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')"
+ rm -rf "${pkgdir}/usr/lib/python${pythonVersion}/site-packages/sphinxbase"
+ rm -f "${pkgdir}/usr/lib/python${pythonVersion}/site-packages/pocketsphinx/__init__.py"
+ rm -f "${pkgdir}/usr/lib/python${pythonVersion}/site-packages/pocketsphinx/pocketsphinx.py"
+ rm -rf "${pkgdir}/usr/lib/python${pythonVersion}/site-packages/pocketsphinx/__pycache__"
}
package_python-pocketsphinx-git() {
- cd "${srcdir}/${_gitname}"
+ cd "${srcdir}/${_gitname}"
- export PYTHON=/usr/bin/python
- python setup.py install --root="${pkgdir}/" --optimize=1
+ export PYTHON=/usr/bin/python
+ python setup.py install --root="${pkgdir}/" --optimize=1
}
package_python2-pocketsphinx-git() {
- export PYTHON=/usr/bin/python2
-
- cd "${srcdir}/python2-pocketsphinx-git/sphinxbase"
- make DESTDIR="${pkgdir}/" install
-
- cd "${srcdir}/python2-pocketsphinx-git/pocketsphinx"
- make DESTDIR="${pkgdir}/" install
-
- cd "${srcdir}/python2-pocketsphinx-git"
- python2 setup.py install --root="${pkgdir}/" --optimize=1
-
- msg "Removing files provided by sphinxbase and pocketsphinx"
- rm -rf "${pkgdir}/garbage"
-}
+ export PYTHON=/usr/bin/python2
+
+ cd "${srcdir}/python2-pocketsphinx-git/deps/sphinxbase"
+ make DESTDIR="${pkgdir}/" install
+
+ cd "${srcdir}/python2-pocketsphinx-git/deps/pocketsphinx"
+ make DESTDIR="${pkgdir}/" install
-# vim: set ts=2 sw=2 ft=sh noet:
+ cd "${srcdir}/python2-pocketsphinx-git"
+ python2 setup.py install --root="${pkgdir}/" --optimize=1
+
+ rm -rf "${pkgdir}/garbage"
+}