lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I have this script [1] that I use first to bundle all the linked Lua and C modules together in one directory. This helps consolidate all the dependencies in a single place. It does it automatically by looking in the code at all the requires and any additional modules that you want included/excluded and finds them using the same way require searches for the module and copies them over.
    Once everything is in one place I use srlua [2] to make an executable. The end result is a directory with 1 executable that contains all the Lua code embedded in it and all the relevant DLLs packaged in 1 directory with these 2 commands.

1. https://github.com/aryajur/many2one
2. https://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/ar/srlua-102.tar.gz

On Mon, Jan 11, 2021 at 12:13 PM Norman Ramsey <nr@cs.tufts.edu> wrote:
I've been asked to simplify distribution of some of my software, which
relies on a library of a couple of hundred Lua modules.  I'm hoping to
distribute code by bundling each key script into a single Lua file,
which will include the source code for every module that would
otherwise be (transitively) loaded by `require`.  I got the idea from
the `ilump` program written in 1994 by Gregg Townsend and distributed
with the Icon programming language:

  #     ilump copies one or more Icon source files, incorporating recursively
  #  the source code for files named by "link" directives.  This produces a
  #  standalone source program in one file, which is useful with certain
  #  profiling and visualization tools.

I'm preparing to write something similar for Lua, but I'd rather not
reinvent any wheels.  Is there code out there that I should be using?


Norman Ramsey