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.
This commit is contained in:
Arthur Gautier 2024-11-12 09:42:31 -08:00
parent b7256c37d6
commit bed1d1e44a

View File

@ -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 { };