Skip to content

Commit ea47b3e

Browse files
committed
rust-overlay: support for darwin
1 parent ad7af23 commit ea47b3e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

rust-overlay.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ let
282282
namesAndSrcs = getComponents pkgs.pkg name targets extensions targetExtensions stdenv fetchurl;
283283
components = installComponents stdenv namesAndSrcs;
284284
componentsOuts = builtins.map (comp: (super.lib.strings.escapeNixString (super.lib.getOutput "out" comp))) components;
285+
sharedLibraryExtensions = stdenv.hostPlatform.extensions.sharedLibrary;
285286
in
286287
super.pkgs.symlinkJoin {
287288
name = name + "-" + version;
@@ -305,9 +306,9 @@ let
305306
306307
# Here we copy the librustc_driver-*.so to our derivation.
307308
# The SYSROOT is determined based on the path of this library.
308-
if test "" != $out/lib/librustc_driver-*.so &> /dev/null; then
309-
RUSTC_DRIVER_PATH=$(realpath -e $out/lib/librustc_driver-*.so)
310-
rm $out/lib/librustc_driver-*.so
309+
if test "" != $out/lib/librustc_driver-*${sharedLibraryExtensions} &> /dev/null; then
310+
RUSTC_DRIVER_PATH=$(realpath -e $out/lib/librustc_driver-*${sharedLibraryExtensions})
311+
rm $out/lib/librustc_driver-*${sharedLibraryExtensions}
311312
cp $RUSTC_DRIVER_PATH $out/lib/
312313
fi
313314
'';

0 commit comments

Comments
 (0)