Otok public index

apotocki/lua

apotocki/lua 5.5.1 (r2, apple)

Library
lua
Variant
apple, target apple
Channel
stable
Published
2026-11-07
Recipe source
https://github.com/otok-dev/recipes
2481fd248e2f96b07e70d4849a338953a7f2305e in recipes/lua/5.5/apple/
Recipe SHA-256
14e1dfbcfe861abdf809e91b1a092ac0af17921ab61ef3e3d6ed3624cb84b002
Previous
5.5.1 (r1, apple)

Changes since 5.5.1 (r1, apple)

Key5.5.1 (r1, apple)5.5.1 (r2, apple)
source.mirrorsabsent["https://www.tecgraf.puc-rio.br/lua/ftp/lua-5.5.1.tar.gz"]

Recipe files changed

  • recipe.toml changed

3 files are the same as in 5.5.1 (r1, apple).

Inputs

source.mirrors["https://www.tecgraf.puc-rio.br/lua/ftp/lua-5.5.1.tar.gz"]
source.sha2561c4b4068d67061f2a2231ad2b5422e77acea1487ea9890f6320af614f4373dce
source.urlhttps://www.lua.org/ftp/lua-5.5.1.tar.gz

Platforms

ios, iossim, macosx, catalyst, tvos, tvossim, watchos, watchossim, xros, xrossim

Toolchains

Recipe files

CMakeLists.txt 1479 bytes · raw
# 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 1066 bytes · raw
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 908 bytes · raw
-- 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 1106 bytes · raw
# 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 = 2
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"
mirrors = ["https://www.tecgraf.puc-rio.br/lua/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" }