Just for the hell of it really, I have a similar setup to love in terms of lua code and libs and it might be possible to push and pull some code between my projects and love since we are working along similar lines.
Hit a couple of strange problems in the process
1: was I semed to be creating zip files that love couldn't read all the files from?
The files where created with zip under linuxmint and I was testing with the packaged version of love.
2: that the module loading system in love doesnt honour the package search path within zip files.
3. The append a zip file to the end of the exe trick does not seem to work with wine which is a shame since I was thinking I could treat the windows version as "universal".
The first I solved by switching to 7zip, see atached love file, is it ok to use that? (I tested with unix/windows) will it break under mac?
The second I fixed by using a custom lua loader module, maybe it would be a good idea to remove the current C loader and replace it with a lua based loader more like this.
Code: Select all
local function loadit(modulename) local errmsg = "" -- Find source local modulepath = string.gsub(modulename, "%.", "/") for path in string.gmatch(package.path, "([^;]+)") do local filename = string.gsub(path, "%?", modulepath) if love.filesystem.exists(filename) then return assert(loadstring(assert(love.filesystem.read(filename) ), filename)) else end errmsg = errmsg.."\n\tno (love) file '"..filename.."'" end return errmsg end -- Install the loader so that it's called just before the normal Lua loader table.insert(package.loaders, 2, loadit)
The third is probably best ignored, its a cheap trick after all.