File tree Expand file tree Collapse file tree 3 files changed +18
-15
lines changed Expand file tree Collapse file tree 3 files changed +18
-15
lines changed Original file line number Diff line number Diff line change 39
39
] ++ lib . optionals hostPlatform . isDarwin [
40
40
# macOS-specific dependencies
41
41
libiconv
42
- darwin . apple_sdk . frameworks . CoreFoundation
43
- darwin . apple_sdk . frameworks . Security
44
- darwin . apple_sdk . frameworks . SystemConfiguration
45
42
] ;
46
43
} ;
47
44
Original file line number Diff line number Diff line change 23
23
buildPlatform = pkgs . stdenv . buildPlatform ;
24
24
hostPlatform = pkgs . stdenv . hostPlatform ;
25
25
26
+ # nixpkgs decided to change the name of the darwin targets which wrecks everything
27
+ hostPlatformName =
28
+ if hostPlatform . config == "arm64-apple-darwin"
29
+ then "aarch64-apple-darwin"
30
+ else hostPlatform . config ;
31
+
26
32
# When possibly cross-compiling we get several versions of nixpkgs of the
27
33
# form, `pkgs.pkgs<where it runs><platform it produces outputs for>`. We use
28
34
# `pkgs.pkgsBuildHost` to get packages that run at build time (so run on the
29
35
# build platform), and that produce outputs for the host platform which is the
30
36
# cross-compilation target.
31
37
rustBin = pkgs . pkgsBuildHost . rust-bin . fromRustupToolchainFile ../rust-toolchain.toml ;
32
- rustToolchain = rustBin . override { targets = [ hostPlatform . config ] ; } ;
38
+ rustToolchain = rustBin . override { targets = [ hostPlatformName ] ; } ;
33
39
craneLib = ( crane . mkLib pkgs ) . overrideToolchain rustToolchain ;
34
40
35
41
buildEnv = {
36
- CARGO_BUILD_TARGET = hostPlatform . config ;
37
- "CARGO_TARGET_${ envCase hostPlatform . config } _LINKER" = "${ pkgs . stdenv . cc . targetPrefix } cc" ;
42
+ CARGO_BUILD_TARGET = hostPlatformName ;
43
+ "CARGO_TARGET_${ envCase hostPlatformName } _LINKER" = "${ pkgs . stdenv . cc . targetPrefix } cc" ;
38
44
39
45
# This environment variable may be necessary if any of your dependencies use
40
46
# a build-script which invokes the `cc` crate to build some other code. The
You can’t perform that action at this time.
0 commit comments