Commit bed1d1e4 authored by Arthur Gautier's avatar Arthur Gautier
Browse files

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.
parent b7256c37
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -55,12 +55,16 @@ 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 { };