为windows创建一个rockspec

时间:2014-09-23 14:25:43

标签: lua luarocks

我对LuaRocks文档感到困惑。我正在创建一个rockspec,它将库dll文件复制到clibs,将文件扩展器复制到lua / logging文件夹。 在这里我到目前为止

package = "lualoggingapender"
version = "1.0-1"
source = {
    url = "",
}
description = {
   summary = "An example for the LuaRocks tutorial.",
   detailed = [[
      This is an example for the LuaRocks tutorial.
      Here we would put a detailed, typically
      paragraph-long description.
   ]],
   homepage = "http://...", -- We don't have one yet
   license = "MIT/X11" -- or whatever you like
}
dependencies = {
   "lua ~> 5.1"
   -- If you depend on other rocks, add them here
}
build = {
  type = "make",
  install_variables = {
    LUA_LIBDIR = "$(LIBDIR)",
    LUA_DIR = "$(LUADIR)",
    BIN_DIR = "$(BINDIR)"
  },
  platforms = {
    win32 = {
      type = "make",
      build_variables = {
        LUA_DIR = "$(LUA_LIBDIR)\\lib/lib.dll",
      }
    }
  }
}

这是我应该怎么做的?

我的配置文件是

local LFW_ROOT = config.LFW_ROOT
rocks_servers = {
   [[http://luarocks.org/repositories/rocks]]
}
rocks_trees = {
   { root = LFW_ROOT, rocks_dir = LFW_ROOT..[[\rocks]],
     bin_dir = LFW_ROOT, lua_dir = LFW_ROOT..[[\lua]],
     lib_dir = LFW_ROOT..[[\clibs]] }
}
variables.WRAPPER = LFW_ROOT..[[\rclauncher.obj]]

当我试图运行它时,我收到以下错误

'nmake' is not recognized as an internal or external command,
operable program or batch file.

Error: Build error: Failed building.

当我在VS2013命令行中运行它时,我收到以下错误

NMAKE : fatal error U1052: file 'Makefile.win' not found
Stop.

Error: Build error: Failed building.

最后一件事我应该使用make还是buildin,有什么区别

更新:我能够复制和构建lua模块,但我仍然遇到安装lib的问题,它说:无法复制FileName 这里是我的最终代码看起来像

package = "lualoggingapender"
version = "1.0-1"
source = {
    url = "",
    dir = "lib",
    dir = "logging"
}
description = {
   summary = "An example for the LuaRocks tutorial.",
   detailed = [[
      This is an example for the LuaRocks tutorial.
      Here we would put a detailed, typically
      paragraph-long description.
   ]],
   homepage = "http://...", -- We don't have one yet
   license = "MIT/X11" -- or whatever you like
}
dependencies = {
   "lua ~> 5.1",
   -- If you depend on other rocks, add them here
}

build = {
  type = "builtin",
  install_variables = {
    LUA_LIBDIR = "$(LIBDIR)",
    LUA_DIR = "$(LUADIR)",
    BIN_DIR = "$(BINDIR)"
  },
  platforms = {
    win32 = {
     type = "builtin",
      modules = {
      ["logging.windows"] = "windows.lua",
      },
      install = {
        lib = {
        winEvntLog ="lib/winEvntLog.dll",
        msgLog = "lib/msgLog.dll",
        },
      },
    }
  }
}

0 个答案:

没有答案