Skip to content

Commit b0d09bf

Browse files
authored
Merge pull request #194 from natecraddock/push-rryklrnwutuy
feat: default to latest Lua
2 parents cf0e794 + 28aeec5 commit b0d09bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+44025
-5
lines changed

build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub fn build(b: *Build) void {
1515
const target = b.standardTargetOptions(.{});
1616
const optimize = b.standardOptimizeOption(.{});
1717

18-
const lang = b.option(Language, "lang", "Lua language version to build") orelse .lua54;
18+
const lang = b.option(Language, "lang", "Lua language version to build") orelse .lua55;
1919
const library_name = b.option([]const u8, "library_name", "Library name for lua linking, default is `lua`") orelse "lua";
2020
const shared = b.option(bool, "shared", "Build shared library instead of static") orelse false;
2121
const system_lua = b.option(bool, "system_lua", "Use system lua") orelse false;

readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
[![shield showing current tests status](https://github.com/natecraddock/ziglua/actions/workflows/tests.yml/badge.svg)](https://github.com/natecraddock/ziglua/actions/workflows/tests.yml)
33
[![Discord](https://img.shields.io/discord/1196908820140671077?style=flat&logo=discord)](https://discord.com/invite/XpZqDFvAtK)
44

5-
Zig bindings for the [Lua C API](https://www.lua.org/manual/5.4/manual.html#4). Ziglua currently supports the latest releases of Lua 5.1, 5.2, 5.3, 5.4, 5.5, [LuaJIT](https://luajit.org) and [Luau](https://luau-lang.org).
5+
Zig bindings for the [Lua C API](https://www.lua.org/manual/5.5/manual.html#4). Ziglua currently supports the latest releases of Lua 5.1, 5.2, 5.3, 5.4, 5.5, [LuaJIT](https://luajit.org) and [Luau](https://luau-lang.org).
66

77
Ziglua can be used in two ways, either
88
* **embedded** to statically embed the Lua VM in a Zig program,
99
* or as a shared **module** to create Lua libraries that can be loaded at runtime in other Lua-based software.
1010

1111
In both cases, Ziglua will compile Lua from source and link against your Zig code making it easy to create software that integrates with Lua without requiring any system Lua libraries.
1212

13-
Ziglua `main` is kept up to date with Zig `master`. See the [`zig-0.13.0`](https://github.com/natecraddock/ziglua/tree/zig-0.13.0) branch for Zig 0.13.0 support.
13+
Ziglua `main` is kept up to date with Zig `master`. See the [`zig-0.15.2`](https://github.com/natecraddock/ziglua/tree/zig-0.15.2) branch for Zig 0.15.2 support.
1414

1515
## Documentation
1616
Docs are a work in progress and are automatically generated. Most functions and public declarations are documented:
@@ -23,7 +23,7 @@ Example code is included in the [examples](https://github.com/natecraddock/ziglu
2323
* Install an example with `zig build install-example-<name>`
2424

2525
## Why use Ziglua?
26-
In a nutshell, Ziglua is a simple wrapper around the C API you would get by using Zig's `@cImport()`. Ziglua aims to mirror the [Lua C API](https://www.lua.org/manual/5.4/manual.html#4) as closely as possible, while improving ergonomics using Zig's features. For example:
26+
In a nutshell, Ziglua is a simple wrapper around the C API you would get by using Zig's `@cImport()`. Ziglua aims to mirror the [Lua C API](https://www.lua.org/manual/5.5/manual.html#4) as closely as possible, while improving ergonomics using Zig's features. For example:
2727

2828
* Zig error unions to require failure state handling
2929
* Null-terminated slices instead of C strings
@@ -63,7 +63,7 @@ This will compile the Lua C sources and link with your project.
6363

6464
There are currently three additional options that can be passed to `b.dependency()`:
6565

66-
* `.lang`: Set the Lua language to build and embed. Defaults to `.lua54`. Possible values are `.lua51`, `.lua52`, `.lua53`, `.lua54`, and `luau`.
66+
* `.lang`: Set the Lua language to build and embed. Defaults to `.lua54`. Possible values are `.lua51`, `.lua52`, `.lua53`, `.lua54`, `.lua55`, and `luau`.
6767
* `.shared`: Defaults to `false` for embedding in a Zig program. Set to `true` to dynamically link the Lua source code (useful for creating shared modules).
6868
* `luau_use_4_vector`: defaults to false. Set to true to use 4-vectors instead of the default 3-vector in Luau.
6969
* `lua_user_h`: defaults to null. Provide a path to an additional header file for the Lua compilation. Must be set to to `examples/user.h` in order to run the multithreaded example.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Makefile for installing Lua
2+
# See doc/readme.html for installation and customization instructions.
3+
4+
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
5+
6+
# Your platform. See PLATS for possible values.
7+
PLAT= guess
8+
9+
# Where to install. The installation starts in the src and doc directories,
10+
# so take care if INSTALL_TOP is not an absolute path. See the local target.
11+
# You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with
12+
# LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
13+
INSTALL_TOP= /usr/local
14+
INSTALL_BIN= $(INSTALL_TOP)/bin
15+
INSTALL_INC= $(INSTALL_TOP)/include
16+
INSTALL_LIB= $(INSTALL_TOP)/lib
17+
INSTALL_MAN= $(INSTALL_TOP)/man/man1
18+
INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
19+
INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
20+
21+
# How to install. If your install program does not support "-p", then
22+
# you may have to run ranlib on the installed liblua.a.
23+
INSTALL= install -p
24+
INSTALL_EXEC= $(INSTALL) -m 0755
25+
INSTALL_DATA= $(INSTALL) -m 0644
26+
#
27+
# If you don't have "install" you can use "cp" instead.
28+
# INSTALL= cp -p
29+
# INSTALL_EXEC= $(INSTALL)
30+
# INSTALL_DATA= $(INSTALL)
31+
32+
# Other utilities.
33+
MKDIR= mkdir -p
34+
RM= rm -f
35+
36+
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
37+
38+
# Convenience platforms targets.
39+
PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
40+
41+
# What to install.
42+
TO_BIN= lua luac
43+
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
44+
TO_LIB= liblua.a
45+
TO_MAN= lua.1 luac.1
46+
47+
# Lua version and release.
48+
V= 5.4
49+
R= $V.8
50+
51+
# Targets start here.
52+
all: $(PLAT)
53+
54+
$(PLATS) help test clean:
55+
@cd src && $(MAKE) $@
56+
57+
install: dummy
58+
cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
59+
cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
60+
cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
61+
cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
62+
cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
63+
64+
uninstall:
65+
cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN)
66+
cd src && cd $(INSTALL_INC) && $(RM) $(TO_INC)
67+
cd src && cd $(INSTALL_LIB) && $(RM) $(TO_LIB)
68+
cd doc && cd $(INSTALL_MAN) && $(RM) $(TO_MAN)
69+
70+
local:
71+
$(MAKE) install INSTALL_TOP=../install
72+
73+
# make may get confused with install/ if it does not support .PHONY.
74+
dummy:
75+
76+
# Echo config parameters.
77+
echo:
78+
@cd src && $(MAKE) -s echo
79+
@echo "PLAT= $(PLAT)"
80+
@echo "V= $V"
81+
@echo "R= $R"
82+
@echo "TO_BIN= $(TO_BIN)"
83+
@echo "TO_INC= $(TO_INC)"
84+
@echo "TO_LIB= $(TO_LIB)"
85+
@echo "TO_MAN= $(TO_MAN)"
86+
@echo "INSTALL_TOP= $(INSTALL_TOP)"
87+
@echo "INSTALL_BIN= $(INSTALL_BIN)"
88+
@echo "INSTALL_INC= $(INSTALL_INC)"
89+
@echo "INSTALL_LIB= $(INSTALL_LIB)"
90+
@echo "INSTALL_MAN= $(INSTALL_MAN)"
91+
@echo "INSTALL_LMOD= $(INSTALL_LMOD)"
92+
@echo "INSTALL_CMOD= $(INSTALL_CMOD)"
93+
@echo "INSTALL_EXEC= $(INSTALL_EXEC)"
94+
@echo "INSTALL_DATA= $(INSTALL_DATA)"
95+
96+
# Echo pkg-config data.
97+
pc:
98+
@echo "version=$R"
99+
@echo "prefix=$(INSTALL_TOP)"
100+
@echo "libdir=$(INSTALL_LIB)"
101+
@echo "includedir=$(INSTALL_INC)"
102+
103+
# Targets that do not create files (not all makes understand .PHONY).
104+
.PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc
105+
106+
# (end of Makefile)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
This is Lua 5.4.8, released on 21 May 2025.
3+
4+
For installation instructions, license details, and
5+
further information about Lua, see doc/readme.html.
6+
11.8 KB
Loading

0 commit comments

Comments
 (0)