z-lua: wrap LUA_CPATH manually instead of lua.withPackages
We can't use lua.withPackages, because on darwin shebangs can't point to interpreted (shebang'd) scripts. See https://github.com/NixOS/nixpkgs/issues/23018
This commit is contained in:
parent
b16a186529
commit
0f1ce1787f
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchFromGitHub, lua }:
|
{ stdenv, fetchFromGitHub, lua52Packages, makeWrapper }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "z-lua";
|
pname = "z-lua";
|
||||||
@ -13,10 +13,17 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
dontBuild = true;
|
dontBuild = true;
|
||||||
|
|
||||||
buildInputs = [ (lua.withPackages (p: with p; [ luafilesystem ])) ];
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
|
buildInputs = [ lua52Packages.lua ];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
install -Dm755 z.lua $out/bin/z
|
install -Dm755 z.lua $out/bin/z
|
||||||
|
wrapProgram $out/bin/z --set LUA_CPATH "${lua52Packages.luafilesystem}/lib/lua/5.2/lfs.so" --set _ZL_USE_LFS 1;
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user