Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite bundle_deb & bundle_nupkg in Pluto #465

Closed
Sainan opened this issue Nov 22, 2023 · 0 comments
Closed

Rewrite bundle_deb & bundle_nupkg in Pluto #465

Sainan opened this issue Nov 22, 2023 · 0 comments

Comments

@Sainan
Copy link
Member

Sainan commented Nov 22, 2023

This is a bit of a stretch goal, but given that by the time we need to run these scripts in the workflow, we already have compiled Pluto, the only thing stopping us is lack of functionality in Pluto itself (ignoring os.execute), which is quite frankly a bit embarrassing.

bundle_deb

Primitive reimplementation
local pluto_version
for line in io.lines("src/lua.h") do
  if line:sub(1, 29) == '#define PLUTO_VERSION "Pluto ' then
    pluto_version = line:rstrip():sub(30, -2)
    break
  end
end
assert(pluto_version, "Failed to determine Pluto version")

io.makedir("pluto")
io.makedir("pluto/DEBIAN")

local control_data = [[
Package: pluto
Version: ]] .. pluto_version .. [[
Section: custom
Priority: optional
Architecture: all
Essential: no
Maintainer: Sainan <[email protected]>
Description: A superset of Lua 5.4 — with unique features, optimizations, and improvements.
]]

local control_file = io.open("pluto/DEBIAN/control", "w")
control_file:write(control_data)
control_file:close()

os.execute("chmod 0644 pluto/DEBIAN/control")

io.makedir("pluto/usr")
io.makedir("pluto/usr/local")
io.makedir("pluto/usr/local/bin")
io.copy("src/pluto", "pluto/usr/local/bin/pluto")
io.copy("src/plutoc", "pluto/usr/local/bin/plutoc")
os.execute("chmod 0755 pluto/usr/local/bin/pluto")
os.execute("chmod 0755 pluto/usr/local/bin/plutoc")
os.execute("dpkg-deb --build pluto")

What I think could be improved:

bundle_nupkg

We definitely need some native way to fetch an HTTP resource to get the chocogen.php.

@Sainan Sainan closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant