git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit3ee47e7e0a8c4e35e11086fa8aa5b63e8fefcf66
parentb173dfcfc9
authorIsaac Freund <[email protected]>
date2021-03-22 12:10
build: fix config path if DESTDIR is set without --prefix

 build.zig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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,
     });