<commit_before>{ lib, stdenv, fetchFromGitHub, catch, cmake
}:

let
  nativeBuild = stdenv.hostPlatform == stdenv.buildPlatform;
in
stdenv.mkDerivation rec {
  pname = "microsoft_gsl";
  version = "2.1.0";

  src = fetchFromGitHub {
    owner = "Microsoft";
    repo = "GSL";
    rev = "v${version}";
    sha256 = "09f08lxqm00152bx9yrizlgabzpzxlpbv06h00z4w78yxywgxlgx";
  };

  # build phase just runs the unit tests, so skip it if
  # we're doing a cross build
  nativeBuildInputs = [ catch cmake ];
  buildPhase = if nativeBuild then "make" else "true";

  # https://github.com/microsoft/GSL/issues/806
  cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-Wno-catch-value" ];

  installPhase = ''
    mkdir -p $out/include
    mv ../include/ $out/
  '';
<commit_msg>microsoft_gsl: fix darwin build<commit_after>{ lib, stdenv, fetchFromGitHub, catch, cmake
}:

let
  nativeBuild = stdenv.hostPlatform == stdenv.buildPlatform;
in
stdenv.mkDerivation rec {
  pname = "microsoft_gsl";
  version = "2.1.0";

  src = fetchFromGitHub {
    owner = "Microsoft";
    repo = "GSL";
    rev = "v${version}";
    sha256 = "09f08lxqm00152bx9yrizlgabzpzxlpbv06h00z4w78yxywgxlgx";
  };

  # build phase just runs the unit tests, so skip it if
  # we're doing a cross build
  nativeBuildInputs = [ catch cmake ];
  buildPhase = if nativeBuild then "make" else "true";

  # https://github.com/microsoft/GSL/issues/806
  cmakeFlags = lib.optionals stdenv.cc.isGNU
    [ "-DCMAKE_CXX_FLAGS=-Wno-catch-value" ];

  installPhase = ''
    mkdir -p $out/include
    mv ../include/ $out/
  '';

{'fraction_non_alphanumeric': 0.13110539845758354, 'fraction_numerical': 0.033419023136246784, 'mean_word_length': 3.4870317002881843, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '250437', 'n_tokens_mistral': 639, 'n_tokens_neox': 580, 'n_words': 131}