aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-filesystem/APKBUILD
blob: 786479a89d067f7b98fe898d00129fa42b6d08e1 (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
64
65
66
67
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>

_luaversions="5.1 5.2"
_defaultlua="5.1"

pkgname=lua-filesystem
pkgver=1.6.2
pkgrel=2
pkgdesc="Filesystem functions for Lua"
url="http://www.keplerproject.org/luafilesystem/"
arch="all"
license="GPL"
depends="lua$_defaultlua-filesystem"
install=

makedepends=""
subpackages=""
for _i in $_luaversions; do
	makedepends="$makedepends lua$_i-dev"
	subpackages="$subpackages lua$_i-filesystem:split_${_i/./_}"
done
source="https://github.com/downloads/keplerproject/luafilesystem/luafilesystem-$pkgver.tar.gz"

_sdir="$srcdir"/luafilesystem-$pkgver

prepare() {
	cd "$_sdir"
	# apply patches here
	cd "$srcdir"
	for _i in $_luaversions; do
		cp -r "$_sdir" "$srcdir"/build-$_i
	done
}

build() {
	for _i in $_luaversions; do
		cd "$srcdir"/build-$_i
		make CFLAGS="$CFLAGS $( pkg-config lua$_i --cflags ) -fPIC" \
			|| return 1
	done
}

package() {
	for _i in $_luaversions; do
		cd "$srcdir"/build-$_i
		make LUA_LIBDIR="$pkgdir"/usr/lib/lua/$_i install \
			|| return 1
	done
}

_split() {
	local d= _ver=$1
	pkgdesc="Filesystem functions for Lua $_ver"
	replaces="$pkgname"
	for d in usr/lib/lua usr/share/lua; do
		if [ -d "$pkgdir"/$d/$_ver ]; then
			mkdir -p "$subpkgdir"/$d
			mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/ || return 1
		fi
	done
}

for _i in $_luaversions; do
	eval "split_${_i/./_}() { _split $_i; }"
done

md5sums="4e7ec93678c760c4e42cea7d28aafa13  luafilesystem-1.6.2.tar.gz"