From 89c3c1cb4284e4712b8509349620a0cd07c39bce Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sat, 7 Sep 2019 19:55:30 +0900 Subject: [PATCH 1/3] update-luarocks-packages: reference only 1 server we now pass a configuration file when calling luarocks to prevent impurities. --- maintainers/scripts/luarocks-config.lua | 3 +++ maintainers/scripts/update-luarocks-packages | 1 + 2 files changed, 4 insertions(+) create mode 100644 maintainers/scripts/luarocks-config.lua diff --git a/maintainers/scripts/luarocks-config.lua b/maintainers/scripts/luarocks-config.lua new file mode 100644 index 000000000000..40b2d611c322 --- /dev/null +++ b/maintainers/scripts/luarocks-config.lua @@ -0,0 +1,3 @@ +rocks_servers = { + "https://luarocks.org" +} diff --git a/maintainers/scripts/update-luarocks-packages b/maintainers/scripts/update-luarocks-packages index a8d67d208e38..1a31d71086fa 100755 --- a/maintainers/scripts/update-luarocks-packages +++ b/maintainers/scripts/update-luarocks-packages @@ -15,6 +15,7 @@ CSV_FILE="maintainers/scripts/luarocks-packages.csv" TMP_FILE="$(mktemp)" # Set in the update-luarocks-shell.nix NIXPKGS_PATH="$LUAROCKS_NIXPKGS_PATH" +export LUAROCKS_CONFIG="$NIXPKGS_PATH/maintainers/scripts/luarocks-config.lua" # 10 is a pretty arbitrary number of simultaneous jobs, but it is generally # impolite to hit a webserver with *too* many simultaneous connections :) From 4d526d6fc63c0316c135435c7f4d6074c9bce09a Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sat, 7 Sep 2019 19:59:23 +0900 Subject: [PATCH 2/3] fetchurl: add luarocks mirrors luarocks defines by default the following mirrors: https://github.com/luarocks/luarocks/blob/83093e7da7f789f0f7d3a6784597cbbed09c73e0/src/luarocks/core/cfg.lua#L205 Let's add them to nixpkgs. I have modified luarocks-nix to generate the proper nixpkgs urls. I bump luarocks-nix in the following commits. --- pkgs/build-support/fetchurl/mirrors.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/build-support/fetchurl/mirrors.nix b/pkgs/build-support/fetchurl/mirrors.nix index ec7d289996b3..c0e115bca280 100644 --- a/pkgs/build-support/fetchurl/mirrors.nix +++ b/pkgs/build-support/fetchurl/mirrors.nix @@ -8,6 +8,13 @@ # Mirrors for mirror://site/filename URIs, where "site" is # "sourceforge", "gnu", etc. + luarocks = [ + https://luarocks.org + https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/ + http://luafr.org/moonrocks + http://luarocks.logiceditor.com/rocks + ]; + # SourceForge. sourceforge = [ https://downloads.sourceforge.net/ From 4a3189085a161dfc0a589bd8ae5cd0cc655843d0 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sat, 7 Sep 2019 21:00:35 +0900 Subject: [PATCH 3/3] luarocks-nix: bump to 2019-09-07 added version and transferred the repostiory to nix-community. With this bump, luarocks-nix generates mirro://luarocks urls. --- maintainers/scripts/luarocks-config.lua | 1 + .../tools/misc/luarocks/darwin-3.0.x.patch | 27 ------------------- .../tools/misc/luarocks/luarocks-nix.nix | 9 ++++--- 3 files changed, 6 insertions(+), 31 deletions(-) delete mode 100644 pkgs/development/tools/misc/luarocks/darwin-3.0.x.patch diff --git a/maintainers/scripts/luarocks-config.lua b/maintainers/scripts/luarocks-config.lua index 40b2d611c322..89e74c00ea8e 100644 --- a/maintainers/scripts/luarocks-config.lua +++ b/maintainers/scripts/luarocks-config.lua @@ -1,3 +1,4 @@ rocks_servers = { "https://luarocks.org" } +version_check_on_fail = false diff --git a/pkgs/development/tools/misc/luarocks/darwin-3.0.x.patch b/pkgs/development/tools/misc/luarocks/darwin-3.0.x.patch deleted file mode 100644 index 013ac5180afa..000000000000 --- a/pkgs/development/tools/misc/luarocks/darwin-3.0.x.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua -index f93e67a..2eb2db9 100644 ---- a/src/luarocks/core/cfg.lua -+++ b/src/luarocks/core/cfg.lua -@@ -425,9 +425,9 @@ local function make_defaults(lua_version, target_cpu, platforms, home) - defaults.external_lib_extension = "dylib" - defaults.arch = "macosx-"..target_cpu - defaults.variables.LIBFLAG = "-bundle -undefined dynamic_lookup -all_load" -- defaults.variables.STAT = "/usr/bin/stat" -+ defaults.variables.STAT = "stat" - defaults.variables.STATFLAG = "-f '%A'" -- local version = util.popen_read("sw_vers -productVersion") -+ local version = os.getenv("MACOSX_DEPLOYMENT_TARGET") or "10.12" - version = tonumber(version and version:match("^[^.]+%.([^.]+)")) or 3 - if version >= 10 then - version = 8 -@@ -436,8 +436,8 @@ local function make_defaults(lua_version, target_cpu, platforms, home) - else - defaults.gcc_rpath = false - end -- defaults.variables.CC = "env MACOSX_DEPLOYMENT_TARGET=10."..version.." gcc" -- defaults.variables.LD = "env MACOSX_DEPLOYMENT_TARGET=10."..version.." gcc" -+ defaults.variables.CC = "env MACOSX_DEPLOYMENT_TARGET=10."..version.." clang" -+ defaults.variables.LD = "env MACOSX_DEPLOYMENT_TARGET=10."..version.." clang" - defaults.web_browser = "open" - end - diff --git a/pkgs/development/tools/misc/luarocks/luarocks-nix.nix b/pkgs/development/tools/misc/luarocks/luarocks-nix.nix index 8da224f0ef8c..21611f05579b 100644 --- a/pkgs/development/tools/misc/luarocks/luarocks-nix.nix +++ b/pkgs/development/tools/misc/luarocks/luarocks-nix.nix @@ -1,13 +1,14 @@ { luarocks, fetchFromGitHub }: luarocks.overrideAttrs(old: { pname = "luarocks-nix"; + version = "2019-09-07"; src = fetchFromGitHub { - owner = "teto"; + owner = "nix-community"; repo = "luarocks"; - rev = "38ed82ba3e5682d7d55ef9a870dfb464ca180df9"; - sha256 = "0vlzywiv3sxkpjg1fzzxicmfr6kh04fxw5q9n8vsd2075xjxg6bs"; + rev = "fa7c367bcdad36768db5f19fd4fcdd9681a14429"; + sha256 = "0kziwfw5gqq5xsckl7qf9wasaiy8rp42h5qrcnjx07qp47a9ldx7"; }; patches = [ - ./darwin-3.0.x.patch + ./darwin-3.1.3.patch ]; })