File tree 2 files changed +21
-5
lines changed
2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -337,8 +337,8 @@ pub fn init(b: *std.Build) !Config {
337
337
target .result .os .tag == .macos and
338
338
config .app_runtime == .none and
339
339
(! config .emit_bench and
340
- ! config .emit_test_exe and
341
- ! config .emit_helpgen );
340
+ ! config .emit_test_exe and
341
+ ! config .emit_helpgen );
342
342
343
343
//---------------------------------------------------------------
344
344
// System Packages
@@ -361,7 +361,6 @@ pub fn init(b: *std.Build) !Config {
361
361
"libpng" ,
362
362
"zlib" ,
363
363
"oniguruma" ,
364
- "gtk4-layer-shell" ,
365
364
}) | dep | {
366
365
_ = b .systemIntegrationOption (
367
366
dep ,
@@ -387,6 +386,15 @@ pub fn init(b: *std.Build) !Config {
387
386
}) | dep | {
388
387
_ = b .systemIntegrationOption (dep , .{ .default = false });
389
388
}
389
+
390
+ // These are dynamic libraries we default to true, preferring
391
+ // to use system packages over building and installing libs
392
+ // as they require additional ldconfig of library paths or
393
+ // patching the rpath of the program to discover the dynamic library
394
+ // at runtime
395
+ for (&[_ ][]const u8 {"gtk4-layer-shell" }) | dep | {
396
+ _ = b .systemIntegrationOption (dep , .{ .default = true });
397
+ }
390
398
}
391
399
392
400
return config ;
Original file line number Diff line number Diff line change @@ -657,8 +657,16 @@ fn addGTK(
657
657
const sharedLib = gtk4_layer_shell .artifact ("gtk4-layer-shell" );
658
658
const artifact : * std.Build.Step.InstallArtifact = b .addInstallArtifact (sharedLib , .{});
659
659
b .getInstallStep ().dependOn (& artifact .step );
660
- // Lookup dynamic libs from installed location
661
- step .root_module .addRPathSpecial (b .getInstallPath (artifact .dest_dir .? , "" ));
660
+ if (self .config .optimize == .Debug ) {
661
+ // Lookup dynamic libs from installed location
662
+ const installPath = b .getInstallPath (artifact .dest_dir .? , "" );
663
+ if (! std .fs .path .isAbsolute (installPath )) {
664
+ // Using a relative path as an rpath is almost useless
665
+ return error .UndesirablePath ;
666
+ }
667
+ // Lookup dynamic libs from installed location
668
+ step .root_module .addRPathSpecial (b .getInstallPath (artifact .dest_dir .? , "" ));
669
+ }
662
670
step .linkLibrary (sharedLib );
663
671
}
664
672
}
You can’t perform that action at this time.
0 commit comments