buildRustCrate: extensions.sharedLibrary -> extensions.library

Switched to a common attribute for library file extensions:
de70971c90

This makes buildRustCrate evaluate successfully when using
pkgsCross/pkgsStatic.
This commit is contained in:
Ilan Joselevich 2024-06-10 16:19:53 +03:00 committed by Alyssa Ross
parent 7aa02ac670
commit de9a49c390
4 changed files with 4 additions and 4 deletions

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 or ""}"
LIB_EXT="${stdenv.hostPlatform.extensions.library}"
LIB_PATH="${libPath}"
LIB_NAME="${libName}"

View File

@ -49,7 +49,7 @@ let
filename =
if lib.any (x: x == "lib" || x == "rlib") dep.crateType
then "${dep.metadata}.rlib"
else "${dep.metadata}${stdenv.hostPlatform.extensions.sharedLibrary}";
else "${dep.metadata}${stdenv.hostPlatform.extensions.library}";
in
" --extern ${opts}${name}=${dep.lib}/lib/lib${extern}-${filename}"
)

View File

@ -41,7 +41,7 @@ if !buildTests then ''
fi
if [ -e target/lib ]; then
find target/lib/ -type f \! -name '*.rlib' \
-a \! -name '*${stdenv.hostPlatform.extensions.sharedLibrary}' \
-a \! -name '*${stdenv.hostPlatform.extensions.library}' \
-a \! -name '*.d' \
-executable \
-print0 | xargs --no-run-if-empty --null install --target $out/tests;

View File

@ -479,7 +479,7 @@ let
# `-undefined dynamic_lookup` as otherwise the compilation fails.
$CC -shared \
${lib.optionalString stdenv.isDarwin "-undefined dynamic_lookup"} \
-o $out/lib/${name}${stdenv.hostPlatform.extensions.sharedLibrary} ${src}
-o $out/lib/${name}${stdenv.hostPlatform.extensions.library} ${src}
'';
b = compile "libb" ''
#include <stdio.h>