aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/wayland.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-02-16 13:17:56 +0900
committerOphestra <cat@gensokyo.uk>2026-02-16 13:49:13 +0900
commit67b2914c94de1d35f72fc43a8051056afc8d53e9 (patch)
tree944cbd6a521e9fb0117e0ae59a0121b0784a883f /internal/rosa/wayland.go
parent74dee118227cd72a2679f8eb167b43a1b165a415 (diff)
internal/rosa: meson helper
This is used by quite a few projects. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/wayland.go')
-rw-r--r--internal/rosa/wayland.go81
1 files changed, 28 insertions, 53 deletions
diff --git a/internal/rosa/wayland.go b/internal/rosa/wayland.go
index 10531ea0..f0d0c777 100644
--- a/internal/rosa/wayland.go
+++ b/internal/rosa/wayland.go
@@ -7,41 +7,31 @@ func (t Toolchain) newWayland() pkg.Artifact {
version = "1.24.0"
checksum = "JxgLiFRRGw2D3uhVw8ZeDbs3V7K_d4z_ypDog2LBqiA_5y2vVbUAk5NT6D5ozm0m"
)
- return t.New("wayland-"+version, 0, []pkg.Artifact{
- t.Load(Python),
- t.Load(Meson),
- t.Load(PkgConfig),
- t.Load(CMake),
- t.Load(Ninja),
+ return t.NewViaMeson("wayland", version, pkg.NewHTTPGetTar(
+ nil, "https://gitlab.freedesktop.org/wayland/wayland/"+
+ "-/archive/"+version+"/wayland-"+version+".tar.bz2",
+ mustDecode(checksum),
+ pkg.TarBzip2,
+ ), &MesonAttr{
+ Writable: true,
+ ScriptEarly: `
+cd /usr/src/wayland
+chmod +w tests tests/sanity-test.c
+echo 'int main(){}' > tests/sanity-test.c
+`,
+ Configure: [][2]string{
+ {"Ddefault_library", "both"},
+ {"Ddocumentation", "false"},
+ {"Dtests", "true"},
+ },
+ },
t.Load(Gawk),
t.Load(Diffutils),
t.Load(Libffi),
t.Load(Libexpat),
t.Load(Libxml2),
- }, nil, nil, `
-cd /usr/src/wayland
-chmod +w tests tests/sanity-test.c
-echo 'int main(){}' > tests/sanity-test.c
-
-cd "$(mktemp -d)"
-meson setup \
- --buildtype=release \
- --prefix=/system \
- -Ddocumentation=false \
- -Dtests=true \
- -Ddefault_library=both \
- . /usr/src/wayland
-meson compile
-meson test
-meson install \
- --destdir=/work
-`, pkg.Path(AbsUsrSrc.Append("wayland"), true, pkg.NewHTTPGetTar(
- nil, "https://gitlab.freedesktop.org/wayland/wayland/"+
- "-/archive/"+version+"/wayland-"+version+".tar.bz2",
- mustDecode(checksum),
- pkg.TarBzip2,
- )))
+ )
}
func init() { artifactsF[Wayland] = Toolchain.newWayland }
@@ -50,33 +40,18 @@ func (t Toolchain) newWaylandProtocols() pkg.Artifact {
version = "1.47"
checksum = "B_NodZ7AQfCstcx7kgbaVjpkYOzbAQq0a4NOk-SA8bQixAE20FY3p1-6gsbPgHn9"
)
- return t.New("wayland-protocols-"+version, 0, []pkg.Artifact{
- t.Load(Python),
- t.Load(Meson),
- t.Load(PkgConfig),
- t.Load(CMake),
- t.Load(Ninja),
-
- t.Load(Wayland),
- t.Load(Libffi),
- t.Load(Libexpat),
- t.Load(Libxml2),
- }, nil, nil, `
-cd "$(mktemp -d)"
-meson setup \
- --reconfigure \
- --buildtype=release \
- --prefix=/system \
- --prefer-static \
- . /usr/src/wayland-protocols
-meson compile
-meson install \
- --destdir=/work
-`, pkg.Path(AbsUsrSrc.Append("wayland-protocols"), false, pkg.NewHTTPGetTar(
+ return t.NewViaMeson("wayland-protocols", version, pkg.NewHTTPGetTar(
nil, "https://gitlab.freedesktop.org/wayland/wayland-protocols/"+
"-/archive/"+version+"/wayland-protocols-"+version+".tar.bz2",
mustDecode(checksum),
pkg.TarBzip2,
- )))
+ ), &MesonAttr{
+ SkipCheck: true,
+ },
+ t.Load(Wayland),
+ t.Load(Libffi),
+ t.Load(Libexpat),
+ t.Load(Libxml2),
+ )
}
func init() { artifactsF[WaylandProtocols] = Toolchain.newWaylandProtocols }