summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 324928a4387a3868f6430243f7f09705cadd2d6e (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
67
68
69
70
71
# Maintainer: Eric Berquist <eric dot berquist at gmail dot com>

_name="cclib"
pkgname="python-${_name}-git"
pkgver=1.8.1.r4748.6832e465
pkgrel=1
pkgdesc="A library for parsing and interpreting the results of computational chemistry packages. (git version)"
arch=("any")
url="http://cclib.github.io"
license=("BSD-3-Clause")
makedepends=("git"
             "python-build"
             "python-installer"
             "python-setuptools"
             "python-wheel")
checkdepends=("psi4"
              "python-biopython"
              "python-iodata"
              "python-pyquante2"
              "python-pyscf"
              "python-pytest")
depends=("python-packaging" "python-periodictable" "python-scipy")
optdepends=('psi4: for Psi4 bridge'
            'python-ase: for ASE bridge'
            'python-biopython: for generating `BioPython.Atom`s of parsed results'
            'python-iodata: for reading proatom densities from horton'
            'python-openbabel: for generating `OBMol`s of results'
            'python-pandas: for generating DataFrames of parsed results'
            'python-pyquante2: for computing grid-based quantities with cube output'
            'python-pyscf: for PySCF bridge')
provides=("python-${_name}")
conflicts=("python-${_name}")
source=("git+https://github.com/${_name}/${_name}")
sha256sums=('SKIP')

prepare() {
  git -C "${srcdir}/${_name}" clean -dfx
}

build() {
  cd "${srcdir}/${_name}"
  python -m build --wheel --no-isolation
}

package() {
  cd "${srcdir}/${_name}"
  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -D -m644 LICENSE "${pkgdir}"/usr/share/licenses/"${pkgname}"/LICENSE
}

# Requires many heavy dependencies
# check() {
#   cd "${srcdir}/${_name}"
#   python -m pytest
# }

pkgver() {
  cd "${srcdir}/${_name}"
  _parent_ver=$(git describe --tags --abbrev=0 | tr -d v)
  _parent_major_ver=$(echo "${_parent_ver}" | cut -d "." -f 1)
  _parent_minor_ver=$(echo "${_parent_ver}" | cut -d "." -f 2)
  _parent_patch_ver=$(echo "${_parent_ver}" | cut -d "." -f 3)
  # Don't use the patch version of the parent tag.
  _git_patch_ver=$((_parent_patch_ver+1))
  printf "%s.%s.%s.r%s.%s" \
         "${_parent_major_ver}" \
         "${_parent_minor_ver}" \
         "${_git_patch_ver}" \
         "$(git rev-list --count HEAD)" \
         "$(git rev-parse --short HEAD)"
}