diff options
| author | Arslaan Pathan <[email protected]> | 2026-03-01 18:26:30 +1300 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-03-01 18:26:30 +1300 |
| commit | 6cd1cd5f1dfdda4c43a272bee7b36cbb83f65a2c (patch) | |
| tree | e64bb850e322d827d7d8e8f36e05653f5e491acc | |
| download | kiiro-6cd1cd5f1dfdda4c43a272bee7b36cbb83f65a2c.tar.xz kiiro-6cd1cd5f1dfdda4c43a272bee7b36cbb83f65a2c.zip | |
Initial commit
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | README.md | 3 | ||||
| -rw-r--r-- | cmd/kiiro/main.go | 9 | ||||
| -rw-r--r-- | go.mod | 8 | ||||
| -rw-r--r-- | internal/build/build.go | 42 | ||||
| -rw-r--r-- | internal/git/git.go | 7 | ||||
| -rw-r--r-- | internal/manifest/manifest.go | 11 | ||||
| -rw-r--r-- | internal/registry/registry.go | 1 | ||||
| -rw-r--r-- | internal/repo/repo.go | 7 |
9 files changed, 89 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..08cb523 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +go.sum diff --git a/README.md b/README.md new file mode 100644 index 0000000..9995efd --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# kiiro + +A lightweight, rootless userland package manager for Linux. diff --git a/cmd/kiiro/main.go b/cmd/kiiro/main.go new file mode 100644 index 0000000..84c8b5e --- /dev/null +++ b/cmd/kiiro/main.go @@ -0,0 +1,9 @@ +package main + +import ( + "fmt" +) + +func main() { + fmt.Println("kiiro") +} @@ -0,0 +1,8 @@ +module github.com/ArslaanPathan/kiiro + +go 1.25.0 + +require ( + github.com/BurntSushi/toml v1.6.0 // indirect + github.com/yuin/gopher-lua v1.1.1 // indirect +) diff --git a/internal/build/build.go b/internal/build/build.go new file mode 100644 index 0000000..3758729 --- /dev/null +++ b/internal/build/build.go @@ -0,0 +1,42 @@ +package build + +import ( + "github.com/yuin/gopher-lua" +) + +type Kiirofile struct { + Path string +} + +func (k *Kiirofile) Load(L *lua.LState) error { + if err := L.DoFile(k.Path); err != nil { + // just return it, they can do the err detection + return err + } + return nil +} + +func (k *Kiirofile) RunBuild(L *lua.LState) error { + // just return it because if its an error notmyfault they detect it + // notmyfault you forgot to Kiirofile.Load() + // or that the Kiirofile maintainer typed it wrong + return L.CallByParam(lua.P{ + Fn: L.GetGlobal("build"), + NRet: 0, + Protect: true, + }) +} + +func (k *Kiirofile) RunPackage(L *lua.LState) error { + // just return it because if its an error notmyfault they detect it + // notmyfault you forgot to Kiirofile.Load() + // or that the Kiirofile maintainer typed it wrong + return L.CallByParam(lua.P{ + Fn: L.GetGlobal("package"), + NRet: 0, + Protect: true, + }) +} + +// TODO: Add auto-detection and methods for MakeBuild, CargoBuild, CMakeBuild, etc for the projects that don't have a Kiirofile +// That's probably for later because right now we need basic package manager with Kiirofile parsing working diff --git a/internal/git/git.go b/internal/git/git.go new file mode 100644 index 0000000..ed88e71 --- /dev/null +++ b/internal/git/git.go @@ -0,0 +1,7 @@ +package git + +import "os/exec" + +func Clone(url string, dest string) error { + return exec.Command("git", "clone", url, dest).Run() +} diff --git a/internal/manifest/manifest.go b/internal/manifest/manifest.go new file mode 100644 index 0000000..5914b0e --- /dev/null +++ b/internal/manifest/manifest.go @@ -0,0 +1,11 @@ +package manifest + +type KiiroToml struct { + Name string `toml:"pkgname"` + Version string `toml:"version"` + Architectures string `toml:"archs"` + Authors []string `toml:"authors"` + Maintainers []string `toml:"maintainers"` + Depends []string `toml:"deps"` +} + diff --git a/internal/registry/registry.go b/internal/registry/registry.go new file mode 100644 index 0000000..b2a276f --- /dev/null +++ b/internal/registry/registry.go @@ -0,0 +1 @@ +package registry diff --git a/internal/repo/repo.go b/internal/repo/repo.go new file mode 100644 index 0000000..6c3ccef --- /dev/null +++ b/internal/repo/repo.go @@ -0,0 +1,7 @@ +package repo + +type PackageListing struct { + Repository string `json:"repo"` + KiirofileOverride *string `json:"kiirofile_override"` + KiirotomlOverride *string `json:"kiirotoml_override"` +} |
