Where do I put external c libs? (luasec on macOS)
Posted: Fri Dec 21, 2018 3:01 pm
Hi there,
I'd like to send HTTPS requests out of my game. I gather from the forums that I need luasec for that. OK, I acquired luasec via luarocks, it is installed here on my machine:
I can now send https requests easily with local https = require 'ssl.https'. I just require 'ssl.https' instead of 'socket.http' and everything works. Amazing.
Except it only works on my machine. My game now depends on the stuff under /usr/local/, if I remove them to simulate being on a random Mac, I get an error "module 'ssl.core' not found". OK then, I'll copy the two lua files and the shared object to my project directory, next to my main.lua. Great, everything works again.
I now make a fused distribution for macOS following the usual guide. I make sure to include ssl.so in my .love file (next to main.lua). No luck.
Note that LOVE does try to load './ssl.so'. I also tried to copy ssl.so next to the SuperGame.love file to the folder SuperGame.app/Contents/Resources, alas, I still get the same output. If I copy back ssl.so to /usr/local/lib/lua/5.1, the app starts successfully in fused mode, and sends HTTPS requests like a champ.
So my question: where do I put external C libraries such as luasec's ssl.so so that it works in fused mode? Thanks a lot!
I'd like to send HTTPS requests out of my game. I gather from the forums that I need luasec for that. OK, I acquired luasec via luarocks, it is installed here on my machine:
Code: Select all
/usr/local/share/lua/5.1/ssl.lua
/usr/local/share/lua/5.1/ssl/https.lua
/usr/local/lib/lua/5.1/ssl.so
Except it only works on my machine. My game now depends on the stuff under /usr/local/, if I remove them to simulate being on a random Mac, I get an error "module 'ssl.core' not found". OK then, I'll copy the two lua files and the shared object to my project directory, next to my main.lua. Great, everything works again.
I now make a fused distribution for macOS following the usual guide. I make sure to include ssl.so in my .love file (next to main.lua). No luck.
Code: Select all
Error
ssl.lua:8: module 'ssl.core' not found:
no field package.preload['ssl.core']
no 'ssl/core' in LOVE game directories.
no file 'ssl/core' in LOVE paths.
no file './ssl/core.lua'
no file '/usr/local/share/luajit-2.0.5/ssl/core.lua'
no file '/usr/local/share/lua/5.1/ssl/core.lua'
no file '/usr/local/share/lua/5.1/ssl/core/init.lua'
no file './ssl/core.so'
no file '/usr/local/lib/lua/5.1/ssl/core.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file './ssl.so'
no file '/usr/local/lib/lua/5.1/ssl.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no module 'ssl.core' in LOVERocks path.
no library 'ssl/core.so' in LOVERocks path.
no library 'ssl/.so' in LOVERocks path.
So my question: where do I put external C libraries such as luasec's ssl.so so that it works in fused mode? Thanks a lot!