summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5d409cfd07f8fc5a73546ca037caa29a96a5e667 (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
55
56
pkgbase=('python-sciscipy')
pkgname=('python-sciscipy' 'python2-sciscipy')
pkgver=1.0.1
pkgrel=1
pkgdesc="A Scilab API for Python"
arch=('any')
url="http://forge.scilab.org/index.php/p/sciscipy/"
license=('GPL')
source=("http://forge.scilab.org/index.php/p/sciscipy/downloads/get/sciscipy-${pkgver}.tar.gz"
        "fixlib.diff")
md5sums=('80fa3e4dbd85445c2535e173c24ffc77'
         'SKIP')
makedepends=('python-setuptools' 'python2-setuptools' 'scilab')

prepare() {
  cd "$srcdir/sciscipy-$pkgver"
  patch -p1 -i "$srcdir/fixlib.diff"
  /usr/lib/python2.7/Tools/scripts/reindent.py setup.py
  2to3 -w setup.py scilab.py

  cp -r "$srcdir/sciscipy-$pkgver" "$srcdir/sciscipy-$pkgver-py2"

  sed -i "s|PyString_|PyBytes_|g" sciconv_write.c
  sed -i "s|PyInt_|PyLong_|g" sciconv_write.c
}

build() {
  cd "$srcdir/sciscipy-$pkgver-py2"
  python2 setup.py build
  cd "$srcdir/sciscipy-$pkgver"
  python setup.py build
}

check () {
  cd "$srcdir/sciscipy-$pkgver"
#   python2 setup.py test
}

package_python2-sciscipy() {
  depends=('python2-numpy' 'scilab')
  conflicts=('python-sciscipy')

  cd "$srcdir/sciscipy-$pkgver-py2"
  python2 ./setup.py install --prefix=/usr --root="$pkgdir"
}

package_python-sciscipy() {
  depends=('python-numpy' 'scilab')
  conflicts=('python2-sciscipy')

  cd "$srcdir/sciscipy-$pkgver"
  python ./setup.py install --prefix=/usr --root="$pkgdir"
}

# test:
# SCI=/usr/share/scilab LD_LIBRARY_PATH=/usr/lib/jvm/java-7-openjdk/jre/lib/amd64/server/:/usr/lib/scilab/:/usr/lib/jvm/java-7-openjdk/jre/lib/amd64/ python2 src/sciscipy-1.0.1/tests/test_call.py