Use luajit to compile lua

This commit is contained in:
Wildan M 2025-09-16 13:37:39 +07:00
parent e6874461fe
commit b9d3ea3837
4 changed files with 63 additions and 4 deletions

View File

@ -4,11 +4,11 @@ tar = "https://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.1.0.tar.gz"
[build]
template = "custom"
dependencies = [
"lua54",
"luajit",
]
script = """
rsync -av --delete "${COOKBOOK_SOURCE}/" ./
make linux
make linux CC="${CC} -I${COOKBOOK_SYSROOT}/include/luajit-2.1"
mkdir -p ${COOKBOOK_STAGE}/usr/lib
cp *.so ${COOKBOOK_STAGE}/usr/lib
"""

View File

@ -1,9 +1,13 @@
[source]
tar = "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.25.8.tar.gz"
patches = [
"redox.patch"
]
[build]
template = "custom"
script = """
DYNAMIC_INIT
PACKAGE_PATH=cli cookbook_cargo
cookbook_cmake "${COOKBOOK_SOURCE}"/lib
"""

View File

@ -0,0 +1,45 @@
diff --color -ruwN source/Cargo.toml source-new/Cargo.toml
--- source/Cargo.toml 2025-07-14 01:32:42.000000000 +0700
+++ source-new/Cargo.toml 2025-09-16 11:37:28.820646655 +0700
@@ -118,7 +118,7 @@
dialoguer = { version = "0.11.0", features = ["fuzzy-select"] }
etcetera = "0.8.0"
filetime = "0.2.25"
-fs4 = "0.12.0"
+fs4 = { git = "https://github.com/al8n/fs4-rs" } # for redox support, still not published yet
git2 = "0.20.0"
glob = "0.3.2"
heck = "0.5.0"
@@ -151,7 +151,7 @@
url = { version = "2.5.4", features = ["serde"] }
walkdir = "2.5.0"
wasmparser = "0.224.0"
-webbrowser = "1.0.3"
+webbrowser = "1.0.5"
tree-sitter = { version = "0.25.1", path = "./lib" }
tree-sitter-generate = { version = "0.25.1", path = "./cli/generate" }
diff --color -ruwN source/cli/src/fuzz/allocations.rs source-new/cli/src/fuzz/allocations.rs
--- source/cli/src/fuzz/allocations.rs 2025-07-14 01:32:42.000000000 +0700
+++ source-new/cli/src/fuzz/allocations.rs 2025-09-16 11:39:56.112458323 +0700
@@ -7,6 +7,7 @@
},
};
+#[cfg(not(target_os = "redox"))]
#[ctor::ctor]
unsafe fn initialize_allocation_recording() {
tree_sitter::set_allocator(
diff --color -ruwN source/lib/src/portable/endian.h source-new/lib/src/portable/endian.h
--- source/lib/src/portable/endian.h 2025-07-14 01:32:42.000000000 +0700
+++ source-new/lib/src/portable/endian.h 2025-09-16 11:27:12.315211556 +0700
@@ -24,7 +24,8 @@
defined(__CYGWIN__) || \
defined(__MSYS__) || \
defined(__EMSCRIPTEN__) || \
- defined(__wasi__)
+ defined(__wasi__) || \
+ defined(__redox__)
#if defined(__NetBSD__)
#define _NETBSD_SOURCE 1

View File

@ -3,11 +3,21 @@
tar = "https://github.com/neovim/neovim/archive/refs/tags/v0.11.3.tar.gz"
[build]
template = "cmake"
template = "custom"
dependencies = [
"lua54",
"luajit",
"libiconv",
"libuv",
"luv",
"lpeg",
"tree-sitter",
"gettext",
"unibilium",
"utf8proc",
]
script = """
DYNAMIC_INIT
cookbook_cmake \
-DUSE_BUNDLED=1 \
-DLUA_GEN_PRG=luajit
"""