summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Voegele2015-07-07 20:59:17 -0700
committerChad Voegele2015-07-07 20:59:17 -0700
commit4935725850aa1cd8bcce138e01b495a2d70aa885 (patch)
tree221152e75f64c5f8406491f2bbb0fe0e2b39b4c3
downloadaur-4935725850aa1cd8bcce138e01b495a2d70aa885.tar.gz
Initial import
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD32
-rw-r--r--python-spams.patch62
3 files changed, 111 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d5cf15de30b6
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = python-spams-svn
+ pkgdesc = Optimization toolbox for solving various sparse estimation problems with Python interface
+ pkgver = 20141221
+ pkgrel = 1
+ url = http://spams-devel.gforge.inria.fr/
+ arch = i686
+ arch = x86_64
+ license = GPL3
+ makedepends = swig
+ depends = python-scipy
+ source = python-spams.patch
+ source = svn+svn://scm.gforge.inria.fr/svnroot/spams-devel/trunk
+ md5sums = e30d28e67a50f2eeb42f1c9de47706fe
+ md5sums = SKIP
+
+pkgname = python-spams-svn
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..14b622e75861
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,32 @@
+# Maintainer: Pablo Lluch <pablo dot lluch at gmail dot com>
+# Contributor: Chad Voegele
+
+pkgname=python-spams-svn
+pkgver=20141221
+pkgrel=1
+arch=('i686' 'x86_64')
+license=('GPL3')
+pkgdesc="Optimization toolbox for solving various sparse estimation problems
+with Python interface"
+url="http://spams-devel.gforge.inria.fr/"
+depends=('python-scipy')
+makedepends=('swig')
+source=("python-spams.patch"
+ "svn+svn://scm.gforge.inria.fr/svnroot/spams-devel/trunk")
+
+md5sums=('e30d28e67a50f2eeb42f1c9de47706fe'
+ 'SKIP')
+
+build() {
+ cd $srcdir
+ patch -p0 -i python-spams.patch
+ cd $srcdir/trunk/swig/python
+ ./mkpy spams
+ python setup.py.in build
+}
+
+package() {
+ cd $srcdir/trunk/swig/python
+ mkdir -p $pkgdir/usr
+ python setup.py.in install --root=$pkgdir --optimize=1 --prefix=/usr
+}
diff --git a/python-spams.patch b/python-spams.patch
new file mode 100644
index 000000000000..c2d750f13030
--- /dev/null
+++ b/python-spams.patch
@@ -0,0 +1,62 @@
+diff -urBN trunka/swig/python/mkpy trunk/swig/python/mkpy
+--- trunka/swig/python/mkpy 2014-05-26 18:13:21.929540835 -0500
++++ trunk/swig/python/mkpy 2014-05-26 17:38:02.316161854 -0500
+@@ -10,8 +10,8 @@
+ exec /cygdrive/c/MinGW/msys/1.0/bin/bash $0 $optx $*
+ fi
+
+-INC="-I. -Ispams/linalg -Ispams/prox -Ispams/decomp -Ispams/dictLearn -I/usr/include/python2.7/"
+-INC_PYTHON=-I/usr/include/python2.6
++INC="-I. -Ispams/linalg -Ispams/prox -Ispams/decomp -Ispams/dictLearn -I/usr/include/python3.4m/"
++INC_PYTHON=-I/usr/include/python3.4m
+ XCCFLAGS=""
+ XLINKFLAGS=""
+ # on MacOS, use following definition instead.
+@@ -88,7 +88,7 @@
+ err=0
+ for nom in $lst; do
+ [ $flg_swig -ne 0 ] && {
+- swig -c++ -python $OPT_DBG -o ${nom}_wrap.cpp $nom.i
++ swig -c++ -py3 -python $OPT_DBG -o ${nom}_wrap.cpp $nom.i
+ [ $? -ne 0 ] && exit
+ }
+ if [ -e $nom.cpp ]; then
+diff -urBN trunka/swig/python/numpy.i trunk/swig/python/numpy.i
+--- trunka/swig/python/numpy.i 2014-05-26 18:13:22.082874172 -0500
++++ trunk/swig/python/numpy.i 2014-05-26 17:48:09.772841603 -0500
+@@ -107,9 +107,11 @@
+ if (PyDict_Check( py_obj)) return "dict" ;
+ if (PyList_Check( py_obj)) return "list" ;
+ if (PyTuple_Check( py_obj)) return "tuple" ;
++%#if PY_MAJOR_VERSION < 3
+ if (PyFile_Check( py_obj)) return "file" ;
+ if (PyModule_Check( py_obj)) return "module" ;
+ if (PyInstance_Check(py_obj)) return "instance" ;
++%#endif
+
+ return "unkown type";
+ }
+diff -urBN trunka/swig/python/setup.py.in trunk/swig/python/setup.py.in
+--- trunka/swig/python/setup.py.in 2014-05-26 18:13:21.926207502 -0500
++++ trunk/swig/python/setup.py.in 2014-05-26 18:03:55.089528628 -0500
+@@ -7,7 +7,7 @@
+ # includes numpy : package numpy.distutils , numpy.get_include()
+ # python setup.py build --inplace
+ # python setup.py install --prefix=dist,
+-incs = ['.'] + map(lambda x: os.path.join('spams',x),[ 'linalg', 'prox', 'decomp', 'dictLearn']) + [numpy.get_include()] + ['/usr/include/python2.7/']
++incs = ['.'] + [os.path.join('spams',x) for x in [ 'linalg', 'prox', 'decomp', 'dictLearn']] + [numpy.get_include()] + ['/usr/include/python3.4m/']
+
+ osname = distutils.util.get_platform()
+ cc_flags = ['-fPIC', '-fopenmp']
+@@ -78,11 +78,6 @@
+ # scripts = ['test_spams.py'],
+ data_files = [
+ ('test',['test_spams.py', 'test_decomp.py', 'test_dictLearn.py', 'test_linalg.py', 'test_prox.py', 'test_utils.py']),
+- ('doc',['doc_spams.pdf', 'python-interface.pdf']),
+- ('doc/sphinx/_sources',mkhtml('_sources')),
+- ('doc/sphinx/_static',mkhtml('_static')),
+- ('doc/sphinx',mkhtml()),
+- ('doc/html',mkhtml(base = 'html')),
+ ('extdata',['boat.png', 'lena.png'])
+ ],
+ )