summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ba9b7c03e3eddbc93dd5dff961452caedf01ab1a (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
47
48
49
50
51
52
# Maintainer: qwjyh <urataw421 at gmail dot com>


# TODO: Fix doc gen and test

pkgname=luax-git
_pkgname="${pkgname%-git}"
pkgver=r590.70bcc33
pkgrel=1
pkgdesc="Lua interpreter and REPL based on Lua 5.4, augmented with some useful packages. It is also a \"compiler\" that produces standalone executables from Lua scripts."
depends=('lua' 'zig' 'glibc')
makedepends=('ninja' 'git')
provides=('luax')
arch=('x86_64' 'aarch64')
url="https://cdelord.fr/luax.html"
license=('GPL-3.0-only')
source=("git+https://github.com/CDSoft/luax.git")
sha256sums=('SKIP')

_distdir="$_pkgname"

prepare() {
    cd "$srcdir/$_distdir"
    ninja -f bootstrap.ninja
    sed -i "s,zig = .*,zig = $(which zig)," build.ninja
    sed -i 's,build $zig: _zig,,' build.ninja
}

pkgver() {
  cd "${_pkgname}" || exit 1
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
    cd "$srcdir/$_distdir"
    ninja
    # TODO: Fails building logo
    # ninja doc
}

check() {
    cd "$srcdir/$_distdir"
    # TODO: Fails
    # ninja test
}

package() {
    cd "$srcdir//$_distdir"
    PREFIX=$pkgdir/usr ninja install
}

# vim: sw=2: