summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ce1096c0fd64165c823e25ec730f89c76b4c70fa (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=ppx_deriving_yojson
pkgname=ocaml-${_pkgname}-git
pkgver=20220816
pkgrel=1
pkgdesc="A Yojson codec generator for OCaml >= 4.02."
arch=('x86_64')
url='https://github.com/ocaml-ppx/ppx_deriving_yojson'
license=('MIT')
provides=('ocaml-ppx_deriving_yojson')
depends=('ocaml' 'ocaml-yojson' 'ocaml-result' 'ocaml-ppx_deriving')
makedepends=('ocamlbuild' 'ocaml-findlib' 'ocaml-ppxlib' 'dune')
source=("git+https://github.com/ocaml-ppx/ppx_deriving_yojson.git")
md5sums=('SKIP')

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

build() {
  cd "$_pkgname"

  dune build --verbose
}

package() {
  cd "$_pkgname"

  #dune install --prefix "${pkgdir}/usr" --libdir "${pkgdir}$(ocamlfind -printconf destdir)"
  DESTDIR="$pkgdir" dune install --prefix '/usr' --libdir '/usr/lib/ocaml'

  install -dm755 "${pkgdir}$(ocamlfind -printconf destdir)" "${pkgdir}/usr/share"
  mv "${pkgdir}/usr/doc" "${pkgdir}/usr/share/"
}