aboutsummaryrefslogtreecommitdiffstats
path: root/community/lua-hiredis/APKBUILD
blob: dfb9d1eb8398762b00320bed2288f546d214c2be (plain) (blame)
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
# Maintainer: Nathan Angelacos <nangel@alpinelinux.org>

_luaversions="5.1 5.2 5.3"

pkgname=lua-hiredis
pkgver=0.2.1
pkgrel=3
pkgdesc="Binding to hiredis for Lua"
url="https://github.com/agladysh/lua-hiredis"
arch="all"
license="MIT"
depends_dev=""
makedepends="$depends_dev hiredis-dev"
subpackages=""

for _v in $_luaversions; do
	makedepends="$makedepends lua$_v-dev"
	subpackages="$subpackages lua$_v-${pkgname#*lua-}:split_${_v/./_}"
	eval "split_${_v/./_}() { _split $_v; }"
done

install=""
source="lua-hiredis-$pkgver.tar.gz::https://github.com/agladysh/lua-hiredis/archive/v$pkgver.tar.gz
	0002-lua-hiredis-master.patch
	0003-lua-5-2-compatibility.patch
	0004-lua-5-3-compatibility.patch"
builddir="$srcdir"/lua-hiredis-$pkgver

build() {
	cd "$builddir"
	local _v
	for _v in $_luaversions; do
		mkdir -p "$srcdir/build-$_v/"
		${CC:-gcc} src/lua-hiredis.c ${CFLAGS} -shared -fPIC \
			$(pkg-config --cflags hiredis lua$_v) \
			$(pkg-config --libs hiredis lua$_v) \
			-I/usr/include/lua$_ver -I/usr/include/hiredis \
			-o "$srcdir/build-$_v/hiredis.so"
	done
}

check() {
	# No check functionality yet
	return 0
}

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

_split() {
	local _ver="$1"
	pkgdesc="$pkgdesc (Lua $_ver)"
	install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"

	install -Dm755 "$srcdir/build-$_v/hiredis.so" "$subpkgdir"/usr/lib/lua/$_ver/hiredis.so
}

sha512sums="b53eea8b51ddfbfa4592e7a3bb004416edd6240a860656ec809b603349357d3e754a2b5f2a92cb33d0a46259beae86f1c99981e848193f112888982d97cb94b7  lua-hiredis-0.2.1.tar.gz
0017a218a126e0b96a5cc4126a0b8dc7600ef6029af24f3ca685e46cabade03d25a3c318b3d80c907785f2f2abc7dfb2c9a047e6a7c53e082ab682a3ac5ca18b  0002-lua-hiredis-master.patch
9cf63994de040d8818c3db3053d506244e7a4a647ae71609533b5c889517d6addf01dde185f83d7472f4580dea4d26dce69e5e5ad86ca7c70343eaffe0d7e137  0003-lua-5-2-compatibility.patch
5603ee2e6566e79c6760160082cc3fa87b44a0dc34c10932bfddcb04375c78f280742e91a343185931da8d241753c2c3e0e3514f48f1347eed8b0ee711865f1b  0004-lua-5-3-compatibility.patch"