Skip to content

Commit

Permalink
Support codesigning on MacOS
Browse files Browse the repository at this point in the history
Fixes #224
  • Loading branch information
avdv committed May 17, 2022
1 parent f28f6dd commit 665950c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions toolchains/cc/cc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ in
}:

let

darwinCC =
# Work around https://github.com/NixOS/nixpkgs/issues/42059.
# See also https://github.com/NixOS/nixpkgs/pull/41589.
pkgs.wrapCCWith rec {
cc = pkgs.stdenv.cc;
bintools = cc.bintools;
extraBuildCommands = with pkgs.darwin.apple_sdk.frameworks; ''
echo "-Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags
echo "-isystem ${pkgs.llvmPackages.libcxx}/include/c++/v1" >> $out/nix-support/cc-cflags
Expand All @@ -37,20 +37,19 @@ let
paths =
if pkgs.stdenv.isDarwin then
{
cc = (pkgs.overrideCC pkgs.stdenv darwinCC).cc;
binutils = pkgs.darwin.binutils;
inherit (darwinCC) cc bintools;
}
else
{
cc = pkgs.stdenv.cc;
binutils = pkgs.binutils;
bintools = pkgs.binutils;
};
in
{
name = "bazel-nixpkgs-cc";
# XXX: `gcov` is missing in `/bin`.
# It exists in `stdenv.cc.cc` but that collides with `stdenv.cc`.
paths = [ paths.cc paths.binutils ];
paths = [ paths.cc paths.bintools ];
pathsToLink = [ "/bin" ];
passthru = {
isClang = paths.cc.isClang;
Expand Down

0 comments on commit 665950c

Please sign in to comment.