aboutsummaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2021-03-22 12:10:10 +0100
committerIsaac Freund <ifreund@ifreund.xyz>2021-03-22 12:10:10 +0100
commit979e64050780b6c7d40f372da7f3f4acdf16d822 (patch)
tree49b51b6e4ead7a26eac7a4f53687ddd4b09d2c34 /build.zig
parent6438f193ae709115dafb76a0c7488416ae78cee5 (diff)
downloadriver-979e64050780b6c7d40f372da7f3f4acdf16d822.tar.gz
river-979e64050780b6c7d40f372da7f3f4acdf16d822.tar.xz
build: fix config path if DESTDIR is set without --prefix
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/build.zig b/build.zig
index bb14e76..785c647 100644
--- a/build.zig
+++ b/build.zig
@@ -56,7 +56,8 @@ pub fn build(b: *zbs.Builder) !void {
};
b.installFile("example/init", rel_config_path);
const abs_config_path = try fs.path.resolve(b.allocator, &[_][]const u8{
- b.install_prefix orelse b.cache_root,
+ // This logic must match std.build.resolveInstallPrefix()
+ b.install_prefix orelse if (b.dest_dir) |_| "/usr" else b.cache_root,
rel_config_path,
});