summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cece4aeceae04ac9d29f7c088d54ef4cffb59688 (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
# Maintainer: Mort Yao <soi@mort.ninja>

pkgname=ocaml-ppx_deriving-git
pkgver=20180318
pkgrel=1
pkgdesc="Type-driven code generation for OCaml >=4.02"
arch=('x86_64')
url='https://github.com/ocaml-ppx/ppx_deriving'
license=('MIT')
provides=('ocaml-ppx_deriving')
depends=('ocaml' 'ocaml-migrate-parsetree' 'ocaml-ppx_derivers' 'ocaml-ppx_tools>=4.02.3' 'ocaml-result')
makedepends=('ocamlbuild' 'ocaml-findlib' 'cppo')
source=("${pkgname}::git://github.com/ocaml-ppx/ppx_deriving.git")
md5sums=('SKIP')

pkgver() {
  cd "$pkgname"
  git log -1 --pretty=format:%cd --date=short | sed 's/-//g'
}

build() {
  cd "$pkgname"

  make
}

package() {
  cd "$pkgname"

  export OCAMLPATH="$(ocamlc -where):${pkgdir}$(ocamlc -where)"
  export OCAMLFIND_DESTDIR="${pkgdir}$(ocamlfind printconf destdir)"
  mkdir -p "${OCAMLFIND_DESTDIR}"

  make install
  install -Dm644 "LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
}