summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ed688db7c6db6969db4b29adb9b6771ed7c92461 (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: Caleb Maclennan <caleb@alerque.com>

_rockname=commonmark
_project=$_rockname-lua
pkgname=("lua-$_rockname-git" "lua52-$_rockname-git" "lua51-$_rockname-git")
pkgver=0.0.0.r12.ge71d851
_branch='master'
_rockrel=0
pkgrel=1
pkgdesc='Lua parser for CommonMark using LPEG grammar'
arch=('any')
url="https://github.com/alerque/$_project"
license=('MIT')
_lua_deps=('epnf' 'penlight')
makedepends=('git' 'lua' 'lua52' 'lua51' 'luarocks')
source=("git+$url.git#branch=$_branch")
sha256sums=('SKIP')

pkgver() {
  cd "$_project"
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

_package_helper() {
  cd "$_project"
  luarocks --lua-version="$1" --tree="$pkgdir/usr/" \
    make --deps-mode=none --no-manifest "$_rockname-scm-$_rockrel.rockspec"
}

package_lua-commonmark-git() {
  depends=('lua' "${_lua_deps[@]/#/lua-}")
  conflicts=("${pkgname/-git}")
  _package_helper 5.3
}

package_lua52-commonmark-git() {
  depends=('lua52' "${_lua_deps[@]/#/lua52-}")
  conflicts=("${pkgname/-git}")
  _package_helper 5.2
}

package_lua51-commonmark-git() {
  depends=('lua51' "${_lua_deps[@]/#/lua51-}")
  conflicts=("${pkgname/-git}")
  _package_helper 5.1
}