internal/rosa: key metadata by string
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m55s
Test / ShareFS (push) Successful in 3m46s
Test / Hakurei (push) Successful in 3m57s
Test / Sandbox (race detector) (push) Successful in 5m25s
Test / Hakurei (race detector) (push) Successful in 6m29s
Test / Flake checks (push) Successful in 1m21s

For upcoming azalea integration. The API is quite ugly right now to ease migration.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-17 13:07:12 +09:00
parent c2ff9c9fa5
commit 30eb0d6a61
95 changed files with 1514 additions and 1567 deletions

View File

@@ -6,6 +6,7 @@ import (
"io" "io"
"os" "os"
"strings" "strings"
"unique"
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
"hakurei.app/internal/rosa" "hakurei.app/internal/rosa"
@@ -36,16 +37,18 @@ func commandInfo(
} }
for i, name := range args { for i, name := range args {
if p, ok := rosa.ResolveName(name); !ok { handle := rosa.ArtifactH(unique.Make(name))
if meta := rosa.Native().Get(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
if version := rosa.Std.Version(p); version != rosa.Unversioned {
a, version := rosa.Native().MustLoad(rosa.Std, handle)
if version != rosa.Unversioned {
suffix += "-" + version suffix += "-" + version
} }
mustPrintln("name : " + name + suffix) mustPrintln("name : " + name + suffix)
meta := rosa.GetMetadata(p)
mustPrintln("description : " + meta.Description) mustPrintln("description : " + meta.Description)
if meta.Website != "" { if meta.Website != "" {
mustPrintln("website : " + mustPrintln("website : " +
@@ -54,9 +57,9 @@ 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.GetMetadata(d).Name s := rosa.Native().MustGet(d).Name
if version := rosa.Std.Version(d); version != rosa.Unversioned { if _, _version := rosa.Native().Load(rosa.Std, d); _version != rosa.Unversioned {
s += "-" + version s += "-" + _version
} }
mustPrint(" " + s) mustPrint(" " + s)
} }
@@ -68,7 +71,7 @@ func commandInfo(
if r == nil { if r == nil {
var f io.ReadSeekCloser var f io.ReadSeekCloser
err = cm.Do(func(cache *pkg.Cache) (err error) { err = cm.Do(func(cache *pkg.Cache) (err error) {
f, err = cache.OpenStatus(rosa.Std.Load(p)) f, err = cache.OpenStatus(a)
return return
}) })
if err != nil { if err != nil {
@@ -87,7 +90,7 @@ func commandInfo(
} }
} }
} else if err = cm.Do(func(cache *pkg.Cache) (err error) { } else if err = cm.Do(func(cache *pkg.Cache) (err error) {
status, n := r.ArtifactOf(cache.Ident(rosa.Std.Load(p))) status, n := r.ArtifactOf(cache.Ident(a))
if status == nil { if status == nil {
mustPrintln( mustPrintln(
statusPrefix + "not in report", statusPrefix + "not in report",

View File

@@ -10,6 +10,7 @@ import (
"strings" "strings"
"syscall" "syscall"
"testing" "testing"
"unique"
"unsafe" "unsafe"
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
@@ -20,6 +21,13 @@ import (
func TestInfo(t *testing.T) { func TestInfo(t *testing.T) {
t.Parallel() t.Parallel()
_, qemuVersion := rosa.Native().Load(rosa.Std, rosa.QEMU)
_, glibVersion := rosa.Native().Load(rosa.Std, rosa.GLib)
zlib, zlibVersion := rosa.Native().Load(rosa.Std, rosa.Zlib)
_, zstdVersion := rosa.Native().Load(rosa.Std, rosa.Zstd)
_, hakureiVersion := rosa.Native().Load(rosa.Std, rosa.Hakurei)
_, hakureiDistVersion := rosa.Native().Load(rosa.Std, rosa.HakureiDist)
testCases := []struct { testCases := []struct {
name string name string
args []string args []string
@@ -29,24 +37,24 @@ func TestInfo(t *testing.T) {
wantErr any wantErr any
}{ }{
{"qemu", []string{"qemu"}, nil, "", ` {"qemu", []string{"qemu"}, nil, "", `
name : qemu-` + rosa.Std.Version(rosa.QEMU) + ` name : qemu-` + qemuVersion + `
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-` + rosa.Std.Version(rosa.GLib) + ` zstd-` + rosa.Std.Version(rosa.Zstd) + ` depends on : glib-` + glibVersion + ` zstd-` + zstdVersion + `
`, nil}, `, nil},
{"multi", []string{"hakurei", "hakurei-dist"}, nil, "", ` {"multi", []string{"hakurei", "hakurei-dist"}, nil, "", `
name : hakurei-` + rosa.Std.Version(rosa.Hakurei) + ` name : hakurei-` + hakureiVersion + `
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-` + rosa.Std.Version(rosa.HakureiDist) + ` name : hakurei-dist-` + hakureiDistVersion + `
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-` + rosa.Std.Version(rosa.Zlib) + ` name : zlib-` + zlibVersion + `
description : lossless data-compression library description : lossless data-compression library
website : https://zlib.net website : https://zlib.net
@@ -56,12 +64,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-` + rosa.Std.Version(rosa.Zlib) + ` name : zlib-` + zlibVersion + `
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-` + rosa.Std.Version(rosa.Zstd) + ` name : zstd-` + zstdVersion + `
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
@@ -70,19 +78,19 @@ 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-` + rosa.Std.Version(rosa.Zlib) + ` name : zlib-` + zlibVersion + `
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 {
return &os.PathError{ return &os.PathError{
Op: "open", Op: "open",
Path: filepath.Join(cm.base, "status", pkg.Encode(cm.c.Ident(rosa.Std.Load(rosa.Zlib)).Value())), Path: filepath.Join(cm.base, "status", pkg.Encode(cm.c.Ident(zlib).Value())),
Err: syscall.EACCES, Err: syscall.EACCES,
} }
}}, }},
{"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-` + rosa.Std.Version(rosa.Zlib) + ` name : zlib-` + zlibVersion + `
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
@@ -131,8 +139,8 @@ status : not in report
if tc.status != nil { if tc.status != nil {
for name, status := range tc.status { for name, status := range tc.status {
p, ok := rosa.ResolveName(name) a, _ := rosa.Native().Load(rosa.Std, rosa.ArtifactH(unique.Make(name)))
if !ok { if a == nil {
t.Fatalf("invalid name %q", name) t.Fatalf("invalid name %q", name)
} }
perm := os.FileMode(0400) perm := os.FileMode(0400)
@@ -143,7 +151,7 @@ status : not in report
return os.WriteFile(filepath.Join( return os.WriteFile(filepath.Join(
cm.base, cm.base,
"status", "status",
pkg.Encode(cache.Ident(rosa.Std.Load(p)).Value()), pkg.Encode(cache.Ident(a).Value()),
), unsafe.Slice(unsafe.StringData(status), len(status)), perm) ), unsafe.Slice(unsafe.StringData(status), len(status)), perm)
}); err != nil { }); err != nil {
t.Fatalf("Do: error = %v", err) t.Fatalf("Do: error = %v", err)

View File

@@ -30,7 +30,7 @@ var (
// handleInfo writes constant system information. // handleInfo writes constant system information.
func handleInfo(w http.ResponseWriter, _ *http.Request) { func handleInfo(w http.ResponseWriter, _ *http.Request) {
infoPayloadOnce.Do(func() { infoPayloadOnce.Do(func() {
infoPayload.Count = int(rosa.PresetUnexportedStart) infoPayload.Count = int(rosa.Native().Count())
infoPayload.HakureiVersion = info.Version() infoPayload.HakureiVersion = info.Version()
}) })
// TODO(mae): cache entire response if no additional fields are planned // TODO(mae): cache entire response if no additional fields are planned
@@ -91,7 +91,7 @@ func (index *packageIndex) handleGet(w http.ResponseWriter, r *http.Request) {
if err != nil || i >= len(index.sorts[0]) || i < 0 { if err != nil || i >= len(index.sorts[0]) || i < 0 {
http.Error( http.Error(
w, "index must be an integer between 0 and "+ w, "index must be an integer between 0 and "+
strconv.Itoa(int(rosa.PresetUnexportedStart-1)), strconv.Itoa(len(index.sorts[0])-1),
http.StatusBadRequest, http.StatusBadRequest,
) )
return return
@@ -125,7 +125,7 @@ func (index *packageIndex) handleSearch(w http.ResponseWriter, r *http.Request)
if err != nil || i >= len(index.sorts[0]) || i < 0 { if err != nil || i >= len(index.sorts[0]) || i < 0 {
http.Error( http.Error(
w, "index must be an integer between 0 and "+ w, "index must be an integer between 0 and "+
strconv.Itoa(int(rosa.PresetUnexportedStart-1)), strconv.Itoa(len(index.sorts[0])-1),
http.StatusBadRequest, http.StatusBadRequest,
) )
return return

View File

@@ -3,7 +3,6 @@ package pkgserver
import ( import (
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"slices"
"strconv" "strconv"
"testing" "testing"
@@ -32,7 +31,7 @@ func TestAPIInfo(t *testing.T) {
checkPayload(t, resp, struct { checkPayload(t, resp, struct {
Count int `json:"count"` Count int `json:"count"`
HakureiVersion string `json:"hakurei_version"` HakureiVersion string `json:"hakurei_version"`
}{int(rosa.PresetUnexportedStart), info.Version()}) }{rosa.Native().Count(), info.Version()})
} }
func TestAPIGet(t *testing.T) { func TestAPIGet(t *testing.T) {
@@ -96,8 +95,8 @@ func TestAPIGet(t *testing.T) {
t.Run("index", func(t *testing.T) { t.Run("index", func(t *testing.T) {
t.Parallel() t.Parallel()
checkValidate( checkValidate(
t, "limit=1&sort=0&index", 0, int(rosa.PresetUnexportedStart-1), t, "limit=1&sort=0&index", 0, rosa.Native().Count()-1,
"index must be an integer between 0 and "+strconv.Itoa(int(rosa.PresetUnexportedStart-1)), "index must be an integer between 0 and "+strconv.Itoa(rosa.Native().Count()-1),
) )
}) })
@@ -108,74 +107,4 @@ func TestAPIGet(t *testing.T) {
"sort must be an integer between 0 and "+strconv.Itoa(int(sortOrderEnd)), "sort must be an integer between 0 and "+strconv.Itoa(int(sortOrderEnd)),
) )
}) })
checkWithSuffix := func(name, suffix string, want []*metadata) {
t.Run(name, func(t *testing.T) {
t.Parallel()
w := newRequest(suffix)
resp := w.Result()
checkStatus(t, resp, http.StatusOK)
checkAPIHeader(t, w.Header())
checkPayloadFunc(t, resp, func(got *struct {
Values []*metadata `json:"values"`
}) bool {
return slices.EqualFunc(got.Values, want, func(a, b *metadata) bool {
return (a.Version == b.Version ||
a.Version == rosa.Unversioned ||
b.Version == rosa.Unversioned) &&
a.HasReport == b.HasReport &&
a.Name == b.Name &&
a.Description == b.Description &&
a.Website == b.Website
})
})
})
}
checkWithSuffix("declarationAscending", "?limit=2&index=1&sort=0", []*metadata{
{
Metadata: rosa.GetMetadata(1),
Version: rosa.Std.Version(1),
},
{
Metadata: rosa.GetMetadata(2),
Version: rosa.Std.Version(2),
},
})
checkWithSuffix("declarationAscending offset", "?limit=3&index=5&sort=0", []*metadata{
{
Metadata: rosa.GetMetadata(5),
Version: rosa.Std.Version(5),
},
{
Metadata: rosa.GetMetadata(6),
Version: rosa.Std.Version(6),
},
{
Metadata: rosa.GetMetadata(7),
Version: rosa.Std.Version(7),
},
})
checkWithSuffix("declarationDescending", "?limit=3&index=0&sort=1", []*metadata{
{
Metadata: rosa.GetMetadata(rosa.PresetUnexportedStart - 1),
Version: rosa.Std.Version(rosa.PresetUnexportedStart - 1),
},
{
Metadata: rosa.GetMetadata(rosa.PresetUnexportedStart - 2),
Version: rosa.Std.Version(rosa.PresetUnexportedStart - 2),
},
{
Metadata: rosa.GetMetadata(rosa.PresetUnexportedStart - 3),
Version: rosa.Std.Version(rosa.PresetUnexportedStart - 3),
},
})
checkWithSuffix("declarationDescending offset", "?limit=1&index=37&sort=1", []*metadata{
{
Metadata: rosa.GetMetadata(rosa.PresetUnexportedStart - 38),
Version: rosa.Std.Version(rosa.PresetUnexportedStart - 38),
},
})
} }

View File

@@ -23,7 +23,7 @@ const (
// packageIndex refers to metadata by name and various sort orders. // packageIndex refers to metadata by name and various sort orders.
type packageIndex struct { type packageIndex struct {
sorts [sortOrderEnd + 1][rosa.PresetUnexportedStart]*metadata sorts [sortOrderEnd + 1][]*metadata
names map[string]*metadata names map[string]*metadata
search searchCache search searchCache
// Taken from [rosa.Report] if available. // Taken from [rosa.Report] if available.
@@ -32,8 +32,8 @@ 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 {
p rosa.PArtifact handle rosa.ArtifactH
*rosa.Metadata *rosa.Artifact
// Populated via [rosa.Toolchain.Version], [rosa.Unversioned] is equivalent // Populated via [rosa.Toolchain.Version], [rosa.Unversioned] is equivalent
// to the zero value. Otherwise, the zero value is invalid. // to the zero value. Otherwise, the zero value is invalid.
@@ -56,15 +56,17 @@ func (index *packageIndex) populate(report *rosa.Report) (err error) {
index.handleAccess = report.HandleAccess index.handleAccess = report.HandleAccess
} }
var work [rosa.PresetUnexportedStart]*metadata handles := rosa.Native().Collect()
work := make([]*metadata, len(handles))
index.names = make(map[string]*metadata) index.names = make(map[string]*metadata)
ir := pkg.NewIR() ir := pkg.NewIR()
for p := range rosa.PresetUnexportedStart { for i, handle := range handles {
a, version := rosa.Native().Load(rosa.Std, handle)
m := metadata{ m := metadata{
p: p, handle: handle,
Metadata: rosa.GetMetadata(p), Artifact: rosa.Native().MustGet(handle),
Version: rosa.Std.Version(p), Version: version,
} }
if m.Version == "" { if m.Version == "" {
return errors.New("invalid version from " + m.Name) return errors.New("invalid version from " + m.Name)
@@ -74,13 +76,13 @@ func (index *packageIndex) populate(report *rosa.Report) (err error) {
} }
if report != nil { if report != nil {
id := ir.Ident(rosa.Std.Load(p)) id := ir.Ident(a)
m.ids = pkg.Encode(id.Value()) m.ids = pkg.Encode(id.Value())
m.status, m.Size = report.ArtifactOf(id) m.status, m.Size = report.ArtifactOf(id)
m.HasReport = m.Size >= 0 m.HasReport = m.Size >= 0
} }
work[p] = &m work[i] = &m
index.names[m.Name] = &m index.names[m.Name] = &m
} }

View File

@@ -97,10 +97,10 @@ func main() {
if !flagLTO { if !flagLTO {
flags |= rosa.OptLLVMNoLTO flags |= rosa.OptLLVMNoLTO
} }
rosa.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.Std.Load(rosa.QEMU) cm.qemu, _ = rosa.Native().Load(rosa.Std, rosa.QEMU)
} }
if cross { if cross {
@@ -108,7 +108,7 @@ func main() {
flags = flagCrossOverride flags = flagCrossOverride
} }
rosa.DropCaches(flagArch, flags) rosa.Native().DropCaches(flagArch, flags)
if !rosa.HasStage0() { if !rosa.HasStage0() {
return pkg.UnsupportedArchError(flagArch) return pkg.UnsupportedArchError(flagArch)
} }
@@ -331,12 +331,12 @@ func main() {
n atomic.Uint64 n atomic.Uint64
) )
w := make(chan rosa.PArtifact) w := make(chan rosa.ArtifactH)
var wg sync.WaitGroup var wg sync.WaitGroup
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.GetMetadata(p) meta := rosa.Native().MustGet(p)
if meta.ID == 0 { if meta.ID == 0 {
continue continue
} }
@@ -349,8 +349,9 @@ func main() {
continue continue
} }
_, version := rosa.Native().Load(rosa.Std, p)
if current, latest := if current, latest :=
rosa.Std.Version(p), version,
meta.GetLatest(v); current != latest { meta.GetLatest(v); current != latest {
n.Add(1) n.Add(1)
@@ -364,9 +365,9 @@ func main() {
} }
done: done:
for i := range rosa.PresetEnd { for _, p := range rosa.Native().Collect() {
select { select {
case w <- rosa.PArtifact(i): case w <- p:
break break
case <-ctx.Done(): case <-ctx.Done():
break done break done
@@ -421,7 +422,7 @@ func main() {
return return
} }
} }
rosa.SetGentooStage3(flagGentoo, checksum) rosa.Native().SetGentooStage3(flagGentoo, checksum)
} }
var ( var (
@@ -430,9 +431,8 @@ func main() {
) )
if err = cm.Do(func(cache *pkg.Cache) (err error) { if err = cm.Do(func(cache *pkg.Cache) (err error) {
pathname, _, err = cache.Cure( llvm, _ := rosa.Native().Load(t-2, rosa.LLVM)
(t - 2).Load(rosa.LLVM), pathname, _, err = cache.Cure(llvm)
)
return return
}); err != nil { }); err != nil {
return return
@@ -440,18 +440,16 @@ 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) {
pathname, checksum[0], err = cache.Cure( llvm, _ := rosa.Native().Load(t-1, rosa.LLVM)
(t - 1).Load(rosa.LLVM), pathname, checksum[0], err = cache.Cure(llvm)
)
return return
}); err != nil { }); err != nil {
return return
} }
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) {
pathname, checksum[1], err = cache.Cure( llvm, _ := rosa.Native().Load(t, rosa.LLVM)
t.Load(rosa.LLVM), pathname, checksum[1], err = cache.Cure(llvm)
)
return return
}); err != nil { }); err != nil {
return return
@@ -472,9 +470,8 @@ 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) {
pathname, _, err = cache.Cure( stage0, _ := rosa.Native().Load(t, rosa.Stage0)
t.Load(rosa.Stage0), pathname, _, err = cache.Cure(stage0)
)
return return
}); err != nil { }); err != nil {
return return
@@ -519,10 +516,6 @@ func main() {
if len(args) != 1 { if len(args) != 1 {
return errors.New("cure requires 1 argument") return errors.New("cure requires 1 argument")
} }
p, ok := rosa.ResolveName(args[0])
if !ok {
return fmt.Errorf("unknown artifact %q", args[0])
}
t := rosa.Std t := rosa.Std
if flagBoot { if flagBoot {
@@ -531,11 +524,16 @@ func main() {
t -= 1 t -= 1
} }
a, _ := rosa.Native().Load(t, rosa.ArtifactH(unique.Make(args[0])))
if a == nil {
return fmt.Errorf("unknown artifact %q", args[0])
}
switch { switch {
default: default:
var pathname *check.Absolute var pathname *check.Absolute
err := cm.Do(func(cache *pkg.Cache) (err error) { err := cm.Do(func(cache *pkg.Cache) (err error) {
pathname, _, err = cache.Cure(t.Load(p)) pathname, _, err = cache.Cure(a)
return return
}) })
if err != nil { if err != nil {
@@ -577,7 +575,7 @@ func main() {
return err return err
} }
if err = pkg.NewIR().EncodeAll(f, rosa.Std.Load(p)); err != nil { if err = pkg.NewIR().EncodeAll(f, a); err != nil {
_ = f.Close() _ = f.Close()
return err return err
} }
@@ -588,7 +586,7 @@ func main() {
return cm.Do(func(cache *pkg.Cache) error { return cm.Do(func(cache *pkg.Cache) error {
return cache.EnterExec( return cache.EnterExec(
ctx, ctx,
t.Load(p), a,
true, os.Stdin, os.Stdout, os.Stderr, true, os.Stdin, os.Stdout, os.Stderr,
rosa.AbsSystem.Append("bin", "mksh"), rosa.AbsSystem.Append("bin", "mksh"),
"sh", "sh",
@@ -600,7 +598,6 @@ func main() {
if flagNoReply { if flagNoReply {
flags |= remoteNoReply flags |= remoteNoReply
} }
a := t.Load(p)
pathname, err := cureRemote(ctx, &addr, a, flags) pathname, err := cureRemote(ctx, &addr, a, flags)
if !flagNoReply && err == nil { if !flagNoReply && err == nil {
log.Println(pathname) log.Println(pathname)
@@ -620,7 +617,7 @@ func main() {
case flagFaults: case flagFaults:
var faults []pkg.Fault var faults []pkg.Fault
if err := cm.Do(func(cache *pkg.Cache) (err error) { if err := cm.Do(func(cache *pkg.Cache) (err error) {
faults, err = cache.ReadFaults(t.Load(p)) faults, err = cache.ReadFaults(a)
return return
}); err != nil { }); err != nil {
return err return err
@@ -634,7 +631,7 @@ func main() {
case flagPop: case flagPop:
var faults []pkg.Fault var faults []pkg.Fault
if err := cm.Do(func(cache *pkg.Cache) (err error) { if err := cm.Do(func(cache *pkg.Cache) (err error) {
faults, err = cache.ReadFaults(t.Load(p)) faults, err = cache.ReadFaults(a)
return return
}); err != nil { }); err != nil {
return err return err
@@ -740,27 +737,26 @@ func main() {
"shell", "shell",
"Interactive shell in the specified Rosa OS environment", "Interactive shell in the specified Rosa OS environment",
func(args []string) error { func(args []string) error {
presets := make([]rosa.PArtifact, len(args)+3) handles := make([]rosa.ArtifactH, len(args)+3)
for i, arg := range args { for i, arg := range args {
p, ok := rosa.ResolveName(arg) handles[i] = rosa.ArtifactH(unique.Make(arg))
if !ok { if rosa.Native().Get(handles[i]) == nil {
return fmt.Errorf("unknown artifact %q", arg) return fmt.Errorf("unknown artifact %q", arg)
} }
presets[i] = p
} }
base := rosa.LLVM base := rosa.LLVM
if !flagWithToolchain { if !flagWithToolchain {
base = rosa.Musl base = rosa.Musl
} }
presets = append(presets, handles = append(handles,
base, base,
rosa.Mksh, rosa.Mksh,
rosa.Toybox, rosa.Toybox,
) )
root := make(pkg.Collect, 0, 6+len(args)) root := make(pkg.Collect, 0, 6+len(args))
root = rosa.Std.AppendPresets(root, presets...) root = rosa.Native().AppendPresets(rosa.Std, root, handles...)
if err := cm.Do(func(cache *pkg.Cache) error { if err := cm.Do(func(cache *pkg.Cache) error {
_, _, err := cache.Cure(&root) _, _, err := cache.Cure(&root)

View File

@@ -9,7 +9,7 @@ import (
) )
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
rosa.DropCaches("", rosa.OptLLVMNoLTO) rosa.Native().DropCaches("", rosa.OptLLVMNoLTO)
os.Exit(m.Run()) os.Exit(m.Run())
} }
@@ -35,10 +35,10 @@ func TestCureAll(t *testing.T) {
} }
}) })
for i := range rosa.PresetEnd { for _, handle := range rosa.Native().Collect() {
p := rosa.PArtifact(i) a, _ := rosa.Native().MustLoad(rosa.Std, handle)
t.Run(rosa.GetMetadata(p).Name, func(t *testing.T) { t.Run(rosa.Native().MustGet(handle).Name, func(t *testing.T) {
_, err := cureRemote(t.Context(), &addr, rosa.Std.Load(p), 0) _, err := cureRemote(t.Context(), &addr, a, 0)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newAttr() (pkg.Artifact, string) { func (t Toolchain) newAttr(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.5.2" version = "2.5.2"
checksum = "YWEphrz6vg1sUMmHHVr1CRo53pFXRhq_pjN-AlG8UgwZK1y6m7zuDhxqJhD0SV0l" checksum = "YWEphrz6vg1sUMmHHVr1CRo53pFXRhq_pjN-AlG8UgwZK1y6m7zuDhxqJhD0SV0l"
) )
return t.NewPackage("attr", version, newTar( return s.NewPackage(t, "attr", version, newTar(
"https://download.savannah.nongnu.org/releases/attr/"+ "https://download.savannah.nongnu.org/releases/attr/"+
"attr-"+version+".tar.gz", "attr-"+version+".tar.gz",
checksum, checksum,
@@ -65,7 +65,7 @@ ln -s ../../system/bin/perl /usr/bin
), version ), version
} }
func init() { func init() {
artifactsM[Attr] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newAttr, f: Toolchain.newAttr,
Name: "attr", Name: "attr",
@@ -73,15 +73,15 @@ func init() {
Website: "https://savannah.nongnu.org/projects/attr/", Website: "https://savannah.nongnu.org/projects/attr/",
ID: 137, ID: 137,
} })
} }
func (t Toolchain) newACL() (pkg.Artifact, string) { func (t Toolchain) newACL(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.3.2" version = "2.3.2"
checksum = "-fY5nwH4K8ZHBCRXrzLdguPkqjKI6WIiGu4dBtrZ1o0t6AIU73w8wwJz_UyjIS0P" checksum = "-fY5nwH4K8ZHBCRXrzLdguPkqjKI6WIiGu4dBtrZ1o0t6AIU73w8wwJz_UyjIS0P"
) )
return t.NewPackage("acl", version, newTar( return s.NewPackage(t, "acl", version, newTar(
"https://download.savannah.nongnu.org/releases/acl/"+ "https://download.savannah.nongnu.org/releases/acl/"+
"acl-"+version+".tar.gz", "acl-"+version+".tar.gz",
checksum, checksum,
@@ -94,7 +94,7 @@ func (t Toolchain) newACL() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[ACL] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newACL, f: Toolchain.newACL,
Name: "acl", Name: "acl",
@@ -106,5 +106,5 @@ func init() {
}, },
ID: 16, ID: 16,
} })
} }

View File

@@ -1,447 +0,0 @@
package rosa
import (
"context"
"encoding/json"
"errors"
"fmt"
"net/http"
"runtime"
"strconv"
"sync"
"hakurei.app/internal/pkg"
)
// PArtifact is a lazily-initialised [pkg.Artifact] preset.
type PArtifact int
const (
LLVM PArtifact = iota
// EarlyInit is the Rosa OS init program.
EarlyInit
// ImageSystem is the Rosa OS /system image.
ImageSystem
// ImageInitramfs is the Rosa OS initramfs archive.
ImageInitramfs
// Kernel is the generic Rosa OS Linux kernel.
Kernel
// KernelHeaders is an installation of kernel headers for [Kernel].
KernelHeaders
// KernelSource is a writable kernel source tree installed to [AbsUsrSrc].
KernelSource
// Firmware is firmware blobs for use with the Linux kernel.
Firmware
ACL
ArgpStandalone
Attr
Autoconf
Automake
BC
Bash
Binutils
Bison
Bzip2
CMake
Connman
Coreutils
Curl
DBus
DTC
Diffutils
Elfutils
Fakeroot
Findutils
Flex
FontUtil
Freetype
Fuse
GMP
GLib
Gawk
GenInitCPIO
Gettext
Git
Glslang
GnuTLS
Go
Gperf
Grep
Gzip
Hakurei
HakureiDist
Hwdata
IPTables
Kmod
LIT
LibX11
LibXau
LibXdmcp
LibXext
LibXfixes
LibXfont2
LibXrandr
LibXrender
LibXxf86vm
Libarchive
Libbsd
Libcap
Libconfig
LibdisplayInfo
Libdrm
Libepoxy
Libev
Libexpat
Libffi
Libfontenc
Libgd
Libglvnd
Libiconv
Libmd
Libmnl
Libnftnl
Libpciaccess
Libpng
Libpsl
Libseccomp
Libtasn1
Libtirpc
Libtool
Libucontext
Libunistring
Libva
LibxcbRenderUtil
LibxcbUtil
LibxcbUtilImage
LibxcbUtilKeysyms
LibxcbUtilWM
Libxcvt
Libxkbfile
Libxml2
Libxshmfence
Libxslt
Libxtrans
LMSensors
M4
MPC
MPFR
Make
Mesa
Meson
Mksh
MuslFts
MuslObstack
NSS
NSSCACert
Ncurses
Nettle
Ninja
OpenSSL
P11Kit
PCRE2
Parallel
Patch
Perl
PerlLocaleGettext
PerlMIMECharset
PerlModuleBuild
PerlPodParser
PerlSGMLS
PerlTermReadKey
PerlTestCmd
PerlTextCharWidth
PerlTextWrapI18N
PerlUnicodeLineBreak
PerlYAMLTiny
Pixman
PkgConfig
Procps
Python
PythonFlitCore
PythonHatchling
PythonIniConfig
PythonMako
PythonMarkupSafe
PythonPackaging
PythonPathspec
PythonPluggy
PythonPyTest
PythonPyYAML
PythonPycparser
PythonPygments
PythonSetuptools
PythonSetuptoolsSCM
PythonTroveClassifiers
PythonVCSVersioning
PythonWheel
QEMU
Rdfind
Readline
Rsync
Sed
SPIRVHeaders
SPIRVLLVMTranslator
SPIRVTools
SquashfsTools
Strace
TamaGo
Tar
Texinfo
Toybox
toyboxEarly
Unzip
UtilLinux
VIM
Wayland
WaylandProtocols
XCB
XCBProto
XDGDBusProxy
XZ
Xkbcomp
XkeyboardConfig
XorgProto
Xserver
Zlib
Zstd
// PresetUnexportedStart is the first unexported preset.
PresetUnexportedStart
stage0Dist = iota - 1
llvmSource
// earlyCompilerRT is an early, standalone compiler-rt installation for the
// standalone runtimes build.
//
// earlyCompilerRT must only be loaded by [LLVM].
earlyCompilerRT
// earlyRuntimes is an early, standalone installation of LLVM runtimes to
// work around the cmake build system leaking the system LLVM installation
// when invoking the newly built toolchain.
//
// earlyRuntimes must only be loaded by [LLVM].
earlyRuntimes
buildcatrust
utilMacros
// Musl is a standalone libc that does not depend on the toolchain.
Musl
// muslHeaders is a system installation of [Musl] headers.
muslHeaders
// gcc is a hacked-to-pieces GCC toolchain meant for use in intermediate
// stages only. This preset and its direct output must never be exposed.
gcc
// nettle3 is an older version of [Nettle].
nettle3
// Stage0 is a tarball containing all compile-time dependencies of artifacts
// part of the [Std] toolchain.
Stage0
// PresetEnd is the total number of presets and does not denote a preset.
PresetEnd
)
// P represents multiple [PArtifact] and is stable through JSON.
type P []PArtifact
// MarshalJSON represents [PArtifact] by their [Metadata.Name].
func (s P) MarshalJSON() ([]byte, error) {
names := make([]string, len(s))
for i, p := range s {
names[i] = GetMetadata(p).Name
}
return json.Marshal(names)
}
// UnmarshalJSON resolves the value created by MarshalJSON back to [P].
func (s *P) UnmarshalJSON(data []byte) error {
var names []string
if err := json.Unmarshal(data, &names); err != nil {
return err
}
*s = make(P, len(names))
for i, name := range names {
if p, ok := ResolveName(name); !ok {
return fmt.Errorf("unknown artifact %q", name)
} else {
(*s)[i] = p
}
}
return nil
}
// Metadata is stage-agnostic information of a [PArtifact] not directly
// representable in the resulting [pkg.Artifact].
type Metadata struct {
f func(t Toolchain) (a pkg.Artifact, version string)
// Unique package name.
Name string `json:"name"`
// Short user-facing description.
Description string `json:"description"`
// Project home page.
Website string `json:"website,omitempty"`
// Runtime dependencies.
Dependencies P `json:"dependencies"`
// Project identifier on [Anitya].
//
// [Anitya]: https://release-monitoring.org/
ID int `json:"-"`
// Optional custom version checking behaviour.
latest func(v *Versions) string
}
// GetLatest returns the latest version described by v.
func (meta *Metadata) GetLatest(v *Versions) string {
if meta.latest != nil {
return meta.latest(v)
}
return v.Latest
}
// Unversioned denotes an unversioned [PArtifact].
const Unversioned = "\x00"
// UnpopulatedIDError is returned by [Metadata.GetLatest] for an instance of
// [Metadata] where ID is not populated.
type UnpopulatedIDError struct{}
func (UnpopulatedIDError) Unwrap() error { return errors.ErrUnsupported }
func (UnpopulatedIDError) Error() string { return "Anitya ID is not populated" }
// Versions are package versions returned by Anitya.
type Versions struct {
// The latest version for the project, as determined by the version sorting algorithm.
Latest string `json:"latest_version"`
// List of all versions that arent flagged as pre-release.
Stable []string `json:"stable_versions"`
// List of all versions stored, sorted from newest to oldest.
All []string `json:"versions"`
}
// getStable returns the first Stable version, or Latest if that is unavailable.
func (v *Versions) getStable() string {
if len(v.Stable) == 0 {
return v.Latest
}
return v.Stable[0]
}
// GetVersions returns versions fetched from Anitya.
func (meta *Metadata) GetVersions(ctx context.Context) (*Versions, error) {
if meta.ID == 0 {
return nil, UnpopulatedIDError{}
}
var resp *http.Response
if req, err := http.NewRequestWithContext(
ctx,
http.MethodGet,
"https://release-monitoring.org/api/v2/versions/?project_id="+
strconv.Itoa(meta.ID),
nil,
); err != nil {
return nil, err
} else {
req.Header.Set("User-Agent", "Rosa/1.1")
if resp, err = http.DefaultClient.Do(req); err != nil {
return nil, err
}
}
var v Versions
err := json.NewDecoder(resp.Body).Decode(&v)
return &v, errors.Join(err, resp.Body.Close())
}
var (
// artifactsM is an array of [PArtifact] metadata.
artifactsM [PresetEnd]Metadata
// artifacts stores the result of Metadata.f.
artifacts [_toolchainEnd][len(artifactsM)]struct {
a pkg.Artifact
v string
}
// artifactsOnce is for lazy initialisation of artifacts.
artifactsOnce [_toolchainEnd][len(artifactsM)]sync.Once
// arch is the target architecture.
arch = runtime.GOARCH
// presetOpts globally modifies behaviour of presets.
presetOpts int
)
const (
// OptSkipCheck skips running all test suites.
OptSkipCheck = 1 << iota
// OptLLVMNoLTO disables LTO in all [LLVM] stages.
OptLLVMNoLTO
)
// Arch returns the target architecture.
func Arch() string { return arch }
// Flags returns the current preset flags
func Flags() int { return presetOpts }
// zero zeros the value pointed to by p.
func zero[T any](p *T) { var v T; *p = v }
// DropCaches arranges for all cached [pkg.Artifact] to be freed some time after
// it returns. Must not be used concurrently with any other function from this
// package.
func DropCaches(targetArch string, flags int) {
if targetArch == "" {
targetArch = runtime.GOARCH
}
arch = targetArch
presetOpts = flags
zero(&artifacts)
zero(&artifactsOnce)
}
// GetMetadata returns [Metadata] of a [PArtifact].
func GetMetadata(p PArtifact) *Metadata { return &artifactsM[p] }
// construct constructs a [pkg.Artifact] corresponding to a [PArtifact] once.
func (t Toolchain) construct(p PArtifact) {
artifactsOnce[t][p].Do(func() {
artifacts[t][p].a, artifacts[t][p].v = artifactsM[p].f(t)
})
}
// Load returns the resulting [pkg.Artifact] of [PArtifact].
func (t Toolchain) Load(p PArtifact) pkg.Artifact {
t.construct(p)
return artifacts[t][p].a
}
// Version returns the version string of [PArtifact].
func (t Toolchain) Version(p PArtifact) string {
t.construct(p)
return artifacts[t][p].v
}
// ResolveName returns a [PArtifact] by name.
func ResolveName(name string) (p PArtifact, ok bool) {
for i := range PresetUnexportedStart {
if name == artifactsM[i].Name {
return i, true
}
}
return 0, false
}

View File

@@ -1,81 +0,0 @@
package rosa_test
import (
"testing"
"hakurei.app/internal/rosa"
)
func TestLoad(t *testing.T) {
t.Parallel()
for i := range rosa.PresetEnd {
p := rosa.PArtifact(i)
t.Run(rosa.GetMetadata(p).Name, func(t *testing.T) {
t.Parallel()
rosa.Std.Load(p)
})
}
}
func BenchmarkAll(b *testing.B) {
arch, flags := rosa.Arch(), rosa.Flags()
b.Cleanup(func() { rosa.DropCaches(arch, flags) })
for b.Loop() {
for i := range rosa.PresetEnd {
rosa.Std.Load(rosa.PArtifact(i))
}
b.StopTimer()
rosa.DropCaches("", 0)
b.StartTimer()
}
}
func TestResolveName(t *testing.T) {
t.Parallel()
for i := range rosa.PresetUnexportedStart {
p := i
name := rosa.GetMetadata(p).Name
t.Run(name, func(t *testing.T) {
t.Parallel()
if got, ok := rosa.ResolveName(name); !ok {
t.Fatal("ResolveName: ok = false")
} else if got != p {
t.Fatalf("ResolveName: %d, want %d", got, p)
}
})
}
}
func TestResolveNameUnexported(t *testing.T) {
t.Parallel()
for i := rosa.PresetUnexportedStart; i < rosa.PresetEnd; i++ {
p := i
name := rosa.GetMetadata(p).Name
t.Run(name, func(t *testing.T) {
t.Parallel()
if got, ok := rosa.ResolveName(name); ok {
t.Fatalf("ResolveName: resolved unexported preset %d", got)
}
})
}
}
func TestUnique(t *testing.T) {
t.Parallel()
names := make(map[string]struct{})
for i := range rosa.PresetEnd {
name := rosa.GetMetadata(rosa.PArtifact(i)).Name
if _, ok := names[name]; ok {
t.Fatalf("name %s is not unique", name)
}
names[name] = struct{}{}
}
}

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newArgpStandalone() (pkg.Artifact, string) { func (t Toolchain) newArgpStandalone(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.3" version = "1.3"
checksum = "vtW0VyO2pJ-hPyYmDI2zwSLS8QL0sPAUKC1t3zNYbwN2TmsaE-fADhaVtNd3eNFl" checksum = "vtW0VyO2pJ-hPyYmDI2zwSLS8QL0sPAUKC1t3zNYbwN2TmsaE-fADhaVtNd3eNFl"
) )
return t.NewPackage("argp-standalone", version, newTar( return s.NewPackage(t, "argp-standalone", version, newTar(
"http://www.lysator.liu.se/~nisse/misc/"+ "http://www.lysator.liu.se/~nisse/misc/"+
"argp-standalone-"+version+".tar.gz", "argp-standalone-"+version+".tar.gz",
checksum, checksum,
@@ -26,11 +26,11 @@ install -D -m755 libargp.a /work/system/lib/libargp.a
), version ), version
} }
func init() { func init() {
artifactsM[ArgpStandalone] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newArgpStandalone, 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

@@ -85,13 +85,13 @@ func (a busyboxBin) Cure(t *pkg.TContext) (err error) {
// newBusyboxBin returns a [pkg.Artifact] containing a busybox installation from // newBusyboxBin returns a [pkg.Artifact] containing a busybox installation from
// the https://busybox.net/downloads/binaries/ binary release. // the https://busybox.net/downloads/binaries/ binary release.
func newBusyboxBin() pkg.Artifact { func (s *S) newBusyboxBin() pkg.Artifact {
var version, url, checksum string var version, url, checksum string
switch arch { switch s.arch {
case "amd64": case "amd64":
version = "1.35.0" version = "1.35.0"
url = "https://busybox.net/downloads/binaries/" + url = "https://busybox.net/downloads/binaries/" +
version + "-" + linuxArch() + "-linux-musl/busybox" version + "-" + s.linuxArch() + "-linux-musl/busybox"
checksum = "L7OBIsPu9enNHn7FqpBT1kOg_mCLNmetSeNMA3i4Y60Z5jTgnlX3qX3zcQtLx5AB" checksum = "L7OBIsPu9enNHn7FqpBT1kOg_mCLNmetSeNMA3i4Y60Z5jTgnlX3qX3zcQtLx5AB"
case "arm64": case "arm64":
version = "1.31.0" version = "1.31.0"
@@ -100,11 +100,11 @@ func newBusyboxBin() pkg.Artifact {
checksum = "npJjBO7iwhjW6Kx2aXeSxf8kXhVgTCDChOZTTsI8ZfFfa3tbsklxRiidZQdrVERg" checksum = "npJjBO7iwhjW6Kx2aXeSxf8kXhVgTCDChOZTTsI8ZfFfa3tbsklxRiidZQdrVERg"
default: default:
panic("unsupported target " + arch) panic("unsupported target " + s.arch)
} }
return pkg.NewExec( return pkg.NewExec(
"busybox-bin-"+version, arch, nil, pkg.ExecTimeoutMax, false, false, "busybox-bin-"+version, s.arch, nil, pkg.ExecTimeoutMax, false, false,
fhs.AbsRoot, []string{ fhs.AbsRoot, []string{
"PATH=/system/bin", "PATH=/system/bin",
}, },

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newBzip2() (pkg.Artifact, string) { func (t Toolchain) newBzip2(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.0.8" version = "1.0.8"
checksum = "cTLykcco7boom-s05H1JVsQi1AtChYL84nXkg_92Dm1Xt94Ob_qlMg_-NSguIK-c" checksum = "cTLykcco7boom-s05H1JVsQi1AtChYL84nXkg_92Dm1Xt94Ob_qlMg_-NSguIK-c"
) )
return t.NewPackage("bzip2", version, newTar( return s.NewPackage(t, "bzip2", version, newTar(
"https://sourceware.org/pub/bzip2/bzip2-"+version+".tar.gz", "https://sourceware.org/pub/bzip2/bzip2-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -26,7 +26,7 @@ func (t Toolchain) newBzip2() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
artifactsM[Bzip2] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newBzip2, f: Toolchain.newBzip2,
Name: "bzip2", Name: "bzip2",
@@ -34,5 +34,5 @@ func init() {
Website: "https://sourceware.org/bzip2/", Website: "https://sourceware.org/bzip2/",
ID: 237, ID: 237,
} })
} }

View File

@@ -8,12 +8,12 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newCMake() (pkg.Artifact, string) { func (t Toolchain) newCMake(s *S) (pkg.Artifact, string) {
const ( const (
version = "4.3.2" version = "4.3.2"
checksum = "6QylwRVKletndTSkZTV2YBRwgd_9rUVgav_QW23HpjUgV21AVYZOUOal8tdBDmO7" checksum = "6QylwRVKletndTSkZTV2YBRwgd_9rUVgav_QW23HpjUgV21AVYZOUOal8tdBDmO7"
) )
return t.NewPackage("cmake", version, newFromGitHubRelease( return s.NewPackage(t, "cmake", version, newFromGitHubRelease(
"Kitware/CMake", "Kitware/CMake",
"v"+version, "v"+version,
"cmake-"+version+".tar.gz", "cmake-"+version+".tar.gz",
@@ -106,7 +106,7 @@ index 2ead810437..f85cbb8b1c 100644
), version ), version
} }
func init() { func init() {
artifactsM[CMake] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newCMake, f: Toolchain.newCMake,
Name: "cmake", Name: "cmake",
@@ -114,7 +114,7 @@ func init() {
Website: "https://cmake.org/", Website: "https://cmake.org/",
ID: 306, ID: 306,
} })
} }
// CMakeHelper is the [CMake] build system helper. // CMakeHelper is the [CMake] build system helper.
@@ -164,7 +164,7 @@ func (*CMakeHelper) createDir() bool { return true }
func (*CMakeHelper) wantsDir() string { return "/cure/" } func (*CMakeHelper) wantsDir() string { return "/cure/" }
// script generates the cure script. // script generates the cure script.
func (attr *CMakeHelper) script(name string) string { func (attr *CMakeHelper) script(s *S, name string) string {
if attr == nil { if attr == nil {
attr = new(CMakeHelper) attr = new(CMakeHelper)
} }
@@ -180,7 +180,7 @@ func (attr *CMakeHelper) script(name string) string {
} }
script := attr.Script script := attr.Script
if !attr.SkipTest && presetOpts&OptSkipCheck == 0 { if !attr.SkipTest && s.opts&OptSkipCheck == 0 {
script += "\n" + test script += "\n" + test
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newConnman() (pkg.Artifact, string) { func (t Toolchain) newConnman(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.0" version = "2.0"
checksum = "MhVTdJOhndnZn2SWd8URKo_Pj7Zvc14tntEbrVOf9L3yVWJvpb3v3Q6104tWJgtW" checksum = "MhVTdJOhndnZn2SWd8URKo_Pj7Zvc14tntEbrVOf9L3yVWJvpb3v3Q6104tWJgtW"
) )
return t.NewPackage("connman", version, newTar( return s.NewPackage(t, "connman", version, newTar(
"https://git.kernel.org/pub/scm/network/connman/connman.git/"+ "https://git.kernel.org/pub/scm/network/connman/connman.git/"+
"snapshot/connman-"+version+".tar.gz", "snapshot/connman-"+version+".tar.gz",
checksum, checksum,
@@ -90,7 +90,7 @@ func (t Toolchain) newConnman() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Connman] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newConnman, f: Toolchain.newConnman,
Name: "connman", Name: "connman",
@@ -105,5 +105,5 @@ func init() {
}, },
ID: 337, ID: 337,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newCurl() (pkg.Artifact, string) { func (t Toolchain) newCurl(s *S) (pkg.Artifact, string) {
const ( const (
version = "8.20.0" version = "8.20.0"
checksum = "xyHXwrngIRGMasuzhn-I5MSCOhktwINbsWt1f_LuR-5jRVvyx_g6U1EQfDLEbr9r" checksum = "xyHXwrngIRGMasuzhn-I5MSCOhktwINbsWt1f_LuR-5jRVvyx_g6U1EQfDLEbr9r"
) )
return t.NewPackage("curl", version, newTar( return s.NewPackage(t, "curl", version, newTar(
"https://curl.se/download/curl-"+version+".tar.bz2", "https://curl.se/download/curl-"+version+".tar.bz2",
checksum, checksum,
pkg.TarBzip2, pkg.TarBzip2,
@@ -39,7 +39,7 @@ chmod +w tests/data && rm -f tests/data/test459
), version ), version
} }
func init() { func init() {
artifactsM[Curl] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newCurl, f: Toolchain.newCurl,
Name: "curl", Name: "curl",
@@ -52,5 +52,5 @@ func init() {
}, },
ID: 381, ID: 381,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newDBus() (pkg.Artifact, string) { func (t Toolchain) newDBus(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.16.2" version = "1.16.2"
checksum = "INwOuNdrDG7XW5ilW_vn8JSxEa444rRNc5ho97i84I1CNF09OmcFcV-gzbF4uCyg" checksum = "INwOuNdrDG7XW5ilW_vn8JSxEa444rRNc5ho97i84I1CNF09OmcFcV-gzbF4uCyg"
) )
return t.NewPackage("dbus", version, newFromGitLab( return s.NewPackage(t, "dbus", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"dbus/dbus", "dbus/dbus",
"dbus-"+version, "dbus-"+version,
@@ -29,7 +29,7 @@ func (t Toolchain) newDBus() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[DBus] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newDBus, f: Toolchain.newDBus,
Name: "dbus", Name: "dbus",
@@ -42,15 +42,15 @@ func init() {
}, },
ID: 5356, ID: 5356,
} })
} }
func (t Toolchain) newXDGDBusProxy() (pkg.Artifact, string) { func (t Toolchain) newXDGDBusProxy(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.1.7" version = "0.1.7"
checksum = "UW5Pe-TP-XAaN-kTbxrkOQ7eYdmlAQlr2pdreLtPT0uwdAz-7rzDP8V_8PWuZBup" checksum = "UW5Pe-TP-XAaN-kTbxrkOQ7eYdmlAQlr2pdreLtPT0uwdAz-7rzDP8V_8PWuZBup"
) )
return t.NewPackage("xdg-dbus-proxy", version, newFromGitHub( return s.NewPackage(t, "xdg-dbus-proxy", version, newFromGitHub(
"flatpak/xdg-dbus-proxy", "flatpak/xdg-dbus-proxy",
version, version,
checksum, checksum,
@@ -65,7 +65,7 @@ func (t Toolchain) newXDGDBusProxy() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[XDGDBusProxy] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newXDGDBusProxy, f: Toolchain.newXDGDBusProxy,
Name: "xdg-dbus-proxy", Name: "xdg-dbus-proxy",
@@ -77,5 +77,5 @@ func init() {
}, },
ID: 58434, ID: 58434,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newDTC() (pkg.Artifact, string) { func (t Toolchain) newDTC(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.7.2" version = "1.7.2"
checksum = "vUoiRynPyYRexTpS6USweT5p4SVHvvVJs8uqFkkVD-YnFjwf6v3elQ0-Etrh00Dt" checksum = "vUoiRynPyYRexTpS6USweT5p4SVHvvVJs8uqFkkVD-YnFjwf6v3elQ0-Etrh00Dt"
) )
return t.NewPackage("dtc", version, newTar( return s.NewPackage(t, "dtc", version, newTar(
"https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/"+ "https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/"+
"dtc-v"+version+".tar.gz", "dtc-v"+version+".tar.gz",
checksum, checksum,
@@ -31,7 +31,7 @@ func (t Toolchain) newDTC() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[DTC] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newDTC, f: Toolchain.newDTC,
Name: "dtc", Name: "dtc",
@@ -39,5 +39,5 @@ func init() {
Website: "https://git.kernel.org/pub/scm/utils/dtc/dtc.git/", Website: "https://git.kernel.org/pub/scm/utils/dtc/dtc.git/",
ID: 16911, ID: 16911,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newElfutils() (pkg.Artifact, string) { func (t Toolchain) newElfutils(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.195" version = "0.195"
checksum = "JrGnBD38w8Mj0ZxDw3fKlRBFcLvRKu8rcYnX35R9yTlUSYnzTazyLboG-a2CsJlu" checksum = "JrGnBD38w8Mj0ZxDw3fKlRBFcLvRKu8rcYnX35R9yTlUSYnzTazyLboG-a2CsJlu"
) )
return t.NewPackage("elfutils", version, newTar( return s.NewPackage(t, "elfutils", version, newTar(
"https://sourceware.org/elfutils/ftp/"+ "https://sourceware.org/elfutils/ftp/"+
version+"/elfutils-"+version+".tar.bz2", version+"/elfutils-"+version+".tar.bz2",
checksum, checksum,
@@ -39,7 +39,7 @@ func (t Toolchain) newElfutils() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Elfutils] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newElfutils, f: Toolchain.newElfutils,
Name: "elfutils", Name: "elfutils",
@@ -55,5 +55,5 @@ func init() {
}, },
ID: 5679, ID: 5679,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newFakeroot() (pkg.Artifact, string) { func (t Toolchain) newFakeroot(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.37.2" version = "1.37.2"
checksum = "4ve-eDqVspzQ6VWDhPS0NjW3aSenBJcPAJq_BFT7OOFgUdrQzoTBxZWipDAGWxF8" checksum = "4ve-eDqVspzQ6VWDhPS0NjW3aSenBJcPAJq_BFT7OOFgUdrQzoTBxZWipDAGWxF8"
) )
return t.NewPackage("fakeroot", version, newFromGitLab( return s.NewPackage(t, "fakeroot", version, newFromGitLab(
"salsa.debian.org", "salsa.debian.org",
"clint/fakeroot", "clint/fakeroot",
"upstream/"+version, "upstream/"+version,
@@ -46,7 +46,7 @@ index f135ad9..85c784c 100644
), version ), version
} }
func init() { func init() {
artifactsM[Fakeroot] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newFakeroot, f: Toolchain.newFakeroot,
Name: "fakeroot", Name: "fakeroot",
@@ -54,5 +54,5 @@ func init() {
Website: "https://salsa.debian.org/clint/fakeroot", Website: "https://salsa.debian.org/clint/fakeroot",
ID: 12048, ID: 12048,
} })
} }

View File

@@ -4,12 +4,12 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newFlex() (pkg.Artifact, string) { func (t Toolchain) newFlex(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.6.4" version = "2.6.4"
checksum = "p9POjQU7VhgOf3x5iFro8fjhy0NOanvA7CTeuWS_veSNgCixIJshTrWVkc5XLZkB" checksum = "p9POjQU7VhgOf3x5iFro8fjhy0NOanvA7CTeuWS_veSNgCixIJshTrWVkc5XLZkB"
) )
return t.NewPackage("flex", version, newFromGitHubRelease( return s.NewPackage(t, "flex", version, newFromGitHubRelease(
"westes/flex", "westes/flex",
"v"+version, "v"+version,
"flex-"+version+".tar.gz", "flex-"+version+".tar.gz",
@@ -20,7 +20,7 @@ func (t Toolchain) newFlex() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Flex] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newFlex, f: Toolchain.newFlex,
Name: "flex", Name: "flex",
@@ -28,5 +28,5 @@ func init() {
Website: "https://github.com/westes/flex/", Website: "https://github.com/westes/flex/",
ID: 819, ID: 819,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newFreetype() (pkg.Artifact, string) { func (t Toolchain) newFreetype(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.14.3" version = "2.14.3"
checksum = "-WfLv8fVJNyCHpP_lriiDzOcVbBL9ajdQ3tl8AzIIUa9-8sVpU9irxOmSMgRHWYz" checksum = "-WfLv8fVJNyCHpP_lriiDzOcVbBL9ajdQ3tl8AzIIUa9-8sVpU9irxOmSMgRHWYz"
) )
return t.NewPackage("freetype", version, newTar( return s.NewPackage(t, "freetype", version, newTar(
"https://download.savannah.gnu.org/releases/freetype/"+ "https://download.savannah.gnu.org/releases/freetype/"+
"freetype-"+version+".tar.gz", "freetype-"+version+".tar.gz",
checksum, checksum,
@@ -15,7 +15,7 @@ func (t Toolchain) newFreetype() (pkg.Artifact, string) {
), nil, (*MakeHelper)(nil)), version ), nil, (*MakeHelper)(nil)), version
} }
func init() { func init() {
artifactsM[Freetype] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newFreetype, f: Toolchain.newFreetype,
Name: "freetype", Name: "freetype",
@@ -23,5 +23,5 @@ func init() {
Website: "http://www.freetype.org/", Website: "http://www.freetype.org/",
ID: 854, ID: 854,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newFuse() (pkg.Artifact, string) { func (t Toolchain) newFuse(s *S) (pkg.Artifact, string) {
const ( const (
version = "3.18.2" version = "3.18.2"
checksum = "iL-7b7eUtmlVSf5cSq0dzow3UiqSjBmzV3cI_ENPs1tXcHdktkG45j1V12h-4jZe" checksum = "iL-7b7eUtmlVSf5cSq0dzow3UiqSjBmzV3cI_ENPs1tXcHdktkG45j1V12h-4jZe"
) )
return t.NewPackage("fuse", version, newFromGitHubRelease( return s.NewPackage(t, "fuse", version, newFromGitHubRelease(
"libfuse/libfuse", "libfuse/libfuse",
"fuse-"+version, "fuse-"+version,
"fuse-"+version+".tar.gz", "fuse-"+version+".tar.gz",
@@ -31,7 +31,7 @@ func (t Toolchain) newFuse() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Fuse] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newFuse, f: Toolchain.newFuse,
Name: "fuse", Name: "fuse",
@@ -39,5 +39,5 @@ func init() {
Website: "https://github.com/libfuse/libfuse/", Website: "https://github.com/libfuse/libfuse/",
ID: 861, ID: 861,
} })
} }

View File

@@ -7,12 +7,12 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newGit() (pkg.Artifact, string) { func (t Toolchain) newGit(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.54.0" version = "2.54.0"
checksum = "7vGKtFOJGqY8DO4e8UMRax7dLgImXKQz5MMalec6MlgYrsarffSJjgOughwRFpSH" checksum = "7vGKtFOJGqY8DO4e8UMRax7dLgImXKQz5MMalec6MlgYrsarffSJjgOughwRFpSH"
) )
return t.NewPackage("git", version, newTar( return s.NewPackage(t, "git", version, newTar(
"https://www.kernel.org/pub/software/scm/git/"+ "https://www.kernel.org/pub/software/scm/git/"+
"git-"+version+".tar.gz", "git-"+version+".tar.gz",
checksum, checksum,
@@ -88,7 +88,7 @@ disable_test t5515-fetch-merge-logic
), version ), version
} }
func init() { func init() {
artifactsM[Git] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newGit, f: Toolchain.newGit,
Name: "git", Name: "git",
@@ -102,18 +102,19 @@ func init() {
}, },
ID: 5350, ID: 5350,
} })
} }
// NewViaGit returns a [pkg.Artifact] for cloning a git repository. // NewViaGit returns a [pkg.Artifact] for cloning a git repository.
func (t Toolchain) NewViaGit( func (s *S) NewViaGit(
t Toolchain,
url, rev string, url, rev string,
checksum pkg.Checksum, checksum pkg.Checksum,
) pkg.Artifact { ) pkg.Artifact {
return t.New(strings.TrimSuffix( return s.New(t, strings.TrimSuffix(
path.Base(url), path.Base(url),
".git", ".git",
)+"-src-"+path.Base(rev), THostNet, t.AppendPresets(nil, )+"-src-"+path.Base(rev), THostNet, s.AppendPresets(t, nil,
NSSCACert, NSSCACert,
Git, Git,
), &checksum, nil, ` ), &checksum, nil, `
@@ -131,6 +132,6 @@ rm -rf /work/.git
} }
// newTagRemote is a helper around NewViaGit for a tag on a git remote. // newTagRemote is a helper around NewViaGit for a tag on a git remote.
func (t Toolchain) newTagRemote(url, tag, checksum string) pkg.Artifact { func (s *S) newTagRemote(t Toolchain, url, tag, checksum string) pkg.Artifact {
return t.NewViaGit(url, "refs/tags/"+tag, mustDecode(checksum)) return s.NewViaGit(t, url, "refs/tags/"+tag, mustDecode(checksum))
} }

View File

@@ -7,12 +7,12 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newSPIRVHeaders() (pkg.Artifact, string) { func (t Toolchain) newSPIRVHeaders(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.4.341.0" version = "1.4.341.0"
checksum = "0PL43-19Iaw4k7_D8J8BvoJ-iLgCVSYZ2ThgDPGfAJwIJFtre7l0cnQtLjcY-JvD" checksum = "0PL43-19Iaw4k7_D8J8BvoJ-iLgCVSYZ2ThgDPGfAJwIJFtre7l0cnQtLjcY-JvD"
) )
return t.NewPackage("spirv-headers", version, newFromGitHub( return s.NewPackage(t, "spirv-headers", version, newFromGitHub(
"KhronosGroup/SPIRV-Headers", "KhronosGroup/SPIRV-Headers",
"vulkan-sdk-"+version, "vulkan-sdk-"+version,
checksum, checksum,
@@ -22,7 +22,7 @@ func (t Toolchain) newSPIRVHeaders() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
artifactsM[SPIRVHeaders] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newSPIRVHeaders, f: Toolchain.newSPIRVHeaders,
Name: "spirv-headers", Name: "spirv-headers",
@@ -49,15 +49,15 @@ func init() {
} }
return v.Latest return v.Latest
}, },
} })
} }
func (t Toolchain) newSPIRVTools() (pkg.Artifact, string) { func (t Toolchain) newSPIRVTools(s *S) (pkg.Artifact, string) {
const ( const (
version = "2026.1" version = "2026.1"
checksum = "ZSQPQx8NltCDzQLk4qlaVxyWRWeI_JtsjEpeFt3kezTanl9DTHfLixSUCezMFBjv" checksum = "ZSQPQx8NltCDzQLk4qlaVxyWRWeI_JtsjEpeFt3kezTanl9DTHfLixSUCezMFBjv"
) )
return t.NewPackage("spirv-tools", version, newFromGitHub( return s.NewPackage(t, "spirv-tools", version, newFromGitHub(
"KhronosGroup/SPIRV-Tools", "KhronosGroup/SPIRV-Tools",
"v"+version, "v"+version,
checksum, checksum,
@@ -72,7 +72,7 @@ func (t Toolchain) newSPIRVTools() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[SPIRVTools] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newSPIRVTools, f: Toolchain.newSPIRVTools,
Name: "spirv-tools", Name: "spirv-tools",
@@ -86,15 +86,15 @@ func init() {
ID: 14894, ID: 14894,
latest: (*Versions).getStable, latest: (*Versions).getStable,
} })
} }
func (t Toolchain) newGlslang() (pkg.Artifact, string) { func (t Toolchain) newGlslang(s *S) (pkg.Artifact, string) {
const ( const (
version = "16.3.0" version = "16.3.0"
checksum = "xyqDf8k3-D0_BXHGi0uLgMglnJ05Rf3j73QgbDs3sGtKNdBIQhY8JfqX1NcNoJQN" checksum = "xyqDf8k3-D0_BXHGi0uLgMglnJ05Rf3j73QgbDs3sGtKNdBIQhY8JfqX1NcNoJQN"
) )
return t.NewPackage("glslang", version, newFromGitHub( return s.NewPackage(t, "glslang", version, newFromGitHub(
"KhronosGroup/glslang", "KhronosGroup/glslang",
version, version,
checksum, checksum,
@@ -116,7 +116,7 @@ func (t Toolchain) newGlslang() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Glslang] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newGlslang, f: Toolchain.newGlslang,
Name: "glslang", Name: "glslang",
@@ -124,10 +124,10 @@ func init() {
Website: "https://github.com/KhronosGroup/glslang", Website: "https://github.com/KhronosGroup/glslang",
ID: 205796, ID: 205796,
} })
} }
func (t Toolchain) newSPIRVLLVMTranslator() (pkg.Artifact, string) { func (t Toolchain) newSPIRVLLVMTranslator(s *S) (pkg.Artifact, string) {
const ( const (
version = "22.1.2" version = "22.1.2"
checksum = "JZAaV5ewYcm-35YA_U2BM2IcsQouZtX1BLZR0zh2vSlfEXMsT5OCtY4Gh5RJkcGy" checksum = "JZAaV5ewYcm-35YA_U2BM2IcsQouZtX1BLZR0zh2vSlfEXMsT5OCtY4Gh5RJkcGy"
@@ -137,7 +137,7 @@ func (t Toolchain) newSPIRVLLVMTranslator() (pkg.Artifact, string) {
"cooperative_matrix_constant_null.spvasm", "cooperative_matrix_constant_null.spvasm",
} }
switch arch { switch s.arch {
case "arm64": case "arm64":
skipChecks = append(skipChecks, skipChecks = append(skipChecks,
// LLVM ERROR: unsupported calling convention // LLVM ERROR: unsupported calling convention
@@ -183,7 +183,7 @@ func (t Toolchain) newSPIRVLLVMTranslator() (pkg.Artifact, string) {
) )
} }
return t.NewPackage("spirv-llvm-translator", version, newFromGitHub( return s.NewPackage(t, "spirv-llvm-translator", version, newFromGitHub(
"KhronosGroup/SPIRV-LLVM-Translator", "KhronosGroup/SPIRV-LLVM-Translator",
"v"+version, checksum, "v"+version, checksum,
), &PackageAttr{ ), &PackageAttr{
@@ -232,7 +232,7 @@ export LIT_OPTS=` + litArgs(true, skipChecks...) + `
), version ), version
} }
func init() { func init() {
artifactsM[SPIRVLLVMTranslator] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newSPIRVLLVMTranslator, f: Toolchain.newSPIRVLLVMTranslator,
Name: "spirv-llvm-translator", Name: "spirv-llvm-translator",
@@ -244,5 +244,5 @@ func init() {
}, },
ID: 227273, ID: 227273,
} })
} }

View File

@@ -42,12 +42,12 @@ func skipGNUTests(tests ...int) string {
return buf.String() return buf.String()
} }
func (t Toolchain) newM4() (pkg.Artifact, string) { func (t Toolchain) newM4(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.4.21" version = "1.4.21"
checksum = "pPa6YOo722Jw80l1OsH1tnUaklnPFjFT-bxGw5iAVrZTm1P8FQaWao_NXop46-pm" checksum = "pPa6YOo722Jw80l1OsH1tnUaklnPFjFT-bxGw5iAVrZTm1P8FQaWao_NXop46-pm"
) )
return t.NewPackage("m4", version, newTar( return s.NewPackage(t, "m4", version, newTar(
"https://ftpmirror.gnu.org/gnu/m4/m4-"+version+".tar.bz2", "https://ftpmirror.gnu.org/gnu/m4/m4-"+version+".tar.bz2",
checksum, checksum,
pkg.TarBzip2, pkg.TarBzip2,
@@ -63,7 +63,7 @@ chmod +w tests/test-c32ispunct.sh && echo '#!/bin/sh' > tests/test-c32ispunct.sh
), version ), version
} }
func init() { func init() {
artifactsM[M4] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newM4, f: Toolchain.newM4,
Name: "m4", Name: "m4",
@@ -71,15 +71,15 @@ func init() {
Website: "https://www.gnu.org/software/m4/", Website: "https://www.gnu.org/software/m4/",
ID: 1871, ID: 1871,
} })
} }
func (t Toolchain) newBison() (pkg.Artifact, string) { func (t Toolchain) newBison(s *S) (pkg.Artifact, string) {
const ( const (
version = "3.8.2" version = "3.8.2"
checksum = "BhRM6K7URj1LNOkIDCFDctSErLS-Xo5d9ba9seg10o6ACrgC1uNhED7CQPgIY29Y" checksum = "BhRM6K7URj1LNOkIDCFDctSErLS-Xo5d9ba9seg10o6ACrgC1uNhED7CQPgIY29Y"
) )
return t.NewPackage("bison", version, newTar( return s.NewPackage(t, "bison", version, newTar(
"https://ftpmirror.gnu.org/gnu/bison/bison-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/bison/bison-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -98,7 +98,7 @@ func (t Toolchain) newBison() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Bison] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newBison, f: Toolchain.newBison,
Name: "bison", Name: "bison",
@@ -106,15 +106,15 @@ func init() {
Website: "https://www.gnu.org/software/bison/", Website: "https://www.gnu.org/software/bison/",
ID: 193, ID: 193,
} })
} }
func (t Toolchain) newSed() (pkg.Artifact, string) { func (t Toolchain) newSed(s *S) (pkg.Artifact, string) {
const ( const (
version = "4.10" version = "4.10"
checksum = "TXTRFQJCyflb-bpBRI2S5Y1DpplwvT7-KfXtpqN4AdZgZ5OtI6yStn1-bkhDKx51" checksum = "TXTRFQJCyflb-bpBRI2S5Y1DpplwvT7-KfXtpqN4AdZgZ5OtI6yStn1-bkhDKx51"
) )
return t.NewPackage("sed", version, newTar( return s.NewPackage(t, "sed", version, newTar(
"https://ftpmirror.gnu.org/gnu/sed/sed-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/sed/sed-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -125,7 +125,7 @@ func (t Toolchain) newSed() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Sed] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newSed, f: Toolchain.newSed,
Name: "sed", Name: "sed",
@@ -133,15 +133,15 @@ func init() {
Website: "https://www.gnu.org/software/sed/", Website: "https://www.gnu.org/software/sed/",
ID: 4789, ID: 4789,
} })
} }
func (t Toolchain) newAutoconf() (pkg.Artifact, string) { func (t Toolchain) newAutoconf(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.73" version = "2.73"
checksum = "yGabDTeOfaCUB0JX-h3REYLYzMzvpDwFmFFzHNR7QilChCUNE4hR6q7nma4viDYg" checksum = "yGabDTeOfaCUB0JX-h3REYLYzMzvpDwFmFFzHNR7QilChCUNE4hR6q7nma4viDYg"
) )
return t.NewPackage("autoconf", version, newTar( return s.NewPackage(t, "autoconf", version, newTar(
"https://ftpmirror.gnu.org/gnu/autoconf/autoconf-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/autoconf/autoconf-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -160,7 +160,7 @@ func (t Toolchain) newAutoconf() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Autoconf] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newAutoconf, f: Toolchain.newAutoconf,
Name: "autoconf", Name: "autoconf",
@@ -173,15 +173,15 @@ func init() {
}, },
ID: 141, ID: 141,
} })
} }
func (t Toolchain) newAutomake() (pkg.Artifact, string) { func (t Toolchain) newAutomake(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.18.1" version = "1.18.1"
checksum = "FjvLG_GdQP7cThTZJLDMxYpRcKdpAVG-YDs1Fj1yaHlSdh_Kx6nRGN14E0r_BjcG" checksum = "FjvLG_GdQP7cThTZJLDMxYpRcKdpAVG-YDs1Fj1yaHlSdh_Kx6nRGN14E0r_BjcG"
) )
return t.NewPackage("automake", version, newTar( return s.NewPackage(t, "automake", version, newTar(
"https://ftpmirror.gnu.org/gnu/automake/automake-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/automake/automake-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -205,7 +205,7 @@ test_disable '#!/bin/sh' t/pr9.sh
), version ), version
} }
func init() { func init() {
artifactsM[Automake] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newAutomake, f: Toolchain.newAutomake,
Name: "automake", Name: "automake",
@@ -217,15 +217,15 @@ func init() {
}, },
ID: 144, ID: 144,
} })
} }
func (t Toolchain) newLibtool() (pkg.Artifact, string) { func (t Toolchain) newLibtool(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.5.4" version = "2.5.4"
checksum = "pa6LSrQggh8mSJHQfwGjysAApmZlGJt8wif2cCLzqAAa2jpsTY0jZ-6stS3BWZ2Q" checksum = "pa6LSrQggh8mSJHQfwGjysAApmZlGJt8wif2cCLzqAAa2jpsTY0jZ-6stS3BWZ2Q"
) )
return t.NewPackage("libtool", version, newTar( return s.NewPackage(t, "libtool", version, newTar(
"https://ftpmirror.gnu.org/gnu/libtool/libtool-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/libtool/libtool-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -243,7 +243,7 @@ func (t Toolchain) newLibtool() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Libtool] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibtool, f: Toolchain.newLibtool,
Name: "libtool", Name: "libtool",
@@ -251,15 +251,15 @@ func init() {
Website: "https://www.gnu.org/software/libtool/", Website: "https://www.gnu.org/software/libtool/",
ID: 1741, ID: 1741,
} })
} }
func (t Toolchain) newGzip() (pkg.Artifact, string) { func (t Toolchain) newGzip(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.14" version = "1.14"
checksum = "NWhjUavnNfTDFkZJyAUonL9aCOak8GVajWX2OMlzpFnuI0ErpBFyj88mz2xSjz0q" checksum = "NWhjUavnNfTDFkZJyAUonL9aCOak8GVajWX2OMlzpFnuI0ErpBFyj88mz2xSjz0q"
) )
return t.NewPackage("gzip", version, newTar( return s.NewPackage(t, "gzip", version, newTar(
"https://ftpmirror.gnu.org/gnu/gzip/gzip-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/gzip/gzip-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -269,7 +269,7 @@ func (t Toolchain) newGzip() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
artifactsM[Gzip] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newGzip, f: Toolchain.newGzip,
Name: "gzip", Name: "gzip",
@@ -277,15 +277,15 @@ func init() {
Website: "https://www.gnu.org/software/gzip/", Website: "https://www.gnu.org/software/gzip/",
ID: 1290, ID: 1290,
} })
} }
func (t Toolchain) newGettext() (pkg.Artifact, string) { func (t Toolchain) newGettext(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.0" version = "1.0"
checksum = "3MasKeEdPeFEgWgzsBKk7JqWqql1wEMbgPmzAfs-mluyokoW0N8oQVxPQoOnSdgC" checksum = "3MasKeEdPeFEgWgzsBKk7JqWqql1wEMbgPmzAfs-mluyokoW0N8oQVxPQoOnSdgC"
) )
return t.NewPackage("gettext", version, newTar( return s.NewPackage(t, "gettext", version, newTar(
"https://ftpmirror.gnu.org/gnu/gettext/gettext-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/gettext/gettext-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -315,7 +315,7 @@ touch gettext-tools/autotools/archive.dir.tar
), version ), version
} }
func init() { func init() {
artifactsM[Gettext] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newGettext, f: Toolchain.newGettext,
Name: "gettext", Name: "gettext",
@@ -323,15 +323,15 @@ func init() {
Website: "https://www.gnu.org/software/gettext/", Website: "https://www.gnu.org/software/gettext/",
ID: 898, ID: 898,
} })
} }
func (t Toolchain) newDiffutils() (pkg.Artifact, string) { func (t Toolchain) newDiffutils(s *S) (pkg.Artifact, string) {
const ( const (
version = "3.12" version = "3.12"
checksum = "9J5VAq5oA7eqwzS1Yvw-l3G5o-TccUrNQR3PvyB_lgdryOFAfxtvQfKfhdpquE44" checksum = "9J5VAq5oA7eqwzS1Yvw-l3G5o-TccUrNQR3PvyB_lgdryOFAfxtvQfKfhdpquE44"
) )
return t.NewPackage("diffutils", version, newTar( return s.NewPackage(t, "diffutils", version, newTar(
"https://ftpmirror.gnu.org/gnu/diffutils/diffutils-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/diffutils/diffutils-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -348,7 +348,7 @@ test_disable '#!/bin/sh' tests/cmp
}, (*MakeHelper)(nil)), version }, (*MakeHelper)(nil)), version
} }
func init() { func init() {
artifactsM[Diffutils] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newDiffutils, f: Toolchain.newDiffutils,
Name: "diffutils", Name: "diffutils",
@@ -356,15 +356,15 @@ func init() {
Website: "https://www.gnu.org/software/diffutils/", Website: "https://www.gnu.org/software/diffutils/",
ID: 436, ID: 436,
} })
} }
func (t Toolchain) newPatch() (pkg.Artifact, string) { func (t Toolchain) newPatch(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.8" version = "2.8"
checksum = "MA0BQc662i8QYBD-DdGgyyfTwaeALZ1K0yusV9rAmNiIsQdX-69YC4t9JEGXZkeR" checksum = "MA0BQc662i8QYBD-DdGgyyfTwaeALZ1K0yusV9rAmNiIsQdX-69YC4t9JEGXZkeR"
) )
return t.NewPackage("patch", version, newTar( return s.NewPackage(t, "patch", version, newTar(
"https://ftpmirror.gnu.org/gnu/patch/patch-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/patch/patch-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -380,7 +380,7 @@ test_disable '#!/bin/sh' tests/need-filename
}, (*MakeHelper)(nil)), version }, (*MakeHelper)(nil)), version
} }
func init() { func init() {
artifactsM[Patch] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPatch, f: Toolchain.newPatch,
Name: "patch", Name: "patch",
@@ -388,15 +388,15 @@ func init() {
Website: "https://savannah.gnu.org/projects/patch/", Website: "https://savannah.gnu.org/projects/patch/",
ID: 2597, ID: 2597,
} })
} }
func (t Toolchain) newBash() (pkg.Artifact, string) { func (t Toolchain) newBash(s *S) (pkg.Artifact, string) {
const ( const (
version = "5.3" version = "5.3"
checksum = "4LQ_GRoB_ko-Ih8QPf_xRKA02xAm_TOxQgcJLmFDT6udUPxTAWrsj-ZNeuTusyDq" checksum = "4LQ_GRoB_ko-Ih8QPf_xRKA02xAm_TOxQgcJLmFDT6udUPxTAWrsj-ZNeuTusyDq"
) )
return t.NewPackage("bash", version, newTar( return s.NewPackage(t, "bash", version, newTar(
"https://ftpmirror.gnu.org/gnu/bash/bash-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/bash/bash-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -410,7 +410,7 @@ func (t Toolchain) newBash() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
artifactsM[Bash] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newBash, f: Toolchain.newBash,
Name: "bash", Name: "bash",
@@ -418,15 +418,15 @@ func init() {
Website: "https://www.gnu.org/software/bash/", Website: "https://www.gnu.org/software/bash/",
ID: 166, ID: 166,
} })
} }
func (t Toolchain) newCoreutils() (pkg.Artifact, string) { func (t Toolchain) newCoreutils(s *S) (pkg.Artifact, string) {
const ( const (
version = "9.11" version = "9.11"
checksum = "t8UMed5wpFEoC56aa42_yidfOAaRGzOfj7MRtQkkqgGbpXiskNA8bd-EmVSQkZie" checksum = "t8UMed5wpFEoC56aa42_yidfOAaRGzOfj7MRtQkkqgGbpXiskNA8bd-EmVSQkZie"
) )
return t.NewPackage("coreutils", version, newTar( return s.NewPackage(t, "coreutils", version, newTar(
"https://ftpmirror.gnu.org/gnu/coreutils/coreutils-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/coreutils/coreutils-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -456,7 +456,7 @@ test_disable 'int main(){return 0;}' gnulib-tests/test-lchown.c
), version ), version
} }
func init() { func init() {
artifactsM[Coreutils] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newCoreutils, f: Toolchain.newCoreutils,
Name: "coreutils", Name: "coreutils",
@@ -464,15 +464,15 @@ func init() {
Website: "https://www.gnu.org/software/coreutils/", Website: "https://www.gnu.org/software/coreutils/",
ID: 343, ID: 343,
} })
} }
func (t Toolchain) newTexinfo() (pkg.Artifact, string) { func (t Toolchain) newTexinfo(s *S) (pkg.Artifact, string) {
const ( const (
version = "7.3" version = "7.3"
checksum = "RRmC8Xwdof7JuZJeWGAQ_GeASIHAuJFQMbNONXBz5InooKIQGmqmWRjGNGEr5n4-" checksum = "RRmC8Xwdof7JuZJeWGAQ_GeASIHAuJFQMbNONXBz5InooKIQGmqmWRjGNGEr5n4-"
) )
return t.NewPackage("texinfo", version, newTar( return s.NewPackage(t, "texinfo", version, newTar(
"https://ftpmirror.gnu.org/gnu/texinfo/texinfo-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/texinfo/texinfo-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -484,7 +484,7 @@ func (t Toolchain) newTexinfo() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Texinfo] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newTexinfo, f: Toolchain.newTexinfo,
Name: "texinfo", Name: "texinfo",
@@ -497,15 +497,15 @@ func init() {
}, },
ID: 4958, ID: 4958,
} })
} }
func (t Toolchain) newGperf() (pkg.Artifact, string) { func (t Toolchain) newGperf(s *S) (pkg.Artifact, string) {
const ( const (
version = "3.3" version = "3.3"
checksum = "RtIy9pPb_Bb8-31J2Nw-rRGso2JlS-lDlVhuNYhqR7Nt4xM_nObznxAlBMnarJv7" checksum = "RtIy9pPb_Bb8-31J2Nw-rRGso2JlS-lDlVhuNYhqR7Nt4xM_nObznxAlBMnarJv7"
) )
return t.NewPackage("gperf", version, newTar( return s.NewPackage(t, "gperf", version, newTar(
"https://ftpmirror.gnu.org/gperf/gperf-"+version+".tar.gz", "https://ftpmirror.gnu.org/gperf/gperf-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -514,7 +514,7 @@ func (t Toolchain) newGperf() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Gperf] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newGperf, f: Toolchain.newGperf,
Name: "gperf", Name: "gperf",
@@ -522,15 +522,15 @@ func init() {
Website: "https://www.gnu.org/software/gperf/", Website: "https://www.gnu.org/software/gperf/",
ID: 1237, ID: 1237,
} })
} }
func (t Toolchain) newGawk() (pkg.Artifact, string) { func (t Toolchain) newGawk(s *S) (pkg.Artifact, string) {
const ( const (
version = "5.4.0" version = "5.4.0"
checksum = "m0RkIolC-PI7EY5q8pcx5Y-0twlIW0Yp3wXXmV-QaHorSdf8BhZ7kW9F8iWomz0C" checksum = "m0RkIolC-PI7EY5q8pcx5Y-0twlIW0Yp3wXXmV-QaHorSdf8BhZ7kW9F8iWomz0C"
) )
return t.NewPackage("gawk", version, newTar( return s.NewPackage(t, "gawk", version, newTar(
"https://ftpmirror.gnu.org/gnu/gawk/gawk-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/gawk/gawk-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -542,7 +542,7 @@ func (t Toolchain) newGawk() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
artifactsM[Gawk] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newGawk, f: Toolchain.newGawk,
Name: "gawk", Name: "gawk",
@@ -550,15 +550,15 @@ func init() {
Website: "https://www.gnu.org/software/gawk/", Website: "https://www.gnu.org/software/gawk/",
ID: 868, ID: 868,
} })
} }
func (t Toolchain) newGrep() (pkg.Artifact, string) { func (t Toolchain) newGrep(s *S) (pkg.Artifact, string) {
const ( const (
version = "3.12" version = "3.12"
checksum = "qMB4RjaPNRRYsxix6YOrjE8gyAT1zVSTy4nW4wKW9fqa0CHYAuWgPwDTirENzm_1" checksum = "qMB4RjaPNRRYsxix6YOrjE8gyAT1zVSTy4nW4wKW9fqa0CHYAuWgPwDTirENzm_1"
) )
return t.NewPackage("grep", version, newTar( return s.NewPackage(t, "grep", version, newTar(
"https://ftpmirror.gnu.org/gnu/grep/grep-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/grep/grep-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -575,7 +575,7 @@ test_disable 'int main(){return 0;}' gnulib-tests/test-c32ispunct.c
), version ), version
} }
func init() { func init() {
artifactsM[Grep] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newGrep, f: Toolchain.newGrep,
Name: "grep", Name: "grep",
@@ -583,15 +583,15 @@ func init() {
Website: "https://www.gnu.org/software/grep/", Website: "https://www.gnu.org/software/grep/",
ID: 1251, ID: 1251,
} })
} }
func (t Toolchain) newFindutils() (pkg.Artifact, string) { func (t Toolchain) newFindutils(s *S) (pkg.Artifact, string) {
const ( const (
version = "4.10.0" version = "4.10.0"
checksum = "ZXABdNBQXL7QjTygynRRTdXYWxQKZ0Wn5eMd3NUnxR0xaS0u0VfcKoTlbo50zxv6" checksum = "ZXABdNBQXL7QjTygynRRTdXYWxQKZ0Wn5eMd3NUnxR0xaS0u0VfcKoTlbo50zxv6"
) )
return t.NewPackage("findutils", version, pkg.NewHTTPGet( return s.NewPackage(t, "findutils", version, pkg.NewHTTPGet(
nil, "https://ftpmirror.gnu.org/gnu/findutils/findutils-"+version+".tar.xz", nil, "https://ftpmirror.gnu.org/gnu/findutils/findutils-"+version+".tar.xz",
mustDecode(checksum), mustDecode(checksum),
), &PackageAttr{ ), &PackageAttr{
@@ -606,7 +606,7 @@ echo 'int main(){return 0;}' > tests/xargs/test-sigusr.c
), version ), version
} }
func init() { func init() {
artifactsM[Findutils] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newFindutils, f: Toolchain.newFindutils,
Name: "findutils", Name: "findutils",
@@ -614,15 +614,15 @@ func init() {
Website: "https://www.gnu.org/software/findutils/", Website: "https://www.gnu.org/software/findutils/",
ID: 812, ID: 812,
} })
} }
func (t Toolchain) newBC() (pkg.Artifact, string) { func (t Toolchain) newBC(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.08.2" version = "1.08.2"
checksum = "8h6f3hjV80XiFs6v9HOPF2KEyg1kuOgn5eeFdVspV05ODBVQss-ey5glc8AmneLy" checksum = "8h6f3hjV80XiFs6v9HOPF2KEyg1kuOgn5eeFdVspV05ODBVQss-ey5glc8AmneLy"
) )
return t.NewPackage("bc", version, newTar( return s.NewPackage(t, "bc", version, newTar(
"https://ftpmirror.gnu.org/gnu/bc/bc-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/bc/bc-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -635,7 +635,7 @@ func (t Toolchain) newBC() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[BC] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newBC, f: Toolchain.newBC,
Name: "bc", Name: "bc",
@@ -643,22 +643,22 @@ func init() {
Website: "https://www.gnu.org/software/bc/", Website: "https://www.gnu.org/software/bc/",
ID: 170, ID: 170,
} })
} }
func (t Toolchain) newLibiconv() (pkg.Artifact, string) { func (t Toolchain) newLibiconv(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.19" version = "1.19"
checksum = "UibB6E23y4MksNqYmCCrA3zTFO6vJugD1DEDqqWYFZNuBsUWMVMcncb_5pPAr88x" checksum = "UibB6E23y4MksNqYmCCrA3zTFO6vJugD1DEDqqWYFZNuBsUWMVMcncb_5pPAr88x"
) )
return t.NewPackage("libiconv", version, newTar( return s.NewPackage(t, "libiconv", version, newTar(
"https://ftpmirror.gnu.org/gnu/libiconv/libiconv-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/libiconv/libiconv-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
), nil, (*MakeHelper)(nil)), version ), nil, (*MakeHelper)(nil)), version
} }
func init() { func init() {
artifactsM[Libiconv] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibiconv, f: Toolchain.newLibiconv,
Name: "libiconv", Name: "libiconv",
@@ -666,15 +666,15 @@ func init() {
Website: "https://www.gnu.org/software/libiconv/", Website: "https://www.gnu.org/software/libiconv/",
ID: 10656, ID: 10656,
} })
} }
func (t Toolchain) newTar() (pkg.Artifact, string) { func (t Toolchain) newTar(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.35" version = "1.35"
checksum = "zSaoSlVUDW0dSfm4sbL4FrXLFR8U40Fh3zY5DWhR5NCIJ6GjU6Kc4VZo2-ZqpBRA" checksum = "zSaoSlVUDW0dSfm4sbL4FrXLFR8U40Fh3zY5DWhR5NCIJ6GjU6Kc4VZo2-ZqpBRA"
) )
return t.NewPackage("tar", version, newTar( return s.NewPackage(t, "tar", version, newTar(
"https://ftpmirror.gnu.org/gnu/tar/tar-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/tar/tar-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -700,7 +700,7 @@ func (t Toolchain) newTar() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Tar] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newTar, f: Toolchain.newTar,
Name: "tar", Name: "tar",
@@ -708,15 +708,15 @@ func init() {
Website: "https://www.gnu.org/software/tar/", Website: "https://www.gnu.org/software/tar/",
ID: 4939, ID: 4939,
} })
} }
func (t Toolchain) newParallel() (pkg.Artifact, string) { func (t Toolchain) newParallel(s *S) (pkg.Artifact, string) {
const ( const (
version = "20260422" version = "20260422"
checksum = "eTsepxgqhXpMEhPd55qh-W5y4vjKn0x9TD2mzbJCNZYtFf4lT4Wzoqr74HGJYBEH" checksum = "eTsepxgqhXpMEhPd55qh-W5y4vjKn0x9TD2mzbJCNZYtFf4lT4Wzoqr74HGJYBEH"
) )
return t.NewPackage("parallel", version, newTar( return s.NewPackage(t, "parallel", version, newTar(
"https://ftpmirror.gnu.org/gnu/parallel/parallel-"+version+".tar.bz2", "https://ftpmirror.gnu.org/gnu/parallel/parallel-"+version+".tar.bz2",
checksum, checksum,
pkg.TarBzip2, pkg.TarBzip2,
@@ -730,7 +730,7 @@ ln -s ../system/bin/bash /bin/
), version ), version
} }
func init() { func init() {
artifactsM[Parallel] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newParallel, f: Toolchain.newParallel,
Name: "parallel", Name: "parallel",
@@ -742,15 +742,15 @@ func init() {
}, },
ID: 5448, ID: 5448,
} })
} }
func (t Toolchain) newLibunistring() (pkg.Artifact, string) { func (t Toolchain) newLibunistring(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.4.2" version = "1.4.2"
checksum = "iW9BbfLoVlXjWoLTZ4AekQSu4cFBnLcZ4W8OHWbv0AhJNgD3j65_zqaLMzFKylg2" checksum = "iW9BbfLoVlXjWoLTZ4AekQSu4cFBnLcZ4W8OHWbv0AhJNgD3j65_zqaLMzFKylg2"
) )
return t.NewPackage("libunistring", version, newTar( return s.NewPackage(t, "libunistring", version, newTar(
"https://ftpmirror.gnu.org/gnu/libunistring/libunistring-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/libunistring/libunistring-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -767,7 +767,7 @@ test_disable 'int main(){return 0;}' tests/test-c32ispunct.c
), version ), version
} }
func init() { func init() {
artifactsM[Libunistring] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibunistring, f: Toolchain.newLibunistring,
Name: "libunistring", Name: "libunistring",
@@ -775,22 +775,22 @@ func init() {
Website: "https://www.gnu.org/software/libunistring/", Website: "https://www.gnu.org/software/libunistring/",
ID: 1747, ID: 1747,
} })
} }
func (t Toolchain) newLibtasn1() (pkg.Artifact, string) { func (t Toolchain) newLibtasn1(s *S) (pkg.Artifact, string) {
const ( const (
version = "4.21.0" version = "4.21.0"
checksum = "9DYI3UYbfYLy8JsKUcY6f0irskbfL0fHZA91Q-JEOA3kiUwpodyjemRsYRjUpjuq" checksum = "9DYI3UYbfYLy8JsKUcY6f0irskbfL0fHZA91Q-JEOA3kiUwpodyjemRsYRjUpjuq"
) )
return t.NewPackage("libtasn1", version, newTar( return s.NewPackage(t, "libtasn1", version, newTar(
"https://ftpmirror.gnu.org/gnu/libtasn1/libtasn1-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/libtasn1/libtasn1-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
), nil, (*MakeHelper)(nil)), version ), nil, (*MakeHelper)(nil)), version
} }
func init() { func init() {
artifactsM[Libtasn1] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibtasn1, f: Toolchain.newLibtasn1,
Name: "libtasn1", Name: "libtasn1",
@@ -798,15 +798,15 @@ func init() {
Website: "https://www.gnu.org/software/libtasn1/", Website: "https://www.gnu.org/software/libtasn1/",
ID: 1734, ID: 1734,
} })
} }
func (t Toolchain) newReadline() (pkg.Artifact, string) { func (t Toolchain) newReadline(s *S) (pkg.Artifact, string) {
const ( const (
version = "8.3" version = "8.3"
checksum = "r-lcGRJq_MvvBpOq47Z2Y1OI2iqrmtcqhTLVXR0xWo37ZpC2uT_md7gKq5o_qTMV" checksum = "r-lcGRJq_MvvBpOq47Z2Y1OI2iqrmtcqhTLVXR0xWo37ZpC2uT_md7gKq5o_qTMV"
) )
return t.NewPackage("readline", version, newTar( return s.NewPackage(t, "readline", version, newTar(
"https://ftpmirror.gnu.org/gnu/readline/readline-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/readline/readline-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -820,7 +820,7 @@ func (t Toolchain) newReadline() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Readline] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newReadline, f: Toolchain.newReadline,
Name: "readline", Name: "readline",
@@ -832,24 +832,24 @@ func init() {
}, },
ID: 4173, ID: 4173,
} })
} }
func (t Toolchain) newGnuTLS() (pkg.Artifact, string) { func (t Toolchain) newGnuTLS(s *S) (pkg.Artifact, string) {
const ( const (
version = "3.8.12" version = "3.8.12"
checksum = "VPdP-nRydQQRJcnma-YA7CJYA_kzTJ2rb3QFeP6D27emSyInJ8sQ-Wzn518I38dl" checksum = "VPdP-nRydQQRJcnma-YA7CJYA_kzTJ2rb3QFeP6D27emSyInJ8sQ-Wzn518I38dl"
) )
var configureExtra []KV var configureExtra []KV
switch arch { switch s.arch {
case "arm64": case "arm64":
configureExtra = []KV{ configureExtra = []KV{
{"disable-hardware-acceleration"}, {"disable-hardware-acceleration"},
} }
} }
return t.NewPackage("gnutls", version, t.newTagRemote( return s.NewPackage(t, "gnutls", version, s.newTagRemote(t,
"https://gitlab.com/gnutls/gnutls.git", "https://gitlab.com/gnutls/gnutls.git",
version, checksum, version, checksum,
), &PackageAttr{ ), &PackageAttr{
@@ -997,7 +997,7 @@ index 1b78b8cf1..350156a86 100644
), version ), version
} }
func init() { func init() {
artifactsM[GnuTLS] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newGnuTLS, f: Toolchain.newGnuTLS,
Name: "gnutls", Name: "gnutls",
@@ -1013,15 +1013,15 @@ func init() {
}, },
ID: 1221, ID: 1221,
} })
} }
func (t Toolchain) newBinutils() (pkg.Artifact, string) { func (t Toolchain) newBinutils(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.46.0" version = "2.46.0"
checksum = "4kK1_EXQipxSqqyvwD4LbiMLFKCUApjq6PeG4XJP4dzxYGqDeqXfh8zLuTyOuOVR" checksum = "4kK1_EXQipxSqqyvwD4LbiMLFKCUApjq6PeG4XJP4dzxYGqDeqXfh8zLuTyOuOVR"
) )
return t.NewPackage("binutils", version, newTar( return s.NewPackage(t, "binutils", version, newTar(
"https://ftpmirror.gnu.org/gnu/binutils/binutils-"+version+".tar.bz2", "https://ftpmirror.gnu.org/gnu/binutils/binutils-"+version+".tar.bz2",
checksum, checksum,
pkg.TarBzip2, pkg.TarBzip2,
@@ -1030,7 +1030,7 @@ func (t Toolchain) newBinutils() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Binutils] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newBinutils, f: Toolchain.newBinutils,
Name: "binutils", Name: "binutils",
@@ -1038,15 +1038,15 @@ func init() {
Website: "https://www.gnu.org/software/binutils/", Website: "https://www.gnu.org/software/binutils/",
ID: 7981, ID: 7981,
} })
} }
func (t Toolchain) newGMP() (pkg.Artifact, string) { func (t Toolchain) newGMP(s *S) (pkg.Artifact, string) {
const ( const (
version = "6.3.0" version = "6.3.0"
checksum = "yrgbgEDWKDdMWVHh7gPbVl56-sRtVVhfvv0M_LX7xMUUk_mvZ1QOJEAnt7g4i3k5" checksum = "yrgbgEDWKDdMWVHh7gPbVl56-sRtVVhfvv0M_LX7xMUUk_mvZ1QOJEAnt7g4i3k5"
) )
return t.NewPackage("gmp", version, newTar( return s.NewPackage(t, "gmp", version, newTar(
"https://gcc.gnu.org/pub/gcc/infrastructure/"+ "https://gcc.gnu.org/pub/gcc/infrastructure/"+
"gmp-"+version+".tar.bz2", "gmp-"+version+".tar.bz2",
checksum, checksum,
@@ -1060,7 +1060,7 @@ func (t Toolchain) newGMP() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[GMP] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newGMP, f: Toolchain.newGMP,
Name: "gmp", Name: "gmp",
@@ -1068,15 +1068,15 @@ func init() {
Website: "https://gmplib.org/", Website: "https://gmplib.org/",
ID: 1186, ID: 1186,
} })
} }
func (t Toolchain) newMPFR() (pkg.Artifact, string) { func (t Toolchain) newMPFR(s *S) (pkg.Artifact, string) {
const ( const (
version = "4.2.2" version = "4.2.2"
checksum = "wN3gx0zfIuCn9r3VAn_9bmfvAYILwrRfgBjYSD1IjLqyLrLojNN5vKyQuTE9kA-B" checksum = "wN3gx0zfIuCn9r3VAn_9bmfvAYILwrRfgBjYSD1IjLqyLrLojNN5vKyQuTE9kA-B"
) )
return t.NewPackage("mpfr", version, newTar( return s.NewPackage(t, "mpfr", version, newTar(
"https://gcc.gnu.org/pub/gcc/infrastructure/"+ "https://gcc.gnu.org/pub/gcc/infrastructure/"+
"mpfr-"+version+".tar.bz2", "mpfr-"+version+".tar.bz2",
checksum, checksum,
@@ -1086,7 +1086,7 @@ func (t Toolchain) newMPFR() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[MPFR] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newMPFR, f: Toolchain.newMPFR,
Name: "mpfr", Name: "mpfr",
@@ -1098,15 +1098,15 @@ func init() {
}, },
ID: 2019, ID: 2019,
} })
} }
func (t Toolchain) newMPC() (pkg.Artifact, string) { func (t Toolchain) newMPC(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.4.1" version = "1.4.1"
checksum = "ZffaZyWkvIw0iPvRe5EJ7O-VvHtSkbbb3K_7SgPtK810NvGan7nbF0T5-6tozjQN" checksum = "ZffaZyWkvIw0iPvRe5EJ7O-VvHtSkbbb3K_7SgPtK810NvGan7nbF0T5-6tozjQN"
) )
return t.NewPackage("mpc", version, newFromGitLab( return s.NewPackage(t, "mpc", version, newFromGitLab(
"gitlab.inria.fr", "gitlab.inria.fr",
"mpc/mpc", "mpc/mpc",
version, checksum, version, checksum,
@@ -1125,7 +1125,7 @@ func (t Toolchain) newMPC() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[MPC] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newMPC, f: Toolchain.newMPC,
Name: "mpc", Name: "mpc",
@@ -1137,22 +1137,22 @@ func init() {
}, },
ID: 1667, ID: 1667,
} })
} }
func (t Toolchain) newGCC() (pkg.Artifact, string) { func (t Toolchain) newGCC(s *S) (pkg.Artifact, string) {
const ( const (
version = "16.1.0" version = "16.1.0"
checksum = "4ASoWbxaA2FW7PAB0zzHDPC5XnNhyaAyjtDPpGzceSLeYnEIXsNYZR3PA_Zu5P0K" checksum = "4ASoWbxaA2FW7PAB0zzHDPC5XnNhyaAyjtDPpGzceSLeYnEIXsNYZR3PA_Zu5P0K"
) )
var configureExtra []KV var configureExtra []KV
switch arch { switch s.arch {
case "amd64", "arm64": case "amd64", "arm64":
configureExtra = append(configureExtra, KV{"with-multilib-list", "''"}) configureExtra = append(configureExtra, KV{"with-multilib-list", "''"})
} }
return t.NewPackage("gcc", version, newTar( return s.NewPackage(t, "gcc", version, newTar(
"https://ftp.tsukuba.wide.ad.jp/software/gcc/releases/"+ "https://ftp.tsukuba.wide.ad.jp/software/gcc/releases/"+
"gcc-"+version+"/gcc-"+version+".tar.gz", "gcc-"+version+"/gcc-"+version+".tar.gz",
checksum, checksum,
@@ -1346,7 +1346,7 @@ ln -s system/lib /work/
), version ), version
} }
func init() { func init() {
artifactsM[gcc] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newGCC, f: Toolchain.newGCC,
Name: "gcc", Name: "gcc",
@@ -1362,5 +1362,5 @@ func init() {
}, },
ID: 6502, ID: 6502,
} })
} }

View File

@@ -7,9 +7,9 @@ import (
) )
// newGoBootstrap returns the Go bootstrap toolchain. // newGoBootstrap returns the Go bootstrap toolchain.
func (t Toolchain) newGoBootstrap() pkg.Artifact { func (s *S) newGoBootstrap(t Toolchain) pkg.Artifact {
const checksum = "8o9JL_ToiQKadCTb04nvBDkp8O1xiWOolAxVEqaTGodieNe4lOFEjlOxN3bwwe23" const checksum = "8o9JL_ToiQKadCTb04nvBDkp8O1xiWOolAxVEqaTGodieNe4lOFEjlOxN3bwwe23"
return t.New("go1.4-bootstrap", 0, t.AppendPresets(nil, return s.New(t, "go1.4-bootstrap", 0, s.AppendPresets(t, nil,
Bash, Bash,
), nil, []string{ ), nil, []string{
"CGO_ENABLED=0", "CGO_ENABLED=0",
@@ -28,17 +28,18 @@ chmod -R +w ..
} }
// newGo returns a specific version of the Go toolchain. // newGo returns a specific version of the Go toolchain.
func (t Toolchain) newGo( func (s *S) newGo(
t Toolchain,
version, checksum string, version, checksum string,
env []string, env []string,
script string, script string,
extra ...pkg.Artifact, extra ...pkg.Artifact,
) pkg.Artifact { ) pkg.Artifact {
name := "all" name := "all"
if presetOpts&OptSkipCheck != 0 { if s.opts&OptSkipCheck != 0 {
name = "make" name = "make"
} }
return t.New("go"+version, 0, t.AppendPresets(extra, return s.New(t, "go"+version, 0, s.AppendPresets(t, extra,
Bash, Bash,
), nil, slices.Concat([]string{ ), nil, slices.Concat([]string{
"CC=cc", "CC=cc",
@@ -65,27 +66,27 @@ ln -s \
))) )))
} }
func (t Toolchain) newGoLatest() (pkg.Artifact, string) { func (t Toolchain) newGoLatest(s *S) (pkg.Artifact, string) {
var ( var (
bootstrapEnv []string bootstrapEnv []string
bootstrapExtra []pkg.Artifact bootstrapExtra []pkg.Artifact
finalEnv []string finalEnv []string
) )
switch arch { switch s.arch {
case "amd64": case "amd64":
bootstrapExtra = append(bootstrapExtra, t.newGoBootstrap()) bootstrapExtra = append(bootstrapExtra, s.newGoBootstrap(t))
case "arm64", "riscv64": case "arm64", "riscv64":
bootstrapEnv = append(bootstrapEnv, "GOROOT_BOOTSTRAP=/system") bootstrapEnv = append(bootstrapEnv, "GOROOT_BOOTSTRAP=/system")
bootstrapExtra = t.AppendPresets(bootstrapExtra, gcc) bootstrapExtra = s.AppendPresets(t, bootstrapExtra, gcc)
finalEnv = append(finalEnv, "CGO_ENABLED=0") finalEnv = append(finalEnv, "CGO_ENABLED=0")
default: default:
panic("unsupported target " + arch) panic("unsupported target " + s.arch)
} }
go119 := t.newGo( go119 := s.newGo(t,
"1.19", "1.19",
"9_e0aFHsIkVxWVGsp9T2RvvjOc3p4n9o9S8tkNe9Cvgzk_zI2FhRQB7ioQkeAAro", "9_e0aFHsIkVxWVGsp9T2RvvjOc3p4n9o9S8tkNe9Cvgzk_zI2FhRQB7ioQkeAAro",
append(bootstrapEnv, "CGO_ENABLED=0"), ` append(bootstrapEnv, "CGO_ENABLED=0"), `
@@ -101,13 +102,13 @@ echo \
os/rawconn_test.go os/rawconn_test.go
`, bootstrapExtra...) `, bootstrapExtra...)
go121 := t.newGo( go121 := s.newGo(t,
"1.21.13", "1.21.13",
"YtrDka402BOAEwywx03Vz4QlVwoBiguJHzG7PuythMCPHXS8CVMLvzmvgEbu4Tzu", "YtrDka402BOAEwywx03Vz4QlVwoBiguJHzG7PuythMCPHXS8CVMLvzmvgEbu4Tzu",
[]string{"CGO_ENABLED=0"}, ` []string{"CGO_ENABLED=0"}, `
sed -i \ sed -i \
's,/lib/ld-musl-`+linuxArch()+`.so.1,/system/bin/linker,' \ 's,/lib/ld-musl-`+s.linuxArch()+`.so.1,/system/bin/linker,' \
cmd/link/internal/`+arch+`/obj.go cmd/link/internal/`+s.arch+`/obj.go
rm \ rm \
crypto/tls/handshake_client_test.go \ crypto/tls/handshake_client_test.go \
@@ -119,23 +120,23 @@ echo \
`, go119, `, go119,
) )
go123 := t.newGo( go123 := s.newGo(t,
"1.23.12", "1.23.12",
"wcI32bl1tkqbgcelGtGWPI4RtlEddd-PTd76Eb-k7nXA5LbE9yTNdIL9QSOOxMOs", "wcI32bl1tkqbgcelGtGWPI4RtlEddd-PTd76Eb-k7nXA5LbE9yTNdIL9QSOOxMOs",
[]string{"CGO_ENABLED=0"}, ` []string{"CGO_ENABLED=0"}, `
sed -i \ sed -i \
's,/lib/ld-musl-`+linuxArch()+`.so.1,/system/bin/linker,' \ 's,/lib/ld-musl-`+s.linuxArch()+`.so.1,/system/bin/linker,' \
cmd/link/internal/`+arch+`/obj.go cmd/link/internal/`+s.arch+`/obj.go
`, go121, `, go121,
) )
go125 := t.newGo( go125 := s.newGo(t,
"1.25.10", "1.25.10",
"TwKwatkpwal-j9U2sDSRPEdM3YesI4Gm88YgGV59wtU-L85K9gA7UPy9SCxn6PMb", "TwKwatkpwal-j9U2sDSRPEdM3YesI4Gm88YgGV59wtU-L85K9gA7UPy9SCxn6PMb",
[]string{"CGO_ENABLED=0"}, ` []string{"CGO_ENABLED=0"}, `
sed -i \ sed -i \
's,/lib/ld-musl-`+linuxArch()+`.so.1,/system/bin/linker,' \ 's,/lib/ld-musl-`+s.linuxArch()+`.so.1,/system/bin/linker,' \
cmd/link/internal/`+arch+`/obj.go cmd/link/internal/`+s.arch+`/obj.go
rm \ rm \
os/root_unix_test.go \ os/root_unix_test.go \
@@ -147,13 +148,13 @@ rm \
version = "1.26.3" version = "1.26.3"
checksum = "lEiFocZFnN5fKvZzmwVdqc9pYUjAuhzqZGbuiOqxUP4XdcY8yECisKcqsQ_eNn1N" checksum = "lEiFocZFnN5fKvZzmwVdqc9pYUjAuhzqZGbuiOqxUP4XdcY8yECisKcqsQ_eNn1N"
) )
return t.newGo( return s.newGo(t,
version, version,
checksum, checksum,
finalEnv, ` finalEnv, `
sed -i \ sed -i \
's,/lib/ld-musl-`+linuxArch()+`.so.1,/system/bin/linker,' \ 's,/lib/ld-musl-`+s.linuxArch()+`.so.1,/system/bin/linker,' \
cmd/link/internal/`+arch+`/obj.go cmd/link/internal/`+s.arch+`/obj.go
sed -i \ sed -i \
's/cpu.X86.HasAVX512VBMI/& \&\& cpu.X86.HasPOPCNT/' \ 's/cpu.X86.HasAVX512VBMI/& \&\& cpu.X86.HasPOPCNT/' \
internal/runtime/gc/scan/scan_amd64.go internal/runtime/gc/scan/scan_amd64.go
@@ -166,7 +167,7 @@ rm \
), version ), version
} }
func init() { func init() {
artifactsM[Go] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newGoLatest, f: Toolchain.newGoLatest,
Name: "go", Name: "go",
@@ -174,5 +175,5 @@ func init() {
Website: "https://go.dev/", Website: "https://go.dev/",
ID: 1227, ID: 1227,
} })
} }

View File

@@ -5,12 +5,12 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newGLib() (pkg.Artifact, string) { func (t Toolchain) newGLib(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.88.1" version = "2.88.1"
checksum = "Rkszn6W4RHjyspyqfXdVAVawdwDJCuS0Zu0f7qot7tbJhnw2fUDoUUJB40m-1MCX" checksum = "Rkszn6W4RHjyspyqfXdVAVawdwDJCuS0Zu0f7qot7tbJhnw2fUDoUUJB40m-1MCX"
) )
return t.NewPackage("glib", version, t.newTagRemote( return s.NewPackage(t, "glib", version, s.newTagRemote(t,
"https://gitlab.gnome.org/GNOME/glib.git", "https://gitlab.gnome.org/GNOME/glib.git",
version, checksum, version, checksum,
), &PackageAttr{ ), &PackageAttr{
@@ -42,7 +42,7 @@ func (t Toolchain) newGLib() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[GLib] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newGLib, f: Toolchain.newGLib,
Name: "glib", Name: "glib",
@@ -56,5 +56,5 @@ func init() {
}, },
ID: 10024, ID: 10024,
} })
} }

View File

@@ -2,7 +2,8 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newHakurei( func (s *S) newHakurei(
t Toolchain,
suffix, script string, suffix, script string,
withHostname bool, withHostname bool,
) pkg.Artifact { ) pkg.Artifact {
@@ -14,7 +15,7 @@ go build -o /bin/hostname /usr/src/hostname/main.go
hostname = "" hostname = ""
} }
return t.New("hakurei"+suffix+"-"+hakureiVersion, 0, t.AppendPresets(nil, return s.New(t, "hakurei"+suffix+"-"+hakureiVersion, 0, s.AppendPresets(t, nil,
Go, Go,
PkgConfig, PkgConfig,
@@ -38,8 +39,8 @@ go build -o /bin/hostname /usr/src/hostname/main.go
cd /usr/src/hakurei cd /usr/src/hakurei
HAKUREI_VERSION='v`+hakureiVersion+`' HAKUREI_VERSION='v`+hakureiVersion+`'
`+script, pkg.Path(AbsUsrSrc.Append("hakurei"), true, t.NewPatchedSource( `+script, pkg.Path(AbsUsrSrc.Append("hakurei"), true, s.NewPatchedSource(
"hakurei", hakureiVersion, hakureiSource, false, hakureiPatches..., t, "hakurei", hakureiVersion, hakureiSource, false, hakureiPatches...,
)), pkg.Path(AbsUsrSrc.Append("hostname", "main.go"), false, pkg.NewFile( )), pkg.Path(AbsUsrSrc.Append("hostname", "main.go"), false, pkg.NewFile(
"hostname.go", "hostname.go",
[]byte(` []byte(`
@@ -58,9 +59,9 @@ func main() {
))) )))
} }
func init() { func init() {
artifactsM[Hakurei] = Metadata{ native.MustRegister(&Artifact{
f: func(t Toolchain) (pkg.Artifact, string) { f: func(t Toolchain, s *S) (pkg.Artifact, string) {
return t.newHakurei("", ` return s.newHakurei(t, "", `
mkdir -p /work/system/libexec/hakurei/ mkdir -p /work/system/libexec/hakurei/
echo "Building hakurei for $(go env GOOS)/$(go env GOARCH)." echo "Building hakurei for $(go env GOOS)/$(go env GOARCH)."
@@ -93,14 +94,14 @@ mkdir -p /work/system/bin/
Website: "https://hakurei.app/", Website: "https://hakurei.app/",
ID: 388834, ID: 388834,
} })
artifactsM[HakureiDist] = Metadata{ native.MustRegister(&Artifact{
f: func(t Toolchain) (pkg.Artifact, string) { f: func(t Toolchain, s *S) (pkg.Artifact, string) {
name := "all" name := "all"
if presetOpts&OptSkipCheck != 0 { if s.opts&OptSkipCheck != 0 {
name = "make" name = "make"
} }
return t.newHakurei("-dist", ` return s.newHakurei(t, "-dist", `
export HAKUREI_VERSION export HAKUREI_VERSION
DESTDIR=/work /usr/src/hakurei/`+name+`.sh DESTDIR=/work /usr/src/hakurei/`+name+`.sh
`, true), hakureiVersion `, true), hakureiVersion
@@ -109,5 +110,5 @@ DESTDIR=/work /usr/src/hakurei/`+name+`.sh
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

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newHwdata() (pkg.Artifact, string) { func (t Toolchain) newHwdata(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.407" version = "0.407"
checksum = "6p1XD0CRuzt6hLfjv4ShKBW934BexmoPkRrmwxD4J63fBVCzVBRHyF8pVJdW_Xjm" checksum = "6p1XD0CRuzt6hLfjv4ShKBW934BexmoPkRrmwxD4J63fBVCzVBRHyF8pVJdW_Xjm"
) )
return t.NewPackage("hwdata", version, newFromGitHub( return s.NewPackage(t, "hwdata", version, newFromGitHub(
"vcrhonek/hwdata", "vcrhonek/hwdata",
"v"+version, checksum, "v"+version, checksum,
), &PackageAttr{ ), &PackageAttr{
@@ -22,7 +22,7 @@ func (t Toolchain) newHwdata() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
artifactsM[Hwdata] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newHwdata, f: Toolchain.newHwdata,
Name: "hwdata", Name: "hwdata",
@@ -30,5 +30,5 @@ func init() {
Website: "https://github.com/vcrhonek/hwdata", Website: "https://github.com/vcrhonek/hwdata",
ID: 5387, ID: 5387,
} })
} }

View File

@@ -6,12 +6,12 @@ import (
) )
func init() { func init() {
artifactsM[EarlyInit] = Metadata{ native.MustRegister(&Artifact{
Name: "earlyinit", Name: "earlyinit",
Description: "Rosa OS initramfs init program", Description: "Rosa OS initramfs init program",
f: func(t Toolchain) (pkg.Artifact, string) { f: func(t Toolchain, s *S) (pkg.Artifact, string) {
return t.newHakurei("-early-init", ` return s.newHakurei(t, "-early-init", `
mkdir -p /work/system/libexec/hakurei/ mkdir -p /work/system/libexec/hakurei/
echo '# Building earlyinit.' echo '# Building earlyinit.'
@@ -24,15 +24,14 @@ go build -trimpath -v -o /work/system/libexec/hakurei -ldflags="-s -w
echo echo
`, false), Unversioned `, false), Unversioned
}, },
} })
} }
func (t Toolchain) newImageSystem(s *S) (pkg.Artifact, string) {
func (t Toolchain) newImageSystem() (pkg.Artifact, string) { return s.New(t, "system.img", TNoToolchain, s.AppendPresets(t, nil,
return t.New("system.img", TNoToolchain, t.AppendPresets(nil,
SquashfsTools, SquashfsTools,
), nil, nil, ` ), nil, nil, `
mksquashfs /mnt/system /work/system.img mksquashfs /mnt/system /work/system.img
`, pkg.Path(fhs.AbsRoot.Append("mnt"), false, t.AppendPresets(nil, `, pkg.Path(fhs.AbsRoot.Append("mnt"), false, s.AppendPresets(t, nil,
Musl, Musl,
Mksh, Mksh,
Toybox, Toybox,
@@ -43,16 +42,15 @@ mksquashfs /mnt/system /work/system.img
)...)), Unversioned )...)), Unversioned
} }
func init() { func init() {
artifactsM[ImageSystem] = Metadata{ native.MustRegister(&Artifact{
Name: "system-image", Name: "system-image",
Description: "Rosa OS system image", Description: "Rosa OS system image",
f: Toolchain.newImageSystem, f: Toolchain.newImageSystem,
} })
} }
func (t Toolchain) newImageInitramfs(s *S) (pkg.Artifact, string) {
func (t Toolchain) newImageInitramfs() (pkg.Artifact, string) { return s.New(t, "initramfs", TNoToolchain, s.AppendPresets(t, nil,
return t.New("initramfs", TNoToolchain, t.AppendPresets(nil,
Zstd, Zstd,
EarlyInit, EarlyInit,
GenInitCPIO, GenInitCPIO,
@@ -66,10 +64,10 @@ file /init /system/libexec/hakurei/earlyinit 0555 0 0
`)))), Unversioned `)))), Unversioned
} }
func init() { func init() {
artifactsM[ImageInitramfs] = Metadata{ native.MustRegister(&Artifact{
Name: "initramfs-image", Name: "initramfs-image",
Description: "Rosa OS initramfs image", Description: "Rosa OS initramfs image",
f: Toolchain.newImageInitramfs, f: Toolchain.newImageInitramfs,
} })
} }

View File

@@ -11,26 +11,26 @@ var kernelSource = newTar(
pkg.TarGzip, pkg.TarGzip,
) )
func (t Toolchain) newKernelSource() (pkg.Artifact, string) { func (t Toolchain) newKernelSource(s *S) (pkg.Artifact, string) {
return t.New("kernel-"+kernelVersion+"-src", 0, nil, nil, nil, ` return s.New(t, "kernel-"+kernelVersion+"-src", 0, nil, nil, nil, `
mkdir -p /work/usr/src/ mkdir -p /work/usr/src/
cp -r /usr/src/linux /work/usr/src/ cp -r /usr/src/linux /work/usr/src/
chmod -R +w /work/usr/src/linux/ 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() {
artifactsM[KernelSource] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newKernelSource, 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/",
} })
} }
func (t Toolchain) newKernelHeaders() (pkg.Artifact, string) { func (t Toolchain) newKernelHeaders(s *S) (pkg.Artifact, string) {
const checksum = "lCmBNcMeUmXifg0vecKOPy3GAaFcJSmOPnf3wit9xYTDSTsFADPt1xxUFfmTn1fD" const checksum = "lCmBNcMeUmXifg0vecKOPy3GAaFcJSmOPnf3wit9xYTDSTsFADPt1xxUFfmTn1fD"
return t.NewPackage("kernel-headers", kernelVersion, kernelSource, &PackageAttr{ return s.NewPackage(t, "kernel-headers", kernelVersion, kernelSource, &PackageAttr{
Flag: TEarly, Flag: TEarly,
KnownChecksum: new(mustDecode(checksum)), KnownChecksum: new(mustDecode(checksum)),
@@ -67,17 +67,17 @@ cat \
), kernelVersion ), kernelVersion
} }
func init() { func init() {
artifactsM[KernelHeaders] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newKernelHeaders, 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/",
} })
} }
func (t Toolchain) newKernel() (pkg.Artifact, string) { func (t Toolchain) newKernel(s *S) (pkg.Artifact, string) {
return t.NewPackage("kernel", kernelVersion, kernelSource, &PackageAttr{ return s.NewPackage(t, "kernel", kernelVersion, kernelSource, &PackageAttr{
Env: []string{ Env: []string{
"PATH=/system/sbin", "PATH=/system/sbin",
}, },
@@ -1272,7 +1272,7 @@ rm -v /work/system/lib/modules/` + kernelVersion + `/build
), kernelVersion ), kernelVersion
} }
func init() { func init() {
artifactsM[Kernel] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newKernel, f: Toolchain.newKernel,
Name: "kernel", Name: "kernel",
@@ -1280,30 +1280,30 @@ func init() {
Website: "https://kernel.org/", Website: "https://kernel.org/",
ID: 375621, ID: 375621,
} })
} }
func (t Toolchain) newGenInitCPIO() (pkg.Artifact, string) { func (t Toolchain) newGenInitCPIO(s *S) (pkg.Artifact, string) {
return t.New("gen_init_cpio-"+kernelVersion, 0, nil, nil, nil, ` return s.New(t, "gen_init_cpio-"+kernelVersion, 0, nil, nil, nil, `
mkdir -p /work/system/bin/ mkdir -p /work/system/bin/
cc -o /work/system/bin/gen_init_cpio /usr/src/linux/usr/gen_init_cpio.c 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() {
artifactsM[GenInitCPIO] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newGenInitCPIO, 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",
} })
} }
func (t Toolchain) newFirmware() (pkg.Artifact, string) { func (t Toolchain) newFirmware(s *S) (pkg.Artifact, string) {
const ( const (
version = "20260410" version = "20260410"
checksum = "J8PdQlGqwrivpskPzbL6xacqR6mlKtXpe5RpzFfVzKPAgG81ZRXsc3qrxwdGJbil" checksum = "J8PdQlGqwrivpskPzbL6xacqR6mlKtXpe5RpzFfVzKPAgG81ZRXsc3qrxwdGJbil"
) )
return t.NewPackage("firmware", version, newFromGitLab( return s.NewPackage(t, "firmware", version, newFromGitLab(
"gitlab.com", "gitlab.com",
"kernel-firmware/linux-firmware", "kernel-firmware/linux-firmware",
version, version,
@@ -1337,7 +1337,7 @@ func (t Toolchain) newFirmware() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Firmware] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newFirmware, f: Toolchain.newFirmware,
Name: "firmware", Name: "firmware",
@@ -1345,5 +1345,5 @@ func init() {
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/",
ID: 141464, ID: 141464,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newKmod() (pkg.Artifact, string) { func (t Toolchain) newKmod(s *S) (pkg.Artifact, string) {
const ( const (
version = "34.2" version = "34.2"
checksum = "0K7POeTKxMhExsaTsnKAC6LUNsRSfe6sSZxWONPbOu-GI_pXOw3toU_BIoqfBhJV" checksum = "0K7POeTKxMhExsaTsnKAC6LUNsRSfe6sSZxWONPbOu-GI_pXOw3toU_BIoqfBhJV"
) )
return t.NewPackage("kmod", version, newTar( return s.NewPackage(t, "kmod", version, newTar(
"https://www.kernel.org/pub/linux/utils/kernel/"+ "https://www.kernel.org/pub/linux/utils/kernel/"+
"kmod/kmod-"+version+".tar.gz", "kmod/kmod-"+version+".tar.gz",
checksum, checksum,
@@ -32,7 +32,7 @@ func (t Toolchain) newKmod() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Kmod] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newKmod, f: Toolchain.newKmod,
Name: "kmod", Name: "kmod",
@@ -46,5 +46,5 @@ func init() {
}, },
ID: 1517, ID: 1517,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newLibarchive() (pkg.Artifact, string) { func (t Toolchain) newLibarchive(s *S) (pkg.Artifact, string) {
const ( const (
version = "3.8.7" version = "3.8.7"
checksum = "CUJK4MDQmZmATClgQBH2Wt-7Ts4iiSUlg1J_TVb6-5IK3rVUgVLIMc5k-bnWB9w3" checksum = "CUJK4MDQmZmATClgQBH2Wt-7Ts4iiSUlg1J_TVb6-5IK3rVUgVLIMc5k-bnWB9w3"
) )
return t.NewPackage("libarchive", version, newFromGitHub( return s.NewPackage(t, "libarchive", version, newFromGitHub(
"libarchive/libarchive", "libarchive/libarchive",
"v"+version, checksum, "v"+version, checksum,
), &PackageAttr{ ), &PackageAttr{
@@ -88,7 +88,7 @@ install -Dv /usr/src/CTestCustom.cmake /cure/
}, (*CMakeHelper)(nil)), version }, (*CMakeHelper)(nil)), version
} }
func init() { func init() {
artifactsM[Libarchive] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibarchive, f: Toolchain.newLibarchive,
Name: "libarchive", Name: "libarchive",
@@ -96,5 +96,5 @@ func init() {
Website: "https://www.libarchive.org/", Website: "https://www.libarchive.org/",
ID: 1558, ID: 1558,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newLibmd() (pkg.Artifact, string) { func (t Toolchain) newLibmd(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.2.0" version = "1.2.0"
checksum = "1rJ6joAO0wwMZvSfnRNkc1MOhywyAq7SM8VmF92NvDtv7Qdl1LRbjm5fg_DFFtGj" checksum = "1rJ6joAO0wwMZvSfnRNkc1MOhywyAq7SM8VmF92NvDtv7Qdl1LRbjm5fg_DFFtGj"
) )
return t.NewPackage("libmd", version, t.newTagRemote( return s.NewPackage(t, "libmd", version, s.newTagRemote(t,
"https://git.hadrons.org/git/libmd.git", "https://git.hadrons.org/git/libmd.git",
version, checksum, version, checksum,
), nil, &MakeHelper{ ), nil, &MakeHelper{
@@ -21,7 +21,7 @@ install -D /usr/src/libmd/src/helper.c src/helper.c
), version ), version
} }
func init() { func init() {
artifactsM[Libmd] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibmd, f: Toolchain.newLibmd,
Name: "libmd", Name: "libmd",
@@ -29,15 +29,15 @@ func init() {
Website: "https://www.hadrons.org/software/libmd/", Website: "https://www.hadrons.org/software/libmd/",
ID: 15525, ID: 15525,
} })
} }
func (t Toolchain) newLibbsd() (pkg.Artifact, string) { func (t Toolchain) newLibbsd(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.12.2" version = "0.12.2"
checksum = "NVS0xFLTwSP8JiElEftsZ-e1_C-IgJhHrHE77RwKt5178M7r087waO-zYx2_dfGX" checksum = "NVS0xFLTwSP8JiElEftsZ-e1_C-IgJhHrHE77RwKt5178M7r087waO-zYx2_dfGX"
) )
return t.NewPackage("libbsd", version, t.newTagRemote( return s.NewPackage(t, "libbsd", version, s.newTagRemote(t,
"https://gitlab.freedesktop.org/libbsd/libbsd.git", "https://gitlab.freedesktop.org/libbsd/libbsd.git",
version, checksum, version, checksum,
), nil, &MakeHelper{ ), nil, &MakeHelper{
@@ -50,7 +50,7 @@ func (t Toolchain) newLibbsd() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Libbsd] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibbsd, f: Toolchain.newLibbsd,
Name: "libbsd", Name: "libbsd",
@@ -58,5 +58,5 @@ func init() {
Website: "https://libbsd.freedesktop.org/", Website: "https://libbsd.freedesktop.org/",
ID: 1567, ID: 1567,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newLibcap() (pkg.Artifact, string) { func (t Toolchain) newLibcap(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.78" version = "2.78"
checksum = "wFdUkBhFMD9InPnrBZyegWrlPSAg_9JiTBC-eSFyWWlmbzL2qjh2mKxr9Kx2a8ut" checksum = "wFdUkBhFMD9InPnrBZyegWrlPSAg_9JiTBC-eSFyWWlmbzL2qjh2mKxr9Kx2a8ut"
) )
return t.NewPackage("libcap", version, newTar( return s.NewPackage(t, "libcap", version, newTar(
"https://git.kernel.org/pub/scm/libs/libcap/libcap.git/"+ "https://git.kernel.org/pub/scm/libs/libcap/libcap.git/"+
"snapshot/libcap-"+version+".tar.gz", "snapshot/libcap-"+version+".tar.gz",
checksum, checksum,
@@ -42,7 +42,7 @@ ln -s ../system/bin/bash /bin/
), version ), version
} }
func init() { func init() {
artifactsM[Libcap] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibcap, f: Toolchain.newLibcap,
Name: "libcap", Name: "libcap",
@@ -50,5 +50,5 @@ func init() {
Website: "https://sites.google.com/site/fullycapable/", Website: "https://sites.google.com/site/fullycapable/",
ID: 1569, ID: 1569,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newLibconfig() (pkg.Artifact, string) { func (t Toolchain) newLibconfig(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.8.2" version = "1.8.2"
checksum = "fD32hjeAZuTz98g6WYHRwsxphrgrEFqxi5Z1jlJemPckPBfxpS3i5HgshAuA6vmT" checksum = "fD32hjeAZuTz98g6WYHRwsxphrgrEFqxi5Z1jlJemPckPBfxpS3i5HgshAuA6vmT"
) )
return t.NewPackage("libconfig", version, newFromGitHub( return s.NewPackage(t, "libconfig", version, newFromGitHub(
"hyperrealm/libconfig", "hyperrealm/libconfig",
"v"+version, "v"+version,
checksum, checksum,
@@ -38,7 +38,7 @@ index eba7eae..f916d2e 100644
}, (*CMakeHelper)(nil)), version }, (*CMakeHelper)(nil)), version
} }
func init() { func init() {
artifactsM[Libconfig] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibconfig, f: Toolchain.newLibconfig,
Name: "libconfig", Name: "libconfig",
@@ -46,5 +46,5 @@ func init() {
Website: "https://hyperrealm.github.io/libconfig/", Website: "https://hyperrealm.github.io/libconfig/",
ID: 1580, ID: 1580,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newLibdisplayInfo() (pkg.Artifact, string) { func (t Toolchain) newLibdisplayInfo(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.3.0" version = "0.3.0"
checksum = "yjOqPUHHYgRtpqGw5RI1n2Q1_hO5j0LiFNMbjcRWV4Nf71XwwoC9fZMlKBDeLchT" checksum = "yjOqPUHHYgRtpqGw5RI1n2Q1_hO5j0LiFNMbjcRWV4Nf71XwwoC9fZMlKBDeLchT"
) )
return t.NewPackage("libdisplay-info", version, newFromGitLab( return s.NewPackage(t, "libdisplay-info", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"emersion/libdisplay-info", "emersion/libdisplay-info",
version, checksum, version, checksum,
@@ -18,7 +18,7 @@ func (t Toolchain) newLibdisplayInfo() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[LibdisplayInfo] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibdisplayInfo, f: Toolchain.newLibdisplayInfo,
Name: "libdisplay-info", Name: "libdisplay-info",
@@ -26,5 +26,5 @@ func init() {
Website: "https://gitlab.freedesktop.org/emersion/libdisplay-info", Website: "https://gitlab.freedesktop.org/emersion/libdisplay-info",
ID: 326668, ID: 326668,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newLibepoxy() (pkg.Artifact, string) { func (t Toolchain) newLibepoxy(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.5.10" version = "1.5.10"
checksum = "OHI8wshrlGw6BMGrmSyejJtwzM2gPhyFJrTsKxULyKMmYrfgcOe7Iw2ibVoUND_Q" checksum = "OHI8wshrlGw6BMGrmSyejJtwzM2gPhyFJrTsKxULyKMmYrfgcOe7Iw2ibVoUND_Q"
) )
return t.NewPackage("libepoxy", version, newFromGitHub( return s.NewPackage(t, "libepoxy", version, newFromGitHub(
"anholt/libepoxy", "anholt/libepoxy",
version, version,
checksum, checksum,
@@ -21,7 +21,7 @@ func (t Toolchain) newLibepoxy() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Libepoxy] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibepoxy, f: Toolchain.newLibepoxy,
Name: "libepoxy", Name: "libepoxy",
@@ -29,5 +29,5 @@ func init() {
Website: "https://github.com/anholt/libepoxy", Website: "https://github.com/anholt/libepoxy",
ID: 6090, ID: 6090,
} })
} }

View File

@@ -2,19 +2,19 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newLibev() (pkg.Artifact, string) { func (t Toolchain) newLibev(s *S) (pkg.Artifact, string) {
const ( const (
version = "4.33" version = "4.33"
checksum = "774eSXV_4k8PySRprUDChbEwsw-kzjIFnJ3MpNOl5zDpamBRvC3BqPyRxvkwcL6_" checksum = "774eSXV_4k8PySRprUDChbEwsw-kzjIFnJ3MpNOl5zDpamBRvC3BqPyRxvkwcL6_"
) )
return t.NewPackage("libev", version, newTar( return s.NewPackage(t, "libev", version, newTar(
"https://dist.schmorp.de/libev/Attic/libev-"+version+".tar.gz", "https://dist.schmorp.de/libev/Attic/libev-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
), nil, (*MakeHelper)(nil)), version ), nil, (*MakeHelper)(nil)), version
} }
func init() { func init() {
artifactsM[Libev] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibev, f: Toolchain.newLibev,
Name: "libev", Name: "libev",
@@ -22,5 +22,5 @@ func init() {
Website: "http://libev.schmorp.de/", Website: "http://libev.schmorp.de/",
ID: 1605, ID: 1605,
} })
} }

View File

@@ -6,12 +6,12 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newLibexpat() (pkg.Artifact, string) { func (t Toolchain) newLibexpat(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.8.1" version = "2.8.1"
checksum = "iMEtbOJhQfGof2GxSlxffQSI1va_NDDQ9VIuqcPbNZ0291Dr8wttD5QecYyjIQap" checksum = "iMEtbOJhQfGof2GxSlxffQSI1va_NDDQ9VIuqcPbNZ0291Dr8wttD5QecYyjIQap"
) )
return t.NewPackage("libexpat", version, newFromGitHubRelease( return s.NewPackage(t, "libexpat", version, newFromGitHubRelease(
"libexpat/libexpat", "libexpat/libexpat",
"R_"+strings.ReplaceAll(version, ".", "_"), "R_"+strings.ReplaceAll(version, ".", "_"),
"expat-"+version+".tar.bz2", "expat-"+version+".tar.bz2",
@@ -22,7 +22,7 @@ func (t Toolchain) newLibexpat() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Libexpat] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibexpat, f: Toolchain.newLibexpat,
Name: "libexpat", Name: "libexpat",
@@ -30,5 +30,5 @@ func init() {
Website: "https://libexpat.github.io/", Website: "https://libexpat.github.io/",
ID: 770, ID: 770,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newLibffi() (pkg.Artifact, string) { func (t Toolchain) newLibffi(s *S) (pkg.Artifact, string) {
const ( const (
version = "3.5.2" version = "3.5.2"
checksum = "2_Q-ZNBBbVhltfL5zEr0wljxPegUimTK4VeMSiwJEGksls3n4gj3lV0Ly3vviSFH" checksum = "2_Q-ZNBBbVhltfL5zEr0wljxPegUimTK4VeMSiwJEGksls3n4gj3lV0Ly3vviSFH"
) )
return t.NewPackage("libffi", version, newFromGitHubRelease( return s.NewPackage(t, "libffi", version, newFromGitHubRelease(
"libffi/libffi", "libffi/libffi",
"v"+version, "v"+version,
"libffi-"+version+".tar.gz", "libffi-"+version+".tar.gz",
@@ -18,7 +18,7 @@ func (t Toolchain) newLibffi() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Libffi] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibffi, f: Toolchain.newLibffi,
Name: "libffi", Name: "libffi",
@@ -26,5 +26,5 @@ func init() {
Website: "https://sourceware.org/libffi/", Website: "https://sourceware.org/libffi/",
ID: 1611, ID: 1611,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newLibgd() (pkg.Artifact, string) { func (t Toolchain) newLibgd(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.3.3" version = "2.3.3"
checksum = "8T-sh1_FJT9K9aajgxzh8ot6vWIF-xxjcKAHvTak9MgGUcsFfzP8cAvvv44u2r36" checksum = "8T-sh1_FJT9K9aajgxzh8ot6vWIF-xxjcKAHvTak9MgGUcsFfzP8cAvvv44u2r36"
) )
return t.NewPackage("libgd", version, newFromGitHubRelease( return s.NewPackage(t, "libgd", version, newFromGitHubRelease(
"libgd/libgd", "libgd/libgd",
"gd-"+version, "gd-"+version,
"libgd-"+version+".tar.gz", checksum, "libgd-"+version+".tar.gz", checksum,
@@ -24,7 +24,7 @@ mkdir /dev/shm/gd
), version ), version
} }
func init() { func init() {
artifactsM[Libgd] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibgd, f: Toolchain.newLibgd,
Name: "libgd", Name: "libgd",
@@ -36,5 +36,5 @@ func init() {
}, },
ID: 880, ID: 880,
} })
} }

View File

@@ -6,12 +6,12 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newLibpng() (pkg.Artifact, string) { func (t Toolchain) newLibpng(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.6.58" version = "1.6.58"
checksum = "m_a5lROJH7vmF3cMjqwTUqURuQLhV1JQx2ySPzcN3VPdgDB9pG3UINsIx_mtkr-t" checksum = "m_a5lROJH7vmF3cMjqwTUqURuQLhV1JQx2ySPzcN3VPdgDB9pG3UINsIx_mtkr-t"
) )
return t.NewPackage("libpng", version, newTar( return s.NewPackage(t, "libpng", version, newTar(
"https://downloads.sourceforge.net/project/libpng/libpng"+ "https://downloads.sourceforge.net/project/libpng/libpng"+
strings.Join(strings.SplitN(version, ".", 3)[:2], "")+ strings.Join(strings.SplitN(version, ".", 3)[:2], "")+
"/"+version+"/libpng-"+version+".tar.gz", "/"+version+"/libpng-"+version+".tar.gz",
@@ -22,7 +22,7 @@ func (t Toolchain) newLibpng() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Libpng] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibpng, f: Toolchain.newLibpng,
Name: "libpng", Name: "libpng",
@@ -34,5 +34,5 @@ func init() {
}, },
ID: 1705, ID: 1705,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newLibpsl() (pkg.Artifact, string) { func (t Toolchain) newLibpsl(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.21.5" version = "0.21.5"
checksum = "XjfxSzh7peG2Vg4vJlL8z4JZJLcXqbuP6pLWkrGCmRxlnYUFTKNBqWGHCxEOlCad" checksum = "XjfxSzh7peG2Vg4vJlL8z4JZJLcXqbuP6pLWkrGCmRxlnYUFTKNBqWGHCxEOlCad"
) )
return t.NewPackage("libpsl", version, newFromGitHubRelease( return s.NewPackage(t, "libpsl", version, newFromGitHubRelease(
"rockdaboot/libpsl", "rockdaboot/libpsl",
version, version,
"libpsl-"+version+".tar.gz", "libpsl-"+version+".tar.gz",
@@ -25,7 +25,7 @@ test_disable 'int main(){return 0;}' tests/test-is-public-builtin.c
), version ), version
} }
func init() { func init() {
artifactsM[Libpsl] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibpsl, f: Toolchain.newLibpsl,
Name: "libpsl", Name: "libpsl",
@@ -33,5 +33,5 @@ func init() {
Website: "https://rockdaboot.github.io/libpsl/", Website: "https://rockdaboot.github.io/libpsl/",
ID: 7305, ID: 7305,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newLibseccomp() (pkg.Artifact, string) { func (t Toolchain) newLibseccomp(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.6.0" version = "2.6.0"
checksum = "mMu-iR71guPjFbb31u-YexBaanKE_nYPjPux-vuBiPfS_0kbwJdfCGlkofaUm-EY" checksum = "mMu-iR71guPjFbb31u-YexBaanKE_nYPjPux-vuBiPfS_0kbwJdfCGlkofaUm-EY"
) )
return t.NewPackage("libseccomp", version, newFromGitHubRelease( return s.NewPackage(t, "libseccomp", version, newFromGitHubRelease(
"seccomp/libseccomp", "seccomp/libseccomp",
"v"+version, "v"+version,
"libseccomp-"+version+".tar.gz", "libseccomp-"+version+".tar.gz",
@@ -43,7 +43,7 @@ index adccef3..65a277a 100644
), version ), version
} }
func init() { func init() {
artifactsM[Libseccomp] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibseccomp, f: Toolchain.newLibseccomp,
Name: "libseccomp", Name: "libseccomp",
@@ -51,5 +51,5 @@ func init() {
Website: "https://github.com/seccomp/libseccomp/", Website: "https://github.com/seccomp/libseccomp/",
ID: 13823, ID: 13823,
} })
} }

View File

@@ -6,12 +6,12 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newLibtirpc() (pkg.Artifact, string) { func (t Toolchain) newLibtirpc(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.3.7" version = "1.3.7"
checksum = "nzFfu7LNvnSNiNAryD1vtnNWnU-Xqee8KqfXUKoBf5yjb5-dkeRkYuRijdCoYLof" checksum = "nzFfu7LNvnSNiNAryD1vtnNWnU-Xqee8KqfXUKoBf5yjb5-dkeRkYuRijdCoYLof"
) )
return t.NewPackage("libtirpc", version, t.newTagRemote( return s.NewPackage(t, "libtirpc", version, s.newTagRemote(t,
"git://linux-nfs.org/~steved/libtirpc", "git://linux-nfs.org/~steved/libtirpc",
"libtirpc-"+ "libtirpc-"+
strings.Join(strings.SplitN(version, ".", 3), "-"), strings.Join(strings.SplitN(version, ".", 3), "-"),
@@ -32,7 +32,7 @@ func (t Toolchain) newLibtirpc() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Libtirpc] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibtirpc, f: Toolchain.newLibtirpc,
Name: "libtirpc", Name: "libtirpc",
@@ -40,5 +40,5 @@ func init() {
Website: "https://sourceforge.net/projects/libtirpc/", Website: "https://sourceforge.net/projects/libtirpc/",
ID: 1740, ID: 1740,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newLibucontext() (pkg.Artifact, string) { func (t Toolchain) newLibucontext(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.5.1" version = "1.5.1"
checksum = "mUgeyJknjMxT-5fORzz-rqhZfP3Y7EZGBhOwvhuX7MsF4Pk9wkuwtrLf5IML-jWu" checksum = "mUgeyJknjMxT-5fORzz-rqhZfP3Y7EZGBhOwvhuX7MsF4Pk9wkuwtrLf5IML-jWu"
) )
return t.NewPackage("libucontext", version, newFromGitHub( return s.NewPackage(t, "libucontext", version, newFromGitHub(
"kaniini/libucontext", "kaniini/libucontext",
"libucontext-"+version, "libucontext-"+version,
checksum, checksum,
@@ -21,13 +21,13 @@ func (t Toolchain) newLibucontext() (pkg.Artifact, string) {
SkipConfigure: true, SkipConfigure: true,
InPlace: true, InPlace: true,
Make: []string{ Make: []string{
"ARCH=" + linuxArch(), "ARCH=" + s.linuxArch(),
}, },
Install: "make prefix=/system DESTDIR=/work install", Install: "make prefix=/system DESTDIR=/work install",
}), version }), version
} }
func init() { func init() {
artifactsM[Libucontext] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibucontext, f: Toolchain.newLibucontext,
Name: "libucontext", Name: "libucontext",
@@ -35,5 +35,5 @@ func init() {
Website: "https://github.com/kaniini/libucontext/", Website: "https://github.com/kaniini/libucontext/",
ID: 17085, ID: 17085,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newLibxml2() (pkg.Artifact, string) { func (t Toolchain) newLibxml2(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.15.3" version = "2.15.3"
checksum = "oJy74htGlEpf70KPvpW18fYJo0RQQkCXZRwqUz6NoXborS3HCq3Nm4gsyaSeNmUH" checksum = "oJy74htGlEpf70KPvpW18fYJo0RQQkCXZRwqUz6NoXborS3HCq3Nm4gsyaSeNmUH"
) )
return t.NewPackage("libxml2", version, newFromGitLab( return s.NewPackage(t, "libxml2", version, newFromGitLab(
"gitlab.gnome.org", "gitlab.gnome.org",
"GNOME/libxml2", "GNOME/libxml2",
"v"+version, checksum, "v"+version, checksum,
@@ -20,7 +20,7 @@ func (t Toolchain) newLibxml2() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Libxml2] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibxml2, f: Toolchain.newLibxml2,
Name: "libxml2", Name: "libxml2",
@@ -28,5 +28,5 @@ func init() {
Website: "https://gitlab.gnome.org/GNOME/libxml2/", Website: "https://gitlab.gnome.org/GNOME/libxml2/",
ID: 1783, ID: 1783,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newLibxslt() (pkg.Artifact, string) { func (t Toolchain) newLibxslt(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.1.45" version = "1.1.45"
checksum = "67ks7v8od2oWaEGf23Sst_Xbn_8brQyolQjqxPoO-lK35k_WJhi2Px5JJgbk-nfn" checksum = "67ks7v8od2oWaEGf23Sst_Xbn_8brQyolQjqxPoO-lK35k_WJhi2Px5JJgbk-nfn"
) )
return t.NewPackage("libxslt", version, newFromGitLab( return s.NewPackage(t, "libxslt", version, newFromGitLab(
"gitlab.gnome.org", "gitlab.gnome.org",
"GNOME/libxslt", "GNOME/libxslt",
"v"+version, checksum, "v"+version, checksum,
@@ -26,7 +26,7 @@ func (t Toolchain) newLibxslt() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Libxslt] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibxslt, f: Toolchain.newLibxslt,
Name: "libxslt", Name: "libxslt",
@@ -38,5 +38,5 @@ func init() {
}, },
ID: 13301, ID: 13301,
} })
} }

View File

@@ -29,10 +29,10 @@ func litArgs(verbose bool, skipChecks ...string) string {
return "'" + strings.Join(args, " ") + "'" return "'" + strings.Join(args, " ") + "'"
} }
func (t Toolchain) newEarlyCompilerRT() (pkg.Artifact, string) { func (t Toolchain) newEarlyCompilerRT(s *S) (pkg.Artifact, string) {
version := t.Version(llvmSource) source, version := s.Load(t, llvmSource)
major, _, _ := strings.Cut(version, ".") major, _, _ := strings.Cut(version, ".")
return t.NewPackage("early-compiler-rt", version, t.Load(llvmSource), &PackageAttr{ return s.NewPackage(t, "early-compiler-rt", version, source, &PackageAttr{
Flag: TExclusive, Flag: TExclusive,
}, &CMakeHelper{ }, &CMakeHelper{
Append: []string{"compiler-rt"}, Append: []string{"compiler-rt"},
@@ -71,10 +71,10 @@ ln -s \
"/work/system/lib/clang/` + major + `/lib/" "/work/system/lib/clang/` + major + `/lib/"
ln -s \ ln -s \
"clang_rt.crtbegin-` + linuxArch() + `.o" \ "clang_rt.crtbegin-` + s.linuxArch() + `.o" \
"/work/system/lib/${ROSA_TRIPLE}/crtbeginS.o" "/work/system/lib/${ROSA_TRIPLE}/crtbeginS.o"
ln -s \ ln -s \
"clang_rt.crtend-` + linuxArch() + `.o" \ "clang_rt.crtend-` + s.linuxArch() + `.o" \
"/work/system/lib/${ROSA_TRIPLE}/crtendS.o" "/work/system/lib/${ROSA_TRIPLE}/crtendS.o"
`, `,
}, },
@@ -85,7 +85,7 @@ ln -s \
), version ), version
} }
func init() { func init() {
artifactsM[earlyCompilerRT] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newEarlyCompilerRT, f: Toolchain.newEarlyCompilerRT,
Name: "early-compiler-rt", Name: "early-compiler-rt",
@@ -94,12 +94,12 @@ func init() {
Dependencies: P{ Dependencies: P{
Musl, Musl,
}, },
} })
} }
func (t Toolchain) newEarlyRuntimes() (pkg.Artifact, string) { func (t Toolchain) newEarlyRuntimes(s *S) (pkg.Artifact, string) {
version := t.Version(llvmSource) source, version := s.Load(t, llvmSource)
return t.NewPackage("early-runtimes", version, t.Load(llvmSource), &PackageAttr{ return s.NewPackage(t, "early-runtimes", version, source, &PackageAttr{
Flag: TExclusive, Flag: TExclusive,
}, &CMakeHelper{ }, &CMakeHelper{
Append: []string{"runtimes"}, Append: []string{"runtimes"},
@@ -145,7 +145,7 @@ func (t Toolchain) newEarlyRuntimes() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[earlyRuntimes] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newEarlyRuntimes, f: Toolchain.newEarlyRuntimes,
Name: "early-runtimes", Name: "early-runtimes",
@@ -154,11 +154,11 @@ func init() {
Dependencies: P{ Dependencies: P{
earlyCompilerRT, earlyCompilerRT,
}, },
} })
} }
func (t Toolchain) newLLVM() (pkg.Artifact, string) { func (t Toolchain) newLLVM(s *S) (pkg.Artifact, string) {
var early PArtifact = muslHeaders early := muslHeaders
if t.isStage0() { if t.isStage0() {
// The LLVM build system uses the system installation when building with // The LLVM build system uses the system installation when building with
// LLVM_LINK_LLVM_DYLIB, since it builds runtimes after the fact, using // LLVM_LINK_LLVM_DYLIB, since it builds runtimes after the fact, using
@@ -247,7 +247,7 @@ func (t Toolchain) newLLVM() (pkg.Artifact, string) {
// unwind: fails on musl // unwind: fails on musl
"eh_frame_fde_pc_range", "eh_frame_fde_pc_range",
} }
switch arch { switch s.arch {
case "arm64": case "arm64":
skipChecks = append(skipChecks, skipChecks = append(skipChecks,
// LLVM: intermittently crashes // LLVM: intermittently crashes
@@ -257,7 +257,7 @@ func (t Toolchain) newLLVM() (pkg.Artifact, string) {
) )
} }
if presetOpts&OptLLVMNoLTO == 0 { if s.opts&OptLLVMNoLTO == 0 {
cache = append(cache, []KV{ cache = append(cache, []KV{
// very expensive // very expensive
{"LLVM_ENABLE_LTO", "Thin"}, {"LLVM_ENABLE_LTO", "Thin"},
@@ -273,8 +273,8 @@ func (t Toolchain) newLLVM() (pkg.Artifact, string) {
}...) }...)
} }
version := t.Version(llvmSource) source, version := s.Load(t, llvmSource)
return t.NewPackage("llvm", version, t.Load(llvmSource), &PackageAttr{ return s.NewPackage(t, "llvm", version, source, &PackageAttr{
Flag: TExclusive, Flag: TExclusive,
}, &CMakeHelper{ }, &CMakeHelper{
Append: []string{"llvm"}, Append: []string{"llvm"},
@@ -324,9 +324,9 @@ func init() {
checksum = "32gOaLPHcUlo3hkdk5RbFumTE01XKeCAYZcpvn8IDHF95egXVfDFSl6eZL3ChMen" checksum = "32gOaLPHcUlo3hkdk5RbFumTE01XKeCAYZcpvn8IDHF95egXVfDFSl6eZL3ChMen"
) )
artifactsM[llvmSource] = Metadata{ native.MustRegister(&Artifact{
f: func(t Toolchain) (pkg.Artifact, string) { f: func(t Toolchain, s *S) (pkg.Artifact, string) {
return t.NewPatchedSource("llvm", version, newFromGitHub( return s.NewPatchedSource(t, "llvm", version, newFromGitHub(
"llvm/llvm-project", "llvm/llvm-project",
"llvmorg-"+version, "llvmorg-"+version,
checksum, checksum,
@@ -337,9 +337,9 @@ func init() {
Description: "LLVM monorepo with Rosa OS patches", Description: "LLVM monorepo with Rosa OS patches",
ID: 1830, ID: 1830,
} })
artifactsM[LLVM] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLLVM, f: Toolchain.newLLVM,
Name: "llvm", Name: "llvm",
@@ -351,5 +351,5 @@ func init() {
Zstd, Zstd,
Musl, Musl,
}, },
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newLMSensors() (pkg.Artifact, string) { func (t Toolchain) newLMSensors(s *S) (pkg.Artifact, string) {
const ( const (
version = "3-6-2" version = "3-6-2"
checksum = "7JYNutrihe-FP6r3ftf96uFZJJWPfxnBHL0ALSMA-vovaXVRr-sAjlLitw7WWpCI" checksum = "7JYNutrihe-FP6r3ftf96uFZJJWPfxnBHL0ALSMA-vovaXVRr-sAjlLitw7WWpCI"
) )
return t.NewPackage("lm_sensors", version, newFromGitHub( return s.NewPackage(t, "lm_sensors", version, newFromGitHub(
"lm-sensors/lm-sensors", "lm-sensors/lm-sensors",
"V"+version, "V"+version,
checksum, checksum,
@@ -47,7 +47,7 @@ ln -s \
), version ), version
} }
func init() { func init() {
artifactsM[LMSensors] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLMSensors, f: Toolchain.newLMSensors,
Name: "lm_sensors", Name: "lm_sensors",
@@ -55,5 +55,5 @@ func init() {
Website: "https://hwmon.wiki.kernel.org/lm_sensors", Website: "https://hwmon.wiki.kernel.org/lm_sensors",
ID: 1831, ID: 1831,
} })
} }

View File

@@ -7,12 +7,12 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newMake() (pkg.Artifact, string) { func (t Toolchain) newMake(s *S) (pkg.Artifact, string) {
const ( const (
version = "4.4.1" version = "4.4.1"
checksum = "YS_B07ZcAy9PbaK5_vKGj64SrxO2VMpnMKfc9I0Q9IC1rn0RwOH7802pJoj2Mq4a" checksum = "YS_B07ZcAy9PbaK5_vKGj64SrxO2VMpnMKfc9I0Q9IC1rn0RwOH7802pJoj2Mq4a"
) )
return t.New("make-"+version, TEarly, nil, nil, nil, ` return s.New(t, "make-"+version, TEarly, nil, nil, nil, `
cd "$(mktemp -d)" cd "$(mktemp -d)"
/usr/src/make/configure \ /usr/src/make/configure \
--prefix=/system \ --prefix=/system \
@@ -27,7 +27,7 @@ cd "$(mktemp -d)"
))), version ))), version
} }
func init() { func init() {
artifactsM[Make] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newMake, f: Toolchain.newMake,
Name: "make", Name: "make",
@@ -35,7 +35,7 @@ func init() {
Website: "https://www.gnu.org/software/make/", Website: "https://www.gnu.org/software/make/",
ID: 1877, ID: 1877,
} })
} }
// MakeHelper is the [Make] build system helper. // MakeHelper is the [Make] build system helper.
@@ -123,7 +123,7 @@ func (attr *MakeHelper) wantsDir() string {
} }
// script generates the cure script. // script generates the cure script.
func (attr *MakeHelper) script(name string) string { func (attr *MakeHelper) script(s *S, name string) string {
if attr == nil { if attr == nil {
attr = new(MakeHelper) attr = new(MakeHelper)
} }
@@ -194,7 +194,7 @@ make \
} }
scriptMake += "\n" scriptMake += "\n"
if !attr.SkipCheck && presetOpts&OptSkipCheck == 0 { if !attr.SkipCheck && s.opts&OptSkipCheck == 0 {
scriptMake += attr.ScriptCheckEarly + `make \ scriptMake += attr.ScriptCheckEarly + `make \
` + jobsFlagE + ` \ ` + jobsFlagE + ` \
` `

View File

@@ -6,12 +6,12 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newLibglvnd() (pkg.Artifact, string) { func (t Toolchain) newLibglvnd(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.7.0" version = "1.7.0"
checksum = "eIQJK2sgFQDHdeFkQO87TrSUaZRFG4y2DrwA8Ut-sGboI59uw1OOiIVqq2AIwnGY" checksum = "eIQJK2sgFQDHdeFkQO87TrSUaZRFG4y2DrwA8Ut-sGboI59uw1OOiIVqq2AIwnGY"
) )
return t.NewPackage("libglvnd", version, newFromGitLab( return s.NewPackage(t, "libglvnd", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"glvnd/libglvnd", "glvnd/libglvnd",
"v"+version, "v"+version,
@@ -35,7 +35,7 @@ trap 'kill $XVFB_PID && wait $XVFB_PID' EXIT
), version ), version
} }
func init() { func init() {
artifactsM[Libglvnd] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibglvnd, f: Toolchain.newLibglvnd,
Name: "libglvnd", Name: "libglvnd",
@@ -47,15 +47,15 @@ func init() {
}, },
ID: 12098, ID: 12098,
} })
} }
func (t Toolchain) newLibdrm() (pkg.Artifact, string) { func (t Toolchain) newLibdrm(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.4.133" version = "2.4.133"
checksum = "bfj296NcR9DndO11hqDbSRFPqaweSLMqRk3dlCPZpM6FONX1WZ9J4JdbTDMUd1rU" checksum = "bfj296NcR9DndO11hqDbSRFPqaweSLMqRk3dlCPZpM6FONX1WZ9J4JdbTDMUd1rU"
) )
return t.NewPackage("libdrm", version, newFromGitLab( return s.NewPackage(t, "libdrm", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"mesa/libdrm", "mesa/libdrm",
"libdrm-"+version, "libdrm-"+version,
@@ -72,7 +72,7 @@ func (t Toolchain) newLibdrm() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Libdrm] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibdrm, f: Toolchain.newLibdrm,
Name: "libdrm", Name: "libdrm",
@@ -84,15 +84,15 @@ func init() {
}, },
ID: 1596, ID: 1596,
} })
} }
func (t Toolchain) newLibva() (pkg.Artifact, string) { func (t Toolchain) newLibva(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.23.0" version = "2.23.0"
checksum = "UmF5tPyWIG_w5kiR3KFpoYbF7UUcaak5tyc-RhOheNTwQlLkPlifreFYCM9FQxbq" checksum = "UmF5tPyWIG_w5kiR3KFpoYbF7UUcaak5tyc-RhOheNTwQlLkPlifreFYCM9FQxbq"
) )
return t.NewPackage("libva", version, newFromGitHub( return s.NewPackage(t, "libva", version, newFromGitHub(
"intel/libva", "intel/libva",
version, version,
checksum, checksum,
@@ -111,7 +111,7 @@ func (t Toolchain) newLibva() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Libva] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibva, f: Toolchain.newLibva,
Name: "libva", Name: "libva",
@@ -126,15 +126,15 @@ func init() {
}, },
ID: 1752, ID: 1752,
} })
} }
func (t Toolchain) newMesa() (pkg.Artifact, string) { func (t Toolchain) newMesa(s *S) (pkg.Artifact, string) {
const ( const (
version = "26.1.0" version = "26.1.0"
checksum = "zU0fjqevySBaoi_5SLW3e2UffmGeBdxOuHmAHTH68n2hV-sjYoqg30koLqFXuk5y" checksum = "zU0fjqevySBaoi_5SLW3e2UffmGeBdxOuHmAHTH68n2hV-sjYoqg30koLqFXuk5y"
) )
return t.NewPackage("mesa", version, newFromGitLab( return s.NewPackage(t, "mesa", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"mesa/mesa", "mesa/mesa",
"mesa-"+version, "mesa-"+version,
@@ -238,7 +238,7 @@ func (t Toolchain) newMesa() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Mesa] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newMesa, f: Toolchain.newMesa,
Name: "mesa", Name: "mesa",
@@ -261,5 +261,5 @@ func init() {
ID: 1970, ID: 1970,
latest: (*Versions).getStable, latest: (*Versions).getStable,
} })
} }

View File

@@ -7,12 +7,12 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newMeson() (pkg.Artifact, string) { func (t Toolchain) newMeson(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.11.1" version = "1.11.1"
checksum = "uvILRxdopwc6Dy17UbIeClcQr0qHqyTaqyk1M9OqWKN9PwB9N6UVAiyN8kSSz3r2" checksum = "uvILRxdopwc6Dy17UbIeClcQr0qHqyTaqyk1M9OqWKN9PwB9N6UVAiyN8kSSz3r2"
) )
return t.NewPackage("meson", version, newFromGitHub( return s.NewPackage(t, "meson", version, newFromGitHub(
"mesonbuild/meson", "mesonbuild/meson",
version, version,
checksum, checksum,
@@ -52,7 +52,7 @@ python3 ./run_project_tests.py \
), version ), version
} }
func init() { func init() {
artifactsM[Meson] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newMeson, f: Toolchain.newMeson,
Name: "meson", Name: "meson",
@@ -67,7 +67,7 @@ func init() {
}, },
ID: 6472, ID: 6472,
} })
} }
// MesonHelper is the [Meson] build system helper. // MesonHelper is the [Meson] build system helper.
@@ -106,7 +106,7 @@ func (*MesonHelper) createDir() bool { return false }
func (*MesonHelper) wantsDir() string { return `"$(mktemp -d)"` } func (*MesonHelper) wantsDir() string { return `"$(mktemp -d)"` }
// script generates the cure script. // script generates the cure script.
func (attr *MesonHelper) script(name string) string { func (attr *MesonHelper) script(s *S, name string) string {
if attr == nil { if attr == nil {
attr = new(MesonHelper) attr = new(MesonHelper)
} }
@@ -117,7 +117,7 @@ func (attr *MesonHelper) script(name string) string {
} }
var scriptTest string var scriptTest string
if !attr.SkipTest && presetOpts&OptSkipCheck == 0 { if !attr.SkipTest && s.opts&OptSkipCheck == 0 {
scriptTest = ` scriptTest = `
meson test \ meson test \
--print-errorlogs` --print-errorlogs`

View File

@@ -2,16 +2,16 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newMksh() (pkg.Artifact, string) { func (t Toolchain) newMksh(s *S) (pkg.Artifact, string) {
const ( const (
version = "59c" version = "59c"
checksum = "0Zj-k4nXEu3IuJY4lvwD2OrC2t27GdZj8SPy4DoaeuBRH1padWb7oREpYgwY8JNq" checksum = "0Zj-k4nXEu3IuJY4lvwD2OrC2t27GdZj8SPy4DoaeuBRH1padWb7oREpYgwY8JNq"
) )
scriptTest := "./test.sh -C regress:no-ctty\n" scriptTest := "./test.sh -C regress:no-ctty\n"
if presetOpts&OptSkipCheck != 0 { if s.opts&OptSkipCheck != 0 {
scriptTest = "" scriptTest = ""
} }
return t.New("mksh-"+version, 0, t.AppendPresets(nil, return s.New(t, "mksh-"+version, 0, s.AppendPresets(t, nil,
Perl, Perl,
Coreutils, Coreutils,
), nil, []string{ ), nil, []string{
@@ -36,7 +36,7 @@ ln -vs ../system/bin/sh /work/bin/
))), version ))), version
} }
func init() { func init() {
artifactsM[Mksh] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newMksh, f: Toolchain.newMksh,
Name: "mksh", Name: "mksh",
@@ -44,5 +44,5 @@ func init() {
Website: "https://www.mirbsd.org/mksh", Website: "https://www.mirbsd.org/mksh",
ID: 5590, ID: 5590,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newMuslFts() (pkg.Artifact, string) { func (t Toolchain) newMuslFts(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.2.7" version = "1.2.7"
checksum = "N_p_ZApX3eHt7xoDCw1hLf6XdJOw7ZSx7xPvpvAP0knG2zgU0zeN5w8tt5Pg60XJ" checksum = "N_p_ZApX3eHt7xoDCw1hLf6XdJOw7ZSx7xPvpvAP0knG2zgU0zeN5w8tt5Pg60XJ"
) )
return t.NewPackage("musl-fts", version, newFromGitHub( return s.NewPackage(t, "musl-fts", version, newFromGitHub(
"void-linux/musl-fts", "void-linux/musl-fts",
"v"+version, "v"+version,
checksum, checksum,
@@ -24,7 +24,7 @@ func (t Toolchain) newMuslFts() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[MuslFts] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newMuslFts, f: Toolchain.newMuslFts,
Name: "musl-fts", Name: "musl-fts",
@@ -32,5 +32,5 @@ func init() {
Website: "https://github.com/void-linux/musl-fts", Website: "https://github.com/void-linux/musl-fts",
ID: 26980, ID: 26980,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newMuslObstack() (pkg.Artifact, string) { func (t Toolchain) newMuslObstack(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.2.3" version = "1.2.3"
checksum = "tVRY_KjIlkkMszcaRlkKdBVQHIXTT_T_TiMxbwErlILXrOBosocg8KklppZhNdCG" checksum = "tVRY_KjIlkkMszcaRlkKdBVQHIXTT_T_TiMxbwErlILXrOBosocg8KklppZhNdCG"
) )
return t.NewPackage("musl-obstack", version, newFromGitHub( return s.NewPackage(t, "musl-obstack", version, newFromGitHub(
"void-linux/musl-obstack", "void-linux/musl-obstack",
"v"+version, "v"+version,
checksum, checksum,
@@ -24,7 +24,7 @@ func (t Toolchain) newMuslObstack() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[MuslObstack] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newMuslObstack, f: Toolchain.newMuslObstack,
Name: "musl-obstack", Name: "musl-obstack",
@@ -32,5 +32,5 @@ func init() {
Website: "https://github.com/void-linux/musl-obstack", Website: "https://github.com/void-linux/musl-obstack",
ID: 146206, ID: 146206,
} })
} }

View File

@@ -2,7 +2,7 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newMusl(headers bool) (pkg.Artifact, string) { func (s *S) newMusl(t Toolchain, headers bool) (pkg.Artifact, string) {
const ( const (
version = "1.2.6" version = "1.2.6"
checksum = "WtWb_OV_XxLDAB5NerOL9loLlHVadV00MmGk65PPBU1evaolagoMHfvpZp_vxEzS" checksum = "WtWb_OV_XxLDAB5NerOL9loLlHVadV00MmGk65PPBU1evaolagoMHfvpZp_vxEzS"
@@ -14,7 +14,7 @@ func (t Toolchain) newMusl(headers bool) (pkg.Artifact, string) {
SkipCheck: true, SkipCheck: true,
Script: ` Script: `
mkdir -p /work/system/bin mkdir -p /work/system/bin
COMPAT_LINKER_NAME="ld-musl-` + linuxArch() + `.so.1" COMPAT_LINKER_NAME="ld-musl-` + s.linuxArch() + `.so.1"
ln -vs ../lib/libc.so /work/system/bin/linker ln -vs ../lib/libc.so /work/system/bin/linker
ln -vs ../lib/libc.so /work/system/bin/ldd ln -vs ../lib/libc.so /work/system/bin/ldd
ln -vs libc.so "/work/system/lib/${COMPAT_LINKER_NAME}" ln -vs libc.so "/work/system/lib/${COMPAT_LINKER_NAME}"
@@ -34,7 +34,7 @@ rmdir -v /work/lib
} }
env := []string{ env := []string{
"LDFLAGS=" + earlyLDFLAGS(false), "LDFLAGS=" + s.earlyLDFLAGS(false),
} }
if t.isStage0() { if t.isStage0() {
env = append(env, env = append(env,
@@ -44,7 +44,7 @@ rmdir -v /work/lib
) )
} }
return t.NewPackage(name, version, newTar( return s.NewPackage(t, name, version, newTar(
"https://musl.libc.org/releases/musl-"+version+".tar.gz", "https://musl.libc.org/releases/musl-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -75,9 +75,9 @@ index 715948f4..c2fece68 100644
), version ), version
} }
func init() { func init() {
artifactsM[Musl] = Metadata{ native.MustRegister(&Artifact{
f: func(t Toolchain) (pkg.Artifact, string) { f: func(t Toolchain, s *S) (pkg.Artifact, string) {
return t.newMusl(false) return s.newMusl(t, false)
}, },
Name: "musl", Name: "musl",
@@ -85,14 +85,14 @@ func init() {
Website: "https://musl.libc.org/", Website: "https://musl.libc.org/",
ID: 11688, ID: 11688,
} })
artifactsM[muslHeaders] = Metadata{ native.MustRegister(&Artifact{
f: func(t Toolchain) (pkg.Artifact, string) { f: func(t Toolchain, s *S) (pkg.Artifact, string) {
return t.newMusl(true) return s.newMusl(t, true)
}, },
Name: "musl-headers", Name: "musl-headers",
Description: "system installation of musl headers", Description: "system installation of musl headers",
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newNcurses() (pkg.Artifact, string) { func (t Toolchain) newNcurses(s *S) (pkg.Artifact, string) {
const ( const (
version = "6.6" version = "6.6"
checksum = "XvWp4xi6hR_hH8XUoGY26L_pqBSDapJYulhzZqPuR0KNklqypqNc1yNXU-nOjf5w" checksum = "XvWp4xi6hR_hH8XUoGY26L_pqBSDapJYulhzZqPuR0KNklqypqNc1yNXU-nOjf5w"
) )
return t.NewPackage("ncurses", version, newTar( return s.NewPackage(t, "ncurses", version, newTar(
"https://ftpmirror.gnu.org/gnu/ncurses/ncurses-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/ncurses/ncurses-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -26,7 +26,7 @@ func (t Toolchain) newNcurses() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Ncurses] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newNcurses, f: Toolchain.newNcurses,
Name: "ncurses", Name: "ncurses",
@@ -34,5 +34,5 @@ func init() {
Website: "https://invisible-island.net/ncurses/", Website: "https://invisible-island.net/ncurses/",
ID: 373226, ID: 373226,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newLibmnl() (pkg.Artifact, string) { func (t Toolchain) newLibmnl(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.0.5" version = "1.0.5"
checksum = "DN-vbbvQDpxXJm0TJ6xlluILvfrB86avrCTX50XyE9SEFSAZ_o8nuKc5Gu0Am7-u" checksum = "DN-vbbvQDpxXJm0TJ6xlluILvfrB86avrCTX50XyE9SEFSAZ_o8nuKc5Gu0Am7-u"
) )
return t.NewPackage("libmnl", version, newTar( return s.NewPackage(t, "libmnl", version, newTar(
"https://www.netfilter.org/projects/libmnl/files/"+ "https://www.netfilter.org/projects/libmnl/files/"+
"libmnl-"+version+".tar.bz2", "libmnl-"+version+".tar.bz2",
checksum, checksum,
@@ -39,7 +39,7 @@ index d223ac2..a7878d0 100644
), version ), version
} }
func init() { func init() {
artifactsM[Libmnl] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibmnl, f: Toolchain.newLibmnl,
Name: "libmnl", Name: "libmnl",
@@ -47,15 +47,15 @@ func init() {
Website: "https://www.netfilter.org/projects/libmnl/", Website: "https://www.netfilter.org/projects/libmnl/",
ID: 1663, ID: 1663,
} })
} }
func (t Toolchain) newLibnftnl() (pkg.Artifact, string) { func (t Toolchain) newLibnftnl(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.3.1" version = "1.3.1"
checksum = "91ou66K-I17iX6DB6hiQkhhC_v4DFW5iDGzwjVRNbJNEmKqowLZBlh3FY-ZDO0r9" checksum = "91ou66K-I17iX6DB6hiQkhhC_v4DFW5iDGzwjVRNbJNEmKqowLZBlh3FY-ZDO0r9"
) )
return t.NewPackage("libnftnl", version, t.newTagRemote( return s.NewPackage(t, "libnftnl", version, s.newTagRemote(t,
"https://git.netfilter.org/libnftnl", "https://git.netfilter.org/libnftnl",
"libnftnl-"+version, checksum, "libnftnl-"+version, checksum,
), &PackageAttr{ ), &PackageAttr{
@@ -77,7 +77,7 @@ func (t Toolchain) newLibnftnl() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Libnftnl] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibnftnl, f: Toolchain.newLibnftnl,
Name: "libnftnl", Name: "libnftnl",
@@ -89,15 +89,15 @@ func init() {
}, },
ID: 1681, ID: 1681,
} })
} }
func (t Toolchain) newIPTables() (pkg.Artifact, string) { func (t Toolchain) newIPTables(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.8.13" version = "1.8.13"
checksum = "TUA-cFIAsiMvtRR-XzQvXzoIhJUOc9J2gQDJCbBRjmgmVfGfPTCf58wL7e-cUKVQ" checksum = "TUA-cFIAsiMvtRR-XzQvXzoIhJUOc9J2gQDJCbBRjmgmVfGfPTCf58wL7e-cUKVQ"
) )
return t.NewPackage("iptables", version, t.newTagRemote( return s.NewPackage(t, "iptables", version, s.newTagRemote(t,
"https://git.netfilter.org/iptables", "https://git.netfilter.org/iptables",
"v"+version, checksum, "v"+version, checksum,
), &PackageAttr{ ), &PackageAttr{
@@ -131,7 +131,7 @@ chmod +w /etc/ && ln -s ../usr/src/iptables/etc/ethertypes /etc/
), version ), version
} }
func init() { func init() {
artifactsM[IPTables] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newIPTables, f: Toolchain.newIPTables,
Name: "iptables", Name: "iptables",
@@ -143,5 +143,5 @@ func init() {
}, },
ID: 1394, ID: 1394,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newNettle() (pkg.Artifact, string) { func (t Toolchain) newNettle(s *S) (pkg.Artifact, string) {
const ( const (
version = "4.0" version = "4.0"
checksum = "6agC-vHzzoqAlaX3K9tX8yHgrm03HLqPZzVzq8jh_ePbuPMIvpxereu_uRJFmQK7" checksum = "6agC-vHzzoqAlaX3K9tX8yHgrm03HLqPZzVzq8jh_ePbuPMIvpxereu_uRJFmQK7"
) )
return t.NewPackage("nettle", version, newTar( return s.NewPackage(t, "nettle", version, newTar(
"https://ftpmirror.gnu.org/gnu/nettle/nettle-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/nettle/nettle-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -19,7 +19,7 @@ func (t Toolchain) newNettle() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Nettle] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newNettle, f: Toolchain.newNettle,
Name: "nettle", Name: "nettle",
@@ -31,5 +31,5 @@ func init() {
}, },
ID: 2073, ID: 2073,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newNettle3() (pkg.Artifact, string) { func (t Toolchain) newNettle3(s *S) (pkg.Artifact, string) {
const ( const (
version = "3.10.2" version = "3.10.2"
checksum = "07aXlj10X5llf67jIqRQAA1pgLSgb0w_JYggZVPuKNoc-B-_usb5Kr8FrfBe7g1S" checksum = "07aXlj10X5llf67jIqRQAA1pgLSgb0w_JYggZVPuKNoc-B-_usb5Kr8FrfBe7g1S"
) )
return t.NewPackage("nettle", version, newTar( return s.NewPackage(t, "nettle", version, newTar(
"https://ftpmirror.gnu.org/gnu/nettle/nettle-"+version+".tar.gz", "https://ftpmirror.gnu.org/gnu/nettle/nettle-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -19,7 +19,7 @@ func (t Toolchain) newNettle3() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[nettle3] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newNettle3, f: Toolchain.newNettle3,
Name: "nettle3", Name: "nettle3",
@@ -29,5 +29,5 @@ func init() {
Dependencies: P{ Dependencies: P{
GMP, GMP,
}, },
} })
} }

View File

@@ -2,14 +2,16 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newNinja() (pkg.Artifact, string) { func (t Toolchain) newNinja(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.13.2" version = "1.13.2"
checksum = "ygKWMa0YV2lWKiFro5hnL-vcKbc_-RACZuPu0Io8qDvgQlZ0dxv7hPNSFkt4214v" checksum = "ygKWMa0YV2lWKiFro5hnL-vcKbc_-RACZuPu0Io8qDvgQlZ0dxv7hPNSFkt4214v"
) )
return t.New("ninja-"+version, 0, []pkg.Artifact{ python, _ := s.Load(t, Python)
t.Load(Python), bash, _ := s.Load(t, Bash)
t.Load(Bash), return s.New(t, "ninja-"+version, 0, []pkg.Artifact{
python,
bash,
}, nil, nil, ` }, nil, nil, `
cd "$(mktemp -d)" cd "$(mktemp -d)"
python3 /usr/src/ninja/configure.py \ python3 /usr/src/ninja/configure.py \
@@ -28,7 +30,7 @@ cp ninja /work/system/bin/
"googletest-1.16.0.tar.gz", "googletest-1.16.0.tar.gz",
"NjLGvSbgPy_B-y-o1hdanlzEzaYeStFcvFGxpYV3KYlhrWWFRcugYhM3ZMzOA9B_", "NjLGvSbgPy_B-y-o1hdanlzEzaYeStFcvFGxpYV3KYlhrWWFRcugYhM3ZMzOA9B_",
pkg.TarGzip, pkg.TarGzip,
)), pkg.Path(AbsUsrSrc.Append("ninja"), true, t.NewPatchedSource( )), pkg.Path(AbsUsrSrc.Append("ninja"), true, s.NewPatchedSource(t,
"ninja", version, newFromGitHub( "ninja", version, newFromGitHub(
"ninja-build/ninja", "ninja-build/ninja",
"v"+version, "v"+version,
@@ -37,7 +39,7 @@ cp ninja /work/system/bin/
))), version ))), version
} }
func init() { func init() {
artifactsM[Ninja] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newNinja, f: Toolchain.newNinja,
Name: "ninja", Name: "ninja",
@@ -45,5 +47,5 @@ func init() {
Website: "https://ninja-build.org/", Website: "https://ninja-build.org/",
ID: 2089, ID: 2089,
} })
} }

View File

@@ -6,7 +6,7 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newNSS() (pkg.Artifact, string) { func (t Toolchain) newNSS(s *S) (pkg.Artifact, string) {
const ( const (
version = "3.123.1" version = "3.123.1"
checksum = "g811Z_fc74ssg-s6BeXRG-ipSfJggD6hrxjVJxrOBIz98CE7piv0OLwzIRLMQpwR" checksum = "g811Z_fc74ssg-s6BeXRG-ipSfJggD6hrxjVJxrOBIz98CE7piv0OLwzIRLMQpwR"
@@ -14,7 +14,7 @@ func (t Toolchain) newNSS() (pkg.Artifact, string) {
version0 = "4_38_2" version0 = "4_38_2"
checksum0 = "25x2uJeQnOHIiq_zj17b4sYqKgeoU8-IsySUptoPcdHZ52PohFZfGuIisBreWzx0" checksum0 = "25x2uJeQnOHIiq_zj17b4sYqKgeoU8-IsySUptoPcdHZ52PohFZfGuIisBreWzx0"
) )
return t.NewPackage("nss", version, newFromGitHub( return s.NewPackage(t, "nss", version, newFromGitHub(
"nss-dev/nss", "nss-dev/nss",
"NSS_"+strings.Join(strings.SplitN(version, ".", 3), "_")+"_RTM", "NSS_"+strings.Join(strings.SplitN(version, ".", 3), "_")+"_RTM",
checksum, checksum,
@@ -67,7 +67,7 @@ cp -r \
), version ), version
} }
func init() { func init() {
artifactsM[NSS] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newNSS, f: Toolchain.newNSS,
Name: "nss", Name: "nss",
@@ -79,7 +79,7 @@ func init() {
}, },
ID: 2503, ID: 2503,
} })
} }
func init() { func init() {
@@ -87,7 +87,7 @@ func init() {
version = "0.5.1" version = "0.5.1"
checksum = "oxjnuIrPVMPvD6x8VFLqB7EdbfuhouGQdtPuHDpEHGzoyH5nkxqtYN9UthMY9noA" checksum = "oxjnuIrPVMPvD6x8VFLqB7EdbfuhouGQdtPuHDpEHGzoyH5nkxqtYN9UthMY9noA"
) )
artifactsM[buildcatrust] = newPythonPackage( native.newPythonPackage(
"buildcatrust", 233988, "buildcatrust", 233988,
"transform certificate stores between formats", "transform certificate stores between formats",
"https://github.com/nix-community/buildcatrust", "https://github.com/nix-community/buildcatrust",
@@ -102,8 +102,8 @@ rm buildcatrust/tests/test_nonhermetic.py
) )
} }
func (t Toolchain) newNSSCACert() (pkg.Artifact, string) { func (t Toolchain) newNSSCACert(s *S) (pkg.Artifact, string) {
return t.New("nss-cacert", 0, t.AppendPresets(nil, return s.New(t, "nss-cacert", 0, s.AppendPresets(t, nil,
Bash, Bash,
NSS, NSS,
@@ -120,11 +120,11 @@ buildcatrust \
`), Unversioned `), Unversioned
} }
func init() { func init() {
artifactsM[NSSCACert] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newNSSCACert, 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

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newOpenSSL() (pkg.Artifact, string) { func (t Toolchain) newOpenSSL(s *S) (pkg.Artifact, string) {
const ( const (
version = "3.6.2" version = "3.6.2"
checksum = "jH004dXTiE01Hp0kyShkWXwrSHEksZi4i_3v47D9H9Uz9LQ1aMwF7mrl2Tb4t_XA" checksum = "jH004dXTiE01Hp0kyShkWXwrSHEksZi4i_3v47D9H9Uz9LQ1aMwF7mrl2Tb4t_XA"
) )
return t.NewPackage("openssl", version, newFromGitHubRelease( return s.NewPackage(t, "openssl", version, newFromGitHubRelease(
"openssl/openssl", "openssl/openssl",
"openssl-"+version, "openssl-"+version,
"openssl-"+version+".tar.gz", "openssl-"+version+".tar.gz",
@@ -40,7 +40,7 @@ func (t Toolchain) newOpenSSL() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[OpenSSL] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newOpenSSL, f: Toolchain.newOpenSSL,
Name: "openssl", Name: "openssl",
@@ -51,5 +51,5 @@ func init() {
// strange malformed tags treated as pre-releases in Anitya // strange malformed tags treated as pre-releases in Anitya
latest: (*Versions).getStable, latest: (*Versions).getStable,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newP11Kit() (pkg.Artifact, string) { func (t Toolchain) newP11Kit(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.26.2" version = "0.26.2"
checksum = "3ei-6DUVtYzrRVe-SubtNgRlweXd6H2qHmUu-_5qVyIn6gSTvZbGS2u79Y8IFb2N" checksum = "3ei-6DUVtYzrRVe-SubtNgRlweXd6H2qHmUu-_5qVyIn6gSTvZbGS2u79Y8IFb2N"
) )
return t.NewPackage("p11-kit", version, t.newTagRemote( return s.NewPackage(t, "p11-kit", version, s.newTagRemote(t,
"https://github.com/p11-glue/p11-kit.git", "https://github.com/p11-glue/p11-kit.git",
version, checksum, version, checksum,
), nil, &MesonHelper{ ), nil, &MesonHelper{
@@ -23,7 +23,7 @@ func (t Toolchain) newP11Kit() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[P11Kit] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newP11Kit, f: Toolchain.newP11Kit,
Name: "p11-kit", Name: "p11-kit",
@@ -36,5 +36,5 @@ func init() {
}, },
ID: 2582, ID: 2582,
} })
} }

View File

@@ -4,12 +4,12 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newPCRE2() (pkg.Artifact, string) { func (t Toolchain) newPCRE2(s *S) (pkg.Artifact, string) {
const ( const (
version = "10.47" version = "10.47"
checksum = "IbC24vVayju6nB9EhrBPSDexk22wDecdpyrjgC3nCZXkwTnUjq4CD2q5sopqu6CW" checksum = "IbC24vVayju6nB9EhrBPSDexk22wDecdpyrjgC3nCZXkwTnUjq4CD2q5sopqu6CW"
) )
return t.NewPackage("pcre2", version, newFromGitHubRelease( return s.NewPackage(t, "pcre2", version, newFromGitHubRelease(
"PCRE2Project/pcre2", "PCRE2Project/pcre2",
"pcre2-"+version, "pcre2-"+version,
"pcre2-"+version+".tar.bz2", "pcre2-"+version+".tar.bz2",
@@ -32,7 +32,7 @@ ln -s ../system/bin/toybox /bin/echo
), version ), version
} }
func init() { func init() {
artifactsM[PCRE2] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPCRE2, f: Toolchain.newPCRE2,
Name: "pcre2", Name: "pcre2",
@@ -40,5 +40,5 @@ func init() {
Website: "https://pcre2project.github.io/pcre2/", Website: "https://pcre2project.github.io/pcre2/",
ID: 5832, ID: 5832,
} })
} }

View File

@@ -7,12 +7,12 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newPerl() (pkg.Artifact, string) { func (t Toolchain) newPerl(s *S) (pkg.Artifact, string) {
const ( const (
version = "5.42.2" version = "5.42.2"
checksum = "Me_xFfgkRnVyG0sE6a74TktK2OUq9Z1LVJNEu_9RdZG3S2fbjfzNiuk2SJqHAgbm" checksum = "Me_xFfgkRnVyG0sE6a74TktK2OUq9Z1LVJNEu_9RdZG3S2fbjfzNiuk2SJqHAgbm"
) )
return t.NewPackage("perl", version, newTar( return s.NewPackage(t, "perl", version, newTar(
"https://www.cpan.org/src/5.0/perl-"+version+".tar.gz", "https://www.cpan.org/src/5.0/perl-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -50,7 +50,7 @@ chmod +w /system/bin && rm -f /system/bin/ps # perl does not like toybox ps
}), version }), version
} }
func init() { func init() {
artifactsM[Perl] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPerl, f: Toolchain.newPerl,
Name: "perl", Name: "perl",
@@ -61,20 +61,21 @@ func init() {
// odd-even versioning // odd-even versioning
latest: (*Versions).getStable, latest: (*Versions).getStable,
} })
} }
// newViaPerlModuleBuild installs a perl module via Build.PL. // newViaPerlModuleBuild installs a perl module via Build.PL.
func (t Toolchain) newViaPerlModuleBuild( func (s *S) newViaPerlModuleBuild(
t Toolchain,
name, version string, name, version string,
source pkg.Artifact, source pkg.Artifact,
patches []KV, patches []KV,
extra ...PArtifact, extra ...ArtifactH,
) pkg.Artifact { ) pkg.Artifact {
if name == "" || version == "" { if name == "" || version == "" {
panic("names must be non-empty") panic("names must be non-empty")
} }
return t.New("perl-"+name, 0, t.AppendPresets(nil, return s.New(t, "perl-"+name, 0, s.AppendPresets(t, nil,
slices.Concat(P{Perl}, extra)..., slices.Concat(P{Perl}, extra)...,
), nil, nil, ` ), nil, nil, `
cd /usr/src/`+name+` cd /usr/src/`+name+`
@@ -82,17 +83,17 @@ perl Build.PL --prefix=/system
./Build build ./Build build
./Build test ./Build test
./Build install --destdir=/work ./Build install --destdir=/work
`, pkg.Path(AbsUsrSrc.Append(name), true, t.NewPatchedSource( `, pkg.Path(AbsUsrSrc.Append(name), true, s.NewPatchedSource(t,
"perl-"+name, version, source, false, patches..., "perl-"+name, version, source, false, patches...,
))) )))
} }
func (t Toolchain) newPerlModuleBuild() (pkg.Artifact, string) { func (t Toolchain) newPerlModuleBuild(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.4234" version = "0.4234"
checksum = "ZKxEFG4hE1rqZt52zBL2LRZBMkYzhjb5-cTBXcsyA52EbPeeYyVxU176yAea8-Di" checksum = "ZKxEFG4hE1rqZt52zBL2LRZBMkYzhjb5-cTBXcsyA52EbPeeYyVxU176yAea8-Di"
) )
return t.newViaPerlModuleBuild("Module-Build", version, newTar( return s.newViaPerlModuleBuild(t, "Module-Build", version, newTar(
"https://cpan.metacpan.org/authors/id/L/LE/LEONT/"+ "https://cpan.metacpan.org/authors/id/L/LE/LEONT/"+
"Module-Build-"+version+".tar.gz", "Module-Build-"+version+".tar.gz",
checksum, checksum,
@@ -100,7 +101,7 @@ func (t Toolchain) newPerlModuleBuild() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
artifactsM[PerlModuleBuild] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPerlModuleBuild, f: Toolchain.newPerlModuleBuild,
Name: "perl-Module::Build", Name: "perl-Module::Build",
@@ -110,17 +111,18 @@ func init() {
Dependencies: P{ Dependencies: P{
Perl, Perl,
}, },
} })
} }
// newViaPerlMakeMaker installs a perl module via Makefile.PL. // newViaPerlMakeMaker installs a perl module via Makefile.PL.
func (t Toolchain) newViaPerlMakeMaker( func (s *S) newViaPerlMakeMaker(
t Toolchain,
name, version string, name, version string,
source pkg.Artifact, source pkg.Artifact,
patches []KV, patches []KV,
extra ...PArtifact, extra ...ArtifactH,
) pkg.Artifact { ) pkg.Artifact {
return t.NewPackage("perl-"+name, version, source, &PackageAttr{ return s.NewPackage(t, "perl-"+name, version, source, &PackageAttr{
// uses source tree as scratch space // uses source tree as scratch space
Writable: true, Writable: true,
Chmod: true, Chmod: true,
@@ -141,12 +143,12 @@ func (t Toolchain) newViaPerlMakeMaker(
})...) })...)
} }
func (t Toolchain) newPerlLocaleGettext() (pkg.Artifact, string) { func (t Toolchain) newPerlLocaleGettext(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.07" version = "1.07"
checksum = "cFq4BKFD1MWSoa7lsrPjpdo9kzPqd0jlRcBFUyL1L1isw8m3D_Sge_ff0MAu_9J3" checksum = "cFq4BKFD1MWSoa7lsrPjpdo9kzPqd0jlRcBFUyL1L1isw8m3D_Sge_ff0MAu_9J3"
) )
return t.newViaPerlMakeMaker("Locale::gettext", version, newFromCPAN( return s.newViaPerlMakeMaker(t, "Locale::gettext", version, newFromCPAN(
"PVANDRY", "PVANDRY",
"Locale-gettext", "Locale-gettext",
version, version,
@@ -154,7 +156,7 @@ func (t Toolchain) newPerlLocaleGettext() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
artifactsM[PerlLocaleGettext] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPerlLocaleGettext, f: Toolchain.newPerlLocaleGettext,
Name: "perl-Locale::gettext", Name: "perl-Locale::gettext",
@@ -162,15 +164,15 @@ func init() {
Website: "https://metacpan.org/release/Locale-gettext", Website: "https://metacpan.org/release/Locale-gettext",
ID: 7523, ID: 7523,
} })
} }
func (t Toolchain) newPerlPodParser() (pkg.Artifact, string) { func (t Toolchain) newPerlPodParser(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.67" version = "1.67"
checksum = "RdURu9mOfExk_loCp6abxlcQV3FycSNbTqhRS9i6JUqnYfGGEgercK30g0gjYyqe" checksum = "RdURu9mOfExk_loCp6abxlcQV3FycSNbTqhRS9i6JUqnYfGGEgercK30g0gjYyqe"
) )
return t.newViaPerlMakeMaker("Pod::Parser", version, newFromCPAN( return s.newViaPerlMakeMaker(t, "Pod::Parser", version, newFromCPAN(
"MAREKR", "MAREKR",
"Pod-Parser", "Pod-Parser",
version, version,
@@ -178,7 +180,7 @@ func (t Toolchain) newPerlPodParser() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
artifactsM[PerlPodParser] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPerlPodParser, f: Toolchain.newPerlPodParser,
Name: "perl-Pod::Parser", Name: "perl-Pod::Parser",
@@ -186,15 +188,15 @@ func init() {
Website: "https://metacpan.org/release/Pod-Parser", Website: "https://metacpan.org/release/Pod-Parser",
ID: 3244, ID: 3244,
} })
} }
func (t Toolchain) newPerlSGMLS() (pkg.Artifact, string) { func (t Toolchain) newPerlSGMLS(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.1" version = "1.1"
checksum = "aZijn4MUqD-wfyZgdcCruCwl4SgDdu25cNmJ4_UvdAk9a7uz4gzMQdoeB6DQ6QOy" checksum = "aZijn4MUqD-wfyZgdcCruCwl4SgDdu25cNmJ4_UvdAk9a7uz4gzMQdoeB6DQ6QOy"
) )
return t.newViaPerlMakeMaker("SGMLS", version, newFromCPAN( return s.newViaPerlMakeMaker(t, "SGMLS", version, newFromCPAN(
"RAAB", "RAAB",
"SGMLSpm", "SGMLSpm",
version, version,
@@ -202,7 +204,7 @@ func (t Toolchain) newPerlSGMLS() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
artifactsM[PerlSGMLS] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPerlSGMLS, f: Toolchain.newPerlSGMLS,
Name: "perl-SGMLS", Name: "perl-SGMLS",
@@ -224,15 +226,15 @@ func init() {
} }
return v.Latest return v.Latest
}, },
} })
} }
func (t Toolchain) newPerlTermReadKey() (pkg.Artifact, string) { func (t Toolchain) newPerlTermReadKey(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.38" version = "2.38"
checksum = "qerL8Xo7kD0f42PZoiEbmE8Roc_S9pOa27LXelY4DN_0UNy_u5wLrGHI8utNlaiI" checksum = "qerL8Xo7kD0f42PZoiEbmE8Roc_S9pOa27LXelY4DN_0UNy_u5wLrGHI8utNlaiI"
) )
return t.newViaPerlMakeMaker("Term::ReadKey", version, newFromCPAN( return s.newViaPerlMakeMaker(t, "Term::ReadKey", version, newFromCPAN(
"JSTOWE", "JSTOWE",
"TermReadKey", "TermReadKey",
version, version,
@@ -240,7 +242,7 @@ func (t Toolchain) newPerlTermReadKey() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
artifactsM[PerlTermReadKey] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPerlTermReadKey, f: Toolchain.newPerlTermReadKey,
Name: "perl-Term::ReadKey", Name: "perl-Term::ReadKey",
@@ -248,15 +250,15 @@ func init() {
Website: "https://metacpan.org/release/TermReadKey", Website: "https://metacpan.org/release/TermReadKey",
ID: 3372, ID: 3372,
} })
} }
func (t Toolchain) newPerlTextCharWidth() (pkg.Artifact, string) { func (t Toolchain) newPerlTextCharWidth(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.04" version = "0.04"
checksum = "G2p5RHU4_HiZ23ZusBA_enTlVMxz0J4esUx4CGcOPhY6xYTbp-aXWRN6lYZpzBw2" checksum = "G2p5RHU4_HiZ23ZusBA_enTlVMxz0J4esUx4CGcOPhY6xYTbp-aXWRN6lYZpzBw2"
) )
return t.newViaPerlMakeMaker("Text::CharWidth", version, newFromCPAN( return s.newViaPerlMakeMaker(t, "Text::CharWidth", version, newFromCPAN(
"KUBOTA", "KUBOTA",
"Text-CharWidth", "Text-CharWidth",
version, version,
@@ -264,7 +266,7 @@ func (t Toolchain) newPerlTextCharWidth() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
artifactsM[PerlTextCharWidth] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPerlTextCharWidth, f: Toolchain.newPerlTextCharWidth,
Name: "perl-Text::CharWidth", Name: "perl-Text::CharWidth",
@@ -272,15 +274,15 @@ func init() {
Website: "https://metacpan.org/release/Text-CharWidth", Website: "https://metacpan.org/release/Text-CharWidth",
ID: 14380, ID: 14380,
} })
} }
func (t Toolchain) newPerlTextWrapI18N() (pkg.Artifact, string) { func (t Toolchain) newPerlTextWrapI18N(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.06" version = "0.06"
checksum = "Vmo89qLgxUqyQ6QmWJVqu60aQAUjrNKRjFQSXGnvClxofzRjiCa6idzPgJ4VkixM" checksum = "Vmo89qLgxUqyQ6QmWJVqu60aQAUjrNKRjFQSXGnvClxofzRjiCa6idzPgJ4VkixM"
) )
return t.newViaPerlMakeMaker("Text::WrapI18N", version, newFromCPAN( return s.newViaPerlMakeMaker(t, "Text::WrapI18N", version, newFromCPAN(
"KUBOTA", "KUBOTA",
"Text-WrapI18N", "Text-WrapI18N",
version, version,
@@ -290,7 +292,7 @@ func (t Toolchain) newPerlTextWrapI18N() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[PerlTextWrapI18N] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPerlTextWrapI18N, f: Toolchain.newPerlTextWrapI18N,
Name: "perl-Text::WrapI18N", Name: "perl-Text::WrapI18N",
@@ -302,15 +304,15 @@ func init() {
}, },
ID: 14385, ID: 14385,
} })
} }
func (t Toolchain) newPerlMIMECharset() (pkg.Artifact, string) { func (t Toolchain) newPerlMIMECharset(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.013.1" version = "1.013.1"
checksum = "Ou_ukcrOa1cgtE3mptinb-os3bdL1SXzbRDFZQF3prrJj-drc3rp_huay7iDLJol" checksum = "Ou_ukcrOa1cgtE3mptinb-os3bdL1SXzbRDFZQF3prrJj-drc3rp_huay7iDLJol"
) )
return t.newViaPerlMakeMaker("MIME::Charset", version, newFromCPAN( return s.newViaPerlMakeMaker(t, "MIME::Charset", version, newFromCPAN(
"NEZUMI", "NEZUMI",
"MIME-Charset", "MIME-Charset",
version, version,
@@ -318,7 +320,7 @@ func (t Toolchain) newPerlMIMECharset() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
artifactsM[PerlMIMECharset] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPerlMIMECharset, f: Toolchain.newPerlMIMECharset,
Name: "perl-MIME::Charset", Name: "perl-MIME::Charset",
@@ -326,15 +328,15 @@ func init() {
Website: "https://metacpan.org/release/MIME-Charset", Website: "https://metacpan.org/release/MIME-Charset",
ID: 3070, ID: 3070,
} })
} }
func (t Toolchain) newPerlUnicodeLineBreak() (pkg.Artifact, string) { func (t Toolchain) newPerlUnicodeLineBreak(s *S) (pkg.Artifact, string) {
const ( const (
version = "2019.001" version = "2019.001"
checksum = "ZHVkh7EDgAUHnTpvXsnPAuWpgNoBImtY_9_8TIbo2co_WgUwEb0MtXPhI8pAZ5OH" checksum = "ZHVkh7EDgAUHnTpvXsnPAuWpgNoBImtY_9_8TIbo2co_WgUwEb0MtXPhI8pAZ5OH"
) )
return t.newViaPerlMakeMaker("Unicode::LineBreak", version, newFromCPAN( return s.newViaPerlMakeMaker(t, "Unicode::LineBreak", version, newFromCPAN(
"NEZUMI", "NEZUMI",
"Unicode-LineBreak", "Unicode-LineBreak",
version, version,
@@ -344,7 +346,7 @@ func (t Toolchain) newPerlUnicodeLineBreak() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[PerlUnicodeLineBreak] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPerlUnicodeLineBreak, f: Toolchain.newPerlUnicodeLineBreak,
Name: "perl-Unicode::LineBreak", Name: "perl-Unicode::LineBreak",
@@ -356,15 +358,15 @@ func init() {
}, },
ID: 6033, ID: 6033,
} })
} }
func (t Toolchain) newPerlYAMLTiny() (pkg.Artifact, string) { func (t Toolchain) newPerlYAMLTiny(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.76" version = "1.76"
checksum = "V1MV4KPym1LxSw8CRXqPR3K-l1hGHbT5Ob4t-9xju6R9X_CWyw6hI8wsMaNdHdBY" checksum = "V1MV4KPym1LxSw8CRXqPR3K-l1hGHbT5Ob4t-9xju6R9X_CWyw6hI8wsMaNdHdBY"
) )
return t.newViaPerlMakeMaker("YAML::Tiny", version, newFromCPAN( return s.newViaPerlMakeMaker(t, "YAML::Tiny", version, newFromCPAN(
"ETHER", "ETHER",
"YAML-Tiny", "YAML-Tiny",
version, version,
@@ -372,7 +374,7 @@ func (t Toolchain) newPerlYAMLTiny() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
artifactsM[PerlYAMLTiny] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPerlYAMLTiny, f: Toolchain.newPerlYAMLTiny,
Name: "perl-YAML::Tiny", Name: "perl-YAML::Tiny",
@@ -380,15 +382,15 @@ func init() {
Website: "https://metacpan.org/release/YAML-Tiny", Website: "https://metacpan.org/release/YAML-Tiny",
ID: 3549, ID: 3549,
} })
} }
func (t Toolchain) newPerlTestCmd() (pkg.Artifact, string) { func (t Toolchain) newPerlTestCmd(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.09" version = "1.09"
checksum = "gpGUwyC9IozDiYSgW_kXARNfXsTPFa6cTowJmmCBbPqcs2-pONZca_SB06FGy-7H" checksum = "gpGUwyC9IozDiYSgW_kXARNfXsTPFa6cTowJmmCBbPqcs2-pONZca_SB06FGy-7H"
) )
return t.newViaPerlMakeMaker("Test::Cmd", version, newFromCPAN( return s.newViaPerlMakeMaker(t, "Test::Cmd", version, newFromCPAN(
"NEILB", "NEILB",
"Test-Cmd", "Test-Cmd",
version, version,
@@ -396,7 +398,7 @@ func (t Toolchain) newPerlTestCmd() (pkg.Artifact, string) {
), nil), version ), nil), version
} }
func init() { func init() {
artifactsM[PerlTestCmd] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPerlTestCmd, f: Toolchain.newPerlTestCmd,
Name: "perl-Test::Cmd", Name: "perl-Test::Cmd",
@@ -404,5 +406,5 @@ func init() {
Website: "https://metacpan.org/release/Test-Cmd", Website: "https://metacpan.org/release/Test-Cmd",
ID: 6014, ID: 6014,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newPixman() (pkg.Artifact, string) { func (t Toolchain) newPixman(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.46.4" version = "0.46.4"
checksum = "iECDxLG9SxUrvGHqeDoaBa-b3uqdT5DC4zudjtrwb8Wodq82pyacmFNEAo4SDsiE" checksum = "iECDxLG9SxUrvGHqeDoaBa-b3uqdT5DC4zudjtrwb8Wodq82pyacmFNEAo4SDsiE"
) )
return t.NewPackage("pixman", version, newFromGitLab( return s.NewPackage(t, "pixman", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"pixman/pixman", "pixman/pixman",
"pixman-"+version, "pixman-"+version,
@@ -19,7 +19,7 @@ func (t Toolchain) newPixman() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
artifactsM[Pixman] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPixman, f: Toolchain.newPixman,
Name: "pixman", Name: "pixman",
@@ -27,5 +27,5 @@ func init() {
Website: "https://pixman.org/", Website: "https://pixman.org/",
ID: 3648, ID: 3648,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newPkgConfig() (pkg.Artifact, string) { func (t Toolchain) newPkgConfig(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.29.2" version = "0.29.2"
checksum = "6UsGqEMA8EER_5b9N0b32UCqiRy39B6_RnPfvuslWhtFV1qYD4DfS10crGZN_TP2" checksum = "6UsGqEMA8EER_5b9N0b32UCqiRy39B6_RnPfvuslWhtFV1qYD4DfS10crGZN_TP2"
) )
return t.NewPackage("pkg-config", version, newFromGitLab( return s.NewPackage(t, "pkg-config", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"pkg-config/pkg-config", "pkg-config/pkg-config",
"pkg-config-"+version, "pkg-config-"+version,
@@ -24,7 +24,7 @@ func (t Toolchain) newPkgConfig() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[PkgConfig] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPkgConfig, f: Toolchain.newPkgConfig,
Name: "pkg-config", Name: "pkg-config",
@@ -32,5 +32,5 @@ func init() {
Website: "https://pkgconfig.freedesktop.org/", Website: "https://pkgconfig.freedesktop.org/",
ID: 3649, ID: 3649,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newProcps() (pkg.Artifact, string) { func (t Toolchain) newProcps(s *S) (pkg.Artifact, string) {
const ( const (
version = "4.0.6" version = "4.0.6"
checksum = "pl_fZLvDlv6iZTkm8l_tHFpzTDVFGCiSJEs3eu0zAX6u36AV36P_En8K7JPScRWM" checksum = "pl_fZLvDlv6iZTkm8l_tHFpzTDVFGCiSJEs3eu0zAX6u36AV36P_En8K7JPScRWM"
) )
return t.NewPackage("procps", version, newFromGitLab( return s.NewPackage(t, "procps", version, newFromGitLab(
"gitlab.com", "gitlab.com",
"procps-ng/procps", "procps-ng/procps",
"v"+version, "v"+version,
@@ -27,7 +27,7 @@ func (t Toolchain) newProcps() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Procps] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newProcps, f: Toolchain.newProcps,
Name: "procps", Name: "procps",
@@ -35,5 +35,5 @@ func init() {
Website: "https://gitlab.com/procps-ng/procps", Website: "https://gitlab.com/procps-ng/procps",
ID: 3708, ID: 3708,
} })
} }

View File

@@ -7,12 +7,12 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newPython() (pkg.Artifact, string) { func (t Toolchain) newPython(s *S) (pkg.Artifact, string) {
const ( const (
version = "3.14.5" version = "3.14.5"
checksum = "zYIpDlk2ftZ-UVGCQS1rthle2OHoyXV653ztWiopKV1NhmIJf1K2hHbkwM4DozQ9" checksum = "zYIpDlk2ftZ-UVGCQS1rthle2OHoyXV653ztWiopKV1NhmIJf1K2hHbkwM4DozQ9"
) )
return t.NewPackage("python", version, newTar( return s.NewPackage(t, "python", version, newTar(
"https://www.python.org/ftp/python/"+version+ "https://www.python.org/ftp/python/"+version+
"/Python-"+version+".tgz", "/Python-"+version+".tgz",
checksum, checksum,
@@ -73,7 +73,7 @@ index 19aea290b58..51603ba9510 100644
// _ctypes appears to infer something from the linker name // _ctypes appears to infer something from the linker name
"LDFLAGS=-Wl,--dynamic-linker=/system/lib/" + "LDFLAGS=-Wl,--dynamic-linker=/system/lib/" +
"ld-musl-" + linuxArch() + ".so.1", "ld-musl-" + s.linuxArch() + ".so.1",
}, },
}, &MakeHelper{ }, &MakeHelper{
Check: []string{"test"}, Check: []string{"test"},
@@ -88,7 +88,7 @@ index 19aea290b58..51603ba9510 100644
), version ), version
} }
func init() { func init() {
artifactsM[Python] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newPython, f: Toolchain.newPython,
Name: "python", Name: "python",
@@ -103,7 +103,7 @@ func init() {
}, },
ID: 13254, ID: 13254,
} })
} }
// PipHelper is the [Python] pip packaging helper. // PipHelper is the [Python] pip packaging helper.
@@ -150,7 +150,7 @@ func (*PipHelper) createDir() bool { return false }
func (*PipHelper) wantsDir() string { return `"$(mktemp -d)"` } func (*PipHelper) wantsDir() string { return `"$(mktemp -d)"` }
// script generates the pip3 install command. // script generates the pip3 install command.
func (attr *PipHelper) script(name string) string { func (attr *PipHelper) script(_ *S, name string) string {
if attr == nil { if attr == nil {
attr = new(PipHelper) attr = new(PipHelper)
} }
@@ -193,16 +193,16 @@ pip3 install \
` + script ` + script
} }
// newPythonPackage creates [Metadata] for a [Python] package. // newPythonPackage registers a new [Python] package.
func newPythonPackage( func (s *S) newPythonPackage(
name string, id int, description, website, version string, name string, id int, description, website, version string,
source pkg.Artifact, attrP *PackageAttr, attr *PipHelper, source pkg.Artifact, attrP *PackageAttr, attr *PipHelper,
build P, extra ...PArtifact, build P, extra ...ArtifactH,
) Metadata { ) {
name = "python-" + name name = "python-" + name
return Metadata{ s.MustRegister(&Artifact{
f: func(t Toolchain) (pkg.Artifact, string) { f: func(t Toolchain, s *S) (pkg.Artifact, string) {
return t.NewPackage(name, version, source, attrP, attr, slices.Concat( return s.NewPackage(t, name, version, source, attrP, attr, slices.Concat(
P{Python}, P{Python},
extra, extra,
build, build,
@@ -216,7 +216,7 @@ func newPythonPackage(
Dependencies: slices.Concat(P{Python}, extra), Dependencies: slices.Concat(P{Python}, extra),
ID: id, ID: id,
} })
} }
func init() { func init() {
@@ -224,7 +224,7 @@ func init() {
version = "0.47.0" version = "0.47.0"
checksum = "HZ-MvkUP8mbbx2YmsRNswj_bbOCIiXckuHqL5Qbvb5NxN5DYfWnqwkGNyS7OrId0" checksum = "HZ-MvkUP8mbbx2YmsRNswj_bbOCIiXckuHqL5Qbvb5NxN5DYfWnqwkGNyS7OrId0"
) )
artifactsM[PythonWheel] = newPythonPackage( native.newPythonPackage(
"wheel", 11428, "wheel", 11428,
"the official binary distribution format for Python", "the official binary distribution format for Python",
"https://peps.python.org/pep-0427/", "https://peps.python.org/pep-0427/",
@@ -242,7 +242,7 @@ func init() {
version = "82.0.1" version = "82.0.1"
checksum = "nznP46Tj539yqswtOrIM4nQgwLA1h-ApKX7z7ghazROCpyF5swtQGwsZoI93wkhc" checksum = "nznP46Tj539yqswtOrIM4nQgwLA1h-ApKX7z7ghazROCpyF5swtQGwsZoI93wkhc"
) )
artifactsM[PythonSetuptools] = newPythonPackage( native.newPythonPackage(
"setuptools", 4021, "setuptools", 4021,
"the autotools of the Python ecosystem", "the autotools of the Python ecosystem",
"https://pypi.org/project/setuptools/", "https://pypi.org/project/setuptools/",
@@ -262,7 +262,7 @@ func init() {
version = "1.1.1" version = "1.1.1"
checksum = "rXZixTsZcRcIoUC1LvWrjySsiXSv5uhW6ng2P-yXZrbdj7FrSrDeJLCfC2b-ladV" checksum = "rXZixTsZcRcIoUC1LvWrjySsiXSv5uhW6ng2P-yXZrbdj7FrSrDeJLCfC2b-ladV"
) )
artifactsM[PythonVCSVersioning] = newPythonPackage( native.newPythonPackage(
"vcs-versioning", 389421, "vcs-versioning", 389421,
"core VCS versioning functionality extracted as a standalone library", "core VCS versioning functionality extracted as a standalone library",
"https://setuptools-scm.readthedocs.io/en/latest/", "https://setuptools-scm.readthedocs.io/en/latest/",
@@ -289,7 +289,7 @@ func init() {
version = "10.0.5" version = "10.0.5"
checksum = "vTN_TPd-b4Wbsw5WmAcsWjrs-FNXXznOeVTDnb54NtXve9Oy-eb2HPy-RG3FzNqp" checksum = "vTN_TPd-b4Wbsw5WmAcsWjrs-FNXXznOeVTDnb54NtXve9Oy-eb2HPy-RG3FzNqp"
) )
artifactsM[PythonSetuptoolsSCM] = newPythonPackage( native.newPythonPackage(
"setuptools-scm", 7874, "setuptools-scm", 7874,
"extracts Python package versions from Git or Mercurial metadata", "extracts Python package versions from Git or Mercurial metadata",
"https://setuptools-scm.readthedocs.io/en/latest/", "https://setuptools-scm.readthedocs.io/en/latest/",
@@ -316,7 +316,7 @@ func init() {
version = "3.12.0" version = "3.12.0"
checksum = "VcTsiGiDU1aPLbjSPe38f9OjJDCLcxFz9loObJqUI1ZxDHXAaQMxBpNyLz_G1Rff" checksum = "VcTsiGiDU1aPLbjSPe38f9OjJDCLcxFz9loObJqUI1ZxDHXAaQMxBpNyLz_G1Rff"
) )
artifactsM[PythonFlitCore] = newPythonPackage( native.newPythonPackage(
"flit-core", 44841, "flit-core", 44841,
"a PEP 517 build backend for packages using Flit", "a PEP 517 build backend for packages using Flit",
"https://flit.pypa.io/", "https://flit.pypa.io/",
@@ -337,7 +337,7 @@ func init() {
version = "26.2" version = "26.2"
checksum = "rdpGa2EkPFbj1mFtLKLnSwIX9gPfELcuneiICjRVDNw6By49szTFVoW8gtMMZ6ZS" checksum = "rdpGa2EkPFbj1mFtLKLnSwIX9gPfELcuneiICjRVDNw6By49szTFVoW8gtMMZ6ZS"
) )
artifactsM[PythonPackaging] = newPythonPackage( native.newPythonPackage(
"packaging", 60461, "packaging", 60461,
"reusable core utilities for various Python Packaging interoperability specifications", "reusable core utilities for various Python Packaging interoperability specifications",
"https://packaging.pypa.io/", "https://packaging.pypa.io/",
@@ -352,10 +352,10 @@ func init() {
} }
func init() { func init() {
artifactsM[LIT] = Metadata{ native.MustRegister(&Artifact{
f: func(t Toolchain) (pkg.Artifact, string) { f: func(t Toolchain, s *S) (pkg.Artifact, string) {
version := t.Version(LLVM) source, version := s.Load(t, llvmSource)
return t.NewPackage("lit", version, t.Load(llvmSource), nil, &PipHelper{ return s.NewPackage(t, "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,
@@ -371,7 +371,7 @@ func init() {
Dependencies: P{ Dependencies: P{
Python, Python,
}, },
} })
} }
func init() { func init() {
@@ -379,7 +379,7 @@ func init() {
version = "1.1.1" version = "1.1.1"
checksum = "1fVwoal6FoKXczoG3qRUi87TxSWESSGcgvnbEZDYuaOgsO25o36iF3SbAhwkr4Va" checksum = "1fVwoal6FoKXczoG3qRUi87TxSWESSGcgvnbEZDYuaOgsO25o36iF3SbAhwkr4Va"
) )
artifactsM[PythonPathspec] = newPythonPackage( native.newPythonPackage(
"pathspec", 23424, "pathspec", 23424,
"utility library for gitignore style pattern matching of file paths", "utility library for gitignore style pattern matching of file paths",
"https://github.com/cpburnz/python-pathspec", "https://github.com/cpburnz/python-pathspec",
@@ -398,7 +398,7 @@ func init() {
version = "2026.5.7.17" version = "2026.5.7.17"
checksum = "1Fcps0gK9P4ofwGL8MISN9k1Q40-quxX7NDpIna50TmziBNrZy-0Vz0I9yIeHCoP" checksum = "1Fcps0gK9P4ofwGL8MISN9k1Q40-quxX7NDpIna50TmziBNrZy-0Vz0I9yIeHCoP"
) )
artifactsM[PythonTroveClassifiers] = newPythonPackage( native.newPythonPackage(
"trove-classifiers", 88298, "trove-classifiers", 88298,
"canonical source for classifiers on PyPI", "canonical source for classifiers on PyPI",
"https://pypi.org/p/trove-classifiers/", "https://pypi.org/p/trove-classifiers/",
@@ -417,7 +417,7 @@ func init() {
version = "1.6.0" version = "1.6.0"
checksum = "GiUgDkKjF8Xn1cmq6iMhTGXzcPIYeaJrvQpHBSAJapNVx4UyuiTXqd5eVlxSClJu" checksum = "GiUgDkKjF8Xn1cmq6iMhTGXzcPIYeaJrvQpHBSAJapNVx4UyuiTXqd5eVlxSClJu"
) )
artifactsM[PythonPluggy] = newPythonPackage( native.newPythonPackage(
"pluggy", 7500, "pluggy", 7500,
"the core framework used by the pytest, tox, and devpi projects", "the core framework used by the pytest, tox, and devpi projects",
"https://pluggy.readthedocs.io/en/latest/", "https://pluggy.readthedocs.io/en/latest/",
@@ -440,7 +440,7 @@ func init() {
version = "1.16.5" version = "1.16.5"
checksum = "V2eREtqZLZeV85yb4O-bfAJCUluHcQP76Qfs0QH5s7RF_Oc8xIP8jD0jl85qFyWk" checksum = "V2eREtqZLZeV85yb4O-bfAJCUluHcQP76Qfs0QH5s7RF_Oc8xIP8jD0jl85qFyWk"
) )
artifactsM[PythonHatchling] = newPythonPackage( native.newPythonPackage(
"hatchling", 16137, "hatchling", 16137,
"the extensible, standards compliant build backend used by Hatch", "the extensible, standards compliant build backend used by Hatch",
"https://hatch.pypa.io/latest/", "https://hatch.pypa.io/latest/",
@@ -465,7 +465,7 @@ func init() {
version = "2.20.0" version = "2.20.0"
checksum = "L-2P6vn7c_CNZYliE5CJAWLxO1ziDQVVkf8bnZbHj8aSCQ43oWv11wC9KzU9MeCa" checksum = "L-2P6vn7c_CNZYliE5CJAWLxO1ziDQVVkf8bnZbHj8aSCQ43oWv11wC9KzU9MeCa"
) )
artifactsM[PythonPygments] = newPythonPackage( native.newPythonPackage(
"pygments", 3986, "pygments", 3986,
"a syntax highlighting package written in Python", "a syntax highlighting package written in Python",
"https://pygments.org/", "https://pygments.org/",
@@ -484,7 +484,7 @@ func init() {
version = "2.3.0" version = "2.3.0"
checksum = "mH7VBZaXcYatBPE3RQQZvSzz_Ay8IPPek60NpPHZulPq4ReAFUUsA4EPWfiyMknZ" checksum = "mH7VBZaXcYatBPE3RQQZvSzz_Ay8IPPek60NpPHZulPq4ReAFUUsA4EPWfiyMknZ"
) )
artifactsM[PythonIniConfig] = newPythonPackage( native.newPythonPackage(
"iniconfig", 114778, "iniconfig", 114778,
"a small and simple INI-file parser module", "a small and simple INI-file parser module",
"https://github.com/pytest-dev/iniconfig", "https://github.com/pytest-dev/iniconfig",
@@ -507,7 +507,7 @@ func init() {
version = "9.0.3" version = "9.0.3"
checksum = "qfLL_znWhbJCDbNJvrx9H3-orJ86z4ifhaW0bIn21jl2sDP-FVoX_1yieOypArQe" checksum = "qfLL_znWhbJCDbNJvrx9H3-orJ86z4ifhaW0bIn21jl2sDP-FVoX_1yieOypArQe"
) )
artifactsM[PythonPyTest] = newPythonPackage( native.newPythonPackage(
"pytest", 3765, "pytest", 3765,
"the pytest framework", "the pytest framework",
"https://pytest.org", "https://pytest.org",
@@ -534,7 +534,7 @@ func init() {
version = "3.0.3" version = "3.0.3"
checksum = "txRGYdWE3his1lHHRI-lZADw0-ILvUg2l5OGdFHtFXIb_QowGxwdxHCUSJIgmjQs" checksum = "txRGYdWE3his1lHHRI-lZADw0-ILvUg2l5OGdFHtFXIb_QowGxwdxHCUSJIgmjQs"
) )
artifactsM[PythonMarkupSafe] = newPythonPackage( native.newPythonPackage(
"markupsafe", 3918, "markupsafe", 3918,
"implements a text object that escapes characters so it is safe to use in HTML and XML", "implements a text object that escapes characters so it is safe to use in HTML and XML",
"https://markupsafe.palletsprojects.com/", "https://markupsafe.palletsprojects.com/",
@@ -553,7 +553,7 @@ func init() {
version = "1.3.12" version = "1.3.12"
checksum = "OZbBsQe2MzRuAo5Mr4qRwWHGqU1EEZeBuSprDDIceAtMLIUJtO7SbERlxHIxNhLk" checksum = "OZbBsQe2MzRuAo5Mr4qRwWHGqU1EEZeBuSprDDIceAtMLIUJtO7SbERlxHIxNhLk"
) )
artifactsM[PythonMako] = newPythonPackage( native.newPythonPackage(
"mako", 3915, "mako", 3915,
"a template library written in Python", "a template library written in Python",
"https://www.makotemplates.org/", "https://www.makotemplates.org/",
@@ -571,7 +571,7 @@ func init() {
version = "6.0.3" version = "6.0.3"
checksum = "7wDv0RW9chBdu9l5Q4Hun5F2HHdo105ZSIixwdFPKbEYbftW9YxmsegfL-zafnbJ" checksum = "7wDv0RW9chBdu9l5Q4Hun5F2HHdo105ZSIixwdFPKbEYbftW9YxmsegfL-zafnbJ"
) )
artifactsM[PythonPyYAML] = newPythonPackage( native.newPythonPackage(
"pyyaml", 4123, "pyyaml", 4123,
"a YAML parser and emitter for Python", "a YAML parser and emitter for Python",
"https://pyyaml.org/", "https://pyyaml.org/",
@@ -590,7 +590,7 @@ func init() {
version = "3.00" version = "3.00"
checksum = "4qfCMFKp0fLsRsloOAF780tXX_Ce_68RwinCmjNGObAX32WpF_iBafIKW1S1bYlA" checksum = "4qfCMFKp0fLsRsloOAF780tXX_Ce_68RwinCmjNGObAX32WpF_iBafIKW1S1bYlA"
) )
artifactsM[PythonPycparser] = newPythonPackage( native.newPythonPackage(
"pycparser", 8175, "pycparser", 8175,
"complete C99 parser in pure Python", "complete C99 parser in pure Python",
"https://github.com/eliben/pycparser", "https://github.com/eliben/pycparser",

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newQEMU() (pkg.Artifact, string) { func (t Toolchain) newQEMU(s *S) (pkg.Artifact, string) {
const ( const (
version = "11.0.0" version = "11.0.0"
checksum = "C64gdi_Tkdg2fTwD9ERxtWGcf8vNn_6UvczW0c-x0KW1NZtd3NbEOIrlDhYGn15n" checksum = "C64gdi_Tkdg2fTwD9ERxtWGcf8vNn_6UvczW0c-x0KW1NZtd3NbEOIrlDhYGn15n"
) )
return t.NewPackage("qemu", version, newTar( return s.NewPackage(t, "qemu", version, newTar(
"https://download.qemu.org/qemu-"+version+".tar.bz2", "https://download.qemu.org/qemu-"+version+".tar.bz2",
checksum, checksum,
pkg.TarBzip2, pkg.TarBzip2,
@@ -94,7 +94,7 @@ EOF
), version ), version
} }
func init() { func init() {
artifactsM[QEMU] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newQEMU, f: Toolchain.newQEMU,
Name: "qemu", Name: "qemu",
@@ -107,5 +107,5 @@ func init() {
}, },
ID: 13607, ID: 13607,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newRdfind() (pkg.Artifact, string) { func (t Toolchain) newRdfind(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.8.0" version = "1.8.0"
checksum = "PoaeJ2WIG6yyfe5VAYZlOdAQiR3mb3WhAUMj2ziTCx_IIEal4640HMJUb4SzU9U3" checksum = "PoaeJ2WIG6yyfe5VAYZlOdAQiR3mb3WhAUMj2ziTCx_IIEal4640HMJUb4SzU9U3"
) )
return t.NewPackage("rdfind", version, newTar( return s.NewPackage(t, "rdfind", version, newTar(
"https://rdfind.pauldreik.se/rdfind-"+version+".tar.gz", "https://rdfind.pauldreik.se/rdfind-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -21,7 +21,7 @@ ln -s ../system/bin/toybox /bin/echo
), version ), version
} }
func init() { func init() {
artifactsM[Rdfind] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newRdfind, f: Toolchain.newRdfind,
Name: "rdfind", Name: "rdfind",
@@ -33,5 +33,5 @@ func init() {
}, },
ID: 231641, ID: 231641,
} })
} }

View File

@@ -32,10 +32,14 @@ func WriteReport(msg message.Msg, w io.Writer, c *pkg.Cache) error {
zero [wordSize]byte zero [wordSize]byte
buf [len(pkg.ID{}) + wordSize]byte buf [len(pkg.ID{}) + wordSize]byte
) )
for i := range PresetEnd { for _, p := range native.Collect() {
a := Std.Load(PArtifact(i)) a, _ := native.Load(Std, p)
meta := native.Get(p)
if meta == nil {
return errors.New("artifact " + p.String() + " in inconsistent state")
}
if _, ok := a.(pkg.FileArtifact); ok { if _, ok := a.(pkg.FileArtifact); ok {
msg.Verbosef("skipping file artifact %s", artifactsM[i].Name) msg.Verbosef("skipping file artifact %s", meta.Name)
continue continue
} }
@@ -44,7 +48,7 @@ func WriteReport(msg message.Msg, w io.Writer, c *pkg.Cache) error {
var f *os.File var f *os.File
if r, err := c.OpenStatus(a); err != nil { if r, err := c.OpenStatus(a); err != nil {
if errors.Is(err, os.ErrNotExist) { if errors.Is(err, os.ErrNotExist) {
msg.Verbosef("artifact %s unavailable", artifactsM[i].Name) msg.Verbosef("artifact %s unavailable", meta.Name)
continue continue
} }
return err return err
@@ -52,7 +56,7 @@ func WriteReport(msg message.Msg, w io.Writer, c *pkg.Cache) error {
f = r.(*os.File) f = r.(*os.File)
} }
msg.Verbosef("writing artifact %s...", artifactsM[i].Name) msg.Verbosef("writing artifact %s...", meta.Name)
var sz int64 var sz int64
if fi, err := f.Stat(); err != nil { if fi, err := f.Stat(); err != nil {

View File

@@ -2,7 +2,6 @@
package rosa package rosa
import ( import (
"errors"
"path" "path"
"slices" "slices"
"strconv" "strconv"
@@ -54,8 +53,8 @@ var (
) )
// linuxArch returns the architecture name used by linux corresponding to arch. // linuxArch returns the architecture name used by linux corresponding to arch.
func linuxArch() string { func (s *S) linuxArch() string {
switch arch { switch s.arch {
case "amd64": case "amd64":
return "x86_64" return "x86_64"
case "arm64": case "arm64":
@@ -64,23 +63,23 @@ func linuxArch() string {
return "riscv64" return "riscv64"
default: default:
panic("unsupported target " + arch) panic("unsupported target " + s.arch)
} }
} }
// triplet returns the Rosa OS host triple corresponding to arch. // triple returns the Rosa OS host triple corresponding to arch.
func triplet() string { func (s *S) triple() string {
return linuxArch() + "-rosa-linux-musl" return s.linuxArch() + "-rosa-linux-musl"
} }
// perArch is a value that differs per architecture. // perArch is a value that differs per architecture.
type perArch[T any] map[string]T type perArch[T any] map[string]T
// unwrap returns the value for the current architecture. // unwrap returns the value for the current architecture.
func (p perArch[T]) unwrap() T { func (p perArch[T]) unwrap(s *S) T {
v, ok := p[arch] v, ok := p[s.arch]
if !ok { if !ok {
panic("unsupported target " + arch) panic("unsupported target " + s.arch)
} }
return v return v
} }
@@ -91,18 +90,18 @@ const (
) )
// earlyLDFLAGS returns LDFLAGS corresponding to triplet. // earlyLDFLAGS returns LDFLAGS corresponding to triplet.
func earlyLDFLAGS(static bool) string { func (s *S) earlyLDFLAGS(static bool) string {
s := "-fuse-ld=lld " + p := "-fuse-ld=lld " +
"-L/system/lib -Wl,-rpath=/system/lib " + "-L/system/lib -Wl,-rpath=/system/lib " +
"-L/system/lib/" + triplet() + " " + "-L/system/lib/" + s.triple() + " " +
"-Wl,-rpath=/system/lib/" + triplet() + " " + "-Wl,-rpath=/system/lib/" + s.triple() + " " +
"-rtlib=compiler-rt " + "-rtlib=compiler-rt " +
"-unwindlib=libunwind " + "-unwindlib=libunwind " +
"-Wl,--as-needed" "-Wl,--as-needed"
if !static { if !static {
s += " -Wl,--dynamic-linker=/system/bin/linker" p += " -Wl,--dynamic-linker=/system/bin/linker"
} }
return s return p
} }
// Toolchain denotes the infrastructure to compile a [pkg.Artifact] on. // Toolchain denotes the infrastructure to compile a [pkg.Artifact] on.
@@ -224,27 +223,9 @@ const (
THostNet THostNet
) )
var ( // New returns a [pkg.Artifact] based on a [Toolchain] via s.
// gentooStage3 is the url of a Gentoo stage3 tarball. func (s *S) New(
gentooStage3 string t Toolchain,
// gentooStage3Checksum is the expected checksum of gentooStage3.
gentooStage3Checksum pkg.Checksum
)
// SetGentooStage3 sets the Gentoo stage3 tarball url and checksum. It panics
// if given zero values or if these values have already been set.
func SetGentooStage3(url string, checksum pkg.Checksum) {
if gentooStage3 != "" {
panic(errors.New("attempting to set Gentoo stage3 url twice"))
}
if url == "" {
panic(errors.New("attempting to set Gentoo stage3 url to the zero value"))
}
gentooStage3, gentooStage3Checksum = url, checksum
}
// New returns a [pkg.Artifact] compiled on this toolchain.
func (t Toolchain) New(
name string, name string,
flag int, flag int,
extra []pkg.Artifact, extra []pkg.Artifact,
@@ -260,7 +241,7 @@ func (t Toolchain) New(
switch t { switch t {
case _toolchainBusybox: case _toolchainBusybox:
name += "-early" name += "-early"
support = slices.Concat([]pkg.Artifact{newBusyboxBin()}, extra) support = slices.Concat([]pkg.Artifact{s.newBusyboxBin()}, extra)
env = fixupEnviron(env, nil, "/system/bin") env = fixupEnviron(env, nil, "/system/bin")
case toolchainGentoo, toolchainStage0: case toolchainGentoo, toolchainStage0:
@@ -268,9 +249,10 @@ func (t Toolchain) New(
support = append(support, extra...) support = append(support, extra...)
support = append(support, cureEtc{}) support = append(support, cureEtc{})
if t == toolchainStage0 { if t == toolchainStage0 {
support = append(support, t.Load(stage0Dist)) a, _ := s.Load(t, stage0Dist)
support = append(support, a)
} else { } else {
support = append(support, _toolchainBusybox.New("gentoo", 0, nil, nil, nil, ` support = append(support, s.New(_toolchainBusybox, "gentoo", 0, nil, nil, nil, `
tar -C /work -xf /usr/src/stage3.tar.xz tar -C /work -xf /usr/src/stage3.tar.xz
rm -rf /work/dev/ /work/proc/ rm -rf /work/dev/ /work/proc/
ln -vs ../usr/bin /work/bin ln -vs ../usr/bin /work/bin
@@ -281,15 +263,15 @@ mkdir -vp /work/system/bin
.) .)
`, pkg.Path(AbsUsrSrc.Append("stage3.tar.xz"), false, `, pkg.Path(AbsUsrSrc.Append("stage3.tar.xz"), false,
pkg.NewHTTPGet( pkg.NewHTTPGet(
nil, gentooStage3, nil, s.gentooStage3,
gentooStage3Checksum, s.gentooStage3Checksum,
), ),
))) )))
} }
env = fixupEnviron(env, []string{ env = fixupEnviron(env, []string{
EnvTriplet + "=" + triplet(), EnvTriplet + "=" + s.triple(),
lcMessages, lcMessages,
"LDFLAGS=" + earlyLDFLAGS(true), "LDFLAGS=" + s.earlyLDFLAGS(true),
}, "/system/bin", }, "/system/bin",
"/usr/bin", "/usr/bin",
) )
@@ -310,7 +292,7 @@ mkdir -vp /work/system/bin
base = Musl base = Musl
} }
support = slices.Concat(extra, (t-1).AppendPresets([]pkg.Artifact{ support = slices.Concat(extra, s.AppendPresets(t-1, []pkg.Artifact{
cureEtc{newIANAEtc()}, cureEtc{newIANAEtc()},
}, },
base, base,
@@ -318,7 +300,7 @@ mkdir -vp /work/system/bin
toybox, toybox,
)) ))
env = fixupEnviron(env, []string{ env = fixupEnviron(env, []string{
EnvTriplet + "=" + triplet(), EnvTriplet + "=" + s.triple(),
lcMessages, lcMessages,
}, "/system/bin", "/bin") }, "/system/bin", "/bin")
@@ -327,7 +309,7 @@ mkdir -vp /work/system/bin
} }
return pkg.NewExec( return pkg.NewExec(
name, arch, knownChecksum, pkg.ExecTimeoutMax, name, s.arch, knownChecksum, pkg.ExecTimeoutMax,
flag&THostNet != 0, flag&THostNet != 0,
flag&TExclusive != 0, flag&TExclusive != 0,
fhs.AbsRoot, env, fhs.AbsRoot, env,
@@ -346,7 +328,8 @@ mkdir -vp /work/system/bin
// NewPatchedSource returns [pkg.Artifact] of source with patches applied. If // NewPatchedSource returns [pkg.Artifact] of source with patches applied. If
// passthrough is true, source is returned as is for zero length patches. // passthrough is true, source is returned as is for zero length patches.
func (t Toolchain) NewPatchedSource( func (s *S) NewPatchedSource(
t Toolchain,
name, version string, name, version string,
source pkg.Artifact, source pkg.Artifact,
passthrough bool, passthrough bool,
@@ -379,7 +362,7 @@ cat /usr/src/` + name + `-patches/* | \
` `
aname += "-patched" aname += "-patched"
} }
return t.New(aname, 0, t.AppendPresets(nil, return s.New(t, aname, 0, s.AppendPresets(t, nil,
Patch, Patch,
), nil, nil, script, paths...) ), nil, nil, script, paths...)
} }
@@ -407,7 +390,7 @@ type Helper interface {
// also empty. The special value helperInPlace omits the cd statement. // also empty. The special value helperInPlace omits the cd statement.
wantsDir() string wantsDir() string
// script returns the helper-specific segment of cure script. // script returns the helper-specific segment of cure script.
script(name string) string script(s *S, name string) string
} }
// PackageAttr holds build-system-agnostic attributes. // PackageAttr holds build-system-agnostic attributes.
@@ -436,55 +419,59 @@ type PackageAttr struct {
Flag int Flag int
} }
// pa holds whether a [PArtifact] is present. // pa holds whether an [ArtifactH] is present.
type pa = [PresetEnd]bool type pa = map[ArtifactH]struct{}
// paPool holds addresses of pa. // paPool holds addresses of pa.
var paPool = sync.Pool{New: func() any { return new(pa) }} var paPool = sync.Pool{New: func() any { return make(pa) }}
// paGet returns the address of a new pa. // paGet returns the address of a new pa.
func paGet() *pa { return paPool.Get().(*pa) } func paGet() pa { return paPool.Get().(pa) }
// paPut returns a pa to paPool. // paPut returns a pa to paPool.
func paPut(pv *pa) { *pv = pa{}; paPool.Put(pv) } func paPut(pv pa) { clear(pv); paPool.Put(pv) }
// appendPreset recursively appends a [PArtifact] and its runtime dependencies. // appendPreset recursively appends a [PArtifact] and its runtime dependencies.
func (t Toolchain) appendPreset( func (s *S) appendPreset(
t Toolchain,
a []pkg.Artifact, a []pkg.Artifact,
pv *pa, p PArtifact, pv pa, p ArtifactH,
) []pkg.Artifact { ) []pkg.Artifact {
if pv[p] { if _, ok := pv[p]; ok {
return a return a
} }
pv[p] = true pv[p] = struct{}{}
for _, d := range GetMetadata(p).Dependencies { for _, d := range s.Get(p).Dependencies {
a = t.appendPreset(a, pv, d) a = s.appendPreset(t, a, pv, d)
} }
return append(a, t.Load(p)) d, _ := s.Load(t, p)
return append(a, d)
} }
// AppendPresets recursively appends multiple [PArtifact] and their runtime // AppendPresets recursively appends multiple [PArtifact] and their runtime
// dependencies. // dependencies.
func (t Toolchain) AppendPresets( func (s *S) AppendPresets(
t Toolchain,
a []pkg.Artifact, a []pkg.Artifact,
presets ...PArtifact, presets ...ArtifactH,
) []pkg.Artifact { ) []pkg.Artifact {
pv := paGet() pv := paGet()
for _, p := range presets { for _, p := range presets {
a = t.appendPreset(a, pv, p) a = s.appendPreset(t, a, pv, p)
} }
paPut(pv) paPut(pv)
return a return a
} }
// NewPackage constructs a [pkg.Artifact] via a build system helper. // NewPackage constructs a [pkg.Artifact] via a build system helper.
func (t Toolchain) NewPackage( func (s *S) NewPackage(
t Toolchain,
name, version string, name, version string,
source pkg.Artifact, source pkg.Artifact,
attr *PackageAttr, attr *PackageAttr,
helper Helper, helper Helper,
extra ...PArtifact, extra ...ArtifactH,
) pkg.Artifact { ) pkg.Artifact {
if attr == nil { if attr == nil {
attr = new(PackageAttr) attr = new(PackageAttr)
@@ -501,10 +488,10 @@ func (t Toolchain) NewPackage(
{ {
pv := paGet() pv := paGet()
for _, p := range helper.extra(attr.Flag) { for _, p := range helper.extra(attr.Flag) {
extraRes = t.appendPreset(extraRes, pv, p) extraRes = s.appendPreset(t, extraRes, pv, p)
} }
for _, p := range extra { for _, p := range extra {
extraRes = t.appendPreset(extraRes, pv, p) extraRes = s.appendPreset(t, extraRes, pv, p)
} }
paPut(pv) paPut(pv)
} }
@@ -548,18 +535,19 @@ cd '/usr/src/` + name + `/'
panic("cannot remain in root") panic("cannot remain in root")
} }
return t.New( return s.New(
t,
name+"-"+version, name+"-"+version,
attr.Flag, attr.Flag,
extraRes, extraRes,
attr.KnownChecksum, attr.KnownChecksum,
attr.Env, attr.Env,
scriptEarly+helper.script(name), scriptEarly+helper.script(s, name),
slices.Concat(attr.Paths, []pkg.ExecPath{ slices.Concat(attr.Paths, []pkg.ExecPath{
pkg.Path(AbsUsrSrc.Append( pkg.Path(AbsUsrSrc.Append(
name+sourceSuffix, name+sourceSuffix,
), attr.Writable || wantsWrite, t.NewPatchedSource( ), attr.Writable || wantsWrite, s.NewPatchedSource(
name, version, source, !attr.Chmod && !wantsChmod, attr.Patches..., t, name, version, source, !attr.Chmod && !wantsChmod, attr.Patches...,
)), )),
})..., })...,
) )
@@ -626,3 +614,8 @@ func newFromGitHubRelease(
compression, compression,
) )
} }
var native S
// Native returns the global [S].
func Native() *S { return &native }

View File

@@ -28,7 +28,7 @@ var (
) )
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
rosa.DropCaches("", rosa.OptLLVMNoLTO) rosa.Native().DropCaches("", rosa.OptLLVMNoLTO)
container.TryArgv0(nil) container.TryArgv0(nil)
code := m.Run() code := m.Run()
@@ -77,10 +77,9 @@ func TestCureAll(t *testing.T) {
cache := getCache(t) cache := getCache(t)
t.Parallel() t.Parallel()
for i := range rosa.PresetEnd { for _, p := range rosa.Native().Collect() {
p := rosa.PArtifact(i) a, _ := rosa.Native().Load(rosa.Std, p)
meta := rosa.GetMetadata(p) meta := rosa.Native().MustGet(p)
a := rosa.Std.Load(p)
t.Run(meta.Name, func(t *testing.T) { t.Run(meta.Name, func(t *testing.T) {
t.Parallel() t.Parallel()
@@ -94,14 +93,13 @@ func TestCureAll(t *testing.T) {
} }
func BenchmarkStage3(b *testing.B) { func BenchmarkStage3(b *testing.B) {
arch, flags := rosa.Arch(), rosa.Flags() s := rosa.Native().Clone()
b.Cleanup(func() { rosa.DropCaches(arch, flags) })
for b.Loop() { for b.Loop() {
rosa.Std.Load(rosa.LLVM) s.Load(rosa.Std, rosa.LLVM)
b.StopTimer() b.StopTimer()
rosa.DropCaches("", 0) s.DropCaches("", 0)
b.StartTimer() b.StartTimer()
} }
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newRsync() (pkg.Artifact, string) { func (t Toolchain) newRsync(s *S) (pkg.Artifact, string) {
const ( const (
version = "3.4.2" version = "3.4.2"
checksum = "t7PxS4WHXzefLMKKc_3hJgxUmlGG6KgHMZ8i4DZvCQAUAizxbclNKwfLyOHyq5BX" checksum = "t7PxS4WHXzefLMKKc_3hJgxUmlGG6KgHMZ8i4DZvCQAUAizxbclNKwfLyOHyq5BX"
) )
return t.NewPackage("rsync", version, newTar( return s.NewPackage(t, "rsync", version, newTar(
"https://download.samba.org/pub/rsync/src/"+ "https://download.samba.org/pub/rsync/src/"+
"rsync-"+version+".tar.gz", "rsync-"+version+".tar.gz",
checksum, checksum,
@@ -27,7 +27,7 @@ func (t Toolchain) newRsync() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
artifactsM[Rsync] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newRsync, f: Toolchain.newRsync,
Name: "rsync", Name: "rsync",
@@ -35,5 +35,5 @@ func init() {
Website: "https://rsync.samba.org/", Website: "https://rsync.samba.org/",
ID: 4217, ID: 4217,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newSquashfsTools() (pkg.Artifact, string) { func (t Toolchain) newSquashfsTools(s *S) (pkg.Artifact, string) {
const ( const (
version = "4.7.5" version = "4.7.5"
checksum = "rF52wLQP-jeAmcD-48wqJcck8ZWRFwkax3T-7snaRf5EBnCQQh0YypMY9lwcivLz" checksum = "rF52wLQP-jeAmcD-48wqJcck8ZWRFwkax3T-7snaRf5EBnCQQh0YypMY9lwcivLz"
) )
return t.NewPackage("squashfs-tools", version, newFromGitHubRelease( return s.NewPackage(t, "squashfs-tools", version, newFromGitHubRelease(
"plougher/squashfs-tools", "plougher/squashfs-tools",
version, version,
"squashfs-tools-"+version+".tar.gz", "squashfs-tools-"+version+".tar.gz",
@@ -42,7 +42,7 @@ func (t Toolchain) newSquashfsTools() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[SquashfsTools] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newSquashfsTools, f: Toolchain.newSquashfsTools,
Name: "squashfs-tools", Name: "squashfs-tools",
@@ -56,5 +56,5 @@ func init() {
}, },
ID: 4879, ID: 4879,
} })
} }

View File

@@ -5,57 +5,57 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newStage0() (pkg.Artifact, string) { func (t Toolchain) newStage0(s *S) (pkg.Artifact, string) {
return t.New("rosa-stage0", 0, t.AppendPresets(nil, return s.New(t, "rosa-stage0", 0, s.AppendPresets(t, nil,
Bzip2, Bzip2,
), nil, nil, ` ), nil, nil, `
umask 377 umask 377
tar \ tar \
-vjc \ -vjc \
-C /stage0 \ -C /stage0 \
-f /work/stage0-`+triplet()+`.tar.bz2 \ -f /work/stage0-`+s.triple()+`.tar.bz2 \
. .
`, pkg.Path(fhs.AbsRoot.Append("stage0"), false, t.AppendPresets(nil, `, pkg.Path(fhs.AbsRoot.Append("stage0"), false, s.AppendPresets(t, nil,
LLVM, LLVM,
Mksh, Mksh,
toyboxEarly, toyboxEarly,
)...)), Unversioned )...)), Unversioned
} }
func init() { func init() {
artifactsM[Stage0] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newStage0, f: Toolchain.newStage0,
Name: "rosa-stage0", Name: "rosa-stage0",
Description: "Rosa OS stage0 toolchain tarball for bootstrap", Description: "Rosa OS stage0 toolchain tarball for bootstrap",
} })
} }
func init() { func init() {
const version = "20260504" const version = "20260504"
artifactsM[stage0Dist] = Metadata{ native.MustRegister(&Artifact{
f: func(Toolchain) (pkg.Artifact, string) { f: func(_ Toolchain, s *S) (pkg.Artifact, string) {
return newTar( return newTar(
"https://hakurei.app/seed/"+version+"/"+ "https://hakurei.app/seed/"+version+"/"+
"stage0-"+triplet()+".tar.bz2", "stage0-"+s.triple()+".tar.bz2",
perArch[string]{ perArch[string]{
"amd64": "IQjFDkiAVLo1XzflgMMiLP3gnVY2hhDMTzl-QqJDCQhcLQ3lLtRzjI5WCxGyW_lk", "amd64": "IQjFDkiAVLo1XzflgMMiLP3gnVY2hhDMTzl-QqJDCQhcLQ3lLtRzjI5WCxGyW_lk",
"arm64": "6fmwl2Umx2QssKQvxxb1JOGkAjzfA_MXKku0jVdGjYGb35OvwEVA5NYtd0HIy3yH", "arm64": "6fmwl2Umx2QssKQvxxb1JOGkAjzfA_MXKku0jVdGjYGb35OvwEVA5NYtd0HIy3yH",
"riscv64": "Z2ODV0rIoo9iQRUIu35bsaOBeXc_9qQfGcyb2aGneatzNUJlXh5emSpEV2bOklUL", "riscv64": "Z2ODV0rIoo9iQRUIu35bsaOBeXc_9qQfGcyb2aGneatzNUJlXh5emSpEV2bOklUL",
}.unwrap(), }.unwrap(s),
pkg.TarBzip2, pkg.TarBzip2,
), version ), version
}, },
Name: "stage0-dist", Name: "stage0-dist",
Description: "Rosa OS stage0 bootstrap seed", Description: "Rosa OS stage0 bootstrap seed",
} })
} }
// HasStage0 returns whether a stage0 distribution is available. // HasStage0 returns whether a stage0 distribution is available.
func HasStage0() (ok bool) { func HasStage0() (ok bool) {
func() { func() {
defer func() { ok = recover() == nil }() defer func() { ok = recover() == nil }()
toolchainStage0.Load(stage0Dist) native.Load(toolchainStage0, stage0Dist)
}() }()
return return
} }

307
internal/rosa/state.go Normal file
View File

@@ -0,0 +1,307 @@
package rosa
import (
"context"
"encoding/json"
"errors"
"net/http"
"runtime"
"slices"
"strconv"
"strings"
"sync"
"sync/atomic"
"unique"
"hakurei.app/internal/pkg"
)
// ArtifactH is a handle of the unique name of a prepared [pkg.Artifact].
type ArtifactH unique.Handle[string]
// String returns the name of p.
func (p ArtifactH) String() string {
return unique.Handle[string](p).Value()
}
// MarshalJSON represents [ArtifactH] by its [Artifact.Name].
func (p ArtifactH) MarshalJSON() ([]byte, error) { return json.Marshal(p.String()) }
// UnmarshalJSON resolves [ArtifactH] by its [Artifact.Name].
func (p *ArtifactH) UnmarshalJSON(data []byte) error {
var name string
if err := json.Unmarshal(data, &name); err != nil {
return err
}
*p = ArtifactH(unique.Make(name))
return nil
}
// P represents multiple [ArtifactH].
type P []ArtifactH
// Artifact is stage-agnostic immutable data with a deterministic resulting
// [pkg.Artifact]. It can be created natively or through evaluation.
type Artifact struct {
f func(t Toolchain, s *S) (a pkg.Artifact, version string)
// Unique package name.
Name string `json:"name"`
// Short user-facing description.
Description string `json:"description"`
// Project home page.
Website string `json:"website,omitempty"`
// Runtime dependencies.
Dependencies P `json:"dependencies"`
// Project identifier on [Anitya].
//
// [Anitya]: https://release-monitoring.org/
ID int `json:"-"`
// Whether to exclude from exported functions.
Exclude bool `json:"exclude,omitempty"`
// Optional custom version checking behaviour.
latest func(v *Versions) string
}
// GetLatest returns the latest version described by v.
func (meta *Artifact) GetLatest(v *Versions) string {
if meta.latest != nil {
return meta.latest(v)
}
return v.Latest
}
// Unversioned denotes an unversioned [Artifact].
const Unversioned = "\x00"
// UnpopulatedIDError is returned by [Artifact.GetLatest] for an instance of
// [Artifact] where ID is not populated.
type UnpopulatedIDError struct{}
func (UnpopulatedIDError) Unwrap() error { return errors.ErrUnsupported }
func (UnpopulatedIDError) Error() string { return "Anitya ID is not populated" }
// Versions are package versions returned by Anitya.
type Versions struct {
// The latest version for the project, as determined by the version sorting algorithm.
Latest string `json:"latest_version"`
// List of all versions that arent flagged as pre-release.
Stable []string `json:"stable_versions"`
// List of all versions stored, sorted from newest to oldest.
All []string `json:"versions"`
}
// getStable returns the first Stable version, or Latest if that is unavailable.
func (v *Versions) getStable() string {
if len(v.Stable) == 0 {
return v.Latest
}
return v.Stable[0]
}
// GetVersions returns versions fetched from Anitya.
func (meta *Artifact) GetVersions(ctx context.Context) (*Versions, error) {
if meta.ID == 0 {
return nil, UnpopulatedIDError{}
}
var resp *http.Response
if req, err := http.NewRequestWithContext(
ctx,
http.MethodGet,
"https://release-monitoring.org/api/v2/versions/?project_id="+
strconv.Itoa(meta.ID),
nil,
); err != nil {
return nil, err
} else {
req.Header.Set("User-Agent", "Rosa/1.1")
if resp, err = http.DefaultClient.Do(req); err != nil {
return nil, err
}
}
var v Versions
err := json.NewDecoder(resp.Body).Decode(&v)
return &v, errors.Join(err, resp.Body.Close())
}
// A cachedArtifact holds [pkg.Artifact] and its corresponding version string.
type cachedArtifact struct {
a pkg.Artifact
v string
}
const (
// OptSkipCheck skips running all test suites.
OptSkipCheck = 1 << iota
// OptLLVMNoLTO disables LTO in all [LLVM] stages.
OptLLVMNoLTO
)
// S holds a set of [Artifact].
type S struct {
// [ArtifactH] to [Artifact].
artifacts sync.Map
// Size of artifacts.
artifactCount atomic.Uint64
// Target architecture.
arch string
// For initialising arch.
archOnce sync.Once
// Options for [pkg.Artifact] created against [S].
opts int
// Cached [pkg.Artifact].
c [_toolchainEnd]sync.Map
// URL of a Gentoo stage3 tarball.
gentooStage3 string
// Expected checksum of gentooStage3.
gentooStage3Checksum pkg.Checksum
}
// Clone returns a copy of s.
func (s *S) Clone() *S {
v := S{arch: s.arch}
s.artifacts.Range(func(key, value any) bool {
v.artifacts.Store(key, value)
v.artifactCount.Add(1)
return true
})
return &v
}
// wantsArch must be called before accessing arch.
func (s *S) wantsArch() {
s.archOnce.Do(func() {
if s.arch == "" {
s.arch = runtime.GOARCH
}
})
}
// Arch returns the target architecture.
func (s *S) Arch() string { s.wantsArch(); return s.arch }
// Flags returns the current preset flags.
func (s *S) Flags() int { return s.opts }
// DropCaches arranges for all cached [pkg.Artifact] to be freed some time after
// it returns. Must not be used concurrently with any other method.
func (s *S) DropCaches(targetArch string, flags int) {
if targetArch == "" {
targetArch = runtime.GOARCH
}
s.arch = targetArch
s.opts = flags
for i := range s.c {
s.c[i].Clear()
}
}
// Get returns the address of the named [Artifact].
func (s *S) Get(p ArtifactH) (meta *Artifact) {
s.wantsArch()
v, ok := s.artifacts.Load(p)
if ok {
meta = v.(*Artifact)
}
return
}
// MustGet is like Get, but panics if the named [Artifact] is not registered.
func (s *S) MustGet(p ArtifactH) (meta *Artifact) {
meta = s.Get(p)
if meta == nil {
panic("artifact " + strconv.Quote(p.String()) + " not available")
}
return
}
// Load returns the resulting [pkg.Artifact] of [ArtifactH].
func (s *S) Load(t Toolchain, p ArtifactH) (pkg.Artifact, string) {
s.wantsArch()
e, ok := s.c[t].Load(p)
if ok {
r := e.(cachedArtifact)
return r.a, r.v
}
meta := s.Get(p)
if meta == nil {
return nil, ""
}
var r cachedArtifact
r.a, r.v = meta.f(t, s)
s.c[t].Store(p, r)
return r.a, r.v
}
// MustLoad is like Load, but panics if the named [Artifact] is not registered.
func (s *S) MustLoad(t Toolchain, p ArtifactH) (pkg.Artifact, string) {
a, version := s.Load(t, p)
if a == nil {
panic("artifact " + strconv.Quote(p.String()) + " not available")
}
return a, version
}
// Register arranges for a new [Artifact] to be cured under s. It returns false
// if another [Artifact] is already registered under the same name.
func (s *S) Register(meta *Artifact) bool {
if meta.Name == "" {
return false
}
p := ArtifactH(unique.Make(meta.Name))
_, ok := s.artifacts.LoadOrStore(p, meta)
if !ok {
s.artifactCount.Add(1)
}
return !ok
}
// MustRegister is like Register, but panics if registration fails.
func (s *S) MustRegister(meta *Artifact) {
if !s.Register(meta) {
panic("attempting to register " + strconv.Quote(meta.Name) + " twice")
}
}
// Count returns the number of [Artifact] registered to s.
func (s *S) Count() int {
return int(s.artifactCount.Load())
}
// Collect returns all [ArtifactH] registered to s.
func (s *S) Collect() (handles []ArtifactH) {
handles = make([]ArtifactH, 0, s.Count())
s.artifacts.Range(func(key, _ any) bool {
handles = append(handles, key.(ArtifactH))
return true
})
slices.SortFunc(handles, func(a, b ArtifactH) int {
return strings.Compare(a.String(), b.String())
})
return
}
// SetGentooStage3 sets the Gentoo stage3 tarball url and checksum. It panics
// if given zero values or if these values have already been set.
func (s *S) SetGentooStage3(url string, checksum pkg.Checksum) {
if s.gentooStage3 != "" {
panic(errors.New("attempting to set Gentoo stage3 url twice"))
}
if url == "" {
panic(errors.New("attempting to set Gentoo stage3 url to the zero value"))
}
s.gentooStage3, s.gentooStage3Checksum = url, checksum
s.DropCaches(s.Arch(), s.Flags())
}

View File

@@ -0,0 +1,197 @@
package rosa
import "unique"
var (
LLVM = ArtifactH(unique.Make("llvm"))
EarlyInit = ArtifactH(unique.Make("earlyinit"))
ImageSystem = ArtifactH(unique.Make("system-image"))
ImageInitramfs = ArtifactH(unique.Make("initramfs-image"))
Kernel = ArtifactH(unique.Make("kernel"))
KernelHeaders = ArtifactH(unique.Make("kernel-headers"))
KernelSource = ArtifactH(unique.Make("kernel-source"))
Firmware = ArtifactH(unique.Make("firmware"))
ACL = ArtifactH(unique.Make("acl"))
ArgpStandalone = ArtifactH(unique.Make("argp-standalone"))
Attr = ArtifactH(unique.Make("attr"))
Autoconf = ArtifactH(unique.Make("autoconf"))
Automake = ArtifactH(unique.Make("automake"))
BC = ArtifactH(unique.Make("bc"))
Bash = ArtifactH(unique.Make("bash"))
Binutils = ArtifactH(unique.Make("binutils"))
Bison = ArtifactH(unique.Make("bison"))
Bzip2 = ArtifactH(unique.Make("bzip2"))
CMake = ArtifactH(unique.Make("cmake"))
Connman = ArtifactH(unique.Make("connman"))
Coreutils = ArtifactH(unique.Make("coreutils"))
Curl = ArtifactH(unique.Make("curl"))
DBus = ArtifactH(unique.Make("dbus"))
DTC = ArtifactH(unique.Make("dtc"))
Diffutils = ArtifactH(unique.Make("diffutils"))
Elfutils = ArtifactH(unique.Make("elfutils"))
Fakeroot = ArtifactH(unique.Make("fakeroot"))
Findutils = ArtifactH(unique.Make("findutils"))
Flex = ArtifactH(unique.Make("flex"))
FontUtil = ArtifactH(unique.Make("font-util"))
Freetype = ArtifactH(unique.Make("freetype"))
Fuse = ArtifactH(unique.Make("fuse"))
GMP = ArtifactH(unique.Make("gmp"))
GLib = ArtifactH(unique.Make("glib"))
Gawk = ArtifactH(unique.Make("gawk"))
GenInitCPIO = ArtifactH(unique.Make("gen_init_cpio"))
Gettext = ArtifactH(unique.Make("gettext"))
Git = ArtifactH(unique.Make("git"))
Glslang = ArtifactH(unique.Make("glslang"))
GnuTLS = ArtifactH(unique.Make("gnutls"))
Go = ArtifactH(unique.Make("go"))
Gperf = ArtifactH(unique.Make("gperf"))
Grep = ArtifactH(unique.Make("grep"))
Gzip = ArtifactH(unique.Make("gzip"))
Hakurei = ArtifactH(unique.Make("hakurei"))
HakureiDist = ArtifactH(unique.Make("hakurei-dist"))
Hwdata = ArtifactH(unique.Make("hwdata"))
IPTables = ArtifactH(unique.Make("iptables"))
Kmod = ArtifactH(unique.Make("kmod"))
LIT = ArtifactH(unique.Make("lit"))
LibX11 = ArtifactH(unique.Make("libX11"))
LibXau = ArtifactH(unique.Make("libXau"))
LibXdmcp = ArtifactH(unique.Make("libXdmcp"))
LibXext = ArtifactH(unique.Make("libXext"))
LibXfixes = ArtifactH(unique.Make("libXfixes"))
LibXfont2 = ArtifactH(unique.Make("libXfont2"))
LibXrandr = ArtifactH(unique.Make("libXrandr"))
LibXrender = ArtifactH(unique.Make("libXrender"))
LibXxf86vm = ArtifactH(unique.Make("libXxf86vm"))
Libarchive = ArtifactH(unique.Make("libarchive"))
Libbsd = ArtifactH(unique.Make("libbsd"))
Libcap = ArtifactH(unique.Make("libcap"))
Libconfig = ArtifactH(unique.Make("libconfig"))
LibdisplayInfo = ArtifactH(unique.Make("libdisplay-info"))
Libdrm = ArtifactH(unique.Make("libdrm"))
Libepoxy = ArtifactH(unique.Make("libepoxy"))
Libev = ArtifactH(unique.Make("libev"))
Libexpat = ArtifactH(unique.Make("libexpat"))
Libffi = ArtifactH(unique.Make("libffi"))
Libfontenc = ArtifactH(unique.Make("libfontenc"))
Libgd = ArtifactH(unique.Make("libgd"))
Libglvnd = ArtifactH(unique.Make("libglvnd"))
Libiconv = ArtifactH(unique.Make("libiconv"))
Libmd = ArtifactH(unique.Make("libmd"))
Libmnl = ArtifactH(unique.Make("libmnl"))
Libnftnl = ArtifactH(unique.Make("libnftnl"))
Libpciaccess = ArtifactH(unique.Make("libpciaccess"))
Libpng = ArtifactH(unique.Make("libpng"))
Libpsl = ArtifactH(unique.Make("libpsl"))
Libseccomp = ArtifactH(unique.Make("libseccomp"))
Libtasn1 = ArtifactH(unique.Make("libtasn1"))
Libtirpc = ArtifactH(unique.Make("libtirpc"))
Libtool = ArtifactH(unique.Make("libtool"))
Libucontext = ArtifactH(unique.Make("libucontext"))
Libunistring = ArtifactH(unique.Make("libunistring"))
Libva = ArtifactH(unique.Make("libva"))
LibxcbRenderUtil = ArtifactH(unique.Make("libxcb-render-util"))
LibxcbUtil = ArtifactH(unique.Make("libxcb-util"))
LibxcbUtilImage = ArtifactH(unique.Make("libxcb-util-image"))
LibxcbUtilKeysyms = ArtifactH(unique.Make("libxcb-util-keysyms"))
LibxcbUtilWM = ArtifactH(unique.Make("libxcb-util-wm"))
Libxcvt = ArtifactH(unique.Make("libxcvt"))
Libxkbfile = ArtifactH(unique.Make("libxkbfile"))
Libxml2 = ArtifactH(unique.Make("libxml2"))
Libxshmfence = ArtifactH(unique.Make("libxshmfence"))
Libxslt = ArtifactH(unique.Make("libxslt"))
Libxtrans = ArtifactH(unique.Make("libxtrans"))
LMSensors = ArtifactH(unique.Make("lm_sensors"))
M4 = ArtifactH(unique.Make("m4"))
MPC = ArtifactH(unique.Make("mpc"))
MPFR = ArtifactH(unique.Make("mpfr"))
Make = ArtifactH(unique.Make("make"))
Mesa = ArtifactH(unique.Make("mesa"))
Meson = ArtifactH(unique.Make("meson"))
Mksh = ArtifactH(unique.Make("mksh"))
MuslFts = ArtifactH(unique.Make("musl-fts"))
MuslObstack = ArtifactH(unique.Make("musl-obstack"))
NSS = ArtifactH(unique.Make("nss"))
NSSCACert = ArtifactH(unique.Make("nss-cacert"))
Ncurses = ArtifactH(unique.Make("ncurses"))
Nettle = ArtifactH(unique.Make("nettle"))
Ninja = ArtifactH(unique.Make("ninja"))
OpenSSL = ArtifactH(unique.Make("openssl"))
P11Kit = ArtifactH(unique.Make("p11-kit"))
PCRE2 = ArtifactH(unique.Make("pcre2"))
Parallel = ArtifactH(unique.Make("parallel"))
Patch = ArtifactH(unique.Make("patch"))
Perl = ArtifactH(unique.Make("perl"))
PerlLocaleGettext = ArtifactH(unique.Make("perl-Locale::gettext"))
PerlMIMECharset = ArtifactH(unique.Make("perl-MIME::Charset"))
PerlModuleBuild = ArtifactH(unique.Make("perl-Module::Build"))
PerlPodParser = ArtifactH(unique.Make("perl-Pod::Parser"))
PerlSGMLS = ArtifactH(unique.Make("perl-SGMLS"))
PerlTermReadKey = ArtifactH(unique.Make("perl-Term::ReadKey"))
PerlTestCmd = ArtifactH(unique.Make("perl-Test::Cmd"))
PerlTextCharWidth = ArtifactH(unique.Make("perl-Text::CharWidth"))
PerlTextWrapI18N = ArtifactH(unique.Make("perl-Text::WrapI18N"))
PerlUnicodeLineBreak = ArtifactH(unique.Make("perl-Unicode::LineBreak"))
PerlYAMLTiny = ArtifactH(unique.Make("perl-YAML::Tiny"))
Pixman = ArtifactH(unique.Make("pixman"))
PkgConfig = ArtifactH(unique.Make("pkg-config"))
Procps = ArtifactH(unique.Make("procps"))
Python = ArtifactH(unique.Make("python"))
PythonFlitCore = ArtifactH(unique.Make("python-flit-core"))
PythonHatchling = ArtifactH(unique.Make("python-hatchling"))
PythonIniConfig = ArtifactH(unique.Make("python-iniconfig"))
PythonMako = ArtifactH(unique.Make("python-mako"))
PythonMarkupSafe = ArtifactH(unique.Make("python-markupsafe"))
PythonPackaging = ArtifactH(unique.Make("python-packaging"))
PythonPathspec = ArtifactH(unique.Make("python-pathspec"))
PythonPluggy = ArtifactH(unique.Make("python-pluggy"))
PythonPyTest = ArtifactH(unique.Make("python-pytest"))
PythonPyYAML = ArtifactH(unique.Make("python-pyyaml"))
PythonPycparser = ArtifactH(unique.Make("python-pycparser"))
PythonPygments = ArtifactH(unique.Make("python-pygments"))
PythonSetuptools = ArtifactH(unique.Make("python-setuptools"))
PythonSetuptoolsSCM = ArtifactH(unique.Make("python-setuptools-scm"))
PythonTroveClassifiers = ArtifactH(unique.Make("python-trove-classifiers"))
PythonVCSVersioning = ArtifactH(unique.Make("python-vcs-versioning"))
PythonWheel = ArtifactH(unique.Make("python-wheel"))
QEMU = ArtifactH(unique.Make("qemu"))
Rdfind = ArtifactH(unique.Make("rdfind"))
Readline = ArtifactH(unique.Make("readline"))
Rsync = ArtifactH(unique.Make("rsync"))
Sed = ArtifactH(unique.Make("sed"))
SPIRVHeaders = ArtifactH(unique.Make("spirv-headers"))
SPIRVLLVMTranslator = ArtifactH(unique.Make("spirv-llvm-translator"))
SPIRVTools = ArtifactH(unique.Make("spirv-tools"))
SquashfsTools = ArtifactH(unique.Make("squashfs-tools"))
Strace = ArtifactH(unique.Make("strace"))
TamaGo = ArtifactH(unique.Make("tamago"))
Tar = ArtifactH(unique.Make("tar"))
Texinfo = ArtifactH(unique.Make("texinfo"))
Toybox = ArtifactH(unique.Make("toybox"))
toyboxEarly = ArtifactH(unique.Make("toybox-early"))
Unzip = ArtifactH(unique.Make("unzip"))
UtilLinux = ArtifactH(unique.Make("util-linux"))
VIM = ArtifactH(unique.Make("vim"))
Wayland = ArtifactH(unique.Make("wayland"))
WaylandProtocols = ArtifactH(unique.Make("wayland-protocols"))
XCB = ArtifactH(unique.Make("xcb"))
XCBProto = ArtifactH(unique.Make("xcb-proto"))
XDGDBusProxy = ArtifactH(unique.Make("xdg-dbus-proxy"))
XZ = ArtifactH(unique.Make("xz"))
Xkbcomp = ArtifactH(unique.Make("xkbcomp"))
XkeyboardConfig = ArtifactH(unique.Make("xkeyboard-config"))
XorgProto = ArtifactH(unique.Make("xorgproto"))
Xserver = ArtifactH(unique.Make("xserver"))
Zlib = ArtifactH(unique.Make("zlib"))
Zstd = ArtifactH(unique.Make("zstd"))
stage0Dist = ArtifactH(unique.Make("stage0-dist"))
llvmSource = ArtifactH(unique.Make("llvm-project"))
earlyCompilerRT = ArtifactH(unique.Make("early-compiler-rt"))
earlyRuntimes = ArtifactH(unique.Make("early-runtimes"))
buildcatrust = ArtifactH(unique.Make("python-buildcatrust"))
utilMacros = ArtifactH(unique.Make("util-macros"))
Musl = ArtifactH(unique.Make("musl"))
muslHeaders = ArtifactH(unique.Make("musl-headers"))
gcc = ArtifactH(unique.Make("gcc"))
nettle3 = ArtifactH(unique.Make("nettle3"))
Stage0 = ArtifactH(unique.Make("rosa-stage0"))
)

View File

@@ -0,0 +1,33 @@
package rosa_test
import (
"testing"
"hakurei.app/internal/rosa"
)
func TestLoad(t *testing.T) {
t.Parallel()
for _, p := range rosa.Native().Collect() {
t.Run(rosa.Native().MustGet(p).Name, func(t *testing.T) {
t.Parallel()
rosa.Native().Load(rosa.Std, p)
})
}
}
func BenchmarkAll(b *testing.B) {
s := rosa.Native().Clone()
for b.Loop() {
for _, p := range s.Collect() {
s.Load(rosa.Std, p)
}
b.StopTimer()
s.DropCaches("", 0)
b.StartTimer()
}
}

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newStrace() (pkg.Artifact, string) { func (t Toolchain) newStrace(s *S) (pkg.Artifact, string) {
const ( const (
version = "6.19" version = "6.19"
checksum = "XJFJJ9XLh_1rHS3m_QNjLKzkkBAooE-QT9p9lJNNWowAmd54IJop_fI4-IFtjeeL" checksum = "XJFJJ9XLh_1rHS3m_QNjLKzkkBAooE-QT9p9lJNNWowAmd54IJop_fI4-IFtjeeL"
) )
return t.NewPackage("strace", version, pkg.NewHTTPGet( return s.NewPackage(t, "strace", version, pkg.NewHTTPGet(
nil, "https://strace.io/files/"+version+"/strace-"+version+".tar.xz", nil, "https://strace.io/files/"+version+"/strace-"+version+".tar.xz",
mustDecode(checksum), mustDecode(checksum),
), &PackageAttr{ ), &PackageAttr{
@@ -37,7 +37,7 @@ sed -i 's/unsigned int msg_len;$/uint32_t msg_len;/g' \
), version ), version
} }
func init() { func init() {
artifactsM[Strace] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newStrace, f: Toolchain.newStrace,
Name: "strace", Name: "strace",
@@ -45,5 +45,5 @@ func init() {
Website: "https://strace.io/", Website: "https://strace.io/",
ID: 4897, ID: 4897,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newTamaGo() (pkg.Artifact, string) { func (t Toolchain) newTamaGo(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.26.3" version = "1.26.3"
checksum = "-nH3MjAzDDLTeJ2hRKYJcJwo5-Ikci4zOHfB8j1vKn7zrF9TS6zYaoLi8qohGwAE" checksum = "-nH3MjAzDDLTeJ2hRKYJcJwo5-Ikci4zOHfB8j1vKn7zrF9TS6zYaoLi8qohGwAE"
) )
return t.New("tamago-go"+version, 0, t.AppendPresets(nil, return s.New(t, "tamago-go"+version, 0, s.AppendPresets(t, nil,
Bash, Bash,
Go, Go,
), nil, []string{ ), nil, []string{
@@ -21,8 +21,8 @@ cd /work/system/tamago/src
chmod -R +w .. chmod -R +w ..
sed -i \ sed -i \
's,/lib/ld-musl-`+linuxArch()+`.so.1,/system/bin/linker,' \ 's,/lib/ld-musl-`+s.linuxArch()+`.so.1,/system/bin/linker,' \
cmd/link/internal/`+arch+`/obj.go cmd/link/internal/`+s.arch+`/obj.go
sed -i \ sed -i \
's/cpu.X86.HasAVX512VBMI/& \&\& cpu.X86.HasPOPCNT/' \ 's/cpu.X86.HasAVX512VBMI/& \&\& cpu.X86.HasPOPCNT/' \
internal/runtime/gc/scan/scan_amd64.go internal/runtime/gc/scan/scan_amd64.go
@@ -40,7 +40,7 @@ rm \
))), version ))), version
} }
func init() { func init() {
artifactsM[TamaGo] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newTamaGo, f: Toolchain.newTamaGo,
Name: "tamago", Name: "tamago",
@@ -48,5 +48,5 @@ func init() {
Website: "https://github.com/usbarmory/tamago-go", Website: "https://github.com/usbarmory/tamago-go",
ID: 388872, ID: 388872,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newToybox(suffix, script string) (pkg.Artifact, string) { func (s *S) newToybox(t Toolchain, suffix, script string) (pkg.Artifact, string) {
const ( const (
version = "0.8.13" version = "0.8.13"
checksum = "rZ1V1ATDte2WeQZanxLVoiRGdfPXhMlEo5-exX-e-ml8cGn9qOv0ABEUVZpX3wTI" checksum = "rZ1V1ATDte2WeQZanxLVoiRGdfPXhMlEo5-exX-e-ml8cGn9qOv0ABEUVZpX3wTI"
) )
return t.NewPackage("toybox"+suffix, version, newTar( return s.NewPackage(t, "toybox"+suffix, version, newTar(
"https://landley.net/toybox/downloads/toybox-"+version+".tar.gz", "https://landley.net/toybox/downloads/toybox-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -59,9 +59,9 @@ ln -s ../../system/bin/env /work/usr/bin
), version ), version
} }
func init() { func init() {
artifactsM[Toybox] = Metadata{ native.MustRegister(&Artifact{
f: func(t Toolchain) (pkg.Artifact, string) { f: func(t Toolchain, s *S) (pkg.Artifact, string) {
return t.newToybox("", "") return s.newToybox(t, "", "")
}, },
Name: "toybox", Name: "toybox",
@@ -69,11 +69,11 @@ func init() {
Website: "https://landley.net/toybox/", Website: "https://landley.net/toybox/",
ID: 13818, ID: 13818,
} })
artifactsM[toyboxEarly] = Metadata{ native.MustRegister(&Artifact{
f: func(t Toolchain) (pkg.Artifact, string) { f: func(t Toolchain, s *S) (pkg.Artifact, string) {
return t.newToybox("-early", ` return s.newToybox(t, "-early", `
echo ' echo '
CONFIG_EXPR=y CONFIG_EXPR=y
CONFIG_TR=y CONFIG_TR=y
@@ -86,5 +86,5 @@ CONFIG_DIFF=y
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

@@ -6,12 +6,12 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newUnzip() (pkg.Artifact, string) { func (t Toolchain) newUnzip(s *S) (pkg.Artifact, string) {
const ( const (
version = "6.0" version = "6.0"
checksum = "fcqjB1IOVRNJ16K5gTGEDt3zCJDVBc7EDSra9w3H93stqkNwH1vaPQs_QGOpQZu1" checksum = "fcqjB1IOVRNJ16K5gTGEDt3zCJDVBc7EDSra9w3H93stqkNwH1vaPQs_QGOpQZu1"
) )
return t.New("unzip-"+version, 0, t.AppendPresets(nil, return s.New(t, "unzip-"+version, 0, s.AppendPresets(t, nil,
Make, Make,
Coreutils, Coreutils,
), nil, nil, ` ), nil, nil, `
@@ -21,7 +21,7 @@ make -f unix/Makefile generic1
mkdir -p /work/system/bin/ mkdir -p /work/system/bin/
mv unzip /work/system/bin/ mv unzip /work/system/bin/
`, pkg.Path(AbsUsrSrc.Append("unzip"), true, t.NewPatchedSource( `, pkg.Path(AbsUsrSrc.Append("unzip"), true, s.NewPatchedSource(t,
"unzip", version, newTar( "unzip", version, newTar(
"https://downloads.sourceforge.net/project/infozip/"+ "https://downloads.sourceforge.net/project/infozip/"+
"UnZip%206.x%20%28latest%29/UnZip%20"+version+"/"+ "UnZip%206.x%20%28latest%29/UnZip%20"+version+"/"+
@@ -32,7 +32,7 @@ mv unzip /work/system/bin/
))), version ))), version
} }
func init() { func init() {
artifactsM[Unzip] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newUnzip, f: Toolchain.newUnzip,
Name: "unzip", Name: "unzip",
@@ -40,5 +40,5 @@ func init() {
Website: "https://infozip.sourceforge.net/", Website: "https://infozip.sourceforge.net/",
ID: 8684, ID: 8684,
} })
} }

View File

@@ -6,12 +6,12 @@ import (
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
) )
func (t Toolchain) newUtilLinux() (pkg.Artifact, string) { func (t Toolchain) newUtilLinux(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.42" version = "2.42"
checksum = "Uy8Nxg9DsW5YwDoeaZeZTyQJ2YmnaaL_fSsQXsLUiFFUd7wnZeD_3SEaVO7ClJlk" checksum = "Uy8Nxg9DsW5YwDoeaZeZTyQJ2YmnaaL_fSsQXsLUiFFUd7wnZeD_3SEaVO7ClJlk"
) )
return t.NewPackage("util-linux", version, newTar( return s.NewPackage(t, "util-linux", version, newTar(
"https://www.kernel.org/pub/linux/utils/util-linux/"+ "https://www.kernel.org/pub/linux/utils/util-linux/"+
"v"+strings.Join(strings.SplitN(version, ".", 3)[:2], ".")+ "v"+strings.Join(strings.SplitN(version, ".", 3)[:2], ".")+
"/util-linux-"+version+".tar.gz", "/util-linux-"+version+".tar.gz",
@@ -47,7 +47,7 @@ ln -s ../system/bin/bash /bin/
), version ), version
} }
func init() { func init() {
artifactsM[UtilLinux] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newUtilLinux, f: Toolchain.newUtilLinux,
Name: "util-linux", Name: "util-linux",
@@ -58,5 +58,5 @@ func init() {
// release candidates confuse Anitya // release candidates confuse Anitya
latest: (*Versions).getStable, latest: (*Versions).getStable,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newVIM() (pkg.Artifact, string) { func (t Toolchain) newVIM(s *S) (pkg.Artifact, string) {
const ( const (
version = "9.2.0461" version = "9.2.0461"
checksum = "18Rr_5oIf_PkKuqVkN4CMZIGkZEgpN1vamlrsvPLBjn4mN98CRuoJmhzRZ7MoVYM" checksum = "18Rr_5oIf_PkKuqVkN4CMZIGkZEgpN1vamlrsvPLBjn4mN98CRuoJmhzRZ7MoVYM"
) )
return t.NewPackage("vim", version, newFromGitHub( return s.NewPackage(t, "vim", version, newFromGitHub(
"vim/vim", "vim/vim",
"v"+version, "v"+version,
checksum, checksum,
@@ -29,7 +29,7 @@ func (t Toolchain) newVIM() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[VIM] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newVIM, f: Toolchain.newVIM,
Name: "vim", Name: "vim",
@@ -41,5 +41,5 @@ func init() {
}, },
ID: 5092, ID: 5092,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newWayland() (pkg.Artifact, string) { func (t Toolchain) newWayland(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.25.0" version = "1.25.0"
checksum = "q-4dYXme46JPgLGtXAxyZGTy7udll9RfT0VXtcW2YRR1WWViUhvdZXZneXzLqpCg" checksum = "q-4dYXme46JPgLGtXAxyZGTy7udll9RfT0VXtcW2YRR1WWViUhvdZXZneXzLqpCg"
) )
return t.NewPackage("wayland", version, newFromGitLab( return s.NewPackage(t, "wayland", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"wayland/wayland", "wayland/wayland",
version, version,
@@ -35,7 +35,7 @@ echo 'int main(){}' > tests/sanity-test.c
), version ), version
} }
func init() { func init() {
artifactsM[Wayland] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newWayland, f: Toolchain.newWayland,
Name: "wayland", Name: "wayland",
@@ -49,15 +49,15 @@ func init() {
}, },
ID: 10061, ID: 10061,
} })
} }
func (t Toolchain) newWaylandProtocols() (pkg.Artifact, string) { func (t Toolchain) newWaylandProtocols(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.48" version = "1.48"
checksum = "xvfHCBIzXGwOqOu9b8dfhGw_U29Pd-g4JBwpYIaxee8SwEbxi6NaVU-Y1Q7wY4jK" checksum = "xvfHCBIzXGwOqOu9b8dfhGw_U29Pd-g4JBwpYIaxee8SwEbxi6NaVU-Y1Q7wY4jK"
) )
return t.NewPackage("wayland-protocols", version, newFromGitLab( return s.NewPackage(t, "wayland-protocols", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"wayland/wayland-protocols", "wayland/wayland-protocols",
version, version,
@@ -121,7 +121,7 @@ GitLab
), version ), version
} }
func init() { func init() {
artifactsM[WaylandProtocols] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newWaylandProtocols, f: Toolchain.newWaylandProtocols,
Name: "wayland-protocols", Name: "wayland-protocols",
@@ -129,5 +129,5 @@ func init() {
Website: "https://wayland.freedesktop.org/", Website: "https://wayland.freedesktop.org/",
ID: 13997, ID: 13997,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newUtilMacros() (pkg.Artifact, string) { func (t Toolchain) newUtilMacros(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.20.2" version = "1.20.2"
checksum = "Ze8QH3Z3emC0pWFP-0nUYeMy7aBW3L_dxBBmVgcumIHNzEKc1iGTR-yUFR3JcM1G" checksum = "Ze8QH3Z3emC0pWFP-0nUYeMy7aBW3L_dxBBmVgcumIHNzEKc1iGTR-yUFR3JcM1G"
) )
return t.NewPackage("util-macros", version, newTar( return s.NewPackage(t, "util-macros", version, newTar(
"https://www.x.org/releases/individual/util/"+ "https://www.x.org/releases/individual/util/"+
"util-macros-"+version+".tar.gz", "util-macros-"+version+".tar.gz",
checksum, checksum,
@@ -15,7 +15,7 @@ func (t Toolchain) newUtilMacros() (pkg.Artifact, string) {
), nil, (*MakeHelper)(nil)), version ), nil, (*MakeHelper)(nil)), version
} }
func init() { func init() {
artifactsM[utilMacros] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newUtilMacros, f: Toolchain.newUtilMacros,
Name: "util-macros", Name: "util-macros",
@@ -23,15 +23,15 @@ func init() {
Website: "https://xorg.freedesktop.org/", Website: "https://xorg.freedesktop.org/",
ID: 5252, ID: 5252,
} })
} }
func (t Toolchain) newLibxtrans() (pkg.Artifact, string) { func (t Toolchain) newLibxtrans(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.6.0" version = "1.6.0"
checksum = "1cxDCF59fLf1HyGDMcjR1L50ZbjD0RTTEDUpOJYcHXu6HUK_Ds0x-KREY7rLNxu9" checksum = "1cxDCF59fLf1HyGDMcjR1L50ZbjD0RTTEDUpOJYcHXu6HUK_Ds0x-KREY7rLNxu9"
) )
return t.NewPackage("libxtrans", version, newFromGitLab( return s.NewPackage(t, "libxtrans", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/lib/libxtrans", "xorg/lib/libxtrans",
"xtrans-"+version, "xtrans-"+version,
@@ -47,7 +47,7 @@ func (t Toolchain) newLibxtrans() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Libxtrans] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibxtrans, f: Toolchain.newLibxtrans,
Name: "libxtrans", Name: "libxtrans",
@@ -55,15 +55,15 @@ func init() {
Website: "https://gitlab.freedesktop.org/xorg/lib/libxtrans", Website: "https://gitlab.freedesktop.org/xorg/lib/libxtrans",
ID: 13441, ID: 13441,
} })
} }
func (t Toolchain) newXorgProto() (pkg.Artifact, string) { func (t Toolchain) newXorgProto(s *S) (pkg.Artifact, string) {
const ( const (
version = "2025.1" version = "2025.1"
checksum = "pTwJiBJHKA6Rgm3cVDXy1lyvXNIUzTRaukvvYdk1xWoJ_1G-Dfjm9MyewuyIjoHz" checksum = "pTwJiBJHKA6Rgm3cVDXy1lyvXNIUzTRaukvvYdk1xWoJ_1G-Dfjm9MyewuyIjoHz"
) )
return t.NewPackage("xorgproto", version, newFromGitLab( return s.NewPackage(t, "xorgproto", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/proto/xorgproto", "xorg/proto/xorgproto",
"xorgproto-"+version, "xorgproto-"+version,
@@ -78,7 +78,7 @@ func (t Toolchain) newXorgProto() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[XorgProto] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newXorgProto, f: Toolchain.newXorgProto,
Name: "xorgproto", Name: "xorgproto",
@@ -86,15 +86,15 @@ func init() {
Website: "https://gitlab.freedesktop.org/xorg/proto/xorgproto", Website: "https://gitlab.freedesktop.org/xorg/proto/xorgproto",
ID: 17190, ID: 17190,
} })
} }
func (t Toolchain) newLibXau() (pkg.Artifact, string) { func (t Toolchain) newLibXau(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.0.12" version = "1.0.12"
checksum = "G9AjnU_C160q814MCdjFOVt_mQz_pIt4wf4GNOQmGJS3UuuyMw53sfPvJ7WOqwXN" checksum = "G9AjnU_C160q814MCdjFOVt_mQz_pIt4wf4GNOQmGJS3UuuyMw53sfPvJ7WOqwXN"
) )
return t.NewPackage("libXau", version, newTar( return s.NewPackage(t, "libXau", version, newTar(
"https://www.x.org/releases/individual/lib/"+ "https://www.x.org/releases/individual/lib/"+
"libXau-"+version+".tar.gz", "libXau-"+version+".tar.gz",
checksum, checksum,
@@ -112,7 +112,7 @@ func (t Toolchain) newLibXau() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[LibXau] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibXau, f: Toolchain.newLibXau,
Name: "libXau", Name: "libXau",
@@ -124,15 +124,15 @@ func init() {
}, },
ID: 1765, ID: 1765,
} })
} }
func (t Toolchain) newXCBProto() (pkg.Artifact, string) { func (t Toolchain) newXCBProto(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.17.0" version = "1.17.0"
checksum = "_NtbKaJ_iyT7XiJz25mXQ7y-niTzE8sHPvLXZPcqtNoV_-vTzqkezJ8Hp2U1enCv" checksum = "_NtbKaJ_iyT7XiJz25mXQ7y-niTzE8sHPvLXZPcqtNoV_-vTzqkezJ8Hp2U1enCv"
) )
return t.NewPackage("xcb-proto", version, newTar( return s.NewPackage(t, "xcb-proto", version, newTar(
"https://xcb.freedesktop.org/dist/xcb-proto-"+version+".tar.gz", "https://xcb.freedesktop.org/dist/xcb-proto-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -141,7 +141,7 @@ func (t Toolchain) newXCBProto() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[XCBProto] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newXCBProto, f: Toolchain.newXCBProto,
Name: "xcb-proto", Name: "xcb-proto",
@@ -149,15 +149,15 @@ func init() {
Website: "https://gitlab.freedesktop.org/xorg/proto/xcbproto", Website: "https://gitlab.freedesktop.org/xorg/proto/xcbproto",
ID: 13646, ID: 13646,
} })
} }
func (t Toolchain) newXCB() (pkg.Artifact, string) { func (t Toolchain) newXCB(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.17.0" version = "1.17.0"
checksum = "hjjsc79LpWM_hZjNWbDDS6qRQUXREjjekS6UbUsDq-RR1_AjgNDxhRvZf-1_kzDd" checksum = "hjjsc79LpWM_hZjNWbDDS6qRQUXREjjekS6UbUsDq-RR1_AjgNDxhRvZf-1_kzDd"
) )
return t.NewPackage("xcb", version, newTar( return s.NewPackage(t, "xcb", version, newTar(
"https://xcb.freedesktop.org/dist/libxcb-"+version+".tar.gz", "https://xcb.freedesktop.org/dist/libxcb-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -170,7 +170,7 @@ func (t Toolchain) newXCB() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[XCB] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newXCB, f: Toolchain.newXCB,
Name: "xcb", Name: "xcb",
@@ -183,15 +183,15 @@ func init() {
}, },
ID: 1767, ID: 1767,
} })
} }
func (t Toolchain) newLibxcbUtilKeysyms() (pkg.Artifact, string) { func (t Toolchain) newLibxcbUtilKeysyms(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.4.1" version = "0.4.1"
checksum = "-EEje12UEjtFBuIjb6Fy4cxEghV20BXwQ1BLvhtvSuVcrFkp_X-ZHRM48wAspXZ4" checksum = "-EEje12UEjtFBuIjb6Fy4cxEghV20BXwQ1BLvhtvSuVcrFkp_X-ZHRM48wAspXZ4"
) )
return t.NewPackage("libxcb-util-keysyms", version, newTar( return s.NewPackage(t, "libxcb-util-keysyms", version, newTar(
"https://xcb.freedesktop.org/dist/xcb-util-keysyms-"+version+".tar.gz", "https://xcb.freedesktop.org/dist/xcb-util-keysyms-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -202,7 +202,7 @@ func (t Toolchain) newLibxcbUtilKeysyms() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[LibxcbUtilKeysyms] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibxcbUtilKeysyms, f: Toolchain.newLibxcbUtilKeysyms,
Name: "libxcb-util-keysyms", Name: "libxcb-util-keysyms",
@@ -214,15 +214,15 @@ func init() {
}, },
ID: 5168, ID: 5168,
} })
} }
func (t Toolchain) newLibxcbUtilImage() (pkg.Artifact, string) { func (t Toolchain) newLibxcbUtilImage(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.4.1" version = "0.4.1"
checksum = "47pvXmFwaUBZIrJ4CE9xjTQIFyxeqoNAL-DshlB11GZ_jjI3G1a6KF0K7mtBQ1E7" checksum = "47pvXmFwaUBZIrJ4CE9xjTQIFyxeqoNAL-DshlB11GZ_jjI3G1a6KF0K7mtBQ1E7"
) )
return t.NewPackage("libxcb-util-image", version, newTar( return s.NewPackage(t, "libxcb-util-image", version, newTar(
"https://xcb.freedesktop.org/dist/xcb-util-image-"+version+".tar.gz", "https://xcb.freedesktop.org/dist/xcb-util-image-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -233,7 +233,7 @@ func (t Toolchain) newLibxcbUtilImage() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[LibxcbUtilImage] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibxcbUtilImage, f: Toolchain.newLibxcbUtilImage,
Name: "libxcb-util-image", Name: "libxcb-util-image",
@@ -245,15 +245,15 @@ func init() {
}, },
ID: 5168, ID: 5168,
} })
} }
func (t Toolchain) newLibxcbUtilWM() (pkg.Artifact, string) { func (t Toolchain) newLibxcbUtilWM(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.4.2" version = "0.4.2"
checksum = "g0VZgMU9hcIgyXb3XxBR9xqsvUMBd9qt_Dbmwoj2h5y24pODr_S_D0DhRsuXUNjF" checksum = "g0VZgMU9hcIgyXb3XxBR9xqsvUMBd9qt_Dbmwoj2h5y24pODr_S_D0DhRsuXUNjF"
) )
return t.NewPackage("libxcb-util-wm", version, newTar( return s.NewPackage(t, "libxcb-util-wm", version, newTar(
"https://xcb.freedesktop.org/dist/xcb-util-wm-"+version+".tar.gz", "https://xcb.freedesktop.org/dist/xcb-util-wm-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -265,7 +265,7 @@ func (t Toolchain) newLibxcbUtilWM() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[LibxcbUtilWM] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibxcbUtilWM, f: Toolchain.newLibxcbUtilWM,
Name: "libxcb-util-wm", Name: "libxcb-util-wm",
@@ -277,15 +277,15 @@ func init() {
}, },
ID: 5170, ID: 5170,
} })
} }
func (t Toolchain) newLibxcbUtil() (pkg.Artifact, string) { func (t Toolchain) newLibxcbUtil(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.4.1" version = "0.4.1"
checksum = "YMXGQUQbF6PoEAGflvYnJYsLWjti6sL_ifY47wIXTNGVM3tQ8u41nkBYN4K1D5CD" checksum = "YMXGQUQbF6PoEAGflvYnJYsLWjti6sL_ifY47wIXTNGVM3tQ8u41nkBYN4K1D5CD"
) )
return t.NewPackage("libxcb-util", version, newTar( return s.NewPackage(t, "libxcb-util", version, newTar(
"https://www.x.org/releases/individual/xcb/"+ "https://www.x.org/releases/individual/xcb/"+
"xcb-util-"+version+".tar.gz", "xcb-util-"+version+".tar.gz",
checksum, checksum,
@@ -298,7 +298,7 @@ func (t Toolchain) newLibxcbUtil() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[LibxcbUtil] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibxcbUtil, f: Toolchain.newLibxcbUtil,
Name: "libxcb-util", Name: "libxcb-util",
@@ -310,15 +310,15 @@ func init() {
}, },
ID: 5165, ID: 5165,
} })
} }
func (t Toolchain) newLibxcbRenderUtil() (pkg.Artifact, string) { func (t Toolchain) newLibxcbRenderUtil(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.3.10" version = "0.3.10"
checksum = "n08L8PyCoOd7v2vb6fSVq5Pq6JtteXVh9K2wrQMTNwGMf_Fjpi6i3HWF-TMFSVTI" checksum = "n08L8PyCoOd7v2vb6fSVq5Pq6JtteXVh9K2wrQMTNwGMf_Fjpi6i3HWF-TMFSVTI"
) )
return t.NewPackage("libxcb-render-util", version, newTar( return s.NewPackage(t, "libxcb-render-util", version, newTar(
"https://www.x.org/releases/individual/xcb/"+ "https://www.x.org/releases/individual/xcb/"+
"xcb-util-renderutil-"+version+".tar.gz", "xcb-util-renderutil-"+version+".tar.gz",
checksum, checksum,
@@ -331,7 +331,7 @@ func (t Toolchain) newLibxcbRenderUtil() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[LibxcbRenderUtil] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibxcbRenderUtil, f: Toolchain.newLibxcbRenderUtil,
Name: "libxcb-render-util", Name: "libxcb-render-util",
@@ -343,15 +343,15 @@ func init() {
}, },
ID: 5169, ID: 5169,
} })
} }
func (t Toolchain) newLibX11() (pkg.Artifact, string) { func (t Toolchain) newLibX11(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.8.13" version = "1.8.13"
checksum = "ARh-cuZY_U2v3DbPS1byc7ybh9NInZc-yav7SJiusk_C7408s058qWV83ocMd2pT" checksum = "ARh-cuZY_U2v3DbPS1byc7ybh9NInZc-yav7SJiusk_C7408s058qWV83ocMd2pT"
) )
return t.NewPackage("libX11", version, newFromGitLab( return s.NewPackage(t, "libX11", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/lib/libx11", "xorg/lib/libx11",
"libX11-"+version, "libX11-"+version,
@@ -375,7 +375,7 @@ func (t Toolchain) newLibX11() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[LibX11] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibX11, f: Toolchain.newLibX11,
Name: "libX11", Name: "libX11",
@@ -387,15 +387,15 @@ func init() {
}, },
ID: 1764, ID: 1764,
} })
} }
func (t Toolchain) newLibXext() (pkg.Artifact, string) { func (t Toolchain) newLibXext(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.3.7" version = "1.3.7"
checksum = "-0wvUDaucLPLNOrK1pcKhHNoO-5nUqQyyw6JAbhx65gRjuMiNKKaF2_tcrbC_KNq" checksum = "-0wvUDaucLPLNOrK1pcKhHNoO-5nUqQyyw6JAbhx65gRjuMiNKKaF2_tcrbC_KNq"
) )
return t.NewPackage("libXext", version, newFromGitLab( return s.NewPackage(t, "libXext", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/lib/libxext", "xorg/lib/libxext",
"libXext-"+version, "libXext-"+version,
@@ -412,7 +412,7 @@ func (t Toolchain) newLibXext() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[LibXext] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibXext, f: Toolchain.newLibXext,
Name: "libXext", Name: "libXext",
@@ -424,15 +424,15 @@ func init() {
}, },
ID: 1774, ID: 1774,
} })
} }
func (t Toolchain) newLibXfixes() (pkg.Artifact, string) { func (t Toolchain) newLibXfixes(s *S) (pkg.Artifact, string) {
const ( const (
version = "6.0.2" version = "6.0.2"
checksum = "_-kJfKZ7cE3NNeMr6NLSXCmsyP7MVEHVPLNfxatz2qBy3_fZJvPMQwZNOC9y6V5L" checksum = "_-kJfKZ7cE3NNeMr6NLSXCmsyP7MVEHVPLNfxatz2qBy3_fZJvPMQwZNOC9y6V5L"
) )
return t.NewPackage("libXfixes", version, newFromGitLab( return s.NewPackage(t, "libXfixes", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/lib/libxfixes", "xorg/lib/libxfixes",
"libXfixes-"+version, "libXfixes-"+version,
@@ -450,7 +450,7 @@ func (t Toolchain) newLibXfixes() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[LibXfixes] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibXfixes, f: Toolchain.newLibXfixes,
Name: "libXfixes", Name: "libXfixes",
@@ -462,15 +462,15 @@ func init() {
}, },
ID: 1775, ID: 1775,
} })
} }
func (t Toolchain) newLibXrender() (pkg.Artifact, string) { func (t Toolchain) newLibXrender(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.9.12" version = "0.9.12"
checksum = "s6nWn-r17X_W-7anaS7wIcq5_Levf9zAigwJDD9Klp-cCJTVDhLo7GufuVOrxVP0" checksum = "s6nWn-r17X_W-7anaS7wIcq5_Levf9zAigwJDD9Klp-cCJTVDhLo7GufuVOrxVP0"
) )
return t.NewPackage("libXrender", version, newFromGitLab( return s.NewPackage(t, "libXrender", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/lib/libxrender", "xorg/lib/libxrender",
"libXrender-"+version, "libXrender-"+version,
@@ -487,7 +487,7 @@ func (t Toolchain) newLibXrender() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[LibXrender] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibXrender, f: Toolchain.newLibXrender,
Name: "libXrender", Name: "libXrender",
@@ -499,15 +499,15 @@ func init() {
}, },
ID: 1789, ID: 1789,
} })
} }
func (t Toolchain) newLibxshmfence() (pkg.Artifact, string) { func (t Toolchain) newLibxshmfence(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.3.3" version = "1.3.3"
checksum = "JamExTPg81By2fs3vWdeo_dzlpBQeAwXr2sDXeHJqm9XBoLW5pamiD6FgAWtAKyA" checksum = "JamExTPg81By2fs3vWdeo_dzlpBQeAwXr2sDXeHJqm9XBoLW5pamiD6FgAWtAKyA"
) )
return t.NewPackage("libxshmfence", version, newFromGitLab( return s.NewPackage(t, "libxshmfence", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/lib/libxshmfence", "xorg/lib/libxshmfence",
"libxshmfence-"+version, "libxshmfence-"+version,
@@ -524,7 +524,7 @@ func (t Toolchain) newLibxshmfence() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Libxshmfence] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibxshmfence, f: Toolchain.newLibxshmfence,
Name: "libxshmfence", Name: "libxshmfence",
@@ -532,15 +532,15 @@ func init() {
Website: "https://gitlab.freedesktop.org/xorg/lib/libxshmfence", Website: "https://gitlab.freedesktop.org/xorg/lib/libxshmfence",
ID: 1792, ID: 1792,
} })
} }
func (t Toolchain) newLibXxf86vm() (pkg.Artifact, string) { func (t Toolchain) newLibXxf86vm(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.1.7" version = "1.1.7"
checksum = "mS4cgKWrwz6M1Lb6Qu4ZVh8Xn2Ca_4HXPxr3LDad4iYY1LecZfeLUPW1hkp6amX_" checksum = "mS4cgKWrwz6M1Lb6Qu4ZVh8Xn2Ca_4HXPxr3LDad4iYY1LecZfeLUPW1hkp6amX_"
) )
return t.NewPackage("libXxf86vm", version, newFromGitLab( return s.NewPackage(t, "libXxf86vm", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/lib/libxxf86vm", "xorg/lib/libxxf86vm",
"libXxf86vm-"+version, "libXxf86vm-"+version,
@@ -558,7 +558,7 @@ func (t Toolchain) newLibXxf86vm() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[LibXxf86vm] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibXxf86vm, f: Toolchain.newLibXxf86vm,
Name: "libXxf86vm", Name: "libXxf86vm",
@@ -570,15 +570,15 @@ func init() {
}, },
ID: 1799, ID: 1799,
} })
} }
func (t Toolchain) newLibXrandr() (pkg.Artifact, string) { func (t Toolchain) newLibXrandr(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.5.5" version = "1.5.5"
checksum = "OF7C7VC5MwnFue9UX5UnIkG1PIWvn9bBMq6d4mVyJJ_rcF0w4Kedn1lfxBsXEKAP" checksum = "OF7C7VC5MwnFue9UX5UnIkG1PIWvn9bBMq6d4mVyJJ_rcF0w4Kedn1lfxBsXEKAP"
) )
return t.NewPackage("libXrandr", version, newFromGitLab( return s.NewPackage(t, "libXrandr", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/lib/libxrandr", "xorg/lib/libxrandr",
"libXrandr-"+version, "libXrandr-"+version,
@@ -597,7 +597,7 @@ func (t Toolchain) newLibXrandr() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[LibXrandr] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibXrandr, f: Toolchain.newLibXrandr,
Name: "libXrandr", Name: "libXrandr",
@@ -610,15 +610,15 @@ func init() {
}, },
ID: 1788, ID: 1788,
} })
} }
func (t Toolchain) newFontUtil() (pkg.Artifact, string) { func (t Toolchain) newFontUtil(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.4.2" version = "1.4.2"
checksum = "YWiaIxkq-N2yNdbGa_RF1S0UkQq6xsgoRT73WZP2DOmyH_CJ0TAkpQjId657MQmh" checksum = "YWiaIxkq-N2yNdbGa_RF1S0UkQq6xsgoRT73WZP2DOmyH_CJ0TAkpQjId657MQmh"
) )
return t.NewPackage("font-util", version, newFromGitLab( return s.NewPackage(t, "font-util", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/font/util", "xorg/font/util",
"font-util-"+version, "font-util-"+version,
@@ -634,7 +634,7 @@ func (t Toolchain) newFontUtil() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[FontUtil] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newFontUtil, f: Toolchain.newFontUtil,
Name: "font-util", Name: "font-util",
@@ -642,15 +642,15 @@ func init() {
Website: "https://gitlab.freedesktop.org/xorg/font/util", Website: "https://gitlab.freedesktop.org/xorg/font/util",
ID: 15055, ID: 15055,
} })
} }
func (t Toolchain) newLibfontenc() (pkg.Artifact, string) { func (t Toolchain) newLibfontenc(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.1.9" version = "1.1.9"
checksum = "XqosXfbVwaoYzG9vVyRCl3eatwjASoJdLZsxQ37NN8S_jTyqNmbxpRSJGImJj7RS" checksum = "XqosXfbVwaoYzG9vVyRCl3eatwjASoJdLZsxQ37NN8S_jTyqNmbxpRSJGImJj7RS"
) )
return t.NewPackage("libfontenc", version, newFromGitLab( return s.NewPackage(t, "libfontenc", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/lib/libfontenc", "xorg/lib/libfontenc",
"libfontenc-"+version, "libfontenc-"+version,
@@ -668,7 +668,7 @@ func (t Toolchain) newLibfontenc() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Libfontenc] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibfontenc, f: Toolchain.newLibfontenc,
Name: "libfontenc", Name: "libfontenc",
@@ -676,15 +676,15 @@ func init() {
Website: "https://gitlab.freedesktop.org/xorg/lib/libfontenc", Website: "https://gitlab.freedesktop.org/xorg/lib/libfontenc",
ID: 1613, ID: 1613,
} })
} }
func (t Toolchain) newLibxkbfile() (pkg.Artifact, string) { func (t Toolchain) newLibxkbfile(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.2.0" version = "1.2.0"
checksum = "WUtph1ab0AyATahlwljchBxZJcpjYrjyhCK9DW2VO0uXEXaN22GWmUaibcA83i_B" checksum = "WUtph1ab0AyATahlwljchBxZJcpjYrjyhCK9DW2VO0uXEXaN22GWmUaibcA83i_B"
) )
return t.NewPackage("libxkbfile", version, newFromGitLab( return s.NewPackage(t, "libxkbfile", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/lib/libxkbfile", "xorg/lib/libxkbfile",
"libxkbfile-"+version, "libxkbfile-"+version,
@@ -694,7 +694,7 @@ func (t Toolchain) newLibxkbfile() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Libxkbfile] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibxkbfile, f: Toolchain.newLibxkbfile,
Name: "libxkbfile", Name: "libxkbfile",
@@ -706,15 +706,15 @@ func init() {
}, },
ID: 1781, ID: 1781,
} })
} }
func (t Toolchain) newXkbcomp() (pkg.Artifact, string) { func (t Toolchain) newXkbcomp(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.5.0" version = "1.5.0"
checksum = "ttICW8ZPbljI-nw2kknvxFhwFoDK40iAMBeZDLAHYsHf3B6UPO_zc9TpzZYRRyZH" checksum = "ttICW8ZPbljI-nw2kknvxFhwFoDK40iAMBeZDLAHYsHf3B6UPO_zc9TpzZYRRyZH"
) )
return t.NewPackage("xkbcomp", version, newFromGitLab( return s.NewPackage(t, "xkbcomp", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/app/xkbcomp", "xorg/app/xkbcomp",
"xkbcomp-"+version, "xkbcomp-"+version,
@@ -732,7 +732,7 @@ func (t Toolchain) newXkbcomp() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Xkbcomp] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newXkbcomp, f: Toolchain.newXkbcomp,
Name: "xkbcomp", Name: "xkbcomp",
@@ -744,15 +744,15 @@ func init() {
}, },
ID: 15018, ID: 15018,
} })
} }
func (t Toolchain) newLibXfont2() (pkg.Artifact, string) { func (t Toolchain) newLibXfont2(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.0.7" version = "2.0.7"
checksum = "jv9BZNA02493KB8j1lfAErF5SA3ZFcAhm3_UVJ--Bp1maz-vNprl_wXpkHApBi9M" checksum = "jv9BZNA02493KB8j1lfAErF5SA3ZFcAhm3_UVJ--Bp1maz-vNprl_wXpkHApBi9M"
) )
return t.NewPackage("libXfont2", version, newFromGitLab( return s.NewPackage(t, "libXfont2", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/lib/libxfont", "xorg/lib/libxfont",
"libXfont2-"+version, "libXfont2-"+version,
@@ -772,7 +772,7 @@ func (t Toolchain) newLibXfont2() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[LibXfont2] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibXfont2, f: Toolchain.newLibXfont2,
Name: "libXfont2", Name: "libXfont2",
@@ -785,15 +785,15 @@ func init() {
}, },
ID: 17165, ID: 17165,
} })
} }
func (t Toolchain) newLibxcvt() (pkg.Artifact, string) { func (t Toolchain) newLibxcvt(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.1.3" version = "0.1.3"
checksum = "IfIA7SxlHMWh681e1AgYmZcRAfkZd5LlzmqcMRifNY5nNVRrUx_wnoaidAv0Yu03" checksum = "IfIA7SxlHMWh681e1AgYmZcRAfkZd5LlzmqcMRifNY5nNVRrUx_wnoaidAv0Yu03"
) )
return t.NewPackage("libxcvt", version, newFromGitLab( return s.NewPackage(t, "libxcvt", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/lib/libxcvt", "xorg/lib/libxcvt",
"libxcvt-"+version, "libxcvt-"+version,
@@ -801,7 +801,7 @@ func (t Toolchain) newLibxcvt() (pkg.Artifact, string) {
), nil, (*MesonHelper)(nil)), version ), nil, (*MesonHelper)(nil)), version
} }
func init() { func init() {
artifactsM[Libxcvt] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibxcvt, f: Toolchain.newLibxcvt,
Name: "libxcvt", Name: "libxcvt",
@@ -809,15 +809,15 @@ func init() {
Website: "https://gitlab.freedesktop.org/xorg/lib/libxcvt", Website: "https://gitlab.freedesktop.org/xorg/lib/libxcvt",
ID: 235147, ID: 235147,
} })
} }
func (t Toolchain) newLibXdmcp() (pkg.Artifact, string) { func (t Toolchain) newLibXdmcp(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.1.5" version = "1.1.5"
checksum = "N6AJSv9pmeBedFn8KuSIOUGvTken4rkypNWVE2KfPlliwkfIbhfXrt5YHZkBMUHp" checksum = "N6AJSv9pmeBedFn8KuSIOUGvTken4rkypNWVE2KfPlliwkfIbhfXrt5YHZkBMUHp"
) )
return t.NewPackage("libXdmcp", version, newFromGitLab( return s.NewPackage(t, "libXdmcp", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/lib/libxdmcp", "xorg/lib/libxdmcp",
"libXdmcp-"+version, "libXdmcp-"+version,
@@ -834,7 +834,7 @@ func (t Toolchain) newLibXdmcp() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[LibXdmcp] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibXdmcp, f: Toolchain.newLibXdmcp,
Name: "libXdmcp", Name: "libXdmcp",
@@ -842,15 +842,15 @@ func init() {
Website: "https://gitlab.freedesktop.org/xorg/lib/libxdmcp", Website: "https://gitlab.freedesktop.org/xorg/lib/libxdmcp",
ID: 1772, ID: 1772,
} })
} }
func (t Toolchain) newXkeyboardConfig() (pkg.Artifact, string) { func (t Toolchain) newXkeyboardConfig(s *S) (pkg.Artifact, string) {
const ( const (
version = "2.47" version = "2.47"
checksum = "E03PsPIaRrxPAuKgDGSQyPiJB49wXtyyvdV0lVx3_G-pelMMlaFLkoTDHTHG_qgA" checksum = "E03PsPIaRrxPAuKgDGSQyPiJB49wXtyyvdV0lVx3_G-pelMMlaFLkoTDHTHG_qgA"
) )
return t.NewPackage("xkeyboard-config", version, newFromGitLab( return s.NewPackage(t, "xkeyboard-config", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xkeyboard-config/xkeyboard-config", "xkeyboard-config/xkeyboard-config",
"xkeyboard-config-"+version, "xkeyboard-config-"+version,
@@ -860,7 +860,7 @@ func (t Toolchain) newXkeyboardConfig() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[XkeyboardConfig] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newXkeyboardConfig, f: Toolchain.newXkeyboardConfig,
Name: "xkeyboard-config", Name: "xkeyboard-config",
@@ -868,15 +868,15 @@ func init() {
Website: "https://www.freedesktop.org/wiki/Software/XKeyboardConfig/", Website: "https://www.freedesktop.org/wiki/Software/XKeyboardConfig/",
ID: 5191, ID: 5191,
} })
} }
func (t Toolchain) newLibpciaccess() (pkg.Artifact, string) { func (t Toolchain) newLibpciaccess(s *S) (pkg.Artifact, string) {
const ( const (
version = "0.19" version = "0.19"
checksum = "84H0c_U_7fMqo81bpuwyXGXtk4XvvFH_YK00UiOriv3YGsuAhmbo2IkFhmJnvu2x" checksum = "84H0c_U_7fMqo81bpuwyXGXtk4XvvFH_YK00UiOriv3YGsuAhmbo2IkFhmJnvu2x"
) )
return t.NewPackage("libpciaccess", version, newFromGitLab( return s.NewPackage(t, "libpciaccess", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/lib/libpciaccess", "xorg/lib/libpciaccess",
"libpciaccess-"+version, "libpciaccess-"+version,
@@ -888,7 +888,7 @@ func (t Toolchain) newLibpciaccess() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
artifactsM[Libpciaccess] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newLibpciaccess, f: Toolchain.newLibpciaccess,
Name: "libpciaccess", Name: "libpciaccess",
@@ -900,15 +900,15 @@ func init() {
}, },
ID: 1703, ID: 1703,
} })
} }
func (t Toolchain) newXserver() (pkg.Artifact, string) { func (t Toolchain) newXserver(s *S) (pkg.Artifact, string) {
const ( const (
version = "21.1.22" version = "21.1.22"
checksum = "prLT2wKecBu5m9w1ThgIt0GvenNpjKXoOyvTiMA1oQTlP0QHh6QiWsdvH3OmUwNo" checksum = "prLT2wKecBu5m9w1ThgIt0GvenNpjKXoOyvTiMA1oQTlP0QHh6QiWsdvH3OmUwNo"
) )
return t.NewPackage("xserver", version, newFromGitLab( return s.NewPackage(t, "xserver", version, newFromGitLab(
"gitlab.freedesktop.org", "gitlab.freedesktop.org",
"xorg/xserver", "xorg/xserver",
"xorg-server-"+version, "xorg-server-"+version,
@@ -955,7 +955,7 @@ func (t Toolchain) newXserver() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[Xserver] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newXserver, f: Toolchain.newXserver,
Name: "xserver", Name: "xserver",
@@ -984,5 +984,5 @@ func init() {
}, },
ID: 5250, ID: 5250,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newXZ() (pkg.Artifact, string) { func (t Toolchain) newXZ(s *S) (pkg.Artifact, string) {
const ( const (
version = "5.8.3" version = "5.8.3"
checksum = "nCdayphPGdIdVoAZ2hR4vYlhDG9LeVKho_i7ealTud4Vxy5o5dWe0VwFlN7utuUL" checksum = "nCdayphPGdIdVoAZ2hR4vYlhDG9LeVKho_i7ealTud4Vxy5o5dWe0VwFlN7utuUL"
) )
return t.NewPackage("xz", version, newFromGitHubRelease( return s.NewPackage(t, "xz", version, newFromGitHubRelease(
"tukaani-project/xz", "tukaani-project/xz",
"v"+version, "v"+version,
"xz-"+version+".tar.bz2", "xz-"+version+".tar.bz2",
@@ -18,7 +18,7 @@ func (t Toolchain) newXZ() (pkg.Artifact, string) {
), version ), version
} }
func init() { func init() {
artifactsM[XZ] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newXZ, f: Toolchain.newXZ,
Name: "xz", Name: "xz",
@@ -26,5 +26,5 @@ func init() {
Website: "https://tukaani.org/xz/", Website: "https://tukaani.org/xz/",
ID: 5277, ID: 5277,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newZlib() (pkg.Artifact, string) { func (t Toolchain) newZlib(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.3.2" version = "1.3.2"
checksum = "KHZrePe42vL2XvOUE3KlJkp1UgWhWkl0jjT_BOvFhuM4GzieEH9S7CioepOFVGYB" checksum = "KHZrePe42vL2XvOUE3KlJkp1UgWhWkl0jjT_BOvFhuM4GzieEH9S7CioepOFVGYB"
) )
return t.NewPackage("zlib", version, newTar( return s.NewPackage(t, "zlib", version, newTar(
"https://www.zlib.net/fossils/zlib-"+version+".tar.gz", "https://www.zlib.net/fossils/zlib-"+version+".tar.gz",
checksum, checksum,
pkg.TarGzip, pkg.TarGzip,
@@ -28,7 +28,7 @@ func (t Toolchain) newZlib() (pkg.Artifact, string) {
}), version }), version
} }
func init() { func init() {
artifactsM[Zlib] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newZlib, f: Toolchain.newZlib,
Name: "zlib", Name: "zlib",
@@ -36,5 +36,5 @@ func init() {
Website: "https://zlib.net/", Website: "https://zlib.net/",
ID: 5303, ID: 5303,
} })
} }

View File

@@ -2,12 +2,12 @@ package rosa
import "hakurei.app/internal/pkg" import "hakurei.app/internal/pkg"
func (t Toolchain) newZstd() (pkg.Artifact, string) { func (t Toolchain) newZstd(s *S) (pkg.Artifact, string) {
const ( const (
version = "1.5.7" version = "1.5.7"
checksum = "4XhfR7DwVkwo1R-TmYDAJOcx9YXv9WSFhcFUe3hWEAMmdMLPhFaznCqYIA19_xxV" checksum = "4XhfR7DwVkwo1R-TmYDAJOcx9YXv9WSFhcFUe3hWEAMmdMLPhFaznCqYIA19_xxV"
) )
return t.NewPackage("zstd", version, newFromGitHubRelease( return s.NewPackage(t, "zstd", version, newFromGitHubRelease(
"facebook/zstd", "facebook/zstd",
"v"+version, "v"+version,
"zstd-"+version+".tar.gz", "zstd-"+version+".tar.gz",
@@ -29,7 +29,7 @@ ZSTD_BIN=/cure/programs/zstd /usr/src/zstd/tests/playTests.sh
), version ), version
} }
func init() { func init() {
artifactsM[Zstd] = Metadata{ native.MustRegister(&Artifact{
f: Toolchain.newZstd, f: Toolchain.newZstd,
Name: "zstd", Name: "zstd",
@@ -37,5 +37,5 @@ func init() {
Website: "https://facebook.github.io/zstd/", Website: "https://facebook.github.io/zstd/",
ID: 12083, ID: 12083,
} })
} }