internal/rosa/package: migrate nss

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-21 15:35:48 +09:00
parent 1acb5b0105
commit cbf18b302d
18 changed files with 196 additions and 209 deletions

View File

@@ -302,7 +302,7 @@ mkdir -vp /work/system/bin
base := LLVM
if flag&TNoToolchain != 0 {
base = musl
base = _musl
}
support = slices.Concat(extra, t.S.New(t.stage-1).Append([]pkg.Artifact{
@@ -345,7 +345,7 @@ var patch = H("patch")
// NewPatchedSource returns [pkg.Artifact] of source with patches applied. If
// passthrough is true, source is returned as is for zero length patches.
func (t Toolchain) NewPatchedSource(
name, version string,
name string,
source pkg.Artifact,
passthrough bool,
patches ...KV,
@@ -363,7 +363,7 @@ func (t Toolchain) NewPatchedSource(
}
paths[0] = pkg.Path(AbsUsrSrc.Append(name), false, source)
aname := name + "-" + version + "-src"
aname := name + "-src"
script := `
cp -r /usr/src/` + name + `/. /work/.
chmod -R +w /work && cd /work
@@ -491,6 +491,10 @@ func (t Toolchain) NewPackage(
if source == nil {
panic("source must be non-nil")
}
rn := name
if version != Unversioned {
rn = name + "-" + version
}
wantsChmod, wantsWrite := helper.wantsChmod(), helper.wantsWrite()
extraRes := make([]pkg.Artifact, 0, 1<<3+len(extra))
{
@@ -519,7 +523,7 @@ func (t Toolchain) NewPackage(
sourceSuffix = ".tar.xz"
scriptEarly += `
tar -C /usr/src/ -xf '/usr/src/` + name + `.tar.xz'
mv '/usr/src/` + name + `-` + version + `' '/usr/src/` + name + `'
mv '/usr/src/` + rn + `' '/usr/src/` + name + `'
`
}
@@ -544,7 +548,7 @@ cd '/usr/src/` + name + `/'
}
return t.New(
name+"-"+version,
rn,
attr.Flag,
extraRes,
attr.KnownChecksum,
@@ -554,7 +558,7 @@ cd '/usr/src/` + name + `/'
pkg.Path(AbsUsrSrc.Append(
name+sourceSuffix,
), attr.Writable || wantsWrite, t.NewPatchedSource(
name, version, source, !attr.Chmod && !wantsChmod, attr.Patches...,
rn, source, !attr.Chmod && !wantsChmod, attr.Patches...,
)),
})...,
)