blob: 63699b9d280dda8323f928e13df796c89e1fb74c (
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
53
54
55
56
57
58
59
60
61
62
63
|
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_luaversions="5.1 5.2 5.3"
pkgname=lua-penlight
pkgver=1.3.2
pkgrel=0
pkgdesc="Lua libraries for extended operations on tables, lists and strings"
url="http://stevedonovan.github.io/Penlight"
arch="noarch"
license="MIT"
depends=""
makedepends=""
install=
subpackages="$pkgname-doc $pkgname-shared"
for _v in $_luaversions; do
makedepends="$makedepends lua$_v-dev lua$_v-filesystem"
subpackages="$subpackages lua$_v-penlight:split_${_v/./_}"
done
source="penlight-$pkgver.tar.gz::https://github.com/stevedonovan/Penlight/archive/$pkgver.tar.gz"
_builddir="$srcdir"/Penlight-$pkgver
build() {
cd "$_builddir"
# fix permissions of scripts
chmod -x lua/pl/*.lua
}
package() {
cd "$_builddir"
mkdir -p "$pkgdir"/usr/share/lua/common/ \
"$pkgdir"/usr/share/doc/$pkgname
cp -r lua/pl "$pkgdir"/usr/share/lua/common/ || return 1
cp -r examples "$pkgdir"/usr/share/doc/$pkgname/
for i in $_luaversions; do
mkdir -p "$pkgdir"/usr/share/lua/$i || return 1
ln -s ../common/pl "$pkgdir"/usr/share/lua/$i/pl || return 1
done
}
shared() {
pkgdesc="penlight files that are shared for all supported Lua versions"
depends=
mkdir -p "$subpkgdir"/usr/share/lua/
mv "$pkgdir"/usr/share/lua/common "$subpkgdir"/usr/share/lua/
}
_split() {
local _ver="$1"
pkgdesc="Lua $_ver libraries for extended operations on tables, lists and strings"
depends="lua-penlight-shared lua$_ver-filesystem"
install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
mkdir -p "$subpkgdir"/usr/share/lua/
mv "$pkgdir"/usr/share/lua/$_ver "$subpkgdir"/usr/share/lua/
}
for _v in $_luaversions; do
eval "split_${_v/./_}() { _split $_v; }"
done
md5sums="0315a39834bb6fab07741ec04ede1bf4 penlight-1.3.2.tar.gz"
sha256sums="19b6e6a3afa0fa2f1a627d26d00db6fb117895eb95715ea2ab78ace7edfee849 penlight-1.3.2.tar.gz"
sha512sums="2d9ded6c8d29385ddebbb712626c6ee2989e6a0228e02a33eb1be663e916004e50b08933a25798f3e153dc0d0f4feddce9c397e6b6b86198a11d0b169ac3afae penlight-1.3.2.tar.gz"
|