aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-inspect/APKBUILD
blob: 082f79e161733c6249e0bf8d1e5eafea647d759b (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
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=lua-inspect
_rockname=inspect
_pkgname=inspect.lua
pkgver=3.1.1
pkgrel=0
pkgdesc="Human-readable representation of Lua tables"
url="https://github.com/kikito/inspect.lua"
arch="noarch"
license="MIT"
depends=""
makedepends=""
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/kikito/$_pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_package"
done

package() {
	cd "$builddir"

	install -Dm644 README.md \
		"${pkgdir}/usr/share/doc/${pkgname}/README.md"
	install -Dm644 MIT-LICENSE.txt \
		"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

_package() {
	local lver="${subpkgname:3:3}"
	pkgdesc="$pkgdesc (for Lua $lver)"
	depends="lua$lver"
	install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
	local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_rockname/$pkgver-1"

	install -Dm644 "$builddir"/inspect.lua \
		"$subpkgdir"/usr/share/lua/$lver/inspect.lua

	mkdir -p "$rockdir"
	echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}

sha512sums="d9e6f605033b43ac07f6ab731b1c10f59ebd0a64bb3d6449cef39b2fc43d9ad0eb062a000f76bc9b25222a52a3b344ab3a8af7b6bfe3d92a52447faf5dfbcbbd  lua-inspect-3.1.1.tar.gz"