From b344568e0568b0c6eeee48d4215304c7e9eecc5c Mon Sep 17 00:00:00 2001 From: Hsiang-Cheng Yang Date: Mon, 6 Mar 2023 02:15:19 +0800 Subject: [PATCH] rust-overlay: support for `darwin` --- rust-overlay.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rust-overlay.nix b/rust-overlay.nix index fb862ec..3159a97 100644 --- a/rust-overlay.nix +++ b/rust-overlay.nix @@ -289,17 +289,17 @@ let cp --remove-destination "$(realpath -e $target)" $target fi - # The SYSROOT is determined by using the librustc_driver-*.so. - # So, we need to point to the *.so files in our derivation. + # The SYSROOT is determined by using the librustc_driver-*.{so,dylib}. + # So, we need to point to the *.{so,dylib} files in our derivation. chmod u+w $target patchelf --set-rpath "$out/lib" $target || true done - # Here we copy the librustc_driver-*.so 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) - rm $out/lib/librustc_driver-*.so + if ls $out/lib/librustc_driver-*.{so,dylib} &> /dev/null; then + RUSTC_DRIVER_PATH=$(realpath -e $out/lib/librustc_driver-*.{so,dylib}) + rm $out/lib/librustc_driver-*.{so,dylib} cp $RUSTC_DRIVER_PATH $out/lib/ fi '';