summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b5c691b36c3a8fe3f6656135d5a1a93e62f92c28 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Maintainer: envolution
# Contributor: Eric Berquist <eric dot berquist at gmail dot com>
# Contributor: Antonio Rojas <arojas@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Damir Perisa <damir.perisa@bluewin.ch>

pkgbase=openbabel-git
pkgname=(openbabel-git python-openbabel-git)
_pkgname=openbabel
pkgver=3.1.1+r6091+g7acf50c9d
pkgrel=1
pkgdesc='A library designed to interconvert between many file formats used in molecular modeling and computational chemistry'
arch=(x86_64)
url='https://openbabel.org/wiki/Main_Page'
license=(GPL)
makedepends=(boost
  cmake
  coordgen
  eigen
  maeparser
  python-setuptools
  rapidjson
  swig
  wxwidgets-gtk3)
source=("${_pkgname}::git+https://github.com/openbabel/openbabel.git#branch=master")
sha256sums=('SKIP')

pkgver() {
  cd "${_pkgname}"
  _version=$(git tag --sort=-v:refname --list | head -n1 | tr - . | grep -o '[0-9.]*' | cut -c2-)
  _commits=$(git rev-list --count HEAD)
  _short_commit_hash=$(git rev-parse --short=9 HEAD)
  echo "${_version}+r${_commits}+g${_short_commit_hash}"
}

build() {
  cmake -B build -S $_pkgname \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DRUN_SWIG=ON \
    -DPYTHON_BINDINGS=ON
  cmake --build build

  # To split python bindings
  sed -i '/scripts.cmake_install.cmake/d' build/cmake_install.cmake
}

package_openbabel-git() {
  depends=(cairo
    coordgen
    libxml2)
  provides=(openbabel)
  conflicts=(openbabel)
  optdepends=('wxwidgets-gtk3: GUI interface')

  DESTDIR="$pkgdir" cmake --install build
}

package_python-openbabel-git() {
  depends=(openbabel
    python)
  provides=(python-openbabel)
  conflicts=(python-openbabel)

  DESTDIR="$pkgdir" cmake --install build/scripts
}
# vim:set ts=2 sw=2 et: