internal/rosa/llvm: patch source tree
All checks were successful
Test / Create distribution (push) Successful in 59s
Test / Sandbox (push) Successful in 3m1s
Test / Hakurei (push) Successful in 4m26s
Test / ShareFS (push) Successful in 4m27s
Test / Hpkg (push) Successful in 4m56s
Test / Sandbox (race detector) (push) Successful in 5m29s
Test / Hakurei (race detector) (push) Successful in 6m19s
Test / Flake checks (push) Successful in 1m46s
All checks were successful
Test / Create distribution (push) Successful in 59s
Test / Sandbox (push) Successful in 3m1s
Test / Hakurei (push) Successful in 4m26s
Test / ShareFS (push) Successful in 4m27s
Test / Hpkg (push) Successful in 4m56s
Test / Sandbox (race detector) (push) Successful in 5m29s
Test / Hakurei (race detector) (push) Successful in 6m19s
Test / Flake checks (push) Successful in 1m46s
A few patches are required for disabling broken tests and changing default search paths. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -27,6 +27,9 @@ type llvmAttr struct {
|
|||||||
script string
|
script string
|
||||||
// Passed through to CMakeAttr.Prefix.
|
// Passed through to CMakeAttr.Prefix.
|
||||||
prefix *check.Absolute
|
prefix *check.Absolute
|
||||||
|
|
||||||
|
// Patch name and body pairs.
|
||||||
|
patches [][2]string
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -172,12 +175,32 @@ cp -r /system/include /usr/include && rm -rf /system/include
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return t.NewViaCMake("llvm", version, variant, pkg.NewHTTPGetTar(
|
source := pkg.NewHTTPGetTar(
|
||||||
nil, "https://github.com/llvm/llvm-project/archive/refs/tags/"+
|
nil, "https://github.com/llvm/llvm-project/archive/refs/tags/"+
|
||||||
"llvmorg-"+version+".tar.gz",
|
"llvmorg-"+version+".tar.gz",
|
||||||
mustDecode(checksum),
|
mustDecode(checksum),
|
||||||
pkg.TarGzip,
|
pkg.TarGzip,
|
||||||
), &CMakeAttr{
|
)
|
||||||
|
|
||||||
|
patches := make([]pkg.ExecPath, len(attr.patches)+1)
|
||||||
|
for i, p := range attr.patches {
|
||||||
|
patches[i+1] = pkg.Path(
|
||||||
|
AbsUsrSrc.Append("llvm-patches", p[0]+".patch"), false,
|
||||||
|
pkg.NewFile(p[0], []byte(p[1])),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
patches[0] = pkg.Path(AbsUsrSrc.Append("llvmorg"), false, source)
|
||||||
|
if len(patches) > 1 {
|
||||||
|
source = t.New(
|
||||||
|
"llvmorg-patched", nil, nil, nil, `
|
||||||
|
cp -r /usr/src/llvmorg/. /work/.
|
||||||
|
chmod -R +w /work && cd /work
|
||||||
|
cat /usr/src/llvm-patches/* | patch -p 1
|
||||||
|
`, patches...,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return t.NewViaCMake("llvm", version, variant, source, &CMakeAttr{
|
||||||
Cache: slices.Concat(cache, attr.cmake),
|
Cache: slices.Concat(cache, attr.cmake),
|
||||||
Append: cmakeAppend,
|
Append: cmakeAppend,
|
||||||
Extra: slices.Concat(attr.extra, extra),
|
Extra: slices.Concat(attr.extra, extra),
|
||||||
|
|||||||
Reference in New Issue
Block a user