build: fix config path if DESTDIR is set without --prefix

This commit is contained in:
Isaac Freund 2021-03-22 12:10:10 +01:00
parent 6438f193ae
commit 979e640507
No known key found for this signature in database
GPG key ID: 86DED400DDFD7A11

View file

@ -56,7 +56,8 @@ pub fn build(b: *zbs.Builder) !void {
}; };
b.installFile("example/init", rel_config_path); b.installFile("example/init", rel_config_path);
const abs_config_path = try fs.path.resolve(b.allocator, &[_][]const u8{ 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, rel_config_path,
}); });