From 6d2168c73cf506d5f9e0bac3aed6e2762b6f9d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Wed, 24 Aug 2022 18:14:26 +0200 Subject: [PATCH] knot-resolver: patch library loading for darwin Apparently until now it could never start up on x86_64-darwin :-/ --- pkgs/servers/dns/knot-resolver/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/servers/dns/knot-resolver/default.nix b/pkgs/servers/dns/knot-resolver/default.nix index 61f105a62bd4..833be5b53429 100644 --- a/pkgs/servers/dns/knot-resolver/default.nix +++ b/pkgs/servers/dns/knot-resolver/default.nix @@ -39,6 +39,13 @@ unwrapped = stdenv.mkDerivation rec { # ExecStart can't be overwritten in overrides. # We need that to use wrapped executable and correct config file. sed '/^ExecStart=/d' -i systemd/kresd@.service.in + + # On x86_64-darwin loading by soname fails to find the libs, surprisingly. + # Even though they should already be loaded and they're in RPATH, too. + for f in daemon/lua/{kres,zonefile}.lua; do + substituteInPlace "$f" \ + --replace "ffi.load(" "ffi.load('${lib.getLib knot-dns}/lib/' .. " + done '' # some tests have issues with network sandboxing, apparently + optionalString doInstallCheck ''