new Packet.lua format, testing it with bat

This commit is contained in:
2025-10-31 13:32:03 -03:00
parent 1c4ade5db9
commit 6c5abdf4d4
2 changed files with 59 additions and 36 deletions

View File

@@ -1,36 +0,0 @@
return {
package = {
name = "packets",
id = "packets@1.0.0",
version = "1.0.0",
author = "robogg133",
description = "fast, opensource, easy to use package manager.",
type = "remote",
serial = 0,
build_dependencies = {["go"] = ">=1.25.1"},
git_url = "https://github.com/roboogg133/packets.git",
git_branch = "main"
},
prepare = function(container)
git.clone("https://github.com/roboogg133/packets.git", container.dir("/data"))
os.remove(container.dir("/data/.git"))
end,
build = function()
os.execute("go build ./data/cmd/packets")
end,
install = function(container)
os.copy(container.dir("./packets"), BIN_DIR)
end,
remove = function ()
os.remove(path_join(BIN_DIR, "packets"))
end
}

59
test/Packet.lua Normal file
View File

@@ -0,0 +1,59 @@
return {
package = {
name = "bat-bin",
version = "0.26.0",
mantainer = "robogg133",
description = "fast, opensource, easy to use package manager.",
serial = 0,
plataforms = {
windows = {
arch = {"x86_64"},
sources = {
["https://github.com/sharkdp/bat/releases/download/v0.26.0/bat-v0.26.0-aarch64-unknown-linux-gnu.tar.gz"] = {method = "GET"}
},
dependencies = {
build = {},
runtime = {},
conflicts = {}
}
},
linux = {
arch = {"x86_64"},
sources = {
["https://github.com/sharkdp/bat/releases/download/v0.26.0/bat-v0.26.0-aarch64-unknown-linux-gnu.tar.gz"] = {method = "GET"}
},
dependencies = {
build = {},
runtime = {},
conflicts = {}
}
},
all = {
sources = {}
}
},
},
prepare = function(container)
git.clone("https://github.com/roboogg133/packets.git", container.dir("/data"))
os.remove(container.dir("/data/.git"))
end,
build = function()
os.execute("go build ./data/cmd/packets")
end,
install = function(container)
os.copy(container.dir("./packets"), BIN_DIR)
end,
remove = function ()
os.remove(path_join(BIN_DIR, "packets"))
end
}