From d4d5e631aea2b0d96ac8d9776299095677e91290 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 16 Feb 2026 19:01:02 +0900 Subject: [PATCH] internal/rosa: glib artifact Unfortunately required by many programs, even non-gtk ones. Signed-off-by: Ophestra --- internal/rosa/all.go | 6 +++-- internal/rosa/gtk.go | 55 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 internal/rosa/gtk.go diff --git a/internal/rosa/all.go b/internal/rosa/all.go index 3c087e5..1a80a0a 100644 --- a/internal/rosa/all.go +++ b/internal/rosa/all.go @@ -23,8 +23,9 @@ const ( Diffutils Findutils Fuse - Gawk GMP + GLib + Gawk Gettext Git Go @@ -129,8 +130,9 @@ func ResolveName(name string) (p PArtifact, ok bool) { "diffutils": Diffutils, "findutils": Findutils, "fuse": Fuse, - "gawk": Gawk, "gmp": GMP, + "glib": GLib, + "gawk": Gawk, "gettext": Gettext, "git": Git, "go": Go, diff --git a/internal/rosa/gtk.go b/internal/rosa/gtk.go new file mode 100644 index 0000000..78469e8 --- /dev/null +++ b/internal/rosa/gtk.go @@ -0,0 +1,55 @@ +package rosa + +import ( + "strings" + + "hakurei.app/container/fhs" + "hakurei.app/internal/pkg" +) + +func (t Toolchain) newGLib() pkg.Artifact { + const ( + version = "2.86.4" + checksum = "AfTjBrrxtXXPL6dFa1LfTe40PyPSth62CoIkM5m_VJTUngGLOFHw6I4XE7RGQE8G" + ) + return t.NewViaMeson("glib", version, pkg.NewHTTPGet( + nil, "https://download.gnome.org/sources/glib/"+ + strings.Join(strings.SplitN(version, ".", 3)[:2], ".")+ + "/glib-"+version+".tar.xz", + mustDecode(checksum), + ), &MesonAttr{ + SourceSuffix: ".tar.xz", + ScriptEarly: ` +cd /usr/src/ +tar xf glib.tar.xz +mv glib-` + version + ` glib +`, + Configure: [][2]string{ + {"Ddefault_library", "both"}, + }, + + Paths: []pkg.ExecPath{ + pkg.Path(fhs.AbsEtc.Append( + "machine-id", + ), false, pkg.NewFile( + "glib-machine-id", + []byte("ffffffffffffffffffffffffffffffff\n"), + )), + pkg.Path(AbsSystem.Append( + "var/lib/dbus/machine-id", + ), false, pkg.NewFile( + "glib-machine-id", + []byte("fefefefefefefefefefefefefefefefe\n"), + )), + }, + }, + t.Load(XZ), + t.Load(Packaging), + t.Load(Bash), + + t.Load(PCRE2), + t.Load(Libffi), + t.Load(Zlib), + ) +} +func init() { artifactsF[GLib] = Toolchain.newGLib }