community/luarocks: configure it to see rocks installed by apk

https://github.com/luarocks/luarocks/wiki/Integrating-distro-modules-with-LuaRocks
This commit is contained in:
Jakub Jirutka 2017-07-22 20:21:02 +02:00
parent 26fecd4b4e
commit 50395fcbaa
5 changed files with 32 additions and 5 deletions

View File

@ -2,7 +2,7 @@
# Maintainer: Jakub Jirutka <jakub@jirutka.cz> # Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=luarocks pkgname=luarocks
pkgver=2.4.2 pkgver=2.4.2
pkgrel=0 pkgrel=1
pkgdesc="Deployment and management system for Lua modules" pkgdesc="Deployment and management system for Lua modules"
url="http://www.luarocks.org/" url="http://www.luarocks.org/"
arch="noarch" arch="noarch"
@ -10,7 +10,9 @@ license="MIT"
depends="curl" depends="curl"
makedepends="" makedepends=""
subpackages="" subpackages=""
source="http://luarocks.org/releases/$pkgname-$pkgver.tar.gz" triggers=""
source="http://luarocks.org/releases/$pkgname-$pkgver.tar.gz
config.lua"
builddir="$srcdir/$pkgname-$pkgver" builddir="$srcdir/$pkgname-$pkgver"
_lua_versions="5.1 5.2 5.3" _lua_versions="5.1 5.2 5.3"
@ -57,6 +59,7 @@ _subpackage() {
pkgdesc="Deployment and management system for Lua $lver modules" pkgdesc="Deployment and management system for Lua $lver modules"
install_if="lua$lver $pkgname=$pkgver-r$pkgrel" install_if="lua$lver $pkgname=$pkgver-r$pkgrel"
depends="lua$lver" depends="lua$lver"
triggers="$subpkgname.trigger=/usr/lib/luarocks/rocks-$lver/*"
cd "$builddir-$lver" cd "$builddir-$lver"
@ -70,8 +73,11 @@ _subpackage() {
sed -i "s/env lua/env lua${lver}/" \ sed -i "s/env lua/env lua${lver}/" \
"$subpkgdir"/usr/bin/luarocks-$lver \ "$subpkgdir"/usr/bin/luarocks-$lver \
"$subpkgdir"/usr/bin/luarocks-admin-$lver "$subpkgdir"/usr/bin/luarocks-admin-$lver
# Config based on:
# https://github.com/luarocks/luarocks/wiki/Integrating-distro-modules-with-LuaRocks
install -D -m 644 "$srcdir"/config.lua "$subpkgdir"/etc/$pkgname/config-$lver.lua
} }
md5sums="32f30478d6bb3594aff9b59ebe591bbd luarocks-2.4.2.tar.gz" sha512sums="30e3b3fb338387412f406c415af49d3624f4dfc05ac5f245185127a0288248ccfae924e7bbdd5b68fef00524c7cc70d9f632ae00f4c696bdf0582e71e8945bc4 luarocks-2.4.2.tar.gz
sha256sums="0e1ec34583e1b265e0fbafb64c8bd348705ad403fe85967fd05d3a659f74d2e5 luarocks-2.4.2.tar.gz" c41bf3f8491e25d69ce0fee379203cc3721f2c79bb9ff652488aa2d66bc1e4613bd59d331cf17b9f18521d4f63539ce946b6a39038dc844083463c2c96f71811 config.lua"
sha512sums="30e3b3fb338387412f406c415af49d3624f4dfc05ac5f245185127a0288248ccfae924e7bbdd5b68fef00524c7cc70d9f632ae00f4c696bdf0582e71e8945bc4 luarocks-2.4.2.tar.gz"

View File

@ -0,0 +1,6 @@
rocks_trees = {
{ name = 'user', root = home..'/.luarocks' },
{ name = 'distro-modules', root = '/usr' },
{ name = 'system', root = '/usr/local' },
}
deps_mode = 'all'

View File

@ -0,0 +1,5 @@
#!/bin/sh
luarocks-admin-5.1 make-manifest --local-tree --tree=/usr >/dev/null 2>&1
exit 0

View File

@ -0,0 +1,5 @@
#!/bin/sh
luarocks-admin-5.2 make-manifest --local-tree --tree=/usr >/dev/null 2>&1
exit 0

View File

@ -0,0 +1,5 @@
#!/bin/sh
luarocks-admin-5.3 make-manifest --local-tree --tree=/usr >/dev/null 2>&1
exit 0