summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1fc0ce70b31d4c256fe3992a3c3fd7d0d1fcdc83 (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
# Maintainer: Stephen Zhang <zsrkmyn at gmail dot com>
_pkgname=line_profiler
pkgbase=python-line_profiler
pkgname=(python{,2}-line_profiler)
pkgver=2.1
pkgrel=3
pkgdesc="line-by-line profiler for python"
arch=('i686' 'x86_64')
url="https://github.com/rkern/line_profiler"
license=('BSD')
makedepends=('python' 'python2' 'cython' 'cython2' 'ipython' 'ipython2')
source=("https://github.com/rkern/line_profiler/archive/${pkgver}.tar.gz")
md5sums=('bd1cb2ba21af02339beab7ddc3a69c66')

prepare() {
  cd "$srcdir"
  cp -r "$_pkgname-$pkgver"{,-py2}
}

build() {
  msg "building Python2..."
  cd "$srcdir/$_pkgname-$pkgver-py2"
  LANG=en_US.UTF-8 python2 setup.py build

  msg "building Python3..."
  cd "$srcdir/$_pkgname-$pkgver"
  LANG=en_US.UTF-8 python3 setup.py build
}

package_python2-line_profiler() {
  depends=('python2' 'ipython2')
  cd "$srcdir/$_pkgname-$pkgver-py2"
  LANG=en_US.UTF-8 python2 setup.py install --root=$pkgdir --optimize=1 --skip-build
  mv -v "$pkgdir/usr/bin/kernprof"{,2}
}

package_python-line_profiler() {
  depends=('python' 'ipython')
  cd "$srcdir/$_pkgname-$pkgver"
  LANG=en_US.UTF-8 python3 setup.py install --root=$pkgdir --optimize=1 --skip-build
}

# vim:set sw=2 et: