mirror of
https://github.com/roc-lang/roc.git
synced 2024-08-16 06:10:44 +03:00
default.nix fixes for macos arm64
This commit is contained in:
parent
510016bf6e
commit
f57456fa0e
6
crates/cli/build.rs
Normal file
6
crates/cli/build.rs
Normal file
@ -0,0 +1,6 @@
|
||||
fn main() {
|
||||
// workaround for issue https://github.com/NixOS/nixpkgs/issues/166205 . This println can be removed when this issue is fixed. Upgrading to LLVM 14 could also fix this issue.
|
||||
// also see https://github.com/NixOS/nixpkgs/pull/181485
|
||||
#[cfg(all(target_os = "macos", target_arch = "aarch64"))]
|
||||
println!("cargo:rustc-link-lib=c++abi")
|
||||
}
|
@ -18,7 +18,7 @@ rustPlatform.buildRustPackage {
|
||||
|
||||
src = pkgs.nix-gitignore.gitignoreSource [] ./.;
|
||||
|
||||
cargoSha256 = "sha256-cFzOcU982kANsZjx4YoLQOZSOYN3loj+5zowhWoBWM8=";
|
||||
cargoSha256 = "sha256-Pd84GGtW1ecrP03uiCVcybIUtWCSDGfLl+fbbdmFyiE=";
|
||||
|
||||
LLVM_SYS_130_PREFIX = "${llvmPkgs.llvm.dev}";
|
||||
|
||||
@ -79,8 +79,11 @@ rustPlatform.buildRustPackage {
|
||||
|
||||
# cp: to copy str.zig,list.zig...
|
||||
# wrapProgram pkgs.stdenv.cc: to make ld available for compiler/build/src/link.rs
|
||||
postInstall = ''
|
||||
postInstall = if pkgs.stdenv.isLinux then ''
|
||||
cp -r target/x86_64-unknown-linux-gnu/release/lib/. $out/lib
|
||||
wrapProgram $out/bin/roc --set NIX_GLIBC_PATH ${nixGlibcPath} --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.stdenv.cc ]}
|
||||
'' else ''
|
||||
cp -r target/aarch64-apple-darwin/release/lib/. $out/lib
|
||||
wrapProgram $out/bin/roc --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.stdenv.cc ]}
|
||||
'';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user