diff options
| author | novakane <mail@novakane.xyz> | 2021-07-28 14:41:40 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2021-07-28 19:30:50 +0000 |
| commit | f56c89295800af0f043342af82febf64a70a1208 (patch) | |
| tree | 2e4fc600967366cc5abcc8ad81a1c1615ffb3779 /build.zig | |
| parent | 863f8156f7660c47fbc612a1c24836aa7e8fd9c4 (diff) | |
| download | river-f56c89295800af0f043342af82febf64a70a1208.tar.gz river-f56c89295800af0f043342af82febf64a70a1208.tar.xz | |
build: Use pkg-config to handle river protocols
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -124,7 +124,26 @@ pub fn build(b: *zbs.Builder) !void { rivertile.install(); } - b.installFile("protocol/river-layout-v3.xml", "share/river/river-layout-v3.xml"); + { + const file = try fs.path.join(b.allocator, &[_][]const u8{ b.cache_root, "river-protocols.pc" }); + const pkgconfig_file = try std.fs.cwd().createFile(file, .{}); + + const writer = pkgconfig_file.writer(); + try writer.print( + \\prefix={s} + \\datadir=${{prefix}}/share + \\pkgdatadir=${{datadir}}/river-protocols + \\ + \\Name: river-protocols + \\URL: https://github.com/ifreund/river + \\Description: protocol files for the river wayland compositor + \\Version: {s} + , .{ b.install_prefix, full_version }); + defer pkgconfig_file.close(); + + b.installFile("protocol/river-layout-v3.xml", "share/river-protocols/river-layout-v3.xml"); + b.installFile(file, "share/pkgconfig/river-protocols.pc"); + } if (man_pages) { const scdoc_step = ScdocStep.create(b); |
