aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-curl/APKBUILD
blob: 39debdafec773490b3a43653d0918f01ad33536e (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_luaversions="5.1 5.2 5.3"
pkgname=lua-curl
_pkgname=Lua-cURLv3
pkgver=0.3.5
pkgrel=2
pkgdesc="Lua bindings to cURL library"
url="https://github.com/Lua-cURL/Lua-cURLv3"
arch="all"
license="MIT/X11"
depends=""
makedepends="curl-dev"
subpackages=""
source="$pkgname-$pkgver.tar.gz::https://github.com/Lua-cURL/$_pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

for _v in $_luaversions; do
	makedepends="$makedepends lua$_v-dev"
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
done

prepare() {
	default_prepare || return 1

	local lver; for lver in $_luaversions; do
		cp -r "$builddir" "$builddir-$lver" || return 1
	done
}

build() {
	local lver; for lver in $_luaversions; do
		msg "Building for Lua $lver..."

		cd "$builddir-$lver"
		echo LUA_IMPL=lua$lver >> .config
		make LUA_VERSION=$lver || return 1
	done
}

package() {
	mkdir -p "$pkgdir"
}

_subpackage() {
	local lver="${subpkgname:3:3}"
	pkgdesc="$pkgdesc (for Lua $lver)"
	depends="lua$lver"
	install_if="$pkgname=$pkgver-r$pkgrel lua$lver"

	cd "$builddir-$lver"
	make install DESTDIR="$subpkgdir" LUA_VERSION=$lver
}

md5sums="7353a52c51162d81ba5ecdb4147161fb  lua-curl-0.3.5.tar.gz"
sha256sums="9ad2c38d676fedfac6883da0e7c2dc3a19af6f8be1417440c3141ff56463ea2a  lua-curl-0.3.5.tar.gz"
sha512sums="28cc9c43beebc2595f5da17a1811a92c4926344f2da280d3416fe8552cab8ca6e477f0f38325765c8fcbc124ade585afe8b6f31bf634a30612355fe9d25a2be1  lua-curl-0.3.5.tar.gz"