Closed eestdnt closed 4 years ago
The main problem is PUC/Rio Lua 5.1 don't have bitwise support. lockbox do lot of bitwise operation.
I already make a small contrib to catch an available bitwise module, see lockbox.util.bit.
IMHO, the rest of the lockbox code should support Lua 5.1 without problem.
Lua and Luarocks don't have official virtual module name.
The depencies is made on specific module (with or without version constraint).
It is not possible to setup a dependency on an abstracted bitwise module (to target any of bit
or bit32
or bit.numberlua
or "another bitwise module").
Thank you for the reply. I managed to run it with LuaJIT 2.0.5, just need to copy the lockbox/ folder to the source code directory.
You're welcome ;)
I managed to run it with LuaJIT 2.0.5, just need to copy the lockbox/ folder to the source code directory.
Hi, I’m looking to use this ‘out of the box’ with a standard Lua install too. Where exactly did you put the lockbox/folder for LuaJIT ? Did you need to do anything else ?
Hi @nodecentral ,
You can put the lockbox/ folder in the same working directory where you start the Lua VM, since require "lockbox"
would then find the module in the VM current working directory.
Another way, if you use luarocks, is to put lockbox/ folder in your project directory and run luarocks make <path to lockbox rockspec file>
, e.g. ./lockbox/rockspecs/lockbox-0.1.0-0.rockspec .
Thanks so much for responding,
To avoid the folder option, could I also pick and choose the files I need and then use just those in a in more flat structure ?
For example if I wanted to use base64.lua ; as that module requires the following..
local String = require("string");
local Bit = require("lockbox.util.bit");
local Array = require("lockbox.util.array");
local Stream = require("lockbox.util.stream");
Can I just bring all the dependant module files in, and alter the above to the following flat structure?
local String = require("string");
local Bit = require("bit");
local Array = require("array");
local Stream = require("stream");
Would I also need to add the following to the base64 module and the same for all the others I need too ?
module("base64", package.seeall)
Yes, I think you can copy the dependent files to same directory where you call the Lua VM if you want a flat file structure.
Those files seem to be already exported as modules, so you only have to use require "array"
or require "base64"
to import them, no need for module(...)
, looks like the function is deprecated (http://lua-users.org/wiki/ModulesTutorial).
Hello,
Is it possible to add support for Lua v5.1 so I can 'luarocks install' for v5.1?