diff --git a/pkgs/development/interpreters/lua-5/5.1.nix b/pkgs/development/interpreters/lua-5/5.1.nix index 9a57a034ad1..e004a30fe20 100644 --- a/pkgs/development/interpreters/lua-5/5.1.nix +++ b/pkgs/development/interpreters/lua-5/5.1.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, readline }: +{ stdenv, fetchurl, readline, makeWrapper }: let dsoPatch = fetchurl { @@ -16,11 +16,11 @@ stdenv.mkDerivation rec { sha256 = "2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333"; }; - buildInputs = [ readline ]; + buildInputs = [ readline makeWrapper ]; patches = if stdenv.isDarwin then [ ./5.1.darwin.patch ] else [ dsoPatch ]; - configurePhase = + configurePhase = if stdenv.isDarwin then '' makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=macosx CFLAGS="-DLUA_USE_LINUX -fno-common -O2" LDLAGS="" ) @@ -35,6 +35,9 @@ stdenv.mkDerivation rec { sed <"etc/lua.pc" >"$out/lib/pkgconfig/lua.pc" -e "s|^prefix=.*|prefix=$out|" mv "doc/"*.{gif,png,css,html} "$out/share/doc/lua/" rmdir $out/{share,lib}/lua/5.1 $out/{share,lib}/lua + wrapProgram $out/bin/lua \ + --set LUA_PATH '$HOME/.nix-profile/lib/lua/5.1/?.lua' \ + --set LUA_CPATH '$HOME/.nix-profile/lib/lua/5.1/?.so' ''; meta = {