updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / pypy-hg / PKGBUILD
blob448d5df207a84fc0e33856125f6b2caf9d58f664
1 # Maintainer: Marti Raudsepp <marti@juffo.org>
2 # Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
3 pkgname=pypy-hg
4 pkgver=45174
5 pkgrel=1
6 pkgdesc="A Python implementation written in Python, JIT enabled"
7 url="http://codespeak.net/pypy/"
8 arch=('i686' 'x86_64')
9 depends=('python2' 'libffi')
10 optdepends=('openssl: openssl module'
11             'expat: pyexpat module'
12             'ncurses: ncurses module'
13             'zlib: zlib module'
14             'bzip2: bz2 module'
15             'pypy: faster build with PyPy itself')
16 makedepends=('mercurial' 'subversion')
17 conflicts=('pypy')
18 provides=('pypy')
19 license=('MIT')
20 #install=('')
21 source=()
22 md5sums=()
24 _hgroot="http://bitbucket.org/pypy"
25 _hgrepo="pypy"
27 build() {
28   cd "$srcdir"
29   msg "Connecting to Mercurial server...."
31   if [ -d $_hgrepo ] ; then
32     cd $_hgrepo
33     hg pull -u
34     msg "The local files are updated."
35   else
36     hg clone $_hgroot $_hgrepo
37   fi
39   msg "Mercurial checkout done or server timeout"
40   msg "Starting make..."
42   rm -rf "$srcdir/$_hgrepo-build"
43   # Copy whole repo: pypy wants to include the hg revision in its version
44   #hg -R "$srcdir/$_hgrepo" archive -r default "$srcdir/$_hgrepo-build"
45   cp -R $srcdir/$_hgrepo $srcdir/$_hgrepo-build
46   cd "$srcdir/$_hgrepo-build"
48   #cf="`pkg-config --cflags libffi`" || return 1
49   #sed "s|cflags = \[|cflags = \[\'${cf/  /}\', |g" -i pypy/translator/platform/linux.py || return 1
51   cd pypy/translator/goal
52   if which pypy >/dev/null 2>/dev/null; then
53     msg "Using PyPy for translation"
54     pypy translate.py -Ojit targetpypystandalone.py
55   else
56     msg "Using CPython for translation"
57     python2 translate.py -Ojit targetpypystandalone.py
58   fi
60   install -Dm755 pypy-c $pkgdir/opt/pypy/pypy-c
61   mkdir -p $pkgdir/opt/pypy/{lib-python,pypy}
62   cp -r $srcdir/$_hgrepo-build/lib-python/2.7 $pkgdir/opt/pypy/lib-python/
63   cp -r $srcdir/$_hgrepo-build/lib-python/modified-2.7 $pkgdir/opt/pypy/lib-python/
64   cp -r $srcdir/$_hgrepo-build/lib_pypy $pkgdir/opt/pypy/
65   mkdir -p $pkgdir/usr/bin/
66   ln -s /opt/pypy/pypy-c $pkgdir/usr/bin/pypy
68 # vim: ts=2 sw=2 et: