Skip to content

osch/luarocks-build-extended

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

luarocks-build-extended

Licence Build Status Build status Install

A fork of Luarocks built-in build system.

Specify "extended" as build type and "luarocks-build-extended" as dependency to use it (see example below).

  • Support for compiling C++ sources, similar to luarocks-build-cpp. C++ files are detected by file extensions (.cpp, .cxx or .cc) For C++ compiling g++ is not used, gcc with stdc++ library is.
  • Support for module specific variables (see also luarocks/luarocks#368 or luarocks/luarocks#367):
    • CFLAG_EXTRAS list of additional C compiler arguments
    • CXXFLAG_EXTRAS list of additional C++ compiler arguments
    • LIBFLAG_EXTRAS list of additional linker arguments
  • New variable BUILD_DATE contains build date in ISO-8601 format.
  • Support for external_dependencies with the ability to disable header search per platform, see also the example for installing LuaGL OpenGL binding.

Example rockspec

package = "name"
version = "0.1-1"
source = {
    url = "git://github.com/username/name.git"
}
description = {
    summary = "...",
    detailed = "...",
    homepage = "http://github.com/username/name",
    license = "MIT/X11"
}
dependencies = {
    "lua >= 5.1, < 5.3",
    "luarocks-build-extended"
}
build = {
    type = "extended",
    platforms = {
        macosx = {
            modules = {
                name = {
                    variables = {
                        LIBFLAG_EXTRAS = { 
                            "-framework", "Cocoa" 
                        }
                    }
                }
            }
        }
    },
    modules = {
        name = {
            sources = {
                "name.cpp",
                "aux.cpp"
            },
            defines = { 
              "MY_BUILD_DATE=$(BUILD_DATE)"
            },
        }
    }
}

See also the real world example for installing Lua OpenGL binding.