internal/rosa: create metadata alongside artifact

This enables deferring evaluation of azalea-based packages and fixes the longstanding quirk of version being disjoint from other metadata.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-19 00:03:42 +09:00
parent 0e95573f18
commit 8807cbc730
88 changed files with 612 additions and 874 deletions

View File

@@ -39,14 +39,13 @@ func commandInfo(
t := rosa.Native().Std() t := rosa.Native().Std()
for i, name := range args { for i, name := range args {
handle := rosa.ArtifactH(unique.Make(name)) handle := rosa.ArtifactH(unique.Make(name))
if meta := rosa.Native().Get(handle); meta == nil { if meta, a := t.Load(handle); meta == nil {
return fmt.Errorf("unknown artifact %q", name) return fmt.Errorf("unknown artifact %q", name)
} else { } else {
var suffix string var suffix string
a, version := t.MustLoad(handle) if meta.Version != rosa.Unversioned {
if version != rosa.Unversioned { suffix += "-" + meta.Version
suffix += "-" + version
} }
mustPrintln("name : " + name + suffix) mustPrintln("name : " + name + suffix)
@@ -58,9 +57,10 @@ func commandInfo(
if len(meta.Dependencies) > 0 { if len(meta.Dependencies) > 0 {
mustPrint("depends on :") mustPrint("depends on :")
for _, d := range meta.Dependencies { for _, d := range meta.Dependencies {
s := rosa.Native().MustGet(d).Name _meta, _ := rosa.Native().Std().MustLoad(d)
if _, _version := t.Load(d); _version != rosa.Unversioned { s := _meta.Name
s += "-" + _version if _meta.Version != rosa.Unversioned {
s += "-" + _meta.Version
} }
mustPrint(" " + s) mustPrint(" " + s)
} }

View File

@@ -22,12 +22,12 @@ func TestInfo(t *testing.T) {
t.Parallel() t.Parallel()
_t := rosa.Native().Std() _t := rosa.Native().Std()
_, qemuVersion := _t.Load(rosa.QEMU) qemuMeta, _ := _t.Load(rosa.QEMU)
_, glibVersion := _t.Load(rosa.GLib) glibMeta, _ := _t.Load(rosa.GLib)
zlib, zlibVersion := _t.Load(rosa.Zlib) zlibMeta, zlib := _t.Load(rosa.Zlib)
_, zstdVersion := _t.Load(rosa.Zstd) zstdMeta, _ := _t.Load(rosa.Zstd)
_, hakureiVersion := _t.Load(rosa.Hakurei) hakureiMeta, _ := _t.Load(rosa.Hakurei)
_, hakureiDistVersion := _t.Load(rosa.HakureiDist) hakureiDistMeta, _ := _t.Load(rosa.HakureiDist)
testCases := []struct { testCases := []struct {
name string name string
@@ -38,24 +38,24 @@ func TestInfo(t *testing.T) {
wantErr any wantErr any
}{ }{
{"qemu", []string{"qemu"}, nil, "", ` {"qemu", []string{"qemu"}, nil, "", `
name : qemu-` + qemuVersion + ` name : qemu-` + qemuMeta.Version + `
description : a generic and open source machine emulator and virtualizer description : a generic and open source machine emulator and virtualizer
website : https://www.qemu.org website : https://www.qemu.org
depends on : glib-` + glibVersion + ` zstd-` + zstdVersion + ` depends on : glib-` + glibMeta.Version + ` zstd-` + zstdMeta.Version + `
`, nil}, `, nil},
{"multi", []string{"hakurei", "hakurei-dist"}, nil, "", ` {"multi", []string{"hakurei", "hakurei-dist"}, nil, "", `
name : hakurei-` + hakureiVersion + ` name : hakurei-` + hakureiMeta.Version + `
description : low-level userspace tooling for Rosa OS description : low-level userspace tooling for Rosa OS
website : https://hakurei.app website : https://hakurei.app
name : hakurei-dist-` + hakureiDistVersion + ` name : hakurei-dist-` + hakureiDistMeta.Version + `
description : low-level userspace tooling for Rosa OS (distribution tarball) description : low-level userspace tooling for Rosa OS (distribution tarball)
website : https://hakurei.app website : https://hakurei.app
`, nil}, `, nil},
{"nonexistent", []string{"zlib", "\x00"}, nil, "", ` {"nonexistent", []string{"zlib", "\x00"}, nil, "", `
name : zlib-` + zlibVersion + ` name : zlib-` + zlibMeta.Version + `
description : lossless data-compression library description : lossless data-compression library
website : https://zlib.net website : https://zlib.net
@@ -65,12 +65,12 @@ website : https://zlib.net
"zstd": "internal/pkg (amd64) on satori\n", "zstd": "internal/pkg (amd64) on satori\n",
"hakurei": "internal/pkg (amd64) on satori\n\n", "hakurei": "internal/pkg (amd64) on satori\n\n",
}, "", ` }, "", `
name : zlib-` + zlibVersion + ` name : zlib-` + zlibMeta.Version + `
description : lossless data-compression library description : lossless data-compression library
website : https://zlib.net website : https://zlib.net
status : not yet cured status : not yet cured
name : zstd-` + zstdVersion + ` name : zstd-` + zstdMeta.Version + `
description : a fast compression algorithm description : a fast compression algorithm
website : https://facebook.github.io/zstd website : https://facebook.github.io/zstd
status : internal/pkg (amd64) on satori status : internal/pkg (amd64) on satori
@@ -79,7 +79,7 @@ status : internal/pkg (amd64) on satori
{"status cache perm", []string{"zlib"}, map[string]string{ {"status cache perm", []string{"zlib"}, map[string]string{
"zlib": "\x00", "zlib": "\x00",
}, "", ` }, "", `
name : zlib-` + zlibVersion + ` name : zlib-` + zlibMeta.Version + `
description : lossless data-compression library description : lossless data-compression library
website : https://zlib.net website : https://zlib.net
`, func(cm *cache) error { `, func(cm *cache) error {
@@ -91,7 +91,7 @@ website : https://zlib.net
}}, }},
{"status report", []string{"zlib"}, nil, strings.Repeat("\x00", len(pkg.Checksum{})+8), ` {"status report", []string{"zlib"}, nil, strings.Repeat("\x00", len(pkg.Checksum{})+8), `
name : zlib-` + zlibVersion + ` name : zlib-` + zlibMeta.Version + `
description : lossless data-compression library description : lossless data-compression library
website : https://zlib.net website : https://zlib.net
status : not in report status : not in report
@@ -140,7 +140,7 @@ status : not in report
if tc.status != nil { if tc.status != nil {
for name, status := range tc.status { for name, status := range tc.status {
a, _ := _t.Load(rosa.ArtifactH(unique.Make(name))) _, a := _t.Load(rosa.ArtifactH(unique.Make(name)))
if a == nil { if a == nil {
t.Fatalf("invalid name %q", name) t.Fatalf("invalid name %q", name)
} }

View File

@@ -33,10 +33,10 @@ type packageIndex struct {
// metadata holds [rosa.Metadata] extended with additional information. // metadata holds [rosa.Metadata] extended with additional information.
type metadata struct { type metadata struct {
handle rosa.ArtifactH handle rosa.ArtifactH
*rosa.Artifact *rosa.Metadata
// Populated via [rosa.Toolchain.Version], [rosa.Unversioned] is equivalent // Copied from [rosa.Metadata], [rosa.Unversioned] is equivalent to the zero
// to the zero value. Otherwise, the zero value is invalid. // value. Otherwise, the zero value is invalid.
Version string `json:"version,omitempty"` Version string `json:"version,omitempty"`
// Output data size, available if present in report. // Output data size, available if present in report.
Size int64 `json:"size,omitempty"` Size int64 `json:"size,omitempty"`
@@ -61,12 +61,12 @@ func (index *packageIndex) populate(report *rosa.Report) (err error) {
index.names = make(map[string]*metadata) index.names = make(map[string]*metadata)
ir := pkg.NewIR() ir := pkg.NewIR()
for i, handle := range handles { for i, handle := range handles {
a, version := rosa.Native().Std().MustLoad(handle) meta, a := rosa.Native().Std().MustLoad(handle)
m := metadata{ m := metadata{
handle: handle, handle: handle,
Artifact: rosa.Native().MustGet(handle), Metadata: meta,
Version: version, Version: meta.Version,
} }
if m.Version == "" { if m.Version == "" {
return errors.New("invalid version from " + m.Name) return errors.New("invalid version from " + m.Name)

View File

@@ -118,7 +118,7 @@ func main() {
rosa.Native().DropCaches("", flags) rosa.Native().DropCaches("", flags)
cross := flagArch != "" && flagArch != runtime.GOARCH cross := flagArch != "" && flagArch != runtime.GOARCH
if flagQEMU || cross { if flagQEMU || cross {
cm.qemu, _ = rosa.Native().Std().Load(rosa.QEMU) _, cm.qemu = rosa.Native().Std().MustLoad(rosa.QEMU)
} }
if cross { if cross {
@@ -358,7 +358,7 @@ func main() {
for range max(flagJobs, 1) { for range max(flagJobs, 1) {
wg.Go(func() { wg.Go(func() {
for p := range w { for p := range w {
meta := rosa.Native().MustGet(p) meta, _ := rosa.Native().Std().MustLoad(p)
if meta.ID == 0 { if meta.ID == 0 {
continue continue
} }
@@ -371,13 +371,9 @@ func main() {
continue continue
} }
_, version := rosa.Native().Std().Load(p) if latest := meta.GetLatest(v); meta.Version != latest {
if current, latest :=
version,
meta.GetLatest(v); current != latest {
n.Add(1) n.Add(1)
log.Printf("%s %s < %s", meta.Name, current, latest) log.Printf("%s %s < %s", meta.Name, meta.Version, latest)
continue continue
} }
@@ -453,7 +449,7 @@ func main() {
) )
if err = cm.Do(func(cache *pkg.Cache) (err error) { if err = cm.Do(func(cache *pkg.Cache) (err error) {
llvm, _ := rosa.Native().New(s - 2).Load(rosa.LLVM) _, llvm := rosa.Native().New(s - 2).Load(rosa.LLVM)
pathname, _, err = cache.Cure(llvm) pathname, _, err = cache.Cure(llvm)
return return
}); err != nil { }); err != nil {
@@ -462,7 +458,7 @@ func main() {
log.Println("stage1:", pathname) log.Println("stage1:", pathname)
if err = cm.Do(func(cache *pkg.Cache) (err error) { if err = cm.Do(func(cache *pkg.Cache) (err error) {
llvm, _ := rosa.Native().New(s - 1).Load(rosa.LLVM) _, llvm := rosa.Native().New(s - 1).Load(rosa.LLVM)
pathname, checksum[0], err = cache.Cure(llvm) pathname, checksum[0], err = cache.Cure(llvm)
return return
}); err != nil { }); err != nil {
@@ -470,7 +466,7 @@ func main() {
} }
log.Println("stage2:", pathname) log.Println("stage2:", pathname)
if err = cm.Do(func(cache *pkg.Cache) (err error) { if err = cm.Do(func(cache *pkg.Cache) (err error) {
llvm, _ := rosa.Native().New(s).Load(rosa.LLVM) _, llvm := rosa.Native().New(s).Load(rosa.LLVM)
pathname, checksum[1], err = cache.Cure(llvm) pathname, checksum[1], err = cache.Cure(llvm)
return return
}); err != nil { }); err != nil {
@@ -492,7 +488,7 @@ func main() {
if flagStage0 { if flagStage0 {
if err = cm.Do(func(cache *pkg.Cache) (err error) { if err = cm.Do(func(cache *pkg.Cache) (err error) {
stage0, _ := rosa.Native().New(s).Load(rosa.Stage0) _, stage0 := rosa.Native().New(s).Load(rosa.Stage0)
pathname, _, err = cache.Cure(stage0) pathname, _, err = cache.Cure(stage0)
return return
}); err != nil { }); err != nil {
@@ -546,7 +542,7 @@ func main() {
t -= 1 t -= 1
} }
a, _ := rosa.Native().New(t).Load(rosa.ArtifactH(unique.Make(args[0]))) _, a := rosa.Native().New(t).Load(rosa.ArtifactH(unique.Make(args[0])))
if a == nil { if a == nil {
return fmt.Errorf("unknown artifact %q", args[0]) return fmt.Errorf("unknown artifact %q", args[0])
} }
@@ -762,7 +758,7 @@ func main() {
handles := make([]rosa.ArtifactH, len(args)+3) handles := make([]rosa.ArtifactH, len(args)+3)
for i, arg := range args { for i, arg := range args {
handles[i] = rosa.ArtifactH(unique.Make(arg)) handles[i] = rosa.ArtifactH(unique.Make(arg))
if rosa.Native().Get(handles[i]) == nil { if meta, _ := rosa.Native().Std().Load(handles[i]); meta == nil {
return fmt.Errorf("unknown artifact %q", arg) return fmt.Errorf("unknown artifact %q", arg)
} }
} }

View File

@@ -36,8 +36,8 @@ func TestCureAll(t *testing.T) {
}) })
for _, handle := range rosa.Native().Collect() { for _, handle := range rosa.Native().Collect() {
a, _ := rosa.Native().Std().MustLoad(handle) _, a := rosa.Native().Std().MustLoad(handle)
t.Run(rosa.Native().MustGet(handle).Name, func(t *testing.T) { t.Run(handle.String(), func(t *testing.T) {
_, err := cureRemote(t.Context(), &addr, a, 0) _, err := cureRemote(t.Context(), &addr, a, 0)
if err != nil { if err != nil {
t.Error(err) t.Error(err)

View File

@@ -26,9 +26,7 @@ install -D -m755 libargp.a /work/system/lib/libargp.a
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newArgpStandalone, &Metadata{
f: Toolchain.newArgpStandalone,
Name: "argp-standalone", Name: "argp-standalone",
Description: "hierarchical argument parsing library broken out from glibc", Description: "hierarchical argument parsing library broken out from glibc",
Website: "http://www.lysator.liu.se/~nisse/misc/", Website: "http://www.lysator.liu.se/~nisse/misc/",

View File

@@ -66,9 +66,7 @@ func (t Toolchain) newBison() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newBison, &Metadata{
f: Toolchain.newBison,
Name: "bison", Name: "bison",
Description: "a general-purpose parser generator", Description: "a general-purpose parser generator",
Website: "https://www.gnu.org/software/bison/", Website: "https://www.gnu.org/software/bison/",

View File

@@ -26,9 +26,7 @@ func (t Toolchain) newBzip2() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newBzip2, &Metadata{
f: Toolchain.newBzip2,
Name: "bzip2", Name: "bzip2",
Description: "a freely available, patent free, high-quality data compressor", Description: "a freely available, patent free, high-quality data compressor",
Website: "https://sourceware.org/bzip2/", Website: "https://sourceware.org/bzip2/",

View File

@@ -106,9 +106,7 @@ index 2ead810437..f85cbb8b1c 100644
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newCMake, &Metadata{
f: Toolchain.newCMake,
Name: "cmake", Name: "cmake",
Description: "cross-platform, open-source build system", Description: "cross-platform, open-source build system",
Website: "https://cmake.org/", Website: "https://cmake.org/",

View File

@@ -90,9 +90,7 @@ func (t Toolchain) newConnman() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newConnman, &Metadata{
f: Toolchain.newConnman,
Name: "connman", Name: "connman",
Description: "a daemon for managing Internet connections", Description: "a daemon for managing Internet connections",
Website: "https://git.kernel.org/pub/scm/network/connman/connman.git/", Website: "https://git.kernel.org/pub/scm/network/connman/connman.git/",

View File

@@ -39,9 +39,7 @@ chmod +w tests/data && rm -f tests/data/test459
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newCurl, &Metadata{
f: Toolchain.newCurl,
Name: "curl", Name: "curl",
Description: "command line tool and library for transferring data with URLs", Description: "command line tool and library for transferring data with URLs",
Website: "https://curl.se/", Website: "https://curl.se/",

View File

@@ -29,9 +29,7 @@ func (t Toolchain) newDBus() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newDBus, &Metadata{
f: Toolchain.newDBus,
Name: "dbus", Name: "dbus",
Description: "a message bus system", Description: "a message bus system",
Website: "https://www.freedesktop.org/wiki/Software/dbus/", Website: "https://www.freedesktop.org/wiki/Software/dbus/",
@@ -65,9 +63,7 @@ func (t Toolchain) newXDGDBusProxy() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newXDGDBusProxy, &Metadata{
f: Toolchain.newXDGDBusProxy,
Name: "xdg-dbus-proxy", Name: "xdg-dbus-proxy",
Description: "a filtering proxy for D-Bus connections", Description: "a filtering proxy for D-Bus connections",
Website: "https://github.com/flatpak/xdg-dbus-proxy", Website: "https://github.com/flatpak/xdg-dbus-proxy",

View File

@@ -31,9 +31,7 @@ func (t Toolchain) newDTC() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newDTC, &Metadata{
f: Toolchain.newDTC,
Name: "dtc", Name: "dtc",
Description: "The Device Tree Compiler", Description: "The Device Tree Compiler",
Website: "https://git.kernel.org/pub/scm/utils/dtc/dtc.git/", Website: "https://git.kernel.org/pub/scm/utils/dtc/dtc.git/",

View File

@@ -39,9 +39,7 @@ func (t Toolchain) newElfutils() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newElfutils, &Metadata{
f: Toolchain.newElfutils,
Name: "elfutils", Name: "elfutils",
Description: "utilities and libraries to handle ELF files and DWARF data", Description: "utilities and libraries to handle ELF files and DWARF data",
Website: "https://sourceware.org/elfutils/", Website: "https://sourceware.org/elfutils/",

View File

@@ -46,9 +46,7 @@ index f135ad9..85c784c 100644
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newFakeroot, &Metadata{
f: Toolchain.newFakeroot,
Name: "fakeroot", Name: "fakeroot",
Description: "tool for simulating superuser privileges", Description: "tool for simulating superuser privileges",
Website: "https://salsa.debian.org/clint/fakeroot", Website: "https://salsa.debian.org/clint/fakeroot",

View File

@@ -20,9 +20,7 @@ func (t Toolchain) newFlex() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newFlex, &Metadata{
f: Toolchain.newFlex,
Name: "flex", Name: "flex",
Description: "scanner generator for lexing in C and C++", Description: "scanner generator for lexing in C and C++",
Website: "https://github.com/westes/flex/", Website: "https://github.com/westes/flex/",

View File

@@ -15,9 +15,7 @@ func (t Toolchain) newFreetype() (pkg.Artifact, string) {
), nil, (*MakeHelper)(nil)), version ), nil, (*MakeHelper)(nil)), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newFreetype, &Metadata{
f: Toolchain.newFreetype,
Name: "freetype", Name: "freetype",
Description: "a freely available software library to render fonts", Description: "a freely available software library to render fonts",
Website: "http://www.freetype.org/", Website: "http://www.freetype.org/",

View File

@@ -31,9 +31,7 @@ func (t Toolchain) newFuse() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newFuse, &Metadata{
f: Toolchain.newFuse,
Name: "fuse", Name: "fuse",
Description: "the reference implementation of the Linux FUSE interface", Description: "the reference implementation of the Linux FUSE interface",
Website: "https://github.com/libfuse/libfuse/", Website: "https://github.com/libfuse/libfuse/",

View File

@@ -88,9 +88,7 @@ disable_test t5515-fetch-merge-logic
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newGit, &Metadata{
f: Toolchain.newGit,
Name: "git", Name: "git",
Description: "distributed version control system", Description: "distributed version control system",
Website: "https://www.git-scm.com/", Website: "https://www.git-scm.com/",

View File

@@ -22,9 +22,7 @@ func (t Toolchain) newSPIRVHeaders() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newSPIRVHeaders, &Metadata{
f: Toolchain.newSPIRVHeaders,
Name: "spirv-headers", Name: "spirv-headers",
Description: "machine-readable files for the SPIR-V Registry", Description: "machine-readable files for the SPIR-V Registry",
Website: "https://github.com/KhronosGroup/SPIRV-Headers", Website: "https://github.com/KhronosGroup/SPIRV-Headers",
@@ -72,9 +70,7 @@ func (t Toolchain) newSPIRVTools() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newSPIRVTools, &Metadata{
f: Toolchain.newSPIRVTools,
Name: "spirv-tools", Name: "spirv-tools",
Description: "an API and commands for processing SPIR-V modules", Description: "an API and commands for processing SPIR-V modules",
Website: "https://github.com/KhronosGroup/SPIRV-Tools", Website: "https://github.com/KhronosGroup/SPIRV-Tools",
@@ -116,9 +112,7 @@ func (t Toolchain) newGlslang() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newGlslang, &Metadata{
f: Toolchain.newGlslang,
Name: "glslang", Name: "glslang",
Description: "reference front end for GLSL/ESSL", Description: "reference front end for GLSL/ESSL",
Website: "https://github.com/KhronosGroup/glslang", Website: "https://github.com/KhronosGroup/glslang",
@@ -232,9 +226,7 @@ export LIT_OPTS=` + litArgs(true, skipChecks...) + `
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newSPIRVLLVMTranslator, &Metadata{
f: Toolchain.newSPIRVLLVMTranslator,
Name: "spirv-llvm-translator", Name: "spirv-llvm-translator",
Description: "bi-directional translation between SPIR-V and LLVM IR", Description: "bi-directional translation between SPIR-V and LLVM IR",
Website: "https://github.com/KhronosGroup/SPIRV-LLVM-Translator", Website: "https://github.com/KhronosGroup/SPIRV-LLVM-Translator",

View File

@@ -166,9 +166,7 @@ rm \
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newGoLatest, &Metadata{
f: Toolchain.newGoLatest,
Name: "go", Name: "go",
Description: "the Go programming language toolchain", Description: "the Go programming language toolchain",
Website: "https://go.dev/", Website: "https://go.dev/",

View File

@@ -42,9 +42,7 @@ func (t Toolchain) newGLib() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newGLib, &Metadata{
f: Toolchain.newGLib,
Name: "glib", Name: "glib",
Description: "the GNU library of miscellaneous stuff", Description: "the GNU library of miscellaneous stuff",
Website: "https://developer.gnome.org/glib/", Website: "https://developer.gnome.org/glib/",

View File

@@ -58,8 +58,7 @@ func main() {
))) )))
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(func(t Toolchain) (pkg.Artifact, string) {
f: func(t Toolchain) (pkg.Artifact, string) {
return t.newHakurei("", ` return t.newHakurei("", `
mkdir -p /work/system/libexec/hakurei/ mkdir -p /work/system/libexec/hakurei/
@@ -86,16 +85,14 @@ mkdir -p /work/system/bin/
sharefs \ sharefs \
../../bin/) ../../bin/)
`, true), hakureiVersion `, true), hakureiVersion
}, }, &Metadata{
Name: "hakurei", Name: "hakurei",
Description: "low-level userspace tooling for Rosa OS", Description: "low-level userspace tooling for Rosa OS",
Website: "https://hakurei.app/", Website: "https://hakurei.app/",
ID: 388834, ID: 388834,
}) })
native.MustRegister(&Artifact{ native.mustRegister(func(t Toolchain) (pkg.Artifact, string) {
f: func(t Toolchain) (pkg.Artifact, string) {
name := "all" name := "all"
if t.opts&OptSkipCheck != 0 { if t.opts&OptSkipCheck != 0 {
name = "make" name = "make"
@@ -104,8 +101,7 @@ mkdir -p /work/system/bin/
export HAKUREI_VERSION export HAKUREI_VERSION
DESTDIR=/work /usr/src/hakurei/`+name+`.sh DESTDIR=/work /usr/src/hakurei/`+name+`.sh
`, true), hakureiVersion `, true), hakureiVersion
}, }, &Metadata{
Name: "hakurei-dist", Name: "hakurei-dist",
Description: "low-level userspace tooling for Rosa OS (distribution tarball)", Description: "low-level userspace tooling for Rosa OS (distribution tarball)",
Website: "https://hakurei.app/", Website: "https://hakurei.app/",

View File

@@ -22,9 +22,7 @@ func (t Toolchain) newHwdata() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newHwdata, &Metadata{
f: Toolchain.newHwdata,
Name: "hwdata", Name: "hwdata",
Description: "contains various hardware identification and configuration data", Description: "contains various hardware identification and configuration data",
Website: "https://github.com/vcrhonek/hwdata", Website: "https://github.com/vcrhonek/hwdata",

View File

@@ -6,12 +6,13 @@ import (
) )
func init() { func init() {
native.MustRegister(&Artifact{ meta := Metadata{
Name: "earlyinit", Name: "earlyinit",
Description: "Rosa OS initramfs init program", Description: "Rosa OS initramfs init program",
Version: Unversioned,
f: func(t Toolchain) (pkg.Artifact, string) { }
return t.newHakurei("-early-init", ` native.MustRegister(meta.Name, func(t Toolchain) (*Metadata, pkg.Artifact) {
return &meta, t.newHakurei("-early-init", `
mkdir -p /work/system/libexec/hakurei/ mkdir -p /work/system/libexec/hakurei/
echo '# Building earlyinit.' echo '# Building earlyinit.'
@@ -22,12 +23,18 @@ go build -trimpath -v -o /work/system/libexec/hakurei -ldflags="-s -w
-X hakurei.app/internal/info.buildVersion=${HAKUREI_VERSION} -X hakurei.app/internal/info.buildVersion=${HAKUREI_VERSION}
" ./cmd/earlyinit " ./cmd/earlyinit
echo echo
`, false), Unversioned `, false)
},
}) })
} }
func (t Toolchain) newImageSystem() (pkg.Artifact, string) {
return t.New("system.img", TNoToolchain, t.Append(nil, func init() {
meta := Metadata{
Name: "system-image",
Description: "Rosa OS system image",
Version: Unversioned,
}
native.MustRegister(meta.Name, func(t Toolchain) (*Metadata, pkg.Artifact) {
return &meta, t.New("system.img", TNoToolchain, t.Append(nil,
SquashfsTools, SquashfsTools,
), nil, nil, ` ), nil, nil, `
mksquashfs /mnt/system /work/system.img mksquashfs /mnt/system /work/system.img
@@ -39,18 +46,18 @@ mksquashfs /mnt/system /work/system.img
Kmod, Kmod,
Kernel, Kernel,
Firmware, Firmware,
)...)), Unversioned )...))
}
func init() {
native.MustRegister(&Artifact{
Name: "system-image",
Description: "Rosa OS system image",
f: Toolchain.newImageSystem,
}) })
} }
func (t Toolchain) newImageInitramfs() (pkg.Artifact, string) {
return t.New("initramfs", TNoToolchain, t.Append(nil, func init() {
meta := Metadata{
Name: "initramfs-image",
Description: "Rosa OS initramfs image",
Version: Unversioned,
}
native.MustRegister(meta.Name, func(t Toolchain) (*Metadata, pkg.Artifact) {
return &meta, t.New("initramfs", TNoToolchain, t.Append(nil,
Zstd, Zstd,
EarlyInit, EarlyInit,
GenInitCPIO, GenInitCPIO,
@@ -61,13 +68,6 @@ dir /dev 0755 0 0
nod /dev/null 0666 0 0 c 1 3 nod /dev/null 0666 0 0 c 1 3
nod /dev/console 0600 0 0 c 5 1 nod /dev/console 0600 0 0 c 5 1
file /init /system/libexec/hakurei/earlyinit 0555 0 0 file /init /system/libexec/hakurei/earlyinit 0555 0 0
`)))), Unversioned `))))
}
func init() {
native.MustRegister(&Artifact{
Name: "initramfs-image",
Description: "Rosa OS initramfs image",
f: Toolchain.newImageInitramfs,
}) })
} }

View File

@@ -19,9 +19,7 @@ chmod -R +w /work/usr/src/linux/
`, pkg.Path(AbsUsrSrc.Append("linux"), false, kernelSource)), kernelVersion `, pkg.Path(AbsUsrSrc.Append("linux"), false, kernelSource)), kernelVersion
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newKernelSource, &Metadata{
f: Toolchain.newKernelSource,
Name: "kernel-source", Name: "kernel-source",
Description: "a writable kernel source tree installed to /usr/src/linux", Description: "a writable kernel source tree installed to /usr/src/linux",
Website: "https://kernel.org/", Website: "https://kernel.org/",
@@ -70,9 +68,7 @@ cat \
), kernelVersion ), kernelVersion
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newKernelHeaders, &Metadata{
f: Toolchain.newKernelHeaders,
Name: "kernel-headers", Name: "kernel-headers",
Description: "an installation of kernel headers", Description: "an installation of kernel headers",
Website: "https://kernel.org/", Website: "https://kernel.org/",
@@ -1275,9 +1271,7 @@ rm -v /work/system/lib/modules/` + kernelVersion + `/build
), kernelVersion ), kernelVersion
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newKernel, &Metadata{
f: Toolchain.newKernel,
Name: "kernel", Name: "kernel",
Description: "the generic Rosa OS linux kernel", Description: "the generic Rosa OS linux kernel",
Website: "https://kernel.org/", Website: "https://kernel.org/",
@@ -1293,9 +1287,7 @@ cc -o /work/system/bin/gen_init_cpio /usr/src/linux/usr/gen_init_cpio.c
`, pkg.Path(AbsUsrSrc.Append("linux"), false, kernelSource)), kernelVersion `, pkg.Path(AbsUsrSrc.Append("linux"), false, kernelSource)), kernelVersion
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newGenInitCPIO, &Metadata{
f: Toolchain.newGenInitCPIO,
Name: "gen_init_cpio", Name: "gen_init_cpio",
Description: "a program in the kernel source tree for creating initramfs archive", Description: "a program in the kernel source tree for creating initramfs archive",
}) })
@@ -1340,9 +1332,7 @@ func (t Toolchain) newFirmware() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newFirmware, &Metadata{
f: Toolchain.newFirmware,
Name: "firmware", Name: "firmware",
Description: "firmware blobs for use with the Linux kernel", Description: "firmware blobs for use with the Linux kernel",
Website: "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/", Website: "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/",

View File

@@ -32,9 +32,7 @@ func (t Toolchain) newKmod() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newKmod, &Metadata{
f: Toolchain.newKmod,
Name: "kmod", Name: "kmod",
Description: "a set of tools to handle common tasks with Linux kernel modules", Description: "a set of tools to handle common tasks with Linux kernel modules",
Website: "https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git", Website: "https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git",

View File

@@ -88,9 +88,7 @@ install -Dv /usr/src/CTestCustom.cmake /cure/
}, (*CMakeHelper)(nil)), version }, (*CMakeHelper)(nil)), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibarchive, &Metadata{
f: Toolchain.newLibarchive,
Name: "libarchive", Name: "libarchive",
Description: "multi-format archive and compression library", Description: "multi-format archive and compression library",
Website: "https://www.libarchive.org/", Website: "https://www.libarchive.org/",

View File

@@ -21,9 +21,7 @@ install -D /usr/src/libmd/src/helper.c src/helper.c
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibmd, &Metadata{
f: Toolchain.newLibmd,
Name: "libmd", Name: "libmd",
Description: "Message Digest functions from BSD systems", Description: "Message Digest functions from BSD systems",
Website: "https://www.hadrons.org/software/libmd/", Website: "https://www.hadrons.org/software/libmd/",
@@ -50,9 +48,7 @@ func (t Toolchain) newLibbsd() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibbsd, &Metadata{
f: Toolchain.newLibbsd,
Name: "libbsd", Name: "libbsd",
Description: "provides useful functions commonly found on BSD systems", Description: "provides useful functions commonly found on BSD systems",
Website: "https://libbsd.freedesktop.org/", Website: "https://libbsd.freedesktop.org/",

View File

@@ -42,9 +42,7 @@ ln -s ../system/bin/bash /bin/
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibcap, &Metadata{
f: Toolchain.newLibcap,
Name: "libcap", Name: "libcap",
Description: "a library for getting and setting POSIX.1e draft 15 capabilities", Description: "a library for getting and setting POSIX.1e draft 15 capabilities",
Website: "https://sites.google.com/site/fullycapable/", Website: "https://sites.google.com/site/fullycapable/",

View File

@@ -38,9 +38,7 @@ index eba7eae..f916d2e 100644
}, (*CMakeHelper)(nil)), version }, (*CMakeHelper)(nil)), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibconfig, &Metadata{
f: Toolchain.newLibconfig,
Name: "libconfig", Name: "libconfig",
Description: "a simple library for processing structured configuration files", Description: "a simple library for processing structured configuration files",
Website: "https://hyperrealm.github.io/libconfig/", Website: "https://hyperrealm.github.io/libconfig/",

View File

@@ -18,9 +18,7 @@ func (t Toolchain) newLibdisplayInfo() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibdisplayInfo, &Metadata{
f: Toolchain.newLibdisplayInfo,
Name: "libdisplay-info", Name: "libdisplay-info",
Description: "EDID and DisplayID library", Description: "EDID and DisplayID library",
Website: "https://gitlab.freedesktop.org/emersion/libdisplay-info", Website: "https://gitlab.freedesktop.org/emersion/libdisplay-info",

View File

@@ -21,9 +21,7 @@ func (t Toolchain) newLibepoxy() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibepoxy, &Metadata{
f: Toolchain.newLibepoxy,
Name: "libepoxy", Name: "libepoxy",
Description: "a library for handling OpenGL function pointer management", Description: "a library for handling OpenGL function pointer management",
Website: "https://github.com/anholt/libepoxy", Website: "https://github.com/anholt/libepoxy",

View File

@@ -14,9 +14,7 @@ func (t Toolchain) newLibev() (pkg.Artifact, string) {
), nil, (*MakeHelper)(nil)), version ), nil, (*MakeHelper)(nil)), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibev, &Metadata{
f: Toolchain.newLibev,
Name: "libev", Name: "libev",
Description: "a full-featured and high-performance event loop", Description: "a full-featured and high-performance event loop",
Website: "http://libev.schmorp.de/", Website: "http://libev.schmorp.de/",

View File

@@ -22,9 +22,7 @@ func (t Toolchain) newLibexpat() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibexpat, &Metadata{
f: Toolchain.newLibexpat,
Name: "libexpat", Name: "libexpat",
Description: "a stream-oriented XML parser library", Description: "a stream-oriented XML parser library",
Website: "https://libexpat.github.io/", Website: "https://libexpat.github.io/",

View File

@@ -18,9 +18,7 @@ func (t Toolchain) newLibffi() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibffi, &Metadata{
f: Toolchain.newLibffi,
Name: "libffi", Name: "libffi",
Description: "a portable, high level programming interface to various calling conventions", Description: "a portable, high level programming interface to various calling conventions",
Website: "https://sourceware.org/libffi/", Website: "https://sourceware.org/libffi/",

View File

@@ -24,9 +24,7 @@ mkdir /dev/shm/gd
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibgd, &Metadata{
f: Toolchain.newLibgd,
Name: "libgd", Name: "libgd",
Description: "an open source code library for the dynamic creation of images", Description: "an open source code library for the dynamic creation of images",
Website: "https://libgd.github.io/", Website: "https://libgd.github.io/",

View File

@@ -22,9 +22,7 @@ func (t Toolchain) newLibpng() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibpng, &Metadata{
f: Toolchain.newLibpng,
Name: "libpng", Name: "libpng",
Description: "the official PNG reference library", Description: "the official PNG reference library",
Website: "https://www.libpng.org/pub/png/libpng.html", Website: "https://www.libpng.org/pub/png/libpng.html",

View File

@@ -25,9 +25,7 @@ test_disable 'int main(){return 0;}' tests/test-is-public-builtin.c
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibpsl, &Metadata{
f: Toolchain.newLibpsl,
Name: "libpsl", Name: "libpsl",
Description: "provides functions to work with the Mozilla Public Suffix List", Description: "provides functions to work with the Mozilla Public Suffix List",
Website: "https://rockdaboot.github.io/libpsl/", Website: "https://rockdaboot.github.io/libpsl/",

View File

@@ -43,9 +43,7 @@ index adccef3..65a277a 100644
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibseccomp, &Metadata{
f: Toolchain.newLibseccomp,
Name: "libseccomp", Name: "libseccomp",
Description: "an interface to the Linux Kernel's syscall filtering mechanism", Description: "an interface to the Linux Kernel's syscall filtering mechanism",
Website: "https://github.com/seccomp/libseccomp/", Website: "https://github.com/seccomp/libseccomp/",

View File

@@ -32,9 +32,7 @@ func (t Toolchain) newLibtirpc() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibtirpc, &Metadata{
f: Toolchain.newLibtirpc,
Name: "libtirpc", Name: "libtirpc",
Description: "a port of Suns Transport-Independent RPC library to Linux", Description: "a port of Suns Transport-Independent RPC library to Linux",
Website: "https://sourceforge.net/projects/libtirpc/", Website: "https://sourceforge.net/projects/libtirpc/",

View File

@@ -27,9 +27,7 @@ func (t Toolchain) newLibucontext() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibucontext, &Metadata{
f: Toolchain.newLibucontext,
Name: "libucontext", Name: "libucontext",
Description: "ucontext implementation featuring glibc-compatible ABI", Description: "ucontext implementation featuring glibc-compatible ABI",
Website: "https://github.com/kaniini/libucontext/", Website: "https://github.com/kaniini/libucontext/",

View File

@@ -20,9 +20,7 @@ func (t Toolchain) newLibxml2() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibxml2, &Metadata{
f: Toolchain.newLibxml2,
Name: "libxml2", Name: "libxml2",
Description: "an XML toolkit implemented in C", Description: "an XML toolkit implemented in C",
Website: "https://gitlab.gnome.org/GNOME/libxml2/", Website: "https://gitlab.gnome.org/GNOME/libxml2/",

View File

@@ -26,9 +26,7 @@ func (t Toolchain) newLibxslt() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibxslt, &Metadata{
f: Toolchain.newLibxslt,
Name: "libxslt", Name: "libxslt",
Description: "an XSLT processor based on libxml2", Description: "an XSLT processor based on libxml2",
Website: "https://gitlab.gnome.org/GNOME/libxslt/", Website: "https://gitlab.gnome.org/GNOME/libxslt/",

View File

@@ -29,10 +29,20 @@ func litArgs(verbose bool, skipChecks ...string) string {
return "'" + strings.Join(args, " ") + "'" return "'" + strings.Join(args, " ") + "'"
} }
func (t Toolchain) newEarlyCompilerRT() (pkg.Artifact, string) { func init() {
source, version := t.Load(llvmSource) native.MustRegister("early-compiler-rt", func(t Toolchain) (*Metadata, pkg.Artifact) {
major, _, _ := strings.Cut(version, ".") meta := Metadata{
return t.NewPackage("early-compiler-rt", version, source, &PackageAttr{ Name: "early-compiler-rt",
Description: "early LLVM runtime: compiler-rt",
Dependencies: P{
Musl,
},
}
_meta, source := t.MustLoad(llvmSource)
meta.Version = _meta.Version
major, _, _ := strings.Cut(meta.Version, ".")
return &meta, t.NewPackage("early-compiler-rt", meta.Version, source, &PackageAttr{
Flag: TExclusive, Flag: TExclusive,
}, &CMakeHelper{ }, &CMakeHelper{
Append: []string{"compiler-rt"}, Append: []string{"compiler-rt"},
@@ -82,24 +92,22 @@ ln -s \
muslHeaders, muslHeaders,
KernelHeaders, KernelHeaders,
), version )
} })
func init() {
native.MustRegister(&Artifact{
f: Toolchain.newEarlyCompilerRT,
Name: "early-compiler-rt", native.MustRegister("early-runtimes", func(t Toolchain) (*Metadata, pkg.Artifact) {
Description: "early LLVM runtime: compiler-rt", meta := Metadata{
Name: "early-runtimes",
Description: "early LLVM runtimes: libunwind, libcxx, libcxxabi",
Dependencies: P{ Dependencies: P{
Musl, earlyCompilerRT,
}, },
}) }
} _meta, source := t.MustLoad(llvmSource)
meta.Version = _meta.Version
func (t Toolchain) newEarlyRuntimes() (pkg.Artifact, string) { return &meta, t.NewPackage("early-runtimes", meta.Version, source, &PackageAttr{
source, version := t.Load(llvmSource)
return t.NewPackage("early-runtimes", version, source, &PackageAttr{
Flag: TExclusive, Flag: TExclusive,
}, &CMakeHelper{ }, &CMakeHelper{
Append: []string{"runtimes"}, Append: []string{"runtimes"},
@@ -142,22 +150,44 @@ func (t Toolchain) newEarlyRuntimes() (pkg.Artifact, string) {
Zstd, Zstd,
earlyCompilerRT, earlyCompilerRT,
KernelHeaders, KernelHeaders,
), version )
} })
func init() {
native.MustRegister(&Artifact{
f: Toolchain.newEarlyRuntimes,
Name: "early-runtimes", const (
Description: "early LLVM runtimes: libunwind, libcxx, libcxxabi", version = "22.1.5"
checksum = "32gOaLPHcUlo3hkdk5RbFumTE01XKeCAYZcpvn8IDHF95egXVfDFSl6eZL3ChMen"
)
native.MustRegister("llvm-project", func(t Toolchain) (*Metadata, pkg.Artifact) {
meta := Metadata{
Name: "llvm-project",
Description: "LLVM monorepo with Rosa OS patches",
Version: version,
ID: 1830,
}
return &meta, t.NewPatchedSource("llvm", version, newFromGitHub(
"llvm/llvm-project",
"llvmorg-"+version,
checksum,
), true, llvmPatches...)
})
native.MustRegister("llvm", func(t Toolchain) (*Metadata, pkg.Artifact) {
meta := Metadata{
Name: "llvm",
Description: "a collection of modular and reusable compiler and toolchain technologies",
Website: "https://llvm.org",
Dependencies: P{ Dependencies: P{
earlyCompilerRT, Zlib,
Zstd,
Musl,
}, },
}) }
} _meta, source := t.MustLoad(llvmSource)
meta.Version = _meta.Version
func (t Toolchain) newLLVM() (pkg.Artifact, string) {
early := muslHeaders early := muslHeaders
if t.stage.isStage0() { if t.stage.isStage0() {
// The LLVM build system uses the system installation when building with // The LLVM build system uses the system installation when building with
@@ -273,8 +303,7 @@ func (t Toolchain) newLLVM() (pkg.Artifact, string) {
}...) }...)
} }
source, version := t.Load(llvmSource) return &meta, t.NewPackage("llvm", meta.Version, source, &PackageAttr{
return t.NewPackage("llvm", version, source, &PackageAttr{
Flag: TExclusive, Flag: TExclusive,
}, &CMakeHelper{ }, &CMakeHelper{
Append: []string{"llvm"}, Append: []string{"llvm"},
@@ -316,40 +345,7 @@ ninja ` + jobsFlagE + ` check-all
Zstd, Zstd,
early, early,
KernelHeaders, KernelHeaders,
), version
}
func init() {
const (
version = "22.1.5"
checksum = "32gOaLPHcUlo3hkdk5RbFumTE01XKeCAYZcpvn8IDHF95egXVfDFSl6eZL3ChMen"
) )
native.MustRegister(&Artifact{
f: func(t Toolchain) (pkg.Artifact, string) {
return t.NewPatchedSource("llvm", version, newFromGitHub(
"llvm/llvm-project",
"llvmorg-"+version,
checksum,
), true, llvmPatches...), version
},
Name: "llvm-project",
Description: "LLVM monorepo with Rosa OS patches",
ID: 1830,
})
native.MustRegister(&Artifact{
f: Toolchain.newLLVM,
Name: "llvm",
Description: "a collection of modular and reusable compiler and toolchain technologies",
Website: "https://llvm.org",
Dependencies: P{
Zlib,
Zstd,
Musl,
},
}) })
} }

View File

@@ -47,9 +47,7 @@ ln -s \
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLMSensors, &Metadata{
f: Toolchain.newLMSensors,
Name: "lm_sensors", Name: "lm_sensors",
Description: "user-space support for hardware monitoring drivers", Description: "user-space support for hardware monitoring drivers",
Website: "https://hwmon.wiki.kernel.org/lm_sensors", Website: "https://hwmon.wiki.kernel.org/lm_sensors",

View File

@@ -27,9 +27,7 @@ cd "$(mktemp -d)"
))), version ))), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newMake, &Metadata{
f: Toolchain.newMake,
Name: "make", Name: "make",
Description: "a tool which controls the generation of executables and other non-source files", Description: "a tool which controls the generation of executables and other non-source files",
Website: "https://www.gnu.org/software/make/", Website: "https://www.gnu.org/software/make/",

View File

@@ -35,9 +35,7 @@ trap 'kill $XVFB_PID && wait $XVFB_PID' EXIT
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibglvnd, &Metadata{
f: Toolchain.newLibglvnd,
Name: "libglvnd", Name: "libglvnd",
Description: "The GL Vendor-Neutral Dispatch library", Description: "The GL Vendor-Neutral Dispatch library",
Website: "https://gitlab.freedesktop.org/glvnd/libglvnd", Website: "https://gitlab.freedesktop.org/glvnd/libglvnd",
@@ -72,9 +70,7 @@ func (t Toolchain) newLibdrm() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibdrm, &Metadata{
f: Toolchain.newLibdrm,
Name: "libdrm", Name: "libdrm",
Description: "a userspace library for accessing the DRM", Description: "a userspace library for accessing the DRM",
Website: "https://dri.freedesktop.org/", Website: "https://dri.freedesktop.org/",
@@ -111,9 +107,7 @@ func (t Toolchain) newLibva() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibva, &Metadata{
f: Toolchain.newLibva,
Name: "libva", Name: "libva",
Description: "an implementation for VA-API (Video Acceleration API)", Description: "an implementation for VA-API (Video Acceleration API)",
Website: "https://01.org/vaapi", Website: "https://01.org/vaapi",
@@ -238,9 +232,7 @@ func (t Toolchain) newMesa() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newMesa, &Metadata{
f: Toolchain.newMesa,
Name: "mesa", Name: "mesa",
Description: "open source implementations of OpenGL, OpenGL ES, Vulkan, OpenCL, and more", Description: "open source implementations of OpenGL, OpenGL ES, Vulkan, OpenCL, and more",
Website: "https://mesa3d.org", Website: "https://mesa3d.org",

View File

@@ -52,9 +52,7 @@ python3 ./run_project_tests.py \
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newMeson, &Metadata{
f: Toolchain.newMeson,
Name: "meson", Name: "meson",
Description: "an open source build system", Description: "an open source build system",
Website: "https://mesonbuild.com/", Website: "https://mesonbuild.com/",

View File

@@ -36,9 +36,7 @@ ln -vs ../system/bin/sh /work/bin/
))), version ))), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newMksh, &Metadata{
f: Toolchain.newMksh,
Name: "mksh", Name: "mksh",
Description: "MirBSD Korn Shell", Description: "MirBSD Korn Shell",
Website: "https://www.mirbsd.org/mksh", Website: "https://www.mirbsd.org/mksh",

View File

@@ -24,9 +24,7 @@ func (t Toolchain) newMuslFts() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newMuslFts, &Metadata{
f: Toolchain.newMuslFts,
Name: "musl-fts", Name: "musl-fts",
Description: "implementation of fts(3) functions which are missing in musl libc", Description: "implementation of fts(3) functions which are missing in musl libc",
Website: "https://github.com/void-linux/musl-fts", Website: "https://github.com/void-linux/musl-fts",

View File

@@ -24,9 +24,7 @@ func (t Toolchain) newMuslObstack() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newMuslObstack, &Metadata{
f: Toolchain.newMuslObstack,
Name: "musl-obstack", Name: "musl-obstack",
Description: "obstack functions and macros separated from glibc", Description: "obstack functions and macros separated from glibc",
Website: "https://github.com/void-linux/musl-obstack", Website: "https://github.com/void-linux/musl-obstack",

View File

@@ -75,11 +75,9 @@ index 715948f4..c2fece68 100644
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(func(t Toolchain) (pkg.Artifact, string) {
f: func(t Toolchain) (pkg.Artifact, string) {
return t.newMusl(false) return t.newMusl(false)
}, }, &Metadata{
Name: "musl", Name: "musl",
Description: "an implementation of the C standard library", Description: "an implementation of the C standard library",
Website: "https://musl.libc.org/", Website: "https://musl.libc.org/",
@@ -87,11 +85,9 @@ func init() {
ID: 11688, ID: 11688,
}) })
native.MustRegister(&Artifact{ native.mustRegister(func(t Toolchain) (pkg.Artifact, string) {
f: func(t Toolchain) (pkg.Artifact, string) {
return t.newMusl(true) return t.newMusl(true)
}, }, &Metadata{
Name: "musl-headers", Name: "musl-headers",
Description: "system installation of musl headers", Description: "system installation of musl headers",
}) })

View File

@@ -26,9 +26,7 @@ func (t Toolchain) newNcurses() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newNcurses, &Metadata{
f: Toolchain.newNcurses,
Name: "ncurses", Name: "ncurses",
Description: "a free software emulation of curses in System V Release 4.0 (SVr4)", Description: "a free software emulation of curses in System V Release 4.0 (SVr4)",
Website: "https://invisible-island.net/ncurses/", Website: "https://invisible-island.net/ncurses/",

View File

@@ -39,9 +39,7 @@ index d223ac2..a7878d0 100644
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibmnl, &Metadata{
f: Toolchain.newLibmnl,
Name: "libmnl", Name: "libmnl",
Description: "a minimalistic user-space library oriented to Netlink developers", Description: "a minimalistic user-space library oriented to Netlink developers",
Website: "https://www.netfilter.org/projects/libmnl/", Website: "https://www.netfilter.org/projects/libmnl/",
@@ -77,9 +75,7 @@ func (t Toolchain) newLibnftnl() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibnftnl, &Metadata{
f: Toolchain.newLibnftnl,
Name: "libnftnl", Name: "libnftnl",
Description: "a userspace library providing a low-level netlink API to the in-kernel nf_tables subsystem", Description: "a userspace library providing a low-level netlink API to the in-kernel nf_tables subsystem",
Website: "https://www.netfilter.org/projects/libnftnl/", Website: "https://www.netfilter.org/projects/libnftnl/",
@@ -131,9 +127,7 @@ chmod +w /etc/ && ln -s ../usr/src/iptables/etc/ethertypes /etc/
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newIPTables, &Metadata{
f: Toolchain.newIPTables,
Name: "iptables", Name: "iptables",
Description: "the userspace command line program used to configure the Linux 2.4.x and later packet filtering ruleset", Description: "the userspace command line program used to configure the Linux 2.4.x and later packet filtering ruleset",
Website: "https://www.netfilter.org/projects/iptables/", Website: "https://www.netfilter.org/projects/iptables/",

View File

@@ -19,9 +19,7 @@ func (t Toolchain) newNettle() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newNettle, &Metadata{
f: Toolchain.newNettle,
Name: "nettle", Name: "nettle",
Description: "a low-level cryptographic library", Description: "a low-level cryptographic library",
Website: "https://www.lysator.liu.se/~nisse/nettle/", Website: "https://www.lysator.liu.se/~nisse/nettle/",

View File

@@ -19,9 +19,7 @@ func (t Toolchain) newNettle3() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newNettle3, &Metadata{
f: Toolchain.newNettle3,
Name: "nettle3", Name: "nettle3",
Description: "a low-level cryptographic library", Description: "a low-level cryptographic library",
Website: "https://www.lysator.liu.se/~nisse/nettle/", Website: "https://www.lysator.liu.se/~nisse/nettle/",

View File

@@ -7,8 +7,8 @@ func (t Toolchain) newNinja() (pkg.Artifact, string) {
version = "1.13.2" version = "1.13.2"
checksum = "ygKWMa0YV2lWKiFro5hnL-vcKbc_-RACZuPu0Io8qDvgQlZ0dxv7hPNSFkt4214v" checksum = "ygKWMa0YV2lWKiFro5hnL-vcKbc_-RACZuPu0Io8qDvgQlZ0dxv7hPNSFkt4214v"
) )
python, _ := t.Load(Python) _, python := t.Load(Python)
bash, _ := t.Load(Bash) _, bash := t.Load(Bash)
return t.New("ninja-"+version, 0, []pkg.Artifact{ return t.New("ninja-"+version, 0, []pkg.Artifact{
python, python,
bash, bash,
@@ -39,9 +39,7 @@ cp ninja /work/system/bin/
))), version ))), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newNinja, &Metadata{
f: Toolchain.newNinja,
Name: "ninja", Name: "ninja",
Description: "a small build system with a focus on speed", Description: "a small build system with a focus on speed",
Website: "https://ninja-build.org/", Website: "https://ninja-build.org/",

View File

@@ -67,9 +67,7 @@ cp -r \
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newNSS, &Metadata{
f: Toolchain.newNSS,
Name: "nss", Name: "nss",
Description: "Network Security Services", Description: "Network Security Services",
Website: "https://firefox-source-docs.mozilla.org/security/nss/index.html", Website: "https://firefox-source-docs.mozilla.org/security/nss/index.html",
@@ -120,9 +118,7 @@ buildcatrust \
`), Unversioned `), Unversioned
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newNSSCACert, &Metadata{
f: Toolchain.newNSSCACert,
Name: "nss-cacert", Name: "nss-cacert",
Description: "bundle of X.509 certificates of public Certificate Authorities", Description: "bundle of X.509 certificates of public Certificate Authorities",
Website: "https://curl.se/docs/caextract.html", Website: "https://curl.se/docs/caextract.html",

View File

@@ -40,9 +40,7 @@ func (t Toolchain) newOpenSSL() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newOpenSSL, &Metadata{
f: Toolchain.newOpenSSL,
Name: "openssl", Name: "openssl",
Description: "TLS/SSL and crypto library", Description: "TLS/SSL and crypto library",
Website: "https://www.openssl.org/", Website: "https://www.openssl.org/",

View File

@@ -23,9 +23,7 @@ func (t Toolchain) newP11Kit() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newP11Kit, &Metadata{
f: Toolchain.newP11Kit,
Name: "p11-kit", Name: "p11-kit",
Description: "provides a way to load and enumerate PKCS#11 modules", Description: "provides a way to load and enumerate PKCS#11 modules",
Website: "https://p11-glue.freedesktop.org/p11-kit.html", Website: "https://p11-glue.freedesktop.org/p11-kit.html",

View File

@@ -32,9 +32,7 @@ ln -s ../system/bin/toybox /bin/echo
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newPCRE2, &Metadata{
f: Toolchain.newPCRE2,
Name: "pcre2", Name: "pcre2",
Description: "a set of C functions that implement regular expression pattern matching", Description: "a set of C functions that implement regular expression pattern matching",
Website: "https://pcre2project.github.io/pcre2/", Website: "https://pcre2project.github.io/pcre2/",

View File

@@ -50,9 +50,7 @@ chmod +w /system/bin && rm -f /system/bin/ps # perl does not like toybox ps
}), version }), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newPerl, &Metadata{
f: Toolchain.newPerl,
Name: "perl", Name: "perl",
Description: "The Perl Programming language", Description: "The Perl Programming language",
Website: "https://www.perl.org/", Website: "https://www.perl.org/",
@@ -100,9 +98,7 @@ func (t Toolchain) newPerlModuleBuild() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newPerlModuleBuild, &Metadata{
f: Toolchain.newPerlModuleBuild,
Name: "perl-Module::Build", Name: "perl-Module::Build",
Description: "build and install Perl modules", Description: "build and install Perl modules",
Website: "https://metacpan.org/release/Module-Build", Website: "https://metacpan.org/release/Module-Build",
@@ -154,9 +150,7 @@ func (t Toolchain) newPerlLocaleGettext() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newPerlLocaleGettext, &Metadata{
f: Toolchain.newPerlLocaleGettext,
Name: "perl-Locale::gettext", Name: "perl-Locale::gettext",
Description: "message handling functions", Description: "message handling functions",
Website: "https://metacpan.org/release/Locale-gettext", Website: "https://metacpan.org/release/Locale-gettext",
@@ -178,9 +172,7 @@ func (t Toolchain) newPerlPodParser() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newPerlPodParser, &Metadata{
f: Toolchain.newPerlPodParser,
Name: "perl-Pod::Parser", Name: "perl-Pod::Parser",
Description: "base class for creating POD filters and translators", Description: "base class for creating POD filters and translators",
Website: "https://metacpan.org/release/Pod-Parser", Website: "https://metacpan.org/release/Pod-Parser",
@@ -202,9 +194,7 @@ func (t Toolchain) newPerlSGMLS() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newPerlSGMLS, &Metadata{
f: Toolchain.newPerlSGMLS,
Name: "perl-SGMLS", Name: "perl-SGMLS",
Description: "class for postprocessing the output from the sgmls and nsgmls parsers", Description: "class for postprocessing the output from the sgmls and nsgmls parsers",
Website: "https://metacpan.org/release/RAAB/SGMLSpm-1.1", Website: "https://metacpan.org/release/RAAB/SGMLSpm-1.1",
@@ -240,9 +230,7 @@ func (t Toolchain) newPerlTermReadKey() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newPerlTermReadKey, &Metadata{
f: Toolchain.newPerlTermReadKey,
Name: "perl-Term::ReadKey", Name: "perl-Term::ReadKey",
Description: "a perl module for simple terminal control", Description: "a perl module for simple terminal control",
Website: "https://metacpan.org/release/TermReadKey", Website: "https://metacpan.org/release/TermReadKey",
@@ -264,9 +252,7 @@ func (t Toolchain) newPerlTextCharWidth() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newPerlTextCharWidth, &Metadata{
f: Toolchain.newPerlTextCharWidth,
Name: "perl-Text::CharWidth", Name: "perl-Text::CharWidth",
Description: "get number of occupied columns of a string on terminal", Description: "get number of occupied columns of a string on terminal",
Website: "https://metacpan.org/release/Text-CharWidth", Website: "https://metacpan.org/release/Text-CharWidth",
@@ -290,9 +276,7 @@ func (t Toolchain) newPerlTextWrapI18N() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newPerlTextWrapI18N, &Metadata{
f: Toolchain.newPerlTextWrapI18N,
Name: "perl-Text::WrapI18N", Name: "perl-Text::WrapI18N",
Description: "line wrapping module", Description: "line wrapping module",
Website: "https://metacpan.org/release/Text-WrapI18N", Website: "https://metacpan.org/release/Text-WrapI18N",
@@ -318,9 +302,7 @@ func (t Toolchain) newPerlMIMECharset() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newPerlMIMECharset, &Metadata{
f: Toolchain.newPerlMIMECharset,
Name: "perl-MIME::Charset", Name: "perl-MIME::Charset",
Description: "Charset Information for MIME", Description: "Charset Information for MIME",
Website: "https://metacpan.org/release/MIME-Charset", Website: "https://metacpan.org/release/MIME-Charset",
@@ -344,9 +326,7 @@ func (t Toolchain) newPerlUnicodeLineBreak() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newPerlUnicodeLineBreak, &Metadata{
f: Toolchain.newPerlUnicodeLineBreak,
Name: "perl-Unicode::LineBreak", Name: "perl-Unicode::LineBreak",
Description: "String as Sequence of UAX #29 Grapheme Clusters", Description: "String as Sequence of UAX #29 Grapheme Clusters",
Website: "https://metacpan.org/release/Unicode-LineBreak", Website: "https://metacpan.org/release/Unicode-LineBreak",
@@ -372,9 +352,7 @@ func (t Toolchain) newPerlYAMLTiny() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newPerlYAMLTiny, &Metadata{
f: Toolchain.newPerlYAMLTiny,
Name: "perl-YAML::Tiny", Name: "perl-YAML::Tiny",
Description: "read/write YAML files with as little code as possible", Description: "read/write YAML files with as little code as possible",
Website: "https://metacpan.org/release/YAML-Tiny", Website: "https://metacpan.org/release/YAML-Tiny",
@@ -396,9 +374,7 @@ func (t Toolchain) newPerlTestCmd() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newPerlTestCmd, &Metadata{
f: Toolchain.newPerlTestCmd,
Name: "perl-Test::Cmd", Name: "perl-Test::Cmd",
Description: "portable testing of commands and scripts", Description: "portable testing of commands and scripts",
Website: "https://metacpan.org/release/Test-Cmd", Website: "https://metacpan.org/release/Test-Cmd",

View File

@@ -19,9 +19,7 @@ func (t Toolchain) newPixman() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newPixman, &Metadata{
f: Toolchain.newPixman,
Name: "pixman", Name: "pixman",
Description: "a low-level software library for pixel manipulation", Description: "a low-level software library for pixel manipulation",
Website: "https://pixman.org/", Website: "https://pixman.org/",

View File

@@ -24,9 +24,7 @@ func (t Toolchain) newPkgConfig() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newPkgConfig, &Metadata{
f: Toolchain.newPkgConfig,
Name: "pkg-config", Name: "pkg-config",
Description: "a helper tool used when compiling applications and libraries", Description: "a helper tool used when compiling applications and libraries",
Website: "https://pkgconfig.freedesktop.org/", Website: "https://pkgconfig.freedesktop.org/",

View File

@@ -27,9 +27,7 @@ func (t Toolchain) newProcps() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newProcps, &Metadata{
f: Toolchain.newProcps,
Name: "procps", Name: "procps",
Description: "command line and full screen utilities for browsing procfs", Description: "command line and full screen utilities for browsing procfs",
Website: "https://gitlab.com/procps-ng/procps", Website: "https://gitlab.com/procps-ng/procps",

View File

@@ -88,9 +88,7 @@ index 19aea290b58..51603ba9510 100644
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newPython, &Metadata{
f: Toolchain.newPython,
Name: "python", Name: "python",
Description: "the Python programming language interpreter", Description: "the Python programming language interpreter",
Website: "https://www.python.org/", Website: "https://www.python.org/",
@@ -200,15 +198,13 @@ func (s *S) newPythonPackage(
build P, extra ...ArtifactH, build P, extra ...ArtifactH,
) { ) {
name = "python-" + name name = "python-" + name
s.MustRegister(&Artifact{ s.mustRegister(func(t Toolchain) (pkg.Artifact, string) {
f: func(t Toolchain) (pkg.Artifact, string) {
return t.NewPackage(name, version, source, attrP, attr, slices.Concat( return t.NewPackage(name, version, source, attrP, attr, slices.Concat(
P{Python}, P{Python},
extra, extra,
build, build,
)...), version )...), version
}, }, &Metadata{
Name: name, Name: name,
Description: description, Description: description,
Website: website, Website: website,
@@ -352,18 +348,16 @@ func init() {
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(func(t Toolchain) (pkg.Artifact, string) {
f: func(t Toolchain) (pkg.Artifact, string) { meta, source := t.Load(llvmSource)
source, version := t.Load(llvmSource) return t.NewPackage("lit", meta.Version, source, nil, &PipHelper{
return t.NewPackage("lit", version, source, nil, &PipHelper{
Append: []string{"llvm", "utils", "lit"}, Append: []string{"llvm", "utils", "lit"},
// already checked during llvm // already checked during llvm
SkipCheck: true, SkipCheck: true,
}, },
PythonSetuptools, PythonSetuptools,
), version ), meta.Version
}, }, &Metadata{
Name: "lit", Name: "lit",
Description: "a portable tool for executing LLVM and Clang style test suites", Description: "a portable tool for executing LLVM and Clang style test suites",
Website: "https://llvm.org/docs/CommandGuide/lit.html", Website: "https://llvm.org/docs/CommandGuide/lit.html",

View File

@@ -94,9 +94,7 @@ EOF
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newQEMU, &Metadata{
f: Toolchain.newQEMU,
Name: "qemu", Name: "qemu",
Description: "a generic and open source machine emulator and virtualizer", Description: "a generic and open source machine emulator and virtualizer",
Website: "https://www.qemu.org/", Website: "https://www.qemu.org/",

View File

@@ -21,9 +21,7 @@ ln -s ../system/bin/toybox /bin/echo
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newRdfind, &Metadata{
f: Toolchain.newRdfind,
Name: "rdfind", Name: "rdfind",
Description: "a program that finds duplicate files", Description: "a program that finds duplicate files",
Website: "https://rdfind.pauldreik.se/", Website: "https://rdfind.pauldreik.se/",

View File

@@ -34,11 +34,10 @@ func WriteReport(msg message.Msg, w io.Writer, c *pkg.Cache) error {
) )
t := native.Std() t := native.Std()
for _, p := range native.Collect() { for _, p := range native.Collect() {
meta := native.Get(p) meta, a := t.MustLoad(p)
if meta == nil { if meta == nil {
return errors.New("artifact " + p.String() + " in inconsistent state") return errors.New("artifact " + p.String() + " in inconsistent state")
} }
a, _ := t.MustLoad(p)
if _, ok := a.(pkg.FileArtifact); ok { if _, ok := a.(pkg.FileArtifact); ok {
msg.Verbosef("skipping file artifact %s", meta.Name) msg.Verbosef("skipping file artifact %s", meta.Name)
continue continue

View File

@@ -249,7 +249,7 @@ func (t Toolchain) New(
support = append(support, extra...) support = append(support, extra...)
support = append(support, cureEtc{}) support = append(support, cureEtc{})
if t.stage == stageEarly { if t.stage == stageEarly {
a, _ := t.Load(stage0Dist) _, a := t.MustLoad(stage0Dist)
support = append(support, a) support = append(support, a)
} else { } else {
support = append(support, t.S.New(_stageBusybox).New("gentoo", 0, nil, nil, nil, ` support = append(support, t.S.New(_stageBusybox).New("gentoo", 0, nil, nil, nil, `
@@ -438,10 +438,11 @@ func (t Toolchain) appendHandle(a []pkg.Artifact, pv pa, p ArtifactH) []pkg.Arti
} }
pv[p] = struct{}{} pv[p] = struct{}{}
for _, d := range t.MustGet(p).Dependencies { meta, _ := t.MustLoad(p)
for _, d := range meta.Dependencies {
a = t.appendHandle(a, pv, d) a = t.appendHandle(a, pv, d)
} }
d, _ := t.Load(p) _, d := t.MustLoad(p)
return append(a, d) return append(a, d)
} }

View File

@@ -78,9 +78,8 @@ func TestCureAll(t *testing.T) {
t.Parallel() t.Parallel()
for _, p := range rosa.Native().Collect() { for _, p := range rosa.Native().Collect() {
a, _ := rosa.Native().Std().MustLoad(p) _, a := rosa.Native().Std().MustLoad(p)
meta := rosa.Native().MustGet(p) t.Run(p.String(), func(t *testing.T) {
t.Run(meta.Name, func(t *testing.T) {
t.Parallel() t.Parallel()
if pathname, _, err := cache.Cure(a); err != nil { if pathname, _, err := cache.Cure(a); err != nil {

View File

@@ -27,9 +27,7 @@ func (t Toolchain) newRsync() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newRsync, &Metadata{
f: Toolchain.newRsync,
Name: "rsync", Name: "rsync",
Description: "an open source utility that provides fast incremental file transfer", Description: "an open source utility that provides fast incremental file transfer",
Website: "https://rsync.samba.org/", Website: "https://rsync.samba.org/",

View File

@@ -42,9 +42,7 @@ func (t Toolchain) newSquashfsTools() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newSquashfsTools, &Metadata{
f: Toolchain.newSquashfsTools,
Name: "squashfs-tools", Name: "squashfs-tools",
Description: "tools to create and extract Squashfs filesystems", Description: "tools to create and extract Squashfs filesystems",
Website: "https://github.com/plougher/squashfs-tools", Website: "https://github.com/plougher/squashfs-tools",

View File

@@ -5,8 +5,14 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newStage0() (pkg.Artifact, string) { func init() {
return t.New("rosa-stage0", 0, t.Append(nil, meta := Metadata{
Name: "rosa-stage0",
Description: "Rosa OS stage0 toolchain tarball for bootstrap",
Version: Unversioned,
}
native.MustRegister(meta.Name, func(t Toolchain) (*Metadata, pkg.Artifact) {
return &meta, t.New("rosa-stage0", 0, t.Append(nil,
Bzip2, Bzip2,
), nil, nil, ` ), nil, nil, `
umask 377 umask 377
@@ -19,23 +25,19 @@ tar \
LLVM, LLVM,
Mksh, Mksh,
toyboxEarly, toyboxEarly,
)...)), Unversioned )...))
}
func init() {
native.MustRegister(&Artifact{
f: Toolchain.newStage0,
Name: "rosa-stage0",
Description: "Rosa OS stage0 toolchain tarball for bootstrap",
}) })
} }
func init() { func init() {
const version = "20260504" meta := Metadata{
native.MustRegister(&Artifact{ Name: "stage0-dist",
f: func(t Toolchain) (pkg.Artifact, string) { Description: "Rosa OS stage0 bootstrap seed",
return newTar( Version: "20260504",
"https://hakurei.app/seed/"+version+"/"+ }
native.MustRegister(meta.Name, func(t Toolchain) (*Metadata, pkg.Artifact) {
return &meta, newTar(
"https://hakurei.app/seed/"+meta.Version+"/"+
"stage0-"+t.triple()+".tar.bz2", "stage0-"+t.triple()+".tar.bz2",
perArch[string]{ perArch[string]{
"amd64": "IQjFDkiAVLo1XzflgMMiLP3gnVY2hhDMTzl-QqJDCQhcLQ3lLtRzjI5WCxGyW_lk", "amd64": "IQjFDkiAVLo1XzflgMMiLP3gnVY2hhDMTzl-QqJDCQhcLQ3lLtRzjI5WCxGyW_lk",
@@ -43,11 +45,7 @@ func init() {
"riscv64": "Z2ODV0rIoo9iQRUIu35bsaOBeXc_9qQfGcyb2aGneatzNUJlXh5emSpEV2bOklUL", "riscv64": "Z2ODV0rIoo9iQRUIu35bsaOBeXc_9qQfGcyb2aGneatzNUJlXh5emSpEV2bOklUL",
}.unwrap(t.S), }.unwrap(t.S),
pkg.TarBzip2, pkg.TarBzip2,
), version )
},
Name: "stage0-dist",
Description: "Rosa OS stage0 bootstrap seed",
}) })
} }

View File

@@ -70,11 +70,9 @@ type (
// P represents multiple [ArtifactH]. // P represents multiple [ArtifactH].
type P []ArtifactH type P []ArtifactH
// Artifact is stage-agnostic immutable data with a deterministic resulting // Metadata is stage-agnostic immutable data around [Artifact] not directly
// [pkg.Artifact]. It can be created natively or through evaluation. // representable in the resulting [pkg.Artifact].
type Artifact struct { type Metadata struct {
f func(t Toolchain) (a pkg.Artifact, version string)
// Unique package name. // Unique package name.
Name string `json:"name"` Name string `json:"name"`
// Short user-facing description. // Short user-facing description.
@@ -85,6 +83,8 @@ type Artifact struct {
// Runtime dependencies. // Runtime dependencies.
Dependencies P `json:"dependencies"` Dependencies P `json:"dependencies"`
// Package version.
Version string `json:"version"`
// Project identifier on [Anitya]. // Project identifier on [Anitya].
// //
// [Anitya]: https://release-monitoring.org/ // [Anitya]: https://release-monitoring.org/
@@ -98,7 +98,7 @@ type Artifact struct {
} }
// GetLatest returns the latest version described by v. // GetLatest returns the latest version described by v.
func (meta *Artifact) GetLatest(v *Versions) string { func (meta *Metadata) GetLatest(v *Versions) string {
if meta.latest != nil { if meta.latest != nil {
return meta.latest(v) return meta.latest(v)
} }
@@ -134,7 +134,7 @@ func (v *Versions) getStable() string {
} }
// GetVersions returns versions fetched from Anitya. // GetVersions returns versions fetched from Anitya.
func (meta *Artifact) GetVersions(ctx context.Context) (*Versions, error) { func (meta *Metadata) GetVersions(ctx context.Context) (*Versions, error) {
if meta.ID == 0 { if meta.ID == 0 {
return nil, UnpopulatedIDError{} return nil, UnpopulatedIDError{}
} }
@@ -160,10 +160,13 @@ func (meta *Artifact) GetVersions(ctx context.Context) (*Versions, error) {
return &v, errors.Join(err, resp.Body.Close()) return &v, errors.Join(err, resp.Body.Close())
} }
// A cachedArtifact holds [pkg.Artifact] and its corresponding version string. // Artifact is a lazily initialised [pkg.Artifact] with associated [Metadata].
type Artifact func(t Toolchain) (meta *Metadata, a pkg.Artifact)
// A cachedArtifact caches satisfied [Artifact].
type cachedArtifact struct { type cachedArtifact struct {
meta *Metadata
a pkg.Artifact a pkg.Artifact
v string
} }
const ( const (
@@ -242,20 +245,20 @@ func (s *S) DropCaches(targetArch string, flags int) {
} }
} }
// Get returns the address of the named [Artifact]. // get returns the named [Artifact].
func (s *S) Get(handle ArtifactH) (meta *Artifact) { func (s *S) get(handle ArtifactH) (f Artifact) {
s.wantsArch() s.wantsArch()
v, ok := s.artifacts.Load(handle) v, ok := s.artifacts.Load(handle)
if ok { if ok {
meta = v.(*Artifact) f = v.(Artifact)
} }
return return
} }
// MustGet is like Get, but panics if the named [Artifact] is not registered. // mustGet is like get, but panics if the named [Artifact] is not registered.
func (s *S) MustGet(handle ArtifactH) (meta *Artifact) { func (s *S) mustGet(handle ArtifactH) (f Artifact) {
meta = s.Get(handle) f = s.get(handle)
if meta == nil { if f == nil {
panic(HandleError(handle)) panic(HandleError(handle))
} }
return return
@@ -282,8 +285,8 @@ func (e LoadError) Error() string {
return "cannot load " + strconv.Quote(e.Handle.String()) + ": " + e.Err.Error() return "cannot load " + strconv.Quote(e.Handle.String()) + ": " + e.Err.Error()
} }
// Load returns the resulting [pkg.Artifact] of [ArtifactH]. // Load satisfies an [Artifact] referred to by an [ArtifactH].
func (t Toolchain) Load(handle ArtifactH) (pkg.Artifact, string) { func (t Toolchain) Load(handle ArtifactH) (*Metadata, pkg.Artifact) {
defer func() { defer func() {
r := recover() r := recover()
if r == nil { if r == nil {
@@ -305,36 +308,36 @@ func (t Toolchain) Load(handle ArtifactH) (pkg.Artifact, string) {
e, ok := t.c[t.stage].Load(handle) e, ok := t.c[t.stage].Load(handle)
if ok { if ok {
r := e.(cachedArtifact) r := e.(cachedArtifact)
return r.a, r.v return r.meta, r.a
} }
meta := t.Get(handle) f := t.get(handle)
if meta == nil { if f == nil {
return nil, "" return nil, nil
} }
var r cachedArtifact var r cachedArtifact
r.a, r.v = meta.f(t) r.meta, r.a = f(t)
t.c[t.stage].Store(handle, r) t.c[t.stage].Store(handle, r)
return r.a, r.v return r.meta, r.a
} }
// MustLoad is like Load, but panics if the named [Artifact] is not registered. // MustLoad is like Load, but panics if the named [Artifact] is not registered.
func (t Toolchain) MustLoad(handle ArtifactH) (pkg.Artifact, string) { func (t Toolchain) MustLoad(handle ArtifactH) (*Metadata, pkg.Artifact) {
a, version := t.Load(handle) meta, a := t.Load(handle)
if a == nil { if meta == nil {
panic(HandleError(handle)) panic(HandleError(handle))
} }
return a, version return meta, a
} }
// Register arranges for a new [Artifact] to be cured under s. It returns false // Register arranges for a new [Artifact] to be cured under s. It returns false
// if another [Artifact] is already registered under the same name. // if another [Artifact] is already registered under the same name.
func (s *S) Register(meta *Artifact) bool { func (s *S) Register(name string, f Artifact) bool {
if meta.Name == "" { if name == "" {
return false return false
} }
p := ArtifactH(unique.Make(meta.Name)) p := ArtifactH(unique.Make(name))
_, ok := s.artifacts.LoadOrStore(p, meta) _, ok := s.artifacts.LoadOrStore(p, f)
if !ok { if !ok {
s.artifactCount.Add(1) s.artifactCount.Add(1)
} }
@@ -346,16 +349,34 @@ func (s *S) Register(meta *Artifact) bool {
type RegisterError ArtifactH type RegisterError ArtifactH
func (e RegisterError) Error() string { func (e RegisterError) Error() string {
if ArtifactH(e).String() == "" {
return "attempting to register invalid name"
}
return "attempting to register " + strconv.Quote(ArtifactH(e).String()) + " twice" return "attempting to register " + strconv.Quote(ArtifactH(e).String()) + " twice"
} }
// MustRegister is like Register, but panics if registration fails. // MustRegister is like Register, but panics if registration fails.
func (s *S) MustRegister(meta *Artifact) { func (s *S) MustRegister(name string, f Artifact) {
if !s.Register(meta) { if !s.Register(name, f) {
panic(RegisterError(H(meta.Name))) panic(RegisterError(H(name)))
} }
} }
// mustRegister registers an [Artifact] with the old function signature.
//
// Deprecated: Artifacts should be migrated to Register.
func (s *S) mustRegister(
f func(t Toolchain) (pkg.Artifact, string),
meta *Metadata,
) {
s.MustRegister(meta.Name, func(t Toolchain) (*Metadata, pkg.Artifact) {
v := *meta
a, version := f(t)
v.Version = version
return &v, a
})
}
// Count returns the number of [Artifact] registered to s. // Count returns the number of [Artifact] registered to s.
func (s *S) Count() int { func (s *S) Count() int {
return int(s.artifactCount.Load()) return int(s.artifactCount.Load())
@@ -567,7 +588,7 @@ func (ctx *evalContext) f(
return unique.Make(azalea.Ident(name)) return unique.Make(azalea.Ident(name))
} }
meta := Artifact{Name: string(name)} meta := Metadata{Name: string(name)}
var ( var (
attr PackageAttr attr PackageAttr
patches []string patches []string
@@ -575,7 +596,6 @@ func (ctx *evalContext) f(
early bool early bool
anitya int64 anitya int64
version string
sourceA any sourceA any
helper Helper helper Helper
@@ -584,11 +604,9 @@ func (ctx *evalContext) f(
if err = args.Apply(map[unique.Handle[azalea.Ident]]any{ if err = args.Apply(map[unique.Handle[azalea.Ident]]any{
k("description"): &meta.Description, k("description"): &meta.Description,
k("website"): &meta.Website, k("website"): &meta.Website,
k("version"): &meta.Version,
k("anitya"): &anitya, k("anitya"): &anitya,
k("version"): &version,
k("source"): &sourceA,
k("writable"): &attr.Writable, k("writable"): &attr.Writable,
k("chmod"): &attr.Chmod, k("chmod"): &attr.Chmod,
k("enterSource"): &attr.EnterSource, k("enterSource"): &attr.EnterSource,
@@ -598,6 +616,7 @@ func (ctx *evalContext) f(
k("exclusive"): &excl, k("exclusive"): &excl,
k("toyboxEarly"): &early, k("toyboxEarly"): &early,
k("source"): &sourceA,
k("exec"): &helper, k("exec"): &helper,
k("inputs"): &inputs, k("inputs"): &inputs,
k("runtime"): &runtimes, k("runtime"): &runtimes,
@@ -630,7 +649,7 @@ func (ctx *evalContext) f(
} }
meta.ID = int(anitya) meta.ID = int(anitya)
meta.f = func(t Toolchain) (pkg.Artifact, string) { v = Artifact(func(t Toolchain) (*Metadata, pkg.Artifact) {
var source pkg.Artifact var source pkg.Artifact
switch p := sourceA.(type) { switch p := sourceA.(type) {
case pkg.Artifact: case pkg.Artifact:
@@ -646,17 +665,15 @@ func (ctx *evalContext) f(
}) })
} }
return t.NewPackage( return &meta, t.NewPackage(
meta.Name, meta.Name,
version, meta.Version,
source, source,
&attr, &attr,
helper, helper,
inputsH..., inputsH...,
), version )
} })
v = meta
set = true set = true
return return
} }
@@ -686,13 +703,13 @@ func (s *S) Evaluate(r io.Reader, b fs.FS) error {
ctx := evalContext{b} ctx := evalContext{b}
for _, f := range pending { for _, f := range pending {
meta, set, err := azalea.Evaluate[Artifact](ctx.f, s.getS(), *f) lf, set, err := azalea.Evaluate[Artifact](ctx.f, s.getS(), *f)
if err != nil { if err != nil {
return err return err
} else if !set { } else if !set {
return errors.New("unexpected unset") return errors.New("unexpected unset")
} }
if !s.Register(&meta) { if !s.Register(string(f.Ident), lf) {
return RegisterError(H(string(f.Ident))) return RegisterError(H(string(f.Ident)))
} }
} }

View File

@@ -10,7 +10,7 @@ func TestLoad(t *testing.T) {
t.Parallel() t.Parallel()
for _, p := range rosa.Native().Collect() { for _, p := range rosa.Native().Collect() {
t.Run(rosa.Native().MustGet(p).Name, func(t *testing.T) { t.Run(p.String(), func(t *testing.T) {
t.Parallel() t.Parallel()
rosa.Native().Std().MustLoad(p) rosa.Native().Std().MustLoad(p)

View File

@@ -37,9 +37,7 @@ sed -i 's/unsigned int msg_len;$/uint32_t msg_len;/g' \
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newStrace, &Metadata{
f: Toolchain.newStrace,
Name: "strace", Name: "strace",
Description: "a diagnostic, debugging and instructional userspace utility", Description: "a diagnostic, debugging and instructional userspace utility",
Website: "https://strace.io/", Website: "https://strace.io/",

View File

@@ -40,9 +40,7 @@ rm \
))), version ))), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newTamaGo, &Metadata{
f: Toolchain.newTamaGo,
Name: "tamago", Name: "tamago",
Description: "a Go toolchain extended with support for bare metal execution", Description: "a Go toolchain extended with support for bare metal execution",
Website: "https://github.com/usbarmory/tamago-go", Website: "https://github.com/usbarmory/tamago-go",

View File

@@ -59,11 +59,9 @@ ln -s ../../system/bin/env /work/usr/bin
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(func(t Toolchain) (pkg.Artifact, string) {
f: func(t Toolchain) (pkg.Artifact, string) {
return t.newToybox("", "") return t.newToybox("", "")
}, }, &Metadata{
Name: "toybox", Name: "toybox",
Description: "many common Linux command line utilities", Description: "many common Linux command line utilities",
Website: "https://landley.net/toybox/", Website: "https://landley.net/toybox/",
@@ -71,8 +69,7 @@ func init() {
ID: 13818, ID: 13818,
}) })
native.MustRegister(&Artifact{ native.mustRegister(func(t Toolchain) (pkg.Artifact, string) {
f: func(t Toolchain) (pkg.Artifact, string) {
return t.newToybox("-early", ` return t.newToybox("-early", `
echo ' echo '
CONFIG_EXPR=y CONFIG_EXPR=y
@@ -81,8 +78,7 @@ CONFIG_AWK=y
CONFIG_DIFF=y CONFIG_DIFF=y
' >> .config ' >> .config
`) `)
}, }, &Metadata{
Name: "toybox-early", Name: "toybox-early",
Description: "a build of toybox with unfinished tools enabled to break dependency loops", Description: "a build of toybox with unfinished tools enabled to break dependency loops",
Website: "https://landley.net/toybox/", Website: "https://landley.net/toybox/",

View File

@@ -32,9 +32,7 @@ mv unzip /work/system/bin/
))), version ))), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newUnzip, &Metadata{
f: Toolchain.newUnzip,
Name: "unzip", Name: "unzip",
Description: "portable compression/archiver utilities", Description: "portable compression/archiver utilities",
Website: "https://infozip.sourceforge.net/", Website: "https://infozip.sourceforge.net/",

View File

@@ -47,9 +47,7 @@ ln -s ../system/bin/bash /bin/
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newUtilLinux, &Metadata{
f: Toolchain.newUtilLinux,
Name: "util-linux", Name: "util-linux",
Description: "a random collection of Linux utilities", Description: "a random collection of Linux utilities",
Website: "https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git", Website: "https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git",

View File

@@ -29,9 +29,7 @@ func (t Toolchain) newVIM() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newVIM, &Metadata{
f: Toolchain.newVIM,
Name: "vim", Name: "vim",
Description: "a greatly improved version of the good old UNIX editor Vi", Description: "a greatly improved version of the good old UNIX editor Vi",
Website: "https://www.vim.org", Website: "https://www.vim.org",

View File

@@ -35,9 +35,7 @@ echo 'int main(){}' > tests/sanity-test.c
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newWayland, &Metadata{
f: Toolchain.newWayland,
Name: "wayland", Name: "wayland",
Description: "core Wayland window system code and protocol", Description: "core Wayland window system code and protocol",
Website: "https://wayland.freedesktop.org/", Website: "https://wayland.freedesktop.org/",
@@ -121,9 +119,7 @@ GitLab
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newWaylandProtocols, &Metadata{
f: Toolchain.newWaylandProtocols,
Name: "wayland-protocols", Name: "wayland-protocols",
Description: "Additional standard Wayland protocols", Description: "Additional standard Wayland protocols",
Website: "https://wayland.freedesktop.org/", Website: "https://wayland.freedesktop.org/",

View File

@@ -15,9 +15,7 @@ func (t Toolchain) newUtilMacros() (pkg.Artifact, string) {
), nil, (*MakeHelper)(nil)), version ), nil, (*MakeHelper)(nil)), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newUtilMacros, &Metadata{
f: Toolchain.newUtilMacros,
Name: "util-macros", Name: "util-macros",
Description: "X.Org Autotools macros", Description: "X.Org Autotools macros",
Website: "https://xorg.freedesktop.org/", Website: "https://xorg.freedesktop.org/",
@@ -47,9 +45,7 @@ func (t Toolchain) newLibxtrans() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibxtrans, &Metadata{
f: Toolchain.newLibxtrans,
Name: "libxtrans", Name: "libxtrans",
Description: "X Window System Protocols Transport layer shared code", Description: "X Window System Protocols Transport layer shared code",
Website: "https://gitlab.freedesktop.org/xorg/lib/libxtrans", Website: "https://gitlab.freedesktop.org/xorg/lib/libxtrans",
@@ -78,9 +74,7 @@ func (t Toolchain) newXorgProto() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newXorgProto, &Metadata{
f: Toolchain.newXorgProto,
Name: "xorgproto", Name: "xorgproto",
Description: "X Window System unified protocol definitions", Description: "X Window System unified protocol definitions",
Website: "https://gitlab.freedesktop.org/xorg/proto/xorgproto", Website: "https://gitlab.freedesktop.org/xorg/proto/xorgproto",
@@ -112,9 +106,7 @@ func (t Toolchain) newLibXau() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibXau, &Metadata{
f: Toolchain.newLibXau,
Name: "libXau", Name: "libXau",
Description: "functions for handling Xauthority files and entries", Description: "functions for handling Xauthority files and entries",
Website: "https://gitlab.freedesktop.org/xorg/lib/libxau", Website: "https://gitlab.freedesktop.org/xorg/lib/libxau",
@@ -141,9 +133,7 @@ func (t Toolchain) newXCBProto() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newXCBProto, &Metadata{
f: Toolchain.newXCBProto,
Name: "xcb-proto", Name: "xcb-proto",
Description: "XML-XCB protocol descriptions used by libxcb for the X11 protocol & extensions", Description: "XML-XCB protocol descriptions used by libxcb for the X11 protocol & extensions",
Website: "https://gitlab.freedesktop.org/xorg/proto/xcbproto", Website: "https://gitlab.freedesktop.org/xorg/proto/xcbproto",
@@ -170,9 +160,7 @@ func (t Toolchain) newXCB() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newXCB, &Metadata{
f: Toolchain.newXCB,
Name: "xcb", Name: "xcb",
Description: "The X protocol C-language Binding", Description: "The X protocol C-language Binding",
Website: "https://xcb.freedesktop.org/", Website: "https://xcb.freedesktop.org/",
@@ -202,9 +190,7 @@ func (t Toolchain) newLibxcbUtilKeysyms() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibxcbUtilKeysyms, &Metadata{
f: Toolchain.newLibxcbUtilKeysyms,
Name: "libxcb-util-keysyms", Name: "libxcb-util-keysyms",
Description: "standard X key constants and conversion to/from keycodes", Description: "standard X key constants and conversion to/from keycodes",
Website: "https://gitlab.freedesktop.org/xorg/lib/libxcb-keysyms", Website: "https://gitlab.freedesktop.org/xorg/lib/libxcb-keysyms",
@@ -233,9 +219,7 @@ func (t Toolchain) newLibxcbUtilImage() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibxcbUtilImage, &Metadata{
f: Toolchain.newLibxcbUtilImage,
Name: "libxcb-util-image", Name: "libxcb-util-image",
Description: "XCB port of Xlib's XImage and XShmImage functions", Description: "XCB port of Xlib's XImage and XShmImage functions",
Website: "https://gitlab.freedesktop.org/xorg/lib/libxcb-image", Website: "https://gitlab.freedesktop.org/xorg/lib/libxcb-image",
@@ -265,9 +249,7 @@ func (t Toolchain) newLibxcbUtilWM() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibxcbUtilWM, &Metadata{
f: Toolchain.newLibxcbUtilWM,
Name: "libxcb-util-wm", Name: "libxcb-util-wm",
Description: "XCB client and window-manager helpers for ICCCM & EWMH", Description: "XCB client and window-manager helpers for ICCCM & EWMH",
Website: "https://gitlab.freedesktop.org/xorg/lib/libxcb-wm", Website: "https://gitlab.freedesktop.org/xorg/lib/libxcb-wm",
@@ -298,9 +280,7 @@ func (t Toolchain) newLibxcbUtil() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibxcbUtil, &Metadata{
f: Toolchain.newLibxcbUtil,
Name: "libxcb-util", Name: "libxcb-util",
Description: "XCB utility libraries", Description: "XCB utility libraries",
Website: "https://gitlab.freedesktop.org/xorg/lib/libxcb-util", Website: "https://gitlab.freedesktop.org/xorg/lib/libxcb-util",
@@ -331,9 +311,7 @@ func (t Toolchain) newLibxcbRenderUtil() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibxcbRenderUtil, &Metadata{
f: Toolchain.newLibxcbRenderUtil,
Name: "libxcb-render-util", Name: "libxcb-render-util",
Description: "XCB convenience functions for the Render extension", Description: "XCB convenience functions for the Render extension",
Website: "https://gitlab.freedesktop.org/xorg/lib/libxcb-render-util", Website: "https://gitlab.freedesktop.org/xorg/lib/libxcb-render-util",
@@ -375,9 +353,7 @@ func (t Toolchain) newLibX11() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibX11, &Metadata{
f: Toolchain.newLibX11,
Name: "libX11", Name: "libX11",
Description: `Core X11 protocol client library (aka "Xlib")`, Description: `Core X11 protocol client library (aka "Xlib")`,
Website: "https://gitlab.freedesktop.org/xorg/lib/libx11", Website: "https://gitlab.freedesktop.org/xorg/lib/libx11",
@@ -412,9 +388,7 @@ func (t Toolchain) newLibXext() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibXext, &Metadata{
f: Toolchain.newLibXext,
Name: "libXext", Name: "libXext",
Description: "Xlib-based library for common extensions to the X11 protocol", Description: "Xlib-based library for common extensions to the X11 protocol",
Website: "https://gitlab.freedesktop.org/xorg/lib/libxext", Website: "https://gitlab.freedesktop.org/xorg/lib/libxext",
@@ -450,9 +424,7 @@ func (t Toolchain) newLibXfixes() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibXfixes, &Metadata{
f: Toolchain.newLibXfixes,
Name: "libXfixes", Name: "libXfixes",
Description: "Xlib-based library for the XFIXES Extension", Description: "Xlib-based library for the XFIXES Extension",
Website: "https://www.freedesktop.org/wiki/Software/FixesExt/", Website: "https://www.freedesktop.org/wiki/Software/FixesExt/",
@@ -487,9 +459,7 @@ func (t Toolchain) newLibXrender() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibXrender, &Metadata{
f: Toolchain.newLibXrender,
Name: "libXrender", Name: "libXrender",
Description: "Xlib library for the Render Extension to the X11 protocol", Description: "Xlib library for the Render Extension to the X11 protocol",
Website: "https://gitlab.freedesktop.org/xorg/lib/libxrender", Website: "https://gitlab.freedesktop.org/xorg/lib/libxrender",
@@ -524,9 +494,7 @@ func (t Toolchain) newLibxshmfence() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibxshmfence, &Metadata{
f: Toolchain.newLibxshmfence,
Name: "libxshmfence", Name: "libxshmfence",
Description: "shared memory 'SyncFence' synchronization primitive", Description: "shared memory 'SyncFence' synchronization primitive",
Website: "https://gitlab.freedesktop.org/xorg/lib/libxshmfence", Website: "https://gitlab.freedesktop.org/xorg/lib/libxshmfence",
@@ -558,9 +526,7 @@ func (t Toolchain) newLibXxf86vm() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibXxf86vm, &Metadata{
f: Toolchain.newLibXxf86vm,
Name: "libXxf86vm", Name: "libXxf86vm",
Description: "Xlib-based library for the XFree86-VidMode X extension", Description: "Xlib-based library for the XFree86-VidMode X extension",
Website: "https://gitlab.freedesktop.org/xorg/lib/libxxf86vm", Website: "https://gitlab.freedesktop.org/xorg/lib/libxxf86vm",
@@ -597,9 +563,7 @@ func (t Toolchain) newLibXrandr() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibXrandr, &Metadata{
f: Toolchain.newLibXrandr,
Name: "libXrandr", Name: "libXrandr",
Description: "Xlib Resize, Rotate and Reflection (RandR) extension library", Description: "Xlib Resize, Rotate and Reflection (RandR) extension library",
Website: "https://gitlab.freedesktop.org/xorg/lib/libxrandr", Website: "https://gitlab.freedesktop.org/xorg/lib/libxrandr",
@@ -634,9 +598,7 @@ func (t Toolchain) newFontUtil() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newFontUtil, &Metadata{
f: Toolchain.newFontUtil,
Name: "font-util", Name: "font-util",
Description: "X.Org font package creation/installation utilities", Description: "X.Org font package creation/installation utilities",
Website: "https://gitlab.freedesktop.org/xorg/font/util", Website: "https://gitlab.freedesktop.org/xorg/font/util",
@@ -668,9 +630,7 @@ func (t Toolchain) newLibfontenc() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibfontenc, &Metadata{
f: Toolchain.newLibfontenc,
Name: "libfontenc", Name: "libfontenc",
Description: "X font encoding library", Description: "X font encoding library",
Website: "https://gitlab.freedesktop.org/xorg/lib/libfontenc", Website: "https://gitlab.freedesktop.org/xorg/lib/libfontenc",
@@ -694,9 +654,7 @@ func (t Toolchain) newLibxkbfile() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibxkbfile, &Metadata{
f: Toolchain.newLibxkbfile,
Name: "libxkbfile", Name: "libxkbfile",
Description: "XKB file handling routines", Description: "XKB file handling routines",
Website: "http://www.x.org/wiki/XKB", Website: "http://www.x.org/wiki/XKB",
@@ -732,9 +690,7 @@ func (t Toolchain) newXkbcomp() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newXkbcomp, &Metadata{
f: Toolchain.newXkbcomp,
Name: "xkbcomp", Name: "xkbcomp",
Description: "XKB keyboard description compiler", Description: "XKB keyboard description compiler",
Website: "http://www.x.org/wiki/XKB", Website: "http://www.x.org/wiki/XKB",
@@ -772,9 +728,7 @@ func (t Toolchain) newLibXfont2() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibXfont2, &Metadata{
f: Toolchain.newLibXfont2,
Name: "libXfont2", Name: "libXfont2",
Description: "X font handling library for server & utilities", Description: "X font handling library for server & utilities",
Website: "https://gitlab.freedesktop.org/xorg/lib/libxfont", Website: "https://gitlab.freedesktop.org/xorg/lib/libxfont",
@@ -801,9 +755,7 @@ func (t Toolchain) newLibxcvt() (pkg.Artifact, string) {
), nil, (*MesonHelper)(nil)), version ), nil, (*MesonHelper)(nil)), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibxcvt, &Metadata{
f: Toolchain.newLibxcvt,
Name: "libxcvt", Name: "libxcvt",
Description: "VESA CVT standard timing modeline generation library & utility", Description: "VESA CVT standard timing modeline generation library & utility",
Website: "https://gitlab.freedesktop.org/xorg/lib/libxcvt", Website: "https://gitlab.freedesktop.org/xorg/lib/libxcvt",
@@ -834,9 +786,7 @@ func (t Toolchain) newLibXdmcp() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibXdmcp, &Metadata{
f: Toolchain.newLibXdmcp,
Name: "libXdmcp", Name: "libXdmcp",
Description: "X Display Manager Control Protocol library", Description: "X Display Manager Control Protocol library",
Website: "https://gitlab.freedesktop.org/xorg/lib/libxdmcp", Website: "https://gitlab.freedesktop.org/xorg/lib/libxdmcp",
@@ -860,9 +810,7 @@ func (t Toolchain) newXkeyboardConfig() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newXkeyboardConfig, &Metadata{
f: Toolchain.newXkeyboardConfig,
Name: "xkeyboard-config", Name: "xkeyboard-config",
Description: "the non-arch keyboard configuration database for X Window", Description: "the non-arch keyboard configuration database for X Window",
Website: "https://www.freedesktop.org/wiki/Software/XKeyboardConfig/", Website: "https://www.freedesktop.org/wiki/Software/XKeyboardConfig/",
@@ -888,9 +836,7 @@ func (t Toolchain) newLibpciaccess() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newLibpciaccess, &Metadata{
f: Toolchain.newLibpciaccess,
Name: "libpciaccess", Name: "libpciaccess",
Description: "generic PCI access library", Description: "generic PCI access library",
Website: "https://gitlab.freedesktop.org/xorg/lib/libpciaccess", Website: "https://gitlab.freedesktop.org/xorg/lib/libpciaccess",
@@ -955,9 +901,7 @@ func (t Toolchain) newXserver() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newXserver, &Metadata{
f: Toolchain.newXserver,
Name: "xserver", Name: "xserver",
Description: "X server", Description: "X server",
Website: "https://gitlab.freedesktop.org/xorg/xserver", Website: "https://gitlab.freedesktop.org/xorg/xserver",

View File

@@ -18,9 +18,7 @@ func (t Toolchain) newXZ() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newXZ, &Metadata{
f: Toolchain.newXZ,
Name: "xz", Name: "xz",
Description: "XZ Utils", Description: "XZ Utils",
Website: "https://tukaani.org/xz/", Website: "https://tukaani.org/xz/",

View File

@@ -28,9 +28,7 @@ func (t Toolchain) newZlib() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newZlib, &Metadata{
f: Toolchain.newZlib,
Name: "zlib", Name: "zlib",
Description: "lossless data-compression library", Description: "lossless data-compression library",
Website: "https://zlib.net/", Website: "https://zlib.net/",

View File

@@ -29,9 +29,7 @@ ZSTD_BIN=/cure/programs/zstd /usr/src/zstd/tests/playTests.sh
), version ), version
} }
func init() { func init() {
native.MustRegister(&Artifact{ native.mustRegister(Toolchain.newZstd, &Metadata{
f: Toolchain.newZstd,
Name: "zstd", Name: "zstd",
Description: "a fast compression algorithm", Description: "a fast compression algorithm",
Website: "https://facebook.github.io/zstd/", Website: "https://facebook.github.io/zstd/",