summarylogtreecommitdiffstats
path: root/libc.patch
blob: 111c6bd5bfd48ff2bdd8d3284c9724398e74d372 (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
--- a/build.zig
+++ b/build.zig
@@ -89,6 +89,7 @@ pub fn build(b: *zbs.Builder) !void {
         riverctl.step.dependOn(&scanner.step);
         riverctl.addPackage(scanner.getPkg());
         riverctl.linkLibC();
+        riverctl.setLibCFile("libc-paths");
         riverctl.linkSystemLibrary("wayland-client");
 
         scanner.addCSource(riverctl);
@@ -104,6 +105,7 @@ pub fn build(b: *zbs.Builder) !void {
         rivertile.step.dependOn(&scanner.step);
         rivertile.addPackage(scanner.getPkg());
         rivertile.linkLibC();
+        rivertile.setLibCFile("libc-paths");
         rivertile.linkSystemLibrary("wayland-client");
 
         scanner.addCSource(rivertile);
@@ -180,6 +182,7 @@ fn addServerDeps(exe: *zbs.LibExeObjStep, scanner: *ScanProtocolsStep) void {
     exe.step.dependOn(&scanner.step);
 
     exe.linkLibC();
+    exe.setLibCFile("libc-paths");
     exe.linkSystemLibrary("libevdev");
 
     exe.addPackage(wayland);
--- a/deps/zig-wayland/build.zig
+++ b/deps/zig-wayland/build.zig
@@ -17,6 +17,7 @@ pub fn build(b: *zbs.Builder) void {
         exe.addPackage(scanner.getPkg());
         scanner.addCSource(exe);
         exe.linkLibC();
+        exe.setLibCFile("../../libc-paths");
         exe.linkSystemLibrary("wayland-client");
 
         exe.install();
@@ -40,6 +41,7 @@ pub fn build(b: *zbs.Builder) void {
         ref_all.addPackage(scanner.getPkg());
         scanner.addCSource(ref_all);
         ref_all.linkLibC();
+        ref_all.setLibCFile("../../libc-paths");
         ref_all.linkSystemLibrary("wayland-client");
         ref_all.linkSystemLibrary("wayland-server");
         ref_all.linkSystemLibrary("wayland-egl");
@@ -117,8 +119,10 @@ pub const ScanProtocolsStep = struct {
     /// Add the necessary C source to the compilation unit.
     /// Once https://github.com/ziglang/zig/issues/131 we can remove this.
     pub fn addCSource(self: *ScanProtocolsStep, obj: *zbs.LibExeObjStep) void {
-        for (self.protocol_paths.items) |path|
+        for (self.protocol_paths.items) |path| {
+            obj.addIncludeDir("/usr/include");
             obj.addCSourceFile(self.getCodePath(path), &[_][]const u8{"-std=c99"});
+        }
     }
 
     pub fn getPkg(self: *ScanProtocolsStep) zbs.Pkg {