blob: 3733e06ce9af2bd62a60a6adb3fba8526acae052 (
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
65
66
67
68
69
70
|
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=lua-sqlite
_rockname=lsqlite3
pkgver=0.9.4
_uuid="fsl_9x"
[ "$pkgver" != "0.9.4" ] && die "Please update uuid!"
_luaversions="5.1 5.2 5.3"
pkgrel=2
pkgdesc="Sqlite3 Binding for Lua"
url="http://lua.sqlite.org/index.cgi/home"
arch="all"
license="MIT"
depends=""
makedepends="sqlite-dev"
install=""
subpackages=""
# the uuid determines the archive version and the filename the target directory
source="$pkgname-$pkgver.zip::http://lua.sqlite.org/index.cgi/zip/$pkgname-$pkgver.zip?uuid=$_uuid"
builddir="$srcdir"/$pkgname-$pkgver
for _v in $_luaversions; do
makedepends="$makedepends lua$_v-dev"
subpackages="$subpackages lua$_v-${pkgname#lua-}:_package"
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
cd "$builddir-$lver"
msg "Building for Lua $lver..."
${CC:-gcc} ${CFLAGS} $(pkg-config --cflags sqlite3) \
$(pkg-config --cflags lua$lver) -shared -fPIC \
-DLSQLITE_VERSION=\"$pkgver\" -o lsqlite3.so lsqlite3.c \
$(pkg-config --libs sqlite3) || return 1
done
}
package() {
mkdir -p "$pkgdir"
}
_package() {
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"
install -Dm755 lsqlite3.so \
"$subpkgdir"/usr/lib/lua/$lver/lsqlite3.so || return 1
mkdir -p "$rockdir"
echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}
md5sums="1389c43431e57c7f2d13b1293bf322d7 lua-sqlite-0.9.4.zip"
sha256sums="a0d2e14853bf228e029c5ecab7e41a424126c40218742205e1d7bdd1416e34b2 lua-sqlite-0.9.4.zip"
sha512sums="f9f786ec22a153495192555ed2d5736231bb740ed143a20118398614e53902d7bbd6939ef08622e367a34111403f7850fe47565a08a48abf6c50250ee11f6fd3 lua-sqlite-0.9.4.zip"
|