diff --git a/rust-overlay.nix b/rust-overlay.nix index 0918f56..6cb5fd6 100644 --- a/rust-overlay.nix +++ b/rust-overlay.nix @@ -290,7 +290,7 @@ let cp --remove-destination "$(realpath -e $target)" $target fi - # The SYSROOT is determined by using the librustc_driver-*.so. + # The SYSROOT is determined by using the librustc_driver-*.{so,dylib}. # So, we need to point to the *.so files in our derivation. if ls $out/lib/*.so &>/dev/null; then chmod u+w $target @@ -298,14 +298,10 @@ let fi done - # Here we copy the librustc_driver-*.{so|dylib} to our derivation. + # Here we copy the librustc_driver-*.{so,dylib} to our derivation. # The SYSROOT is determined based on the path of this library. - if ls $out/lib/librustc_driver-*.so &>/dev/null; then - RUSTC_DRIVER_PATH=$(realpath -e $out/lib/librustc_driver-*.so) - cp --remove-destination $RUSTC_DRIVER_PATH $out/lib/ - fi - if ls $out/lib/librustc_driver-*.dylib &>/dev/null; then - RUSTC_DRIVER_PATH=$(realpath -e $out/lib/librustc_driver-*.dylib) + if ls $out/lib/librustc_driver-*.{so,dylib} &>/dev/null; then + RUSTC_DRIVER_PATH=$(realpath -e $out/lib/librustc_driver-*.{so,dylib}) cp --remove-destination $RUSTC_DRIVER_PATH $out/lib/ fi '';