about summary refs log tree commit diff
path: root/maintainers
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2019-03-07 16:58:54 +0900
committerMatthieu Coudron <mattator@gmail.com>2019-03-07 17:43:07 +0900
commit68a72f1a478b0dd09f0105d460e7e1a28bbc4560 (patch)
tree9f9815f726a072ad95ac89e30e81025f0733434c /maintainers
parentc37b8925ba6d1b23a892f99b8634c5b5f51f1688 (diff)
downloadnixlib-68a72f1a478b0dd09f0105d460e7e1a28bbc4560.tar
nixlib-68a72f1a478b0dd09f0105d460e7e1a28bbc4560.tar.gz
nixlib-68a72f1a478b0dd09f0105d460e7e1a28bbc4560.tar.bz2
nixlib-68a72f1a478b0dd09f0105d460e7e1a28bbc4560.tar.lz
nixlib-68a72f1a478b0dd09f0105d460e7e1a28bbc4560.tar.xz
nixlib-68a72f1a478b0dd09f0105d460e7e1a28bbc4560.tar.zst
nixlib-68a72f1a478b0dd09f0105d460e7e1a28bbc4560.zip
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.
Diffstat (limited to 'maintainers')
-rw-r--r--maintainers/scripts/luarocks-packages.csv15
-rwxr-xr-xmaintainers/scripts/update-luarocks-packages26
2 files changed, 24 insertions, 17 deletions
diff --git a/maintainers/scripts/luarocks-packages.csv b/maintainers/scripts/luarocks-packages.csv
index f5998f010d85..035a0d891cca 100644
--- a/maintainers/scripts/luarocks-packages.csv
+++ b/maintainers/scripts/luarocks-packages.csv
@@ -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
diff --git a/maintainers/scripts/update-luarocks-packages b/maintainers/scripts/update-luarocks-packages
index 171b49ee5689..4b94343233e4 100755
--- a/maintainers/scripts/update-luarocks-packages
+++ b/maintainers/scripts/update-luarocks-packages
@@ -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