Add support for macOS on intel

This adds x86_64-darwin as a supported target, and adds libiconv to
the native build dependencies, as otherwise the rust crate can't be
compiled on Darwin.
This commit is contained in:
Andreas Fuchs 2021-10-28 17:09:10 +02:00 committed by Akshay
parent a34ab7a09f
commit 81ce42286c

View File

@ -22,7 +22,7 @@
let
inherit (import-cargo.builders) importCargo;
supportedSystems = [ "x86_64-linux" ];
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system:
import nixpkgs {
@ -58,7 +58,7 @@
(importCargo { lockFile = ./Cargo.lock; inherit pkgs; }).cargoHome
rust
cargo
];
] ++ lib.optionals stdenv.isDarwin [ libiconv ];
buildPhase = ''
cargo build -p statix --all-features --release --offline
'';