summaryrefslogtreecommitdiff
path: root/main/lua-subprocess/APKBUILD
blob: 6ed36d9afca33ceba0458d1e6e1f196fc88aa580 (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
# Contributor: Ted Trask <ttrask01@yahoo.com>
# Maintainer: Ted Trask <ttrask01@yahoo.com>
_luaversions="5.1 5.2 5.3 5.4"
pkgname=lua-subprocess
pkgver=0_git20230625
pkgrel=0
_gitrev=ccd71c90653b39c6745c771af4393c9e76e4105f
pkgdesc="A Lua module written in C that allows you to create child processes and communicate with them"
url="https://github.com/tdtrask/lua-subprocess"
arch="all"
license="MIT"
makedepends="asciidoc"
for _i in $_luaversions; do
	makedepends="$makedepends lua$_i-dev"
	subpackages="$subpackages lua$_i-subprocess:split_${_i/./_}"
done
source="$pkgname-$_gitrev.tar.gz::https://github.com/tdtrask/lua-subprocess/archive/$_gitrev.tar.gz
	makefile.patch
	"
builddir="$srcdir/lua-subprocess-$_gitrev"
options="!check"

prepare() {
	default_prepare
	for _i in $_luaversions; do
		cp -r "$builddir" "$srcdir"/build-$_i
	done
}

build() {
	export CFLAGS="$CFLAGS -DSHARE_LIOLIB"
	for _i in $_luaversions; do
		cd "$srcdir"/build-$_i
		make lua_package="lua$_i"
	done
}

package() {
	for _i in $_luaversions; do
		cd "$srcdir"/build-$_i
		make lua_package="lua$_i" DESTDIR="$pkgdir" install
	done
}

_split() {
	local d= _ver=$1
	pkgdesc="A Lua $_ver module written in C that allows you to create child processes and communicate with them"
	install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
	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/
		fi
	done
}

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

sha512sums="
d6c2cb45225f518748405ae6039ecad5475eac029f1a1f7250a73dcfcc429420298884d00f8d11677b3fffab833232d3b9436a067cfcce8f70585b2a2b31c46e  lua-subprocess-ccd71c90653b39c6745c771af4393c9e76e4105f.tar.gz
af4e25d8d503e9cb8296a2b8d8b19577e64b412f56607bf38bc828a7c214904ecdf9619fc2541461bc4dda6c6fcd47cbb1051499bd2f132dad76092cf3ae5e9d  makefile.patch
"