Hello,
LuaDist more or less follows unix style of software deployment.
Packages are installed into /bin /lib /include /share etc. Package
data is usually stored in /share/[package] using the install_data ( )
macro[1]. In that directory the structure is up to you.
On Tue, Apr 2, 2013 at 1:08 PM, Gaspard Bucher <
gas...@teti.ch> wrote:
> Hi there,
>
> I would like to let lua users easily install core parts of lubyk but before
> moving forward, I have one important issue that I want to be sure can be
> handled by luadist:
>
> How are assets (template files, images, etc) managed ?
The recommended approach is to install to /share/[package] but
installing alongside Lua modules is acceptable also.
> Actually, I install these along the lua source files (like rubygems does)
> and this makes finding them very easy, portable and relocatable.
Yes, indeed this has advantages but also some disadvantages. The
primary advantage is that the files are easy to locate using
package.path. The disadvantage is that this makes the installations
messier and limits automated processing of lua modules using automated
tools to some extent.
> How does luadist handle this ?
I prefer to install into /share/[package], from within Lua the path to
the LuaDist deployment directory is as follows:
local paths = {}
package.path:gsub("([^;]+)", function(c) table.insert(paths, c) end)
local path = paths[2]:gsub("[/\\]bin[/\\]%.%..*","")
LuaDist does provide utility function to obtain the directory also but
the above snippet removes the requirement to have luadist-git package
installed. From within that path you can access /share/[package] as
usual.
If you intend to pack an application rather then lua modules please
have a look at zerobranestudio and its launcher[2].
pd
[1]
https://github.com/LuaDist/zerobranestudio/blob/master/CMakeLists.txt#L13
[2]
https://github.com/LuaDist/zerobranestudio/blob/master/zbstudio.lua