Skip to content

Commit 4a26da0

Browse files
committed
feat: implementing vibescript build by darwin
1 parent 24a296d commit 4a26da0

File tree

8 files changed

+57
-8
lines changed

8 files changed

+57
-8
lines changed

build/build/alpine_static_build.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ function alpine_static_build()
2323
{ "././release", "/release" },
2424

2525
},
26-
command = compiler..[[ --static /release/amalgamation.c -o /release/alpine_static_bin.out]]
26+
command = compiler..[[ --static /release/amalgamation.c -o /release/vibescript.out]]
2727

2828
})
2929
end
30+
31+
darwin.add_recipe({
32+
name = "alpine_static_build",
33+
description = "builds a static binary inside an Alpine container",
34+
outs = {"release/vibescript.out"},
35+
inputs = {"release/amalgamation.c"},
36+
callback = alpine_static_build
37+
})

build/build/amalgamation_build.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,11 @@ function amalgamation_build()
6262
project.load_lib_from_c("vibescript_start","cvibescript")
6363
project.generate_c_file({output="release/amalgamation.c",include_lua_cembed=false})
6464
end
65+
66+
darwin.add_recipe({
67+
name = "amalgamation",
68+
description = "Generates a single-file C amalgamation (release/amalgamation.c) from all Lua and C sources",
69+
outs = {"release/amalgamation.c"},
70+
inputs = {"csrc", "luasrc", "dependencies", "assets"},
71+
callback = amalgamation_build
72+
})

build/build/debian_static_build.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ Description: SUMARY
5353
{ "./release", "/release" },
5454

5555
},
56-
command = "chmod 755 /project/DEBIAN/postinst && dpkg-deb --build /project /release/debian_static.deb"
56+
command = "chmod 755 /project/DEBIAN/postinst && dpkg-deb --build /project /release/vibescript.deb"
5757
})
5858
end
59+
60+
darwin.add_recipe({
61+
name = "debian_static_build",
62+
description = "Packages the static binary as a Debian .deb package",
63+
outs = {"release/vibescript.deb"},
64+
inputs = {"release/alpine_static_bin.out", "csrc", "luasrc", "dependencies", "assets"},
65+
callback = debian_static_build
66+
})

build/build/local_linux_build.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,12 @@ function local_linux_build()
44
local comand = [[gcc release/amalgamation.c -DCONTENT_ENCRYPT_KEY=\"../keys/content.h\" -DLLM_ENCRYPT_KEY=\"../keys/llm.h\" -DNAME_ENCRYPT_KEY=\"../keys/name.h\" -o vibescript]]
55
os.execute(comand)
66

7-
end
7+
end
8+
9+
darwin.add_recipe({
10+
name = "local_linux_build",
11+
description = "builds the project locally on Linux using gcc",
12+
outs = {"vibescript"},
13+
inputs = {"release/amalgamation.c", "../keys/content.h", "../keys/llm.h", "../keys/name.h"},
14+
callback = local_linux_build
15+
})

build/build/rpm_static_build.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,16 @@ chmod +x %{buildroot}/usr/local/bin/PROJECT_NAME
8181
for _, file in ipairs(rpms) do
8282
if darwin.dtw.ends_with(file, ".rpm") then
8383
--it will have only one rpm
84-
darwin.dtw.copy_any_overwriting(file, "release/rpm_static_build.rpm")
84+
darwin.dtw.copy_any_overwriting(file, "release/vibescript.rpm")
8585
break
8686
end
8787
end
8888
end
89+
90+
darwin.add_recipe({
91+
name = "rpm_static_build",
92+
description = "Packages the static binary as an RPM package for RHEL/CentOS/AlmaLinux",
93+
outs = {"release/vibescript.rpm"},
94+
inputs = {"release/alpine_static_bin.out", "csrc", "luasrc", "dependencies", "assets"},
95+
callback = rpm_static_build
96+
})

build/build/windowsi32_build.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ function windowsi32_build()
2121
volumes = {
2222
{ "././release", "/release" },
2323
},
24-
command = compiler..[[ --static /release/amalgamation.c -o /release/windowsi32.exe -lws2_32]]
24+
command = compiler..[[ --static /release/amalgamation.c -o /release/vibescripti32.exe -lws2_32]]
2525
})
2626
end
27+
28+
darwin.add_recipe({
29+
name = "windowsi32_build",
30+
description = "Builds a static Windows 32-bit executable (windowsi32.exe) using MinGW",
31+
outs = { "release/vibescripti32.exe" },
32+
inputs = { "release/amalgamation.c", "csrc", "luasrc", "dependencies", "assets" },
33+
callback = windowsi32_build
34+
})

build/main.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ function main()
66

77
local build_funcs = create_build_funcs()
88

9-
109
darwin.dtw.remove_any("release")
1110
darwin.dtw.remove_any(".cache")
1211
local i = 1
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PROJECT_NAME = "vibescript"
2-
CONTANIZER = darwin.argv.get_flag_arg_by_index({ "contanizer", }, 1,"docker" )
2+
CONTANIZER = darwin.argv.get_flag_arg_by_index({ "contanizer", }, 1,"podman" )
33
VERSION = "0.0.1"
44
LICENSE = "MIT"
55
URL = "https://github.com/OUIsolutions/Ai-RagTemplate"
@@ -9,4 +9,6 @@ EMAIL = "[email protected]"
99
SUMARY = "A Runtime to work with llms"
1010
YOUR_CHANGES = "--"
1111

12-
LAUNGUAGE = "c"
12+
LAUNGUAGE = "c"
13+
14+
darwin.load_all("build")

0 commit comments

Comments
 (0)