aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/wayland.go
blob: 063c71b08ca728dfd4156d2d0ce00684c9fbf225 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package rosa

import "hakurei.app/internal/pkg"

func (t Toolchain) newWayland() pkg.Artifact {
	const (
		version  = "1.24.0"
		checksum = "JxgLiFRRGw2D3uhVw8ZeDbs3V7K_d4z_ypDog2LBqiA_5y2vVbUAk5NT6D5ozm0m"
	)
	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),
	)
}
func init() { artifactsF[Wayland] = Toolchain.newWayland }

func (t Toolchain) newWaylandProtocols() pkg.Artifact {
	const (
		version  = "1.47"
		checksum = "B_NodZ7AQfCstcx7kgbaVjpkYOzbAQq0a4NOk-SA8bQixAE20FY3p1-6gsbPgHn9"
	)
	return t.NewViaMeson("wayland-protocols", version, t.NewPatchedSource(
		"wayland-protocols", version, pkg.NewHTTPGetTar(
			nil, "https://gitlab.freedesktop.org/wayland/wayland-protocols/"+
				"-/archive/"+version+"/wayland-protocols-"+version+".tar.bz2",
			mustDecode(checksum),
			pkg.TarBzip2,
		), false, [2]string{"build-only", `From 8b4c76275fa1b6e0a99a53494151d9a2c907144d Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Fri, 8 Nov 2024 11:27:25 -0600
Subject: [PATCH] tests: Make build-only tests actually build-only

The goal behind the pedantic compiler tests are to ensure that the code
that wayland-scanner is generating can be compiled in pedantic mode by
the system C compiler.

Trying to execute the built tests may fail because of undefined symbols.
This affects certain platforms more than others; Linux/musl and Darwin
are examples of platforms that cannot execute binaries with undefined
symbols.  This meant tests needlessly failed on these platforms.

Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
Closes: #48, #228
---
 tests/meson.build | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/meson.build b/tests/meson.build
index aa216ec2..5a93bb36 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,4 +1,5 @@
 prog_scan_sh = find_program('scan.sh')
+prog_true = find_program('true')
 
 libwayland = [
 	dependency('wayland-client'),
@@ -100,7 +101,7 @@ foreach protocol_file : protocol_files
 			test_source,
 			client_header,
 			server_header,
-			code
+			code,
 		],
 		link_args: extra_linker_flags,
 		dependencies: libwayland,
@@ -111,7 +112,7 @@ foreach protocol_file : protocol_files
 			'-Werror' ],
 		install: false,
 	)
-	test(test_name, pedantic_test_executable)
+	test(test_name, prog_true, depends : [pedantic_test_executable])
 
 	# Check that the header
 	if not protocol_file.contains('xdg-foreign-unstable-v1')
-- 
GitLab
`},
	), nil,
		t.Load(Wayland),
		t.Load(Libffi),
		t.Load(Libexpat),
		t.Load(Libxml2),
	)
}
func init() { artifactsF[WaylandProtocols] = Toolchain.newWaylandProtocols }