git.iko.soy/typeable/nixpkgs
on master help sign in
luarocks: 3.2 -> 3.8
commit8bb4179147ba81713f12085b1a7395547b812294 authorMatthieu Coudron <mcoudron@hotmail.com> dateTue 29 Mar 2022, 03:19 (5 years ago) parent2c338f5
4 files changed+4−113
pkgs/development/tools/misc/luarocks/3.7.nix−81 pkgs/development/tools/misc/luarocks/darwin-3.1.3.patch−24 pkgs/development/tools/misc/luarocks/default.nix+3−3 pkgs/top-level/lua-packages.nix+1−5
pkgs/development/tools/misc/luarocks/3.7.nixdeleted−81
@@ -1,81 +0,0 @@
1−{lib, stdenv, fetchFromGitHub
2−, curl, makeWrapper, which, unzip
3−, lua
4−# for 'luarocks pack'
5−, zip
6−# some packages need to be compiled with cmake
7−, cmake
8−, installShellFiles
9−}:
10−
11−stdenv.mkDerivation rec {
12− pname = "luarocks";
13− version = "3.7.0";
14−
15− src = fetchFromGitHub {
16− owner = "luarocks";
17− repo = "luarocks";
18− rev = "v${version}";
19− sha256 = "1sn2j7hv8nbdjqj1747glk9770zw8q5v8ivaxhvwbk3vl038ck9d";
20− };
21−
22− patches = [ ./darwin-3.7.0.patch ];
23−
24− postPatch = lib.optionalString stdenv.targetPlatform.isDarwin ''
25− substituteInPlace src/luarocks/core/cfg.lua --subst-var-by 'darwinMinVersion' '${stdenv.targetPlatform.darwinMinVersion}'
26− '';
27−
28− preConfigure = ''
29− lua -e "" || {
30− luajit -e "" && {
31− export LUA_SUFFIX=jit
32− configureFlags="$configureFlags --lua-suffix=$LUA_SUFFIX"
33− }
34− }
35− lua_inc="$(echo "${lua}/include"/*/)"
36− if test -n "$lua_inc"; then
37− configureFlags="$configureFlags --with-lua-include=$lua_inc"
38− fi
39− '';
40−
41− nativeBuildInputs = [ makeWrapper installShellFiles ];
42−
43− buildInputs = [ lua curl which ];
44−
45− postInstall = ''
46− sed -e "1s@.*@#! ${lua}/bin/lua$LUA_SUFFIX@" -i "$out"/bin/*
47− for i in "$out"/bin/*; do
48− test -L "$i" || {
49− wrapProgram "$i" \
50− --suffix LUA_PATH ";" "$(echo "$out"/share/lua/*/)?.lua" \
51− --suffix LUA_PATH ";" "$(echo "$out"/share/lua/*/)?/init.lua" \
52− --suffix LUA_CPATH ";" "$(echo "$out"/lib/lua/*/)?.so" \
53− --suffix LUA_CPATH ";" "$(echo "$out"/share/lua/*/)?/init.lua"
54− }
55− done
56−
57− installShellCompletion --cmd luarocks --bash <($out/bin/luarocks completion bash)
58− installShellCompletion --cmd luarocks --zsh <($out/bin/luarocks completion zsh)
59− '';
60−
61− propagatedBuildInputs = [ zip unzip cmake ];
62−
63− # unpack hook for src.rock and rockspec files
64− setupHook = ./setup-hook.sh;
65−
66− # cmake is just to compile packages with "cmake" buildType, not luarocks itself
67− dontUseCmakeConfigure = true;
68−
69− shellHook = ''
70− export PATH="src/bin:''${PATH:-}"
71− export LUA_PATH="src/?.lua;''${LUA_PATH:-}"
72− '';
73−
74− meta = with lib; {
75− description = "A package manager for Lua";
76− license = licenses.mit ;
77− maintainers = with maintainers; [raskin teto];
78− platforms = platforms.linux ++ platforms.darwin;
79− downloadPage = "http://luarocks.org/releases/";
80− };
81−}
pkgs/development/tools/misc/luarocks/darwin-3.1.3.patchdeleted−24
@@ -1,24 +0,0 @@
1−diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua
2−index c5af5a2..1949fdc 100644
3−--- a/src/luarocks/core/cfg.lua
4−+++ b/src/luarocks/core/cfg.lua
5−@@ -425,7 +425,7 @@ local function make_defaults(lua_version, target_cpu, platforms, home)
6− defaults.external_lib_extension = "dylib"
7− defaults.arch = "macosx-"..target_cpu
8− defaults.variables.LIBFLAG = "-bundle -undefined dynamic_lookup -all_load"
9−- local version = util.popen_read("sw_vers -productVersion")
10−+ local version = os.getenv("MACOSX_DEPLOYMENT_TARGET") or "@darwinMinVersion@"
11− version = tonumber(version and version:match("^[^.]+%.([^.]+)")) or 3
12− if version >= 10 then
13− version = 8
14−@@ -434,8 +434,8 @@ local function make_defaults(lua_version, target_cpu, platforms, home)
15− else
16− defaults.gcc_rpath = false
17− end
18−- defaults.variables.CC = "env MACOSX_DEPLOYMENT_TARGET=10."..version.." gcc"
19−- defaults.variables.LD = "env MACOSX_DEPLOYMENT_TARGET=10."..version.." gcc"
20−+ defaults.variables.CC = "env MACOSX_DEPLOYMENT_TARGET=10."..version.." clang"
21−+ defaults.variables.LD = "env MACOSX_DEPLOYMENT_TARGET=10."..version.." clang"
22− defaults.web_browser = "open"
23− end
24−
pkgs/development/tools/misc/luarocks/default.nix+3−3
@@ -10,16 +10,16 @@
1010
1111stdenv.mkDerivation rec {
1212 pname = "luarocks";
13− version = "3.2.1";
13+ version = "3.8.0";
1414
1515 src = fetchFromGitHub {
1616 owner = "luarocks";
1717 repo = "luarocks";
1818 rev = "v${version}";
19− sha256 = "0viiafmb8binksda79ah828q1dfnb6jsqlk7vyndl2xvx9yfn4y2";
19+ sha256 = "sha256-tPSAtveOodF2w54d82hEyaTj91imtySJUTsk/gje2dQ=";
2020 };
2121
22− patches = [ ./darwin-3.1.3.patch ];
22+ patches = [ ./darwin-3.7.0.patch ];
2323
2424 postPatch = lib.optionalString stdenv.targetPlatform.isDarwin ''
2525 substituteInPlace src/luarocks/core/cfg.lua --subst-var-by 'darwinMinVersion' '${stdenv.targetPlatform.darwinMinVersion}'
pkgs/top-level/lua-packages.nix+1−5
@@ -63,11 +63,7 @@ in
6363 inherit (pkgs) makeSetupHook makeWrapper;
6464 };
6565
66− luarocks = callPackage ../development/tools/misc/luarocks {
67− inherit lua lib;
68− };
69−
70− luarocks-3_7 = callPackage ../development/tools/misc/luarocks/3.7.nix {
66+ luarocks = callPackage ../development/tools/misc/luarocks/default.nix {
7167 inherit lua lib;
7268 };
7369