summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorOtakar Jašek2019-03-15 11:57:25 +0100
committerOtakar Jašek2019-03-15 11:57:25 +0100
commitdd55b6a146cdcd345240181ca1502c55567a7793 (patch)
tree2b3438506d600e471c75f6877ed9ca7aebe8b4ad
parent87ddb148eadb6ae987b6f69e526548181382b6bb (diff)
downloadaur-dd55b6a146cdcd345240181ca1502c55567a7793.tar.gz
Redone packaging structure
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD52
2 files changed, 32 insertions, 31 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5a20d8fe2a99..49e7affde187 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -6,6 +6,13 @@ pkgbase = faiss-cuda-git
arch = i686
arch = x86_64
license = BSD
+ makedepends = python
+ makedepends = python2
+ makedepends = python-numpy
+ makedepends = python2-numpy
+ makedepends = swig
+ makedepends = python-setuptools
+ makedepends = python2-setuptools
depends = blas
depends = lapack
depends = cuda
@@ -18,17 +25,13 @@ pkgname = faiss-cuda-git
pkgname = python-faiss-cuda-git
depends = python
- depends = python-setuptools
depends = python-numpy
- depends = swig
provides = python-faiss
conflicts = python-faiss
pkgname = python2-faiss-cuda-git
depends = python2
- depends = python2-setuptools
depends = python2-numpy
- depends = swig
provides = python2-faiss
conflicts = python2-faiss
diff --git a/PKGBUILD b/PKGBUILD
index f82aa8787f7b..c7809f7f2110 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -14,6 +14,8 @@ pkgrel=1
source=(${_pkgname}::git+https://github.com/facebookresearch/faiss.git)
sha256sums=('SKIP')
depends=('blas' 'lapack' 'cuda')
+makedepends=('python' 'python2' 'python-numpy' 'python2-numpy' 'swig' 'python-setuptools' 'python2-setuptools')
+
pkgver() {
cd "${_pkgname}"
@@ -24,19 +26,33 @@ pkgver() {
prepare() {
cd "${srcdir}/${_pkgname}"
cp -ar python python2
+ sed -i 's/makefile.inc/makefile2.inc/g' python2/Makefile
}
build() {
cd "${srcdir}/${_pkgname}"
- ./configure --prefix=/usr --with-cuda=/opt/cuda
+ ./configure --prefix=/usr --with-cuda=/opt/cuda --with-python=python2
if ! [ -z "$_GPU_TARGET" ]
then
sed -i "s/compute_[0-9][0-9]/compute_${_GPU_TARGET}/g" makefile.inc
sed -i '$!N; /^\(.*\)\n\1$/!P; D' makefile.inc
fi
- make
- make -C gpu
+ mv makefile.inc makefile2.inc
+ ./configure --prefix=/usr --with-cuda=/opt/cuda --with-python=python
+ if ! [ -z "$_GPU_TARGET" ]
+ then
+ sed -i "s/compute_[0-9][0-9]/compute_${_GPU_TARGET}/g" makefile.inc
+ sed -i '$!N; /^\(.*\)\n\1$/!P; D' makefile.inc
+ fi
+ make # build faiss
+ make -C gpu # build gpu part
+ make -C python cpu # build cpu python
+ make -C python gpu # build gpu python
+ make -C python build # build python package
+ make -C python2 cpu # build cpu python2
+ make -C python2 gpu # build gpu python2
+ make -C python2 build # build python2 package
}
package_faiss-cuda-git() {
@@ -50,35 +66,17 @@ package_faiss-cuda-git() {
package_python-faiss-cuda-git() {
provides=('python-faiss')
conflicts=('python-faiss')
- depends=('python' 'python-setuptools' 'python-numpy' 'swig')
+ depends=('python' 'python-numpy')
- cd "${srcdir}/${_pkgname}"
- ./configure --prefix=/usr --with-python=python --with-cuda=/opt/cuda
- if ! [ -z "$_GPU_TARGET" ]
- then
- sed -i "s/compute_[0-9][0-9]/compute_${_GPU_TARGET}/g" makefile.inc
- sed -i '$!N; /^\(.*\)\n\1$/!P; D' makefile.inc
- fi
- cd python
- make cpu
- make gpu
- python setup.py install --root="$pkgdir/" --optimize=1
+ cd "${srcdir}/${_pkgname}/python"
+ python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
}
package_python2-faiss-cuda-git() {
provides=('python2-faiss')
conflicts=('python2-faiss')
- depends=('python2' 'python2-setuptools' 'python2-numpy' 'swig')
+ depends=('python2' 'python2-numpy')
- cd "${srcdir}/${_pkgname}"
- ./configure --prefix=/usr --with-python=python2 --with-cuda=/opt/cuda
- if ! [ -z "$_GPU_TARGET" ]
- then
- sed -i "s/compute_[0-9][0-9]/compute_${_GPU_TARGET}/g" makefile.inc
- sed -i '$!N; /^\(.*\)\n\1$/!P; D' makefile.inc
- fi
- cd python2
- make cpu
- make gpu
- python2 setup.py install --root="$pkgdir/" --optimize=1
+ cd "${srcdir}/${_pkgname}/python2"
+ python2 setup.py install --root="$pkgdir/" --optimize=1 --skip-build
}