OpenLuup OS X

Morning all.
I’m looking at alternatives to Vera and happen to have stumbled across some posts on OpenLuup
I also happen to have a Mac Mini I’m about to retire from mail server duties and wondered if there was any way I could re-purpose this and avoid having (another) RaspberryPi around the house (I keep losing track of the ones I already have!)

Any pointers, or a How To I can give a peruse at?

Cheers

C

I don’t think that OSX comes with a Lua install, but it’s really easy to get it. You need v5.1 to be compatible with Vera. I think the latest 5.1 is, in fact, 5.1.5.

You can build from scratch or use a pre-built binary.

You are a gent sir.

Lua installed
Trying to install OpenLuup and hitting an error:
lua: openLuup_install.lua:15: module ‘socket.http’ not found:

To the googles :slight_smile:

C

The openLuup User Guide says which additional libraries you need. Includes LuaSocket, LuaSec, plus a few others, mostly which comes as standard in pre-built versions.

Ta

Luarocks :slight_smile:

C

Thanks. So I’ve installed what appear to be the other required libraries (LuaSocket, Lua Sec and Luafilesystem) Got a snag that doesn’t appear to be library related:

openLuup_install 2018.08.05 @akbooer
lua: error loading module ‘ssl.core’ from file ‘/usr/local/lib/lua/5.3/ssl.so’:
dlopen(/usr/local/lib/lua/5.3/ssl.so, 6): Symbol not found: _EVP_PKEY_base_id
Referenced from: /usr/local/lib/lua/5.3/ssl.so
Expected in: dynamic lookup

stack traceback:
[C]: in ?
[C]: in function ‘require’
/usr/local/share/lua/5.3/ssl.lua:8: in main chunk
[C]: in function ‘require’
/usr/local/share/lua/5.3/ssl/https.lua:10: in main chunk
[C]: in function ‘require’
openLuup_install.lua:16: in main chunk
[C]: in ?

Googling rapidly loses me that there appears to be (possibly) some compatibility issue with the version installed by Luarocks and the version required by current OpenLuup.

If anyone can share some guidance or pointers, that would be simply super, or just some thoughts.

Many thanks

C

That’s a Lua 5.3 version, not 5.1.

Doh!

Thanks

C

OK, tried to get this correct

Removed Lua 5.3
Removed everything luarocks
deleted everything I could find that looked like it might be an issue.

Updated my brew installation so that that was working properly then did
brew install lua@5.1

That seemed to work fine

brew install luarocks

The same (although it also installed lua 5.3)

Then told me this:
LuaRocks supports multiple versions of Lua. By default it is configured
to use Lua5.3, but you can require it to use another version at runtime
with the --lua-dir flag, like this:

Fine, I thought so…

sudo luarocks --lua-dir=/usr/local/Cellar/lua@5.1/5.1.5_8 install luasocket
luasocket 3.0rc1-2 is now installed in /usr/local (license: MIT)

sudo luarocks --lua-dir=/usr/local/Cellar/lua@5.1/5.1.5_8 install luasec
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/config.c -o src/config.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/ec.c -o src/ec.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/x509.c -o src/x509.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/context.c -o src/context.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/ssl.c -o src/ssl.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/luasocket/buffer.c -o src/luasocket/buffer.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/luasocket/io.c -o src/luasocket/io.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/luasocket/timeout.c -o src/luasocket/timeout.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/luasocket/usocket.c -o src/luasocket/usocket.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -bundle -undefined dynamic_lookup -all_load -o ssl.so src/config.o src/ec.o src/x509.o src/context.o src/ssl.o src/luasocket/buffer.o src/luasocket/io.o src/luasocket/timeout.o src/luasocket/usocket.o -L/usr/lib -Wl,-rpath,/usr/lib: -lssl -lcrypto
luasec 0.7-1 is now installed in /usr/local (license: MIT)

But…

lua-5.1 openLuup_install.lua
openLuup_install 2018.08.05 @akbooer
lua-5.1: error loading module ‘ssl.core’ from file ‘/usr/local/lib/lua/5.1/ssl.so’:
dlopen(/usr/local/lib/lua/5.1/ssl.so, 2): Symbol not found: _EVP_PKEY_base_id
Referenced from: /usr/local/lib/lua/5.1/ssl.so
Expected in: dynamic lookup

stack traceback:
[C]: ?
[C]: in function ‘require’
/usr/local/share/lua/5.1/ssl.lua:8: in main chunk
[C]: in function ‘require’
/usr/local/share/lua/5.1/ssl/https.lua:10: in main chunk
[C]: in function ‘require’
openLuup_install.lua:16: in main chunk
[C]: ?

/usr/local/lib/lua/5.1/ssl.so is timestamped to indicate it was the version I just installed.

Anything else to help a poor, feeble seeker after knowledge?

Cheers!

C

Hmm, could this be a mismatch between the env MACOSX_DEPLOYMENT_TARGET=10.5 and my target actually running 10.6.8?

Just a thought…

Cheers

C

I’m not in front of my development system, ATM (or, indeed, anywhere near it!)

TBH, the Lua install I use is the one which comes with the fabulous Lua IDE, ZeroBrane Studio, so I’ve not messed with either brew or LuaRocks. I do need to update my Mac’s OpenSSL, though, since for the last few months it has not been able to cope with the security level that GitHub now requires for automatic updates (for openLuup and AltUI) but that is a separate issue.

No panic. I appreciate your input!

C