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

pkgname=ulex-git
pkgver=20171127
pkgrel=4
pkgdesc="ulex is a lexer generator for Unicode and OCaml"
url="https://github.com/whitequark/ulex"
arch=(x86_64)
license=('GPL')
depends=('ocaml' 'camlp4')
makedepends=('ocamlbuild' 'ocaml-findlib')
provides=('ulex')
conflicts=('ulex')
source=("${pkgname}::git://github.com/whitequark/ulex.git")
md5sums=('SKIP')

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

prepare() {
  cd "$pkgname"
  # build native code as well
  sed -i '1s/.*/ALL=pa_ulex.cmxa ulexing.cmxa pa_ulex.cma ulexing.cma/' Makefile
}

build() {
  cd "$pkgname"
  make
  make doc
}

package() {
  _DOCDIR="${pkgdir}/usr/share/doc/${pkgname}"

  cd "$pkgname"

  export OCAMLFIND_DESTDIR="${pkgdir}$(ocamlfind printconf destdir)"
  mkdir -p "${OCAMLFIND_DESTDIR}"
  make install

  # Install doc
  mkdir -p $_DOCDIR
  cp *.html *.css $_DOCDIR/
}