summary refs log tree commit diff
path: root/pkgs/development/tools/misc/luarocks
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/misc/luarocks')
-rw-r--r--pkgs/development/tools/misc/luarocks/darwin-3.1.3.patch2
-rw-r--r--pkgs/development/tools/misc/luarocks/default.nix12
-rw-r--r--pkgs/development/tools/misc/luarocks/luarocks-nix.nix9
3 files changed, 12 insertions, 11 deletions
diff --git a/pkgs/development/tools/misc/luarocks/darwin-3.1.3.patch b/pkgs/development/tools/misc/luarocks/darwin-3.1.3.patch
index 4ba883f0113..8070af173aa 100644
--- a/pkgs/development/tools/misc/luarocks/darwin-3.1.3.patch
+++ b/pkgs/development/tools/misc/luarocks/darwin-3.1.3.patch
@@ -7,7 +7,7 @@ index c5af5a2..1949fdc 100644
        defaults.arch = "macosx-"..target_cpu
        defaults.variables.LIBFLAG = "-bundle -undefined dynamic_lookup -all_load"
 -      local version = util.popen_read("sw_vers -productVersion")
-+      local version = os.getenv("MACOSX_DEPLOYMENT_TARGET") or "10.12"
++      local version = os.getenv("MACOSX_DEPLOYMENT_TARGET") or "@darwinMinVersion@"
        version = tonumber(version and version:match("^[^.]+%.([^.]+)")) or 3
        if version >= 10 then
           version = 8
diff --git a/pkgs/development/tools/misc/luarocks/default.nix b/pkgs/development/tools/misc/luarocks/default.nix
index fa19b249407..f3ec4b4d7a4 100644
--- a/pkgs/development/tools/misc/luarocks/default.nix
+++ b/pkgs/development/tools/misc/luarocks/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub
+{lib, stdenv, fetchFromGitHub
 , curl, makeWrapper, which, unzip
 , lua
 # for 'luarocks pack'
@@ -19,6 +19,11 @@ stdenv.mkDerivation rec {
   };
 
   patches = [ ./darwin-3.1.3.patch ];
+
+  postPatch = lib.optionalString stdenv.targetPlatform.isDarwin ''
+    substituteInPlace src/luarocks/core/cfg.lua --subst-var-by 'darwinMinVersion' '${stdenv.targetPlatform.darwinMinVersion}'
+  '';
+
   preConfigure = ''
     lua -e "" || {
         luajit -e "" && {
@@ -62,9 +67,8 @@ stdenv.mkDerivation rec {
     export LUA_PATH="src/?.lua;''${LUA_PATH:-}"
   '';
 
-  meta = with stdenv.lib; {
-    inherit version;
-    description = ''A package manager for Lua'';
+  meta = with lib; {
+    description = "A package manager for Lua";
     license = licenses.mit ;
     maintainers = with maintainers; [raskin teto];
     platforms = platforms.linux ++ platforms.darwin;
diff --git a/pkgs/development/tools/misc/luarocks/luarocks-nix.nix b/pkgs/development/tools/misc/luarocks/luarocks-nix.nix
index 57f200fd0fc..30e02a3623f 100644
--- a/pkgs/development/tools/misc/luarocks/luarocks-nix.nix
+++ b/pkgs/development/tools/misc/luarocks/luarocks-nix.nix
@@ -1,14 +1,11 @@
 { luarocks, fetchFromGitHub }:
 luarocks.overrideAttrs(old: {
   pname = "luarocks-nix";
-  version = "2019-09-07";
+  version = "2021-01-22";
   src = fetchFromGitHub {
     owner = "nix-community";
     repo = "luarocks-nix";
-    rev = "73b8772e56fd39dfffda9e3b13e9eb31e93d5cde";
-    sha256 = "00jgshygw439pbaxg7yph3ijia6nid9r1br416wdbyl5wqhlhm1y";
+    rev = "v3.5.0_nix";
+    sha256 = "sha256-Ea3PVkCaUPO/mvVZtHtD1G9T/Yom28M9oN6duY4ovHk=";
   };
-  patches = [
-    ./darwin-3.1.3.patch
-  ];
 })