anchor.diff:    '';
   
     LuaPathSearchPaths = [
  -    "lib/lua/${luaversion}/?.lua" "share/lua/${luaversion}/?.lua"
  -    "share/lua/${luaversion}/?/init.lua" "lib/lua/${luaversion}/?/init.lua"
  +    "lib/lua/${luaversion}/?.lua"
  +    "share/lua/${luaversion}/?.lua"
  +    "share/lua/${luaversion}/?/init.lua"
  +    "lib/lua/${luaversion}/?/init.lua"
       "share/${name}/?.lua"
     ];
     LuaCPathSearchPaths = [ "lib/lua/${luaversion}/?.so" "share/lua/${luaversion}/?.so" ];
  
positive.code:       lua = self;
        inherit (luaPackages) requiredLuaModules;
      };
      withPackages = import ../lua-5/with-packages.nix { inherit buildEnv luaPackages;};
      pkgs = luaPackages;
      interpreter = "${self}/bin/lua";
    };
  
    meta = with lib; {
      description = "High-performance JIT compiler for Lua 5.1";
      homepage    = "http://luajit.org";
      license     = licenses.mit;
      platforms   = platforms.linux ++ platforms.darwin;
      maintainers = with maintainers; [ thoughtpolice smironov vcunat andir lblasc ];
    } // extraMeta;
  }
  
negative.code: assert enableGDBJITSupport -> enableJIT;
  assert enableValgrindSupport -> valgrind != null;
  let
    luaPackages = callPackage ../../lua-modules { lua = self; overrides = packageOverrides; };
  
    XCFLAGS = with lib;
      optional (!enableFFI) "-DLUAJIT_DISABLE_FFI"
      ++ optional (!enableJIT) "-DLUAJIT_DISABLE_JIT"
      ++ optional enable52Compat "-DLUAJIT_ENABLE_LUA52COMPAT"
      ++ optional (!enableGC64) "-DLUAJIT_DISABLE_GC64"
      ++ optional useSystemMalloc "-DLUAJIT_USE_SYSMALLOC"
      ++ optional enableValgrindSupport "-DLUAJIT_USE_VALGRIND"
      ++ optional enableGDBJITSupport "-DLUAJIT_USE_GDBJIT"
      ++ optional enableAPICheck "-DLUAJIT_USE_APICHECK"
      ++ optional enableVMAssertions "-DLUAJIT_USE_ASSERT"
    ;
  in
  stdenv.mkDerivation rec {
    inherit name version;
    src = fetchFromGitHub {
      owner = "LuaJIT";
      repo = "LuaJIT";
      inherit sha256 rev;
    };
  
  