Merge pull request #134791 from gpanders/luajit-openresty

Use luajit-openresty with Neovim on aarch64-darwin

authored by

Jörg Thalheim and committed by
GitHub
965c1c56 c754d40c

+27 -28
+5
pkgs/development/interpreters/lua-5/default.nix
··· 54 inherit callPackage; 55 }; 56 57 }
··· 54 inherit callPackage; 55 }; 56 57 + luajit_openresty = import ../luajit/openresty.nix { 58 + self = luajit_openresty; 59 + inherit callPackage; 60 + }; 61 + 62 }
+2
pkgs/development/interpreters/luajit/2.0.nix
··· 1 { self, callPackage, lib }: 2 callPackage ./default.nix { 3 inherit self; 4 version = "2.0.5-2021-06-08"; 5 rev = "98f95f69180d48ce49289d6428b46a9ccdd67a46"; 6 isStable = true;
··· 1 { self, callPackage, lib }: 2 callPackage ./default.nix { 3 inherit self; 4 + owner = "LuaJIT"; 5 + repo = "LuaJIT"; 6 version = "2.0.5-2021-06-08"; 7 rev = "98f95f69180d48ce49289d6428b46a9ccdd67a46"; 8 isStable = true;
+2
pkgs/development/interpreters/luajit/2.1.nix
··· 1 { self, callPackage }: 2 callPackage ./default.nix { 3 inherit self; 4 version = "2.1.0-2021-06-25"; 5 rev = "e957737650e060d5bf1c2909b741cc3dffe073ac"; 6 isStable = false;
··· 1 { self, callPackage }: 2 callPackage ./default.nix { 3 inherit self; 4 + owner = "LuaJIT"; 5 + repo = "LuaJIT"; 6 version = "2.1.0-2021-06-25"; 7 rev = "e957737650e060d5bf1c2909b741cc3dffe073ac"; 8 isStable = false;
+3 -3
pkgs/development/interpreters/luajit/default.nix
··· 1 { lib, stdenv, fetchFromGitHub, buildPackages 2 , name ? "luajit-${version}" 3 , isStable 4 , sha256 5 , rev 6 , version ··· 41 stdenv.mkDerivation rec { 42 inherit name version; 43 src = fetchFromGitHub { 44 - owner = "LuaJIT"; 45 - repo = "LuaJIT"; 46 - inherit sha256 rev; 47 }; 48 49 luaversion = "5.1";
··· 1 { lib, stdenv, fetchFromGitHub, buildPackages 2 , name ? "luajit-${version}" 3 , isStable 4 + , owner 5 + , repo 6 , sha256 7 , rev 8 , version ··· 43 stdenv.mkDerivation rec { 44 inherit name version; 45 src = fetchFromGitHub { 46 + inherit owner repo sha256 rev; 47 }; 48 49 luaversion = "5.1";
+10
pkgs/development/interpreters/luajit/openresty.nix
···
··· 1 + { self, callPackage }: 2 + callPackage ./default.nix rec { 3 + inherit self; 4 + owner = "openresty"; 5 + repo = "luajit2"; 6 + version = "2.1-20210510"; 7 + rev = "v${version}"; 8 + isStable = true; 9 + sha256 = "1h21w5axwka2j9jb86yc69qrprcavccyr2qihiw4b76r1zxzalvd"; 10 + }
+5 -25
pkgs/top-level/all-packages.nix
··· 12670 12671 ### LUA interpreters 12672 luaInterpreters = callPackage ./../development/interpreters/lua-5 {}; 12673 - inherit (luaInterpreters) lua5_1 lua5_2 lua5_2_compat lua5_3 lua5_3_compat lua5_4 lua5_4_compat luajit_2_1 luajit_2_0; 12674 12675 lua5 = lua5_2_compat; 12676 lua = lua5; ··· 27983 wrapNeovimUnstable = callPackage ../applications/editors/neovim/wrapper.nix { }; 27984 wrapNeovim = neovim-unwrapped: lib.makeOverridable (neovimUtils.legacyWrapper neovim-unwrapped); 27985 neovim-unwrapped = callPackage ../applications/editors/neovim { 27986 - # neovim doesn't build with luajit on aarch64-darwin : 27987 - # ./luarocks init 27988 - # PANIC: unprotected error in call to Lua API (module 'luarocks.core.hardcoded' not found: 27989 - # no field package.preload['luarocks.core.hardcoded'] 27990 - # no file '/private/tmp/nix-build-luarocks-3.2.1.drv-0/source/src/luarocks/core/hardcoded.lua' 27991 - # no file './luarocks/core/hardcoded.lua' 27992 - # no file '/nix/store/3s6c509q9vvq3db87rfi7qa38wzxwz8w-luajit-2.1.0-2021-05-29/share/luajit-2.1.0-beta3/luarocks/core/hardcoded.lua' 27993 - # no file '/usr/local/share/lua/5.1/luarocks/core/hardcoded.lua' 27994 - # no file '/usr/local/share/lua/5.1/luarocks/core/hardcoded/init.lua' 27995 - # no file '/nix/store/3s6c509q9vvq3db87rfi7qa38wzxwz8w-luajit-2.1.0-2021-05-29/share/lua/5.1/luarocks/core/hardcoded.lua' 27996 - # no file '/nix/store/3s6c509q9vvq3db87rfi7qa38wzxwz8w-luajit-2.1.0-2021-05-29/share/lua/5.1/luarocks/core/hardcoded/init.lua' 27997 - # no file './luarocks/core/hardcoded.so' 27998 - # no file '/usr/local/lib/lua/5.1/luarocks/core/hardcoded.so' 27999 - # no file '/nix/store/3s6c509q9vvq3db87rfi7qa38wzxwz8w-luajit-2.1.0-2021-05-29/lib/lua/5.1/luarocks/core/hardcoded.so' 28000 - # no file '/usr/local/lib/lua/5.1/loadall.so' 28001 - # no file './luarocks.so' 28002 - # no file '/usr/local/lib/lua/5.1/luarocks.so' 28003 - # no file '/nix/store/3s6c509q9vvq3db87rfi7qa38wzxwz8w-luajit-2.1.0-2021-05-29/lib/lua/5.1/luarocks.so' 28004 - # no file '/usr/local/lib/lua/5.1/loadall.so') 28005 - # make: *** [GNUmakefile:57: luarocks] Error 1 28006 - # 28007 - # See https://github.com/NixOS/nixpkgs/issues/129099 28008 - # Possibly related: https://github.com/neovim/neovim/issues/7879 28009 lua = 28010 - if (stdenv.isDarwin && stdenv.isAarch64) then lua5_1 else 28011 luajit; 28012 }; 28013
··· 12670 12671 ### LUA interpreters 12672 luaInterpreters = callPackage ./../development/interpreters/lua-5 {}; 12673 + inherit (luaInterpreters) lua5_1 lua5_2 lua5_2_compat lua5_3 lua5_3_compat lua5_4 lua5_4_compat luajit_openresty luajit_2_1 luajit_2_0; 12674 12675 lua5 = lua5_2_compat; 12676 lua = lua5; ··· 27983 wrapNeovimUnstable = callPackage ../applications/editors/neovim/wrapper.nix { }; 27984 wrapNeovim = neovim-unwrapped: lib.makeOverridable (neovimUtils.legacyWrapper neovim-unwrapped); 27985 neovim-unwrapped = callPackage ../applications/editors/neovim { 27986 + # See: 27987 + # - https://github.com/NixOS/nixpkgs/issues/129099 27988 + # - https://github.com/NixOS/nixpkgs/issues/128959 27989 lua = 27990 + if (stdenv.isDarwin && stdenv.isAarch64) then luajit_openresty else 27991 luajit; 27992 }; 27993