On 30 January 2015 at 22:56, tenspd137 . <dcday...@gmail.com> wrote: > Sorry for not replying directly, but for some reason I did not get > mail from the list - I checked the archives. Anyway, I did see this, > but I couldn't figure out the variable: FFI_INCDIR > > For future reference - how do you find these variables?
The documentation exists, but indeed it is a bit scattered around: http://www.luarocks.org/en/Paths_and_external_dependencies Paths for external dependencies (such as C libraries used in the compilation of modules) are generated from the external_dependencies section of the rockspec (see the Rockspec format page for details.) And then in the Rockspec format page we have: http://www.luarocks.org/en/Rockspec_format external_dependencies (table) - For each key in the external_dependencies table in the rockspec file, four variables available to the build rules are created: key_DIR, key_BINDIR, key_INCDIR and key_LIBDIR. These are not overwritten if already set (e.g. by the LuaRocks config file or through the command-line). The base prefix for these can be given explicitly setting key_DIR in the config file or through the command-line, or implicitly, defaulting to the value of default_external_deps_dir, set in the config file. Values in the external_dependencies table are tables that may contain a "header" or a "library" field, with filenames to be tested for existence. Example: { EXPAT = { header = "expat.h" } } -- on Unix, this will check that key_DIR/include/expat.h exists and will create variables accordingly. And this bit is hidden in the source code comments: https://github.com/keplerproject/luarocks/blob/7a7c124/src/luarocks/deps.lua#L522-L529 --- Set up path-related variables for external dependencies. -- For each key in the external_dependencies table in the -- rockspec file, four variables are created: <key>_DIR, <key>_BINDIR, -- <key>_INCDIR and <key>_LIBDIR. These are not overwritten -- if already set (e.g. by the LuaRocks config file or through the -- command-line). Values in the external_dependencies table -- are tables that may contain a "header" or a "library" field, -- with filenames to be tested for existence. Notably, none of these feature a full example. So, if you have an external dependency on Expat and have an EXPAT entry in the external_dependencies table, you'll get these variables auto-populated: EXPAT_DIR, EXPAT_BINDIR, EXPAT_INCDIR, EXPAT_LIBDIR. In a default configuration, if expat.h is found in, say, /usr/local/include/expat.h, this means: EXPAT_DIR will be /usr/local, EXPAT_BINDIR will be /usr/local, EXPAT_INCDIR will be /usr/local/include, EXPAT_LIBDIR will be /usr/local/lib. If LuaRocks fails to find your external dependency, you can pass those as assignments in the command line: luarocks install luaexpat EXPAT_DIR=/usr/local (this will auto-derive EXPAT_BINDIR, EXPAT_INCDIR, EXPAT_LIBDIR) or luarocks install luaexpat EXPAT_INCDIR=/usr/local/include (to set one of those variables individually) The way these variables are derived from the main one is also configurable, through the config file, using the external_deps_subdirs table: http://www.luarocks.org/en/Config_file_format external_deps_subdirs (table with string keys and string values) - Subdirectories to be used in conjunction with external_deps_dirs. Specifies where to look for specific types external dependencies. This can be overriden, for example, on Linux distributions which feature multiarch libraries and libraries are no longer in the "lib" subdir. Default is { bin = "bin", lib = "lib", include = "include" }. You can check the location of the config file of your LuaRocks install by typing "luarocks" with no parameters. -- Hisham ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Luarocks-developers mailing list Luarocks-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/luarocks-developers