aboutsummaryrefslogtreecommitdiffstats
path: root/community/luarocks/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/luarocks/APKBUILD')
-rw-r--r--community/luarocks/APKBUILD75
1 files changed, 75 insertions, 0 deletions
diff --git a/community/luarocks/APKBUILD b/community/luarocks/APKBUILD
new file mode 100644
index 0000000000..afc39ed937
--- /dev/null
+++ b/community/luarocks/APKBUILD
@@ -0,0 +1,75 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=luarocks
+pkgver=2.3.0
+pkgrel=2
+pkgdesc="Deployment and management system for Lua modules"
+url="http://www.luarocks.org/"
+arch="noarch"
+license="MIT"
+depends="curl"
+makedepends=""
+subpackages=""
+source="http://luarocks.org/releases/$pkgname-$pkgver.tar.gz"
+builddir="$srcdir/$pkgname-$pkgver"
+
+_lua_versions="5.1 5.2 5.3"
+for _v in $_lua_versions; do
+ makedepends="$makedepends lua$_v-dev"
+ subpackages="$subpackages $pkgname${_v}:_package"
+done
+
+prepare() {
+ default_prepare || return 1
+
+ # Create builddir for each Lua version.
+ local lver; for lver in $_lua_versions; do
+ cp -r "$builddir" "$builddir-$lver"
+ done
+}
+
+build() {
+ local lver; for lver in $_lua_versions; do
+ cd "$builddir-$lver"
+
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc/luarocks \
+ --rocks-tree=/usr/local \
+ --lua-version="$lver" \
+ --lua-suffix="$lver" \
+ --with-downloader=curl \
+ --with-md5-checker=md5sum \
+ --versioned-rocks-dir \
+ || return 1
+ make || return 1
+ done
+}
+
+package() {
+ mkdir -p "$pkgdir"
+}
+
+_package() {
+ local lver="${subpkgname#$pkgname}"
+ pkgdesc="Deployment and management system for Lua $lver modules"
+ install_if="lua$lver $pkgname=$pkgver-r$pkgrel"
+ depends="lua$lver"
+
+ cd "$builddir-$lver"
+
+ make install DESTDIR="$subpkgdir" || return 1
+
+ # Remove default script names which conflict per Lua version.
+ rm "$subpkgdir"/usr/bin/luarocks \
+ "$subpkgdir"/usr/bin/luarocks-admin || return 1
+
+ # Set the correct Lua version.
+ sed -i "s/env lua/env lua${lver}/" \
+ "$subpkgdir"/usr/bin/luarocks-$lver \
+ "$subpkgdir"/usr/bin/luarocks-admin-$lver
+}
+
+md5sums="a38126684cf42b7d0e7a3c7cf485defb luarocks-2.3.0.tar.gz"
+sha256sums="68e38feeb66052e29ad1935a71b875194ed8b9c67c2223af5f4d4e3e2464ed97 luarocks-2.3.0.tar.gz"
+sha512sums="99f99ec59f663b3db22350946eb3357928c0e462ddcc7c3e5e0923e422c7ad6acffb0d2c95d1ec53526b08c33f2ae628276138e2daa7da077fd8de4b0b18eb15 luarocks-2.3.0.tar.gz"