build-rust-crate: Allow missing hostPlatform.extensions.sharedLibrary

If you cross-build, sharedLibrary might not be set. E.g. for this
nixpkgs instance:

```nix
pkgs = import <nixpkgs> {
    config = { };
    crossSystem = {
        config = "riscv32-unknown-none-elf";
        rustc = {
            config = "riscv32i-unknown-none-elf";
        };
    };
}
```
This commit is contained in:
Peter Kolloch 2024-01-04 12:14:17 +01:00
parent 416ab464ba
commit 597f3d31d8

View File

@ -51,7 +51,7 @@
# configure & source common build functions
LIB_RUSTC_OPTS="${libRustcOpts}"
BIN_RUSTC_OPTS="${binRustcOpts}"
LIB_EXT="${stdenv.hostPlatform.extensions.sharedLibrary}"
LIB_EXT="${stdenv.hostPlatform.extensions.sharedLibrary or ""}"
LIB_PATH="${libPath}"
LIB_NAME="${libName}"