summaryrefslogtreecommitdiff
path: root/community/python-openbabel/PKGBUILD
blob: 7f86ce23294c03156e1d7a664735e16c9b9f79b6 (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
# $Id: PKGBUILD 57093 2011-10-21 05:48:48Z kchen $
# Maintainer: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Michal Bozon <bozonm@vscht.cz>

pkgname=python-openbabel
pkgver=2.3.1
pkgrel=1
pkgdesc="Python bindings of openbabel library"
arch=('i686' 'x86_64' 'mips64el')
url="http://openbabel.org/wiki/Python"
license=('GPL')
depends=('python' 'gcc-libs' "openbabel=${pkgver}" 'eigen')
makedepends=('swig' 'cmake')
options=('!libtool')
source=(http://downloads.sourceforge.net/openbabel/openbabel-$pkgver.tar.gz)
md5sums=('1f029b0add12a3b55582dc2c832b04f8')

build() {
  cd "${srcdir}/openbabel-$pkgver"
  
  # Create babelconfig.h
  cmake .

  # Regenerate interface with the patched swig 2.0.2
  cd scripts
  swig -I../include/ -python -py3 -c++  openbabel-python.i
  mv openbabel-python_wrap.cxx python/openbabel-python.cpp
  mv openbabel.py python/

  cd python
  sed -i '19i os.path.join("/usr/include/openbabel-2.0"),' setup.py
  sed -i '20i os.path.join("/usr/include/eigen2"),'        setup.py
}

package() {
  cd "${srcdir}/openbabel-$pkgver/scripts/python"
  python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1
}