1 # Maintainer: Marti Raudsepp <marti@juffo.org>
2 # Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
3 pkgname=pypy-postgresql-hg
6 pkgdesc="The PyPy Python JIT, with a built-in PostgreSQL adapter"
7 url="https://bitbucket.org/alex_gaynor/pypy-postgresql"
9 depends=('python2' 'libffi')
10 optdepends=('openssl: openssl module'
11 'expat: pyexpat module'
12 'ncurses: ncurses module'
15 'pypy: faster build with PyPy itself')
16 makedepends=('mercurial' 'subversion')
24 _hgroot="https://bitbucket.org/alex_gaynor"
25 _hgrepo="pypy-postgresql"
29 msg "Connecting to Mercurial server...."
31 if [ -d $_hgrepo ] ; then
34 msg "The local files are updated."
36 hg clone $_hgroot $_hgrepo
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 --withmod-postgresql
56 msg "Using CPython for translation"
57 python2 translate.py -Ojit targetpypystandalone.py --withmod-postgresql
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.5.2 $pkgdir/opt/pypy/lib-python/
63 cp -r $srcdir/$_hgrepo-build/lib-python/modified-2.5.2 $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