From bed1d1e44aa3297ae35da614f97d853766115148 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 12 Nov 2024 09:42:31 -0800 Subject: [PATCH] rpm-sequoia: fixup darwin build When building derivations that depends on rpm on darwin, we get the following error: ``` dyld[69225]: Library not loaded: /nix/store/cz9sppfrs9ag34lq2pq6wmhspwcnvbxq-rpm-sequoia-1.7.0/lib/librpm_sequoia.1.7.0.dylib Referenced from: <0EA94AC5-F54A-3791-9374-4092232F33A1> /nix/store/mak6qp2pvgz19dn0fb0pr2lksgca43qp-rpm-4.20.0/lib/librpmio.10.2.0.dylib Reason: tried: '/nix/store/cz9sppfrs9ag34lq2pq6wmhspwcnvbxq-rpm-sequoia-1.7.0/lib/librpm_sequoia.1.7.0.dylib' (no such file), '/System/Vol> cpio: premature end of archive ``` This commit adds the correct symlinks on darwin. --- pkgs/by-name/rp/rpm-sequoia/package.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/rp/rpm-sequoia/package.nix b/pkgs/by-name/rp/rpm-sequoia/package.nix index d3ecf9fa91f6..4718e8c6c876 100644 --- a/pkgs/by-name/rp/rpm-sequoia/package.nix +++ b/pkgs/by-name/rp/rpm-sequoia/package.nix @@ -55,13 +55,17 @@ rustPlatform.buildRustPackage rec { '' + # Dependents will rely on the versioned symlinks - '' + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' install -d $out/lib find target/release/ \ -maxdepth 1 \ -type l -name 'librpm_sequoia.*' \ -exec cp --no-dereference {} $out/lib/ \; - ''; + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install -d $out/lib + ln -s librpm_sequoia.dylib $out/lib/librpm_sequoia.${version}.dylib + ''; passthru.updateScript = nix-update-script { };