From b9d3ea3837fd4cfb7839ae2ac95f2130980abe9d Mon Sep 17 00:00:00 2001 From: Wildan M Date: Tue, 16 Sep 2025 13:37:39 +0700 Subject: [PATCH] Use luajit to compile lua --- recipes/wip/libs/lua/lpeg/recipe.toml | 4 +- .../wip/libs/other/tree-sitter/recipe.toml | 4 ++ .../wip/libs/other/tree-sitter/redox.patch | 45 +++++++++++++++++++ recipes/wip/text/neovim/recipe.toml | 14 +++++- 4 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 recipes/wip/libs/other/tree-sitter/redox.patch diff --git a/recipes/wip/libs/lua/lpeg/recipe.toml b/recipes/wip/libs/lua/lpeg/recipe.toml index 2f9fd4132..094d9b135 100644 --- a/recipes/wip/libs/lua/lpeg/recipe.toml +++ b/recipes/wip/libs/lua/lpeg/recipe.toml @@ -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 """ \ No newline at end of file diff --git a/recipes/wip/libs/other/tree-sitter/recipe.toml b/recipes/wip/libs/other/tree-sitter/recipe.toml index 63295a445..e5507e3e9 100644 --- a/recipes/wip/libs/other/tree-sitter/recipe.toml +++ b/recipes/wip/libs/other/tree-sitter/recipe.toml @@ -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 """ diff --git a/recipes/wip/libs/other/tree-sitter/redox.patch b/recipes/wip/libs/other/tree-sitter/redox.patch new file mode 100644 index 000000000..62c28d13f --- /dev/null +++ b/recipes/wip/libs/other/tree-sitter/redox.patch @@ -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 diff --git a/recipes/wip/text/neovim/recipe.toml b/recipes/wip/text/neovim/recipe.toml index abd43b7ba..f5e46fe23 100644 --- a/recipes/wip/text/neovim/recipe.toml +++ b/recipes/wip/text/neovim/recipe.toml @@ -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 +"""