Otok public index

apotocki/lua

apotocki/lua 5.5.1 (r1, windows)

Library
lua
Variant
windows, target windows
Channel
stable
Published
2026-11-07
Recipe source
https://github.com/otok-dev/recipes.git
32756a87cf5bd189ca4c9825159bf0713ea8cf5e in recipes/lua/5.5/windows/
Recipe SHA-256
a15f4265660abebc1356c9a777644bf40b43ad41776f0e771660e5371728b731

Recipe files changed

Inputs

source.sha2561c4b4068d67061f2a2231ad2b5422e77acea1487ea9890f6320af614f4373dce
source.urlhttps://www.lua.org/ftp/lua-5.5.1.tar.gz

Platforms

windows

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 660 bytes · raw
-- The Lua library through the recipe's CMakeLists.txt, which builds what the release's src/Makefile
-- builds into liblua.a, static or as a DLL (the Makefile has no MSVC build). luaconf.h sees _WIN32.

function build(slice, options, deps)
    otok.copy(slice.recipe .. "/CMakeLists.txt", slice.source .. "/CMakeLists.txt")
    otok.cmake{ defines = { LUA_SYSTEM = "" } }
    local p = slice.prefix
    local dll = otok.glob("bin/lua.dll", p)[1]
    if dll then return { libraries = { lua = { link = p .. "/lib/lua.lib", runtime = dll } }, headers = p .. "/include" } end
    return { libraries = { lua = p .. "/lib/lua.lib" }, headers = p .. "/include" }
end
recipe.toml 981 bytes · raw
# The otok recipe of Lua (https://github.com/apotocki/otok): the library for Windows, from the release archive,
# with MSVC or with clang-cl across from Linux; static or dynamic.
[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", "dynamic"]

[source]
url = "https://www.lua.org/ftp/lua-5.5.1.tar.gz"
sha256 = "1c4b4068d67061f2a2231ad2b5422e77acea1487ea9890f6320af614f4373dce"

[platforms]
supported = ["windows"]
build-on = ["windows/msvc", "linux/clang-cl"]

[toolchains]
cmake = { version = ">= 3.20", default-recipe = "apotocki/cmake" }
ninja = { version = ">= 1.10", default-recipe = "apotocki/ninja" }

[[product]]
name = "Lua"
libraries = ["lua"]