Merge pull request #57010 from teto/luarocks_update

Luarocks update
This commit is contained in:
Michael Raskin 2019-03-07 10:52:56 +00:00 committed by GitHub
commit bd616c0cd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 56 additions and 52 deletions

View File

@ -1,3 +1,4 @@
# nix name, luarocks name, server, version/additionnal args
ansicolors, ansicolors,
argparse, argparse,
basexx, basexx,
@ -17,15 +18,15 @@ lua-term,
luabitop, luabitop,
luaevent, luaevent,
luacheck luacheck
luaffi,http://luarocks.org/dev, luaffi,,http://luarocks.org/dev,
luuid, luuid,
penlight, penlight,
say, say,
luv, luv,
luasystem, luasystem,
mediator_lua,http://luarocks.org/manifests/teto mediator_lua,,http://luarocks.org/manifests/teto
mpack,http://luarocks.org/manifests/teto mpack,,http://luarocks.org/manifests/teto
nvim-client,http://luarocks.org/manifests/teto nvim-client,,http://luarocks.org/manifests/teto
busted,http://luarocks.org/manifests/teto busted,,http://luarocks.org/manifests/teto
luassert,http://luarocks.org/manifests/teto luassert,,http://luarocks.org/manifests/teto
coxpcall,https://luarocks.org/manifests/hisham,1.17.0-1 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 () { function convert_pkg () {
pkg="$1" nix_pkg_name="$1"
lua_pkg_name="$2"
server="" server=""
if [ ! -z "$2" ]; then if [ ! -z "$3" ]; then
server=" --server=$2" server=" --server=$3"
fi fi
version="${3:-}" version="${3:-}"
echo "looking at $pkg (version $version) from server [$server]" >&2 echo "looking at $lua_pkg_name (version $version) from server [$server]" >&2
cmd="luarocks nix $server $pkg $version" cmd="luarocks nix $server $lua_pkg_name $version"
drv="$($cmd)" drv="$nix_pkg_name = $($cmd)"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Failed to convert $pkg" >&2 echo "Failed to convert $pkg" >&2
echo "$drv" >&2 echo "$drv" >&2
@ -98,12 +99,17 @@ echo "$HEADER" | tee "$TMP_FILE"
# list of packages with format # list of packages with format
# name,server,version # name,server,version
while IFS=, read -r pkg_name server version while IFS=, read -r nix_pkg_name lua_pkg_name server version
do do
if [ -z "$pkg_name" ]; then if [ "${nix_pkg_name:0:1}" == "#" ]; then
echo "Skipping empty package name" >&2 echo "Skipping comment ${nix_pkg_name}" >&2
continue
fi 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" done < "$CSV_FILE"
# close the set # close the set

View File

@ -1,20 +1,20 @@
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua
index 55cd4c9..060a6f1 100644 index f93e67a..2eb2db9 100644
--- a/src/luarocks/cfg.lua --- a/src/luarocks/core/cfg.lua
+++ b/src/luarocks/cfg.lua +++ b/src/luarocks/core/cfg.lua
@@ -587,9 +587,9 @@ if cfg.platforms.macosx then @@ -425,9 +425,9 @@ local function make_defaults(lua_version, target_cpu, platforms, home)
defaults.external_lib_extension = "dylib" defaults.external_lib_extension = "dylib"
defaults.arch = "macosx-"..cfg.target_cpu defaults.arch = "macosx-"..target_cpu
defaults.variables.LIBFLAG = "-bundle -undefined dynamic_lookup -all_load" defaults.variables.LIBFLAG = "-bundle -undefined dynamic_lookup -all_load"
- defaults.variables.STAT = "/usr/bin/stat" - defaults.variables.STAT = "/usr/bin/stat"
+ defaults.variables.STAT = "stat" + defaults.variables.STAT = "stat"
defaults.variables.STATFLAG = "-f '%A'" defaults.variables.STATFLAG = "-f '%A'"
- local version = io.popen("sw_vers -productVersion"):read("*l") - local version = util.popen_read("sw_vers -productVersion")
+ local version = "10.10" + local version = "10.10"
version = tonumber(version and version:match("^[^.]+%.([^.]+)")) or 3 version = tonumber(version and version:match("^[^.]+%.([^.]+)")) or 3
if version >= 10 then if version >= 10 then
version = 8 version = 8
@@ -598,8 +598,8 @@ if cfg.platforms.macosx then @@ -436,8 +436,8 @@ local function make_defaults(lua_version, target_cpu, platforms, home)
else else
defaults.gcc_rpath = false defaults.gcc_rpath = false
end end

View File

@ -7,16 +7,13 @@
, cmake , cmake
}: }:
let
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname="luarocks"; pname = "luarocks";
version="2.4.4"; version = "3.0.4";
src = fetchurl { src = fetchurl {
url="http://luarocks.org/releases/luarocks-${version}.tar.gz"; url="http://luarocks.org/releases/luarocks-${version}.tar.gz";
sha256="0d7rl60dwh52qh5pfsphgx5ypp7k190h9ri6qpr2yx9kvqrxyf1r"; sha256="1pqfzwvjy8dzqg4fqjq2cgqcr00fgrdd7nwzxm7nqmawr83s6dhj";
}; };
patches = [ ./darwin.patch ]; patches = [ ./darwin.patch ];

View File

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

View File

@ -12,7 +12,6 @@
, fetchFromGitHub, libmpack, which, fetchpatch, writeText , fetchFromGitHub, libmpack, which, fetchpatch, writeText
, pkgs , pkgs
, fetchgit , fetchgit
, overrides ? (self: super: {})
, lib , lib
}: }:
@ -867,4 +866,4 @@ with self; {
}); });
}); });
in (lib.extends overrides packages) in packages