aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/libcap.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/rosa/libcap.go')
-rw-r--r--internal/rosa/libcap.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/internal/rosa/libcap.go b/internal/rosa/libcap.go
new file mode 100644
index 00000000..804581c1
--- /dev/null
+++ b/internal/rosa/libcap.go
@@ -0,0 +1,40 @@
+package rosa
+
+import "hakurei.app/internal/pkg"
+
+func (t Toolchain) newLibcap() pkg.Artifact {
+ const (
+ version = "2.77"
+ checksum = "2GOTFU4cl2QoS7Dv5wh0c9-hxsQwIzMB9Y_gfAo5xKHqcM13fiHt1RbPkfemzjmB"
+ )
+ return t.NewViaMake("libcap", version, t.NewPatchedSource(
+ "libcap", version, pkg.NewHTTPGetTar(
+ nil, "https://git.kernel.org/pub/scm/libs/libcap/libcap.git/"+
+ "snapshot/libcap-"+version+".tar.gz",
+ mustDecode(checksum),
+ pkg.TarGzip,
+ ), false,
+ ), &MakeAttr{
+ Writable: true,
+ SkipConfigure: true,
+ InPlace: true,
+
+ Env: []string{
+ "prefix=/system",
+ "lib=lib",
+ },
+ ScriptEarly: `
+ln -s ../system/bin/bash /bin/
+cd /usr/src/libcap
+`,
+ Make: []string{
+ "CC=cc",
+ "all",
+ },
+ CheckName: "test",
+ },
+ t.Load(Bash),
+ t.Load(Diffutils),
+ )
+}
+func init() { artifactsF[Libcap] = Toolchain.newLibcap }