Skip to content

Instantly share code, notes, and snippets.

@daurnimator
Created October 20, 2019 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daurnimator/71a6a5540d63530efc34fea342425b99 to your computer and use it in GitHub Desktop.
Save daurnimator/71a6a5540d63530efc34fea342425b99 to your computer and use it in GitHub Desktop.
luarocks draft makepkg-template
pkgname=("lua-$_rockname" "lua51-$_rockname" "lua52-$_rockname")
makedepends+=('luarocks' 'lua' 'lua51' 'lua52')
build() {
for lua_ver in 5.1 5.2 5.3; do
mkdir -p "$lua_ver"
(cd "$lua_ver"; luarocks build --pack-binary-rock --lua-version="$lua_ver" --deps-mode=none --no-manifest "$_rockname"-"$pkgver"-*.rockspec)
done
}
check() {
luarocks test "$_rockspec"
}
package_lua51-"$_rockname" {
pkgdesc="$pkgdesc for Lua 5.1"
luarocks install --lua-version=5.1 --tree="$pkgdir/usr/" --deps-mode=none 5.1/*.rock
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
package_lua52-"$_rockname" {
pkgdesc="$pkgdesc for Lua 5.2"
luarocks install --lua-version=5.2 --tree="$pkgdir/usr/" --deps-mode=none 5.2/*.rock
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
package_lua-"$_rockname" {
pkgdesc="$pkgdesc for Lua 5.3"
luarocks install --lua-version=5.3 --tree="$pkgdir/usr/" --deps-mode=none 5.3/*.rock
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment