summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorMort Yao2018-04-18 14:40:25 +0200
committerMort Yao2018-04-18 14:41:14 +0200
commit74987a44074d72627b355aa688787b9423fa207b (patch)
tree23e9ade58e7ffba13347b4e5d61944be0b05e6a6 /PKGBUILD
downloadaur-74987a44074d72627b355aa688787b9423fa207b.tar.gz
ulex-git 20171127-1
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD46
1 files changed, 46 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..12e22e10be63
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
+# Maintainer: Mort Yao <soi@mort.ninja>
+
+pkgname=ulex-git
+pkgver=20171127
+pkgrel=1
+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=()
+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/
+}