mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-23 12:34:15 +00:00
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:
parent
7aa02ac670
commit
de9a49c390
@ -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}"
|
||||
|
||||
|
@ -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}"
|
||||
)
|
||||
|
@ -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;
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user