apotocki/lua 5.5.1 (r1, apple)
- Library
- lua
- Variant
- apple, target apple
- Channel
- stable
- Published
- 2026-11-07
- Recipe source
- https://github.com/otok-dev/recipes
32756a87cf5bd189ca4c9825159bf0713ea8cf5einrecipes/lua/5.5/apple/ - Recipe SHA-256
a6bb2bc8884072974a0e8f81a2f6902a8e19e864ee10c4a52a298b209f40e033
Recipe files changed
Inputs
| source.sha256 | 1c4b4068d67061f2a2231ad2b5422e77acea1487ea9890f6320af614f4373dce |
|---|---|
| source.url | https://www.lua.org/ftp/lua-5.5.1.tar.gz |
Platforms
ios, iossim, macosx, catalyst, tvos, tvossim, watchos, watchossim, xros, xrossim
Toolchains
cmake { default-recipe = "apotocki/cmake", version = ">= 3.20" }ninja { default-recipe = "apotocki/ninja", version = ">= 1.10" }
Recipe files
CMakeLists.txt
# The Lua library of the otok recipe: the core and the standard libraries of the release's src/Makefile
# (CORE_O and LIB_O), without the lua and luac programs, static or shared as BUILD_SHARED_LIBS says.
cmake_minimum_required(VERSION 3.20)
project(lua VERSION 5.5.1 LANGUAGES C)
# LUA_USE_LINUX, LUA_USE_MACOSX, LUA_USE_IOS, as the Makefile's targets set them; empty on Windows, where
# luaconf.h sees _WIN32
set(LUA_SYSTEM "" CACHE STRING "The target system's definition for luaconf.h")
set(core lapi lcode lctype ldebug ldo ldump lfunc lgc llex lmem lobject lopcodes lparser lstate lstring ltable ltm lundump lvm lzio)
set(libs lauxlib lbaselib lcorolib ldblib liolib lmathlib loadlib loslib lstrlib ltablib lutf8lib linit)
set(sources "")
foreach(name IN LISTS core libs)
list(APPEND sources src/${name}.c)
endforeach()
add_library(lua ${sources})
if(LUA_SYSTEM)
target_compile_definitions(lua PRIVATE ${LUA_SYSTEM})
endif()
if(WIN32 AND BUILD_SHARED_LIBS)
# luaconf.h exports the API from the DLL
target_compile_definitions(lua PRIVATE LUA_BUILD_AS_DLL)
endif()
if(UNIX)
target_link_libraries(lua PRIVATE m ${CMAKE_DL_LIBS})
endif()
set_target_properties(lua PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR})
install(TARGETS lua RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
install(FILES src/lua.h src/luaconf.h src/lualib.h src/lauxlib.h src/lua.hpp DESTINATION include)
LICENSE
Copyright (C) 1994-2026 Lua.org, PUC-Rio.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
build.lua
-- The Lua library through the recipe's CMakeLists.txt, which builds what the release's src/Makefile
-- builds into liblua.a.
function build(slice, options, deps)
otok.copy(slice.recipe .. "/CMakeLists.txt", slice.source .. "/CMakeLists.txt")
-- the system's definition for luaconf.h, as the Makefile's targets set it; the other Apple platforms have no
-- system(): LUA_USE_IOS replaces it with a stub
otok.cmake{ defines = { LUA_SYSTEM = slice.platform == "macosx" and "LUA_USE_MACOSX" or "LUA_USE_IOS" } }
-- lua.hpp is for C++ only (extern "C"), so it stays out of the module
local p = slice.prefix
otok.write(p .. "/module.modulemap", 'module Lua {\n header "../lua.h"\n header "../lualib.h"\n header "../lauxlib.h"\n export *\n}\n')
return { libraries = { lua = p .. "/lib/liblua.a" }, headers = p .. "/include", module_map = p .. "/module.modulemap" }
end
recipe.toml
# The otok recipe of Lua (https://github.com/apotocki/otok): the library for every Apple platform, from the
# release archive; static.
[recipe]
api = 1
library = "lua"
name = "lua"
version = "5.5.1"
revision = 1
license = "MIT"
# the release archive has no license file: LICENSE is the notice at the end of src/lua.h
license-files = [{ recipe = "LICENSE" }]
homepage = "https://www.lua.org"
description = "Lua, the embeddable scripting language, as a library."
keywords = ["lua", "scripting"]
linkage = ["static"]
[source]
url = "https://www.lua.org/ftp/lua-5.5.1.tar.gz"
sha256 = "1c4b4068d67061f2a2231ad2b5422e77acea1487ea9890f6320af614f4373dce"
[platforms]
supported = ["ios", "iossim", "macosx", "catalyst", "tvos", "tvossim", "watchos", "watchossim", "xros", "xrossim"]
build-on = ["macos/xcode"]
[toolchains]
cmake = { version = ">= 3.20", default-recipe = "apotocki/cmake" }
ninja = { version = ">= 1.10", default-recipe = "apotocki/ninja" }
[[product]]
name = "Lua"
libraries = ["lua"]
apple = { privacy-manifest = "none" }