updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / pypy-postgresql-hg / PKGBUILD
blobeab1269957f41584912b5820accd22afb7d0b845
1 # Maintainer: Marti Raudsepp <marti@juffo.org>
2 # Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
3 pkgname=pypy-postgresql-hg
4 pkgver=43072
5 pkgrel=1
6 pkgdesc="The PyPy Python JIT, with a built-in PostgreSQL adapter"
7 url="https://bitbucket.org/alex_gaynor/pypy-postgresql"
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="https://bitbucket.org/alex_gaynor"
25 _hgrepo="pypy-postgresql"
27 build() {
28   cd "$srcdir"
29   msg "Connecting to Mercurial server...."
31   if [ -d $_hgrepo ] ; then
32     cd $_hgrepo
33     hg pull -u -r default
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 --withmod-postgresql
55   else
56     msg "Using CPython for translation"
57     python2 translate.py -Ojit targetpypystandalone.py --withmod-postgresql
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.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
68 # vim: ts=2 sw=2 et: