luarocks-nix: bump to match luarocks

Also made changes to lua package generation system to account for packages like cqueues
that have one version per lua interpreter.
The csv file also accepts comments now.
This commit is contained in:
Matthieu Coudron 2019-03-07 16:58:54 +09:00
parent c37b8925ba
commit 68a72f1a47
3 changed files with 27 additions and 19 deletions

View File

@ -1,3 +1,4 @@
# nix name, luarocks name, server, version/additionnal args
ansicolors,
argparse,
basexx,
@ -17,15 +18,15 @@ lua-term,
luabitop,
luaevent,
luacheck
luaffi,http://luarocks.org/dev,
luaffi,,http://luarocks.org/dev,
luuid,
penlight,
say,
luv,
luasystem,
mediator_lua,http://luarocks.org/manifests/teto
mpack,http://luarocks.org/manifests/teto
nvim-client,http://luarocks.org/manifests/teto
busted,http://luarocks.org/manifests/teto
luassert,http://luarocks.org/manifests/teto
coxpcall,https://luarocks.org/manifests/hisham,1.17.0-1
mediator_lua,,http://luarocks.org/manifests/teto
mpack,,http://luarocks.org/manifests/teto
nvim-client,,http://luarocks.org/manifests/teto
busted,,http://luarocks.org/manifests/teto
luassert,,http://luarocks.org/manifests/teto
coxpcall,,https://luarocks.org/manifests/hisham,1.17.0-1

1 ansicolors, # nix name, luarocks name, server, version/additionnal args
1 # nix name, luarocks name, server, version/additionnal args
2 ansicolors, ansicolors,
3 argparse, argparse,
4 basexx, basexx,
18 luabitop, luabitop,
19 luaevent, luaevent,
20 luacheck luacheck
21 luaffi,http://luarocks.org/dev, luaffi,,http://luarocks.org/dev,
22 luuid, luuid,
23 penlight, penlight,
24 say, say,
25 luv, luv,
26 luasystem, luasystem,
27 mediator_lua,http://luarocks.org/manifests/teto mediator_lua,,http://luarocks.org/manifests/teto
28 mpack,http://luarocks.org/manifests/teto mpack,,http://luarocks.org/manifests/teto
29 nvim-client,http://luarocks.org/manifests/teto nvim-client,,http://luarocks.org/manifests/teto
30 busted,http://luarocks.org/manifests/teto busted,,http://luarocks.org/manifests/teto
31 luassert,http://luarocks.org/manifests/teto luassert,,http://luarocks.org/manifests/teto
32 coxpcall,https://luarocks.org/manifests/hisham,1.17.0-1 coxpcall,,https://luarocks.org/manifests/hisham,1.17.0-1

View File

@ -74,17 +74,18 @@ FOOTER="
function convert_pkg () {
pkg="$1"
nix_pkg_name="$1"
lua_pkg_name="$2"
server=""
if [ ! -z "$2" ]; then
server=" --server=$2"
if [ ! -z "$3" ]; then
server=" --server=$3"
fi
version="${3:-}"
echo "looking at $pkg (version $version) from server [$server]" >&2
cmd="luarocks nix $server $pkg $version"
drv="$($cmd)"
echo "looking at $lua_pkg_name (version $version) from server [$server]" >&2
cmd="luarocks nix $server $lua_pkg_name $version"
drv="$nix_pkg_name = $($cmd)"
if [ $? -ne 0 ]; then
echo "Failed to convert $pkg" >&2
echo "$drv" >&2
@ -98,12 +99,17 @@ echo "$HEADER" | tee "$TMP_FILE"
# list of packages with format
# name,server,version
while IFS=, read -r pkg_name server version
while IFS=, read -r nix_pkg_name lua_pkg_name server version
do
if [ -z "$pkg_name" ]; then
echo "Skipping empty package name" >&2
if [ "${nix_pkg_name:0:1}" == "#" ]; then
echo "Skipping comment ${nix_pkg_name}" >&2
continue
fi
convert_pkg "$pkg_name" "$server" "$version"
if [ -z "$lua_pkg_name" ]; then
echo "Using nix_name as lua_pkg_name" >&2
lua_pkg_name="$nix_pkg_name"
fi
convert_pkg "$nix_pkg_name" "$lua_pkg_name" "$server" "$version"
done < "$CSV_FILE"
# close the set

View File

@ -1,9 +1,10 @@
{ luarocks, fetchFromGitHub }:
luarocks.overrideAttrs(old: {
pname = "luarocks-nix";
src = fetchFromGitHub {
owner = "teto";
repo = "luarocks";
rev = "f9dc7892214bff6bce822d94aca3331048e61df0";
sha256 = "117qqbiv87p2qw0zwapl7b0p4wgnn9f8k0qpppkj3653a1bwli05";
rev = "8fb03a9bc8f4fa079d26c0f02804139bb2578848";
sha256 = "09iwjvs9sbk6vwhrh7sijmfpji6wvg5bbdraw7l5lpnr9jj5wy91";
};
})