summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9f7aa20e67c23db573dd2265dfc1ece6228e4bb3 (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
# Maintainer: sukanka <su975853527 [at] gmail.com>
# Contributor: xantares <xantares09 [at] hotmail.com>
pkgbase=stanmath
pkgname=(stanmath stanmath-docs)
pkgver=4.9.0
pkgrel=2
pkgdesc="reverse-mode automatic differentiation library"
license=('BSD-3-Clause')
arch=('any')
makedepends=(make doxygen)
url="https://github.com/stan-dev/math"
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver/_/-}.tar.gz")
sha256sums=('876881b71dee6fec32f2b4aa52692994cccd2a19c6de1b986d7fc457155f219c')
options=(!strip)

prepare() {
  cd math-${pkgver/_/-}/stan/math/rev/functor
  sed -i kinsol_data.hpp \
    -e "s|sundials_context.h>|sundials_context.hpp>|"
  sed -i cvodes_integrator{,_adjoint}.hpp \
    -e "s|realtype|sunrealtype|g"
  sed -i idas_service.hpp \
    -e "s|RCONST|SUN_RCONST|g"
}

build() {
  cd math-${pkgver/_/-}
  make doxygen
}

package_stanmath() {
  cd math-${pkgver/_/-}

  install -d "$pkgdir"/usr/include
  cp -r stan "$pkgdir"/usr/include
  install -Dm644 LICENSE.md -t "$pkgdir"/usr/share/licenses/stanmath/

}

package_stanmath-docs() {
  pkgdesc+=" (documentation)"

  cd math-${pkgver/_/-}
  install -d "$pkgdir"/usr/share/doc/stan
  cp -r doc "$pkgdir"/usr/share/doc/stan/math
  install -Dm644 LICENSE.md -t "$pkgdir"/usr/share/licenses/stanmath/
}