aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-sqlite/APKBUILD
blob: 8579e4430a9746290eda006522df779ee0e20638 (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
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=lua-sqlite
pkgver=0.9.3
_realver=fsl09w
_luaversions="5.1 5.2 5.3"
pkgrel=1
pkgdesc="Sqlite3 Binding for Lua"
url="http://lua.sqlite.org/index.cgi/home"
arch="all"
license="MIT"
depends=""
depends_dev=""
makedepends="$depends_dev sqlite-dev"
install=""
subpackages=""
source="http://lua.sqlite.org/index.cgi/tar/lsqlite3_$_realver.tar.gz"

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

_builddir="$srcdir"/lsqlite3_$_realver

prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	for _v in $_luaversions; do
		cp -r $_builddir "$srcdir"/$pkgname-$_v
	done
}

build() {
	cd "$_builddir"
}

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

_split() {
	local _ver="$1"
	cd "$srcdir"/$pkgname-$_ver || return 1
	pkgdesc="$pkgdesc (Lua $_ver)"
	install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
	${CC:-gcc} ${CFLAGS} $(pkg-config --cflags sqlite3) \
		$(pkg-config --cflags lua$_ver) -shared -fPIC \
		-DLSQLITE_VERSION=\"$pkgver\" -o lsqlite3.so lsqlite3.c \
		$(pkg-config --libs sqlite3) || return 1
	install -Dm755 lsqlite3.so \
		"$subpkgdir"/usr/lib/lua/$_ver/lsqlite3.so || return 1
}

md5sums="2f426934179b2dca988f6b542d41f33a  lsqlite3_fsl09w.tar.gz"
sha256sums="39cb183b82254c1eef43f54bb16d60e9759a87c92375c4b0dd31492706c17fac  lsqlite3_fsl09w.tar.gz"
sha512sums="b2998678626b8cddc81b5fe4b6674ab46c578dc31c8c26b4d8e2d9e42ebcc4f38ab1263eb8f09f34e4726fcf18416707230235f57f0bd7ea93dc7834849ba00f  lsqlite3_fsl09w.tar.gz"