internal/rosa/package: migrate glib
All checks were successful
Test / Create distribution (push) Successful in 1m6s
Test / Sandbox (push) Successful in 2m55s
Test / ShareFS (push) Successful in 3m44s
Test / Hakurei (push) Successful in 3m54s
Test / Sandbox (race detector) (push) Successful in 5m23s
Test / Hakurei (race detector) (push) Successful in 6m30s
Test / Flake checks (push) Successful in 1m18s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-20 02:09:12 +09:00
parent a7f5a5802d
commit fcba32e9c4
6 changed files with 50 additions and 66 deletions

View File

@@ -1,58 +0,0 @@
package rosa
import (
"hakurei.app/fhs"
"hakurei.app/internal/pkg"
)
func (t Toolchain) newGLib() (pkg.Artifact, string) {
const (
version = "2.88.1"
checksum = "Rkszn6W4RHjyspyqfXdVAVawdwDJCuS0Zu0f7qot7tbJhnw2fUDoUUJB40m-1MCX"
)
return t.NewPackage("glib", version, t.newTagRemote(
"https://gitlab.gnome.org/GNOME/glib.git",
version, checksum,
), &PackageAttr{
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"),
)),
},
}, &MesonHelper{
Setup: []KV{
{"Ddefault_library", "both"},
},
},
PythonPackaging,
Bash,
PCRE2,
Libffi,
Zlib,
), version
}
func init() {
native.mustRegister(Toolchain.newGLib, &Metadata{
Name: "glib",
Description: "the GNU library of miscellaneous stuff",
Website: "https://developer.gnome.org/glib/",
Dependencies: P{
PCRE2,
Libffi,
Zlib,
},
ID: 10024,
})
}

View File

@@ -0,0 +1,38 @@
package glib {
description = "the GNU library of miscellaneous stuff";
website = "https://developer.gnome.org/glib";
anitya = 10024;
version* = "2.88.1";
source = remoteGit {
url = "https://gitlab.gnome.org/GNOME/glib.git";
tag = version;
checksum = "Rkszn6W4RHjyspyqfXdVAVawdwDJCuS0Zu0f7qot7tbJhnw2fUDoUUJB40m-1MCX";
};
files = [
"/etc/machine-id:stub-machine-id-fhs",
"/system/var/lib/dbus/machine-id:stub-machine-id",
];
exec = meson {
setup = {
"Ddefault_library": "both";
};
};
inputs = [
python-packaging,
bash,
pcre2,
libffi,
zlib,
];
runtime = [
pcre2,
libffi,
zlib,
];
}

View File

@@ -0,0 +1 @@
fefefefefefefefefefefefefefefefe

View File

@@ -0,0 +1 @@
ffffffffffffffffffffffffffffffff

View File

@@ -18,6 +18,7 @@ import (
"unique" "unique"
"unsafe" "unsafe"
"hakurei.app/check"
"hakurei.app/internal/pkg" "hakurei.app/internal/pkg"
"hakurei.app/internal/rosa/azalea" "hakurei.app/internal/rosa/azalea"
) )
@@ -919,21 +920,25 @@ func (ctx *evalContext) pf(
} }
for _, pair := range files { for _, pair := range files {
base, pathname, ok := strings.Cut(pair, ":") var pathname *check.Absolute
dst, src, ok := strings.Cut(pair, ":")
if !ok { if !ok {
pathname, base = base, filepath.Base(base) src, dst = dst, filepath.Base(dst)
}
if pathname, err = check.NewAbs(dst); err != nil {
pathname = AbsUsrSrc.Append(dst)
} }
var p []byte var p []byte
p, err = fs.ReadFile(ctx.b, pathname) p, err = fs.ReadFile(ctx.b, src)
if err != nil { if err != nil {
return return
} }
attr.Paths = append(attr.Paths, pkg.Path( attr.Paths = append(attr.Paths, pkg.Path(
AbsUsrSrc.Append(base), pathname,
false, false,
pkg.NewFile(base, p), pkg.NewFile(filepath.Base(dst), p),
)) ))
} }

View File

@@ -35,7 +35,6 @@ var (
HakureiDist = H("hakurei-dist") HakureiDist = H("hakurei-dist")
Hwdata = H("hwdata") Hwdata = H("hwdata")
Kmod = H("kmod") Kmod = H("kmod")
LIT = H("lit")
LibX11 = H("libX11") LibX11 = H("libX11")
LibXau = H("libXau") LibXau = H("libXau")
LibXdmcp = H("libXdmcp") LibXdmcp = H("libXdmcp")
@@ -82,7 +81,6 @@ var (
Ncurses = H("ncurses") Ncurses = H("ncurses")
Nettle = H("nettle") Nettle = H("nettle")
OpenSSL = H("openssl") OpenSSL = H("openssl")
PCRE2 = H("pcre2")
Patch = H("patch") Patch = H("patch")
PerlTestCmd = H("perl-Test-Cmd") PerlTestCmd = H("perl-Test-Cmd")
Pixman = H("pixman") Pixman = H("pixman")
@@ -97,7 +95,6 @@ var (
QEMU = H("qemu") QEMU = H("qemu")
Sed = H("sed") Sed = H("sed")
SPIRVLLVMTranslator = H("spirv-llvm-translator") SPIRVLLVMTranslator = H("spirv-llvm-translator")
SPIRVTools = H("spirv-tools")
SquashfsTools = H("squashfs-tools") SquashfsTools = H("squashfs-tools")
Toybox = H("toybox") Toybox = H("toybox")
toyboxEarly = H("toybox-early") toyboxEarly = H("toybox-early")