aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-curl/APKBUILD
blob: 0c823d8186649aa52aaa762f4aac368bfac4e985 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua-curl
_pkgname=Lua-cURLv3
pkgver=0.3.8
pkgrel=1
pkgdesc="Lua bindings to cURL library"
url="https://github.com/Lua-cURL/Lua-cURLv3"
arch="all"
license="MIT"
makedepends="curl-dev"
subpackages=""
source="$pkgname-$pkgver.tar.gz::https://github.com/Lua-cURL/$_pkgname/archive/v$pkgver.tar.gz
	fix-build-with-curl-7.62.0.patch"
builddir="$srcdir/$_pkgname-$pkgver"

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

prepare() {
	default_prepare

	local lver; for lver in $_luaversions; do
		cp -r "$builddir" "$builddir-$lver"
	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
	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"
	local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$pkgname/$pkgver-1"

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

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

sha512sums="38661c43f1d20f17b27375277c50050a64d0b76354d184a161b9ac73858d7cd83998711775e29c0a3d0a2cc3440fb96fe85c97579fec73b9bba0c83c8d5d5a6a  lua-curl-0.3.8.tar.gz
3cd33f93a782fffac2036e94fbadff7a668bd74af4f6301d6c917717cf842e6d2724497f9aece42f782f04ab9cc4d21b0f2e511a6bd636986735b6c3dbbae457  fix-build-with-curl-7.62.0.patch"