<commit_before>{ lib
, fetchFromGitHub
, cmake
, llvmPackages
, libxml2
, zlib
, fetchpatch
}:

let
  inherit (llvmPackages) stdenv;
in
stdenv.mkDerivation rec {
  pname = "zig";
  version = "0.8.0";

  src = fetchFromGitHub {
    owner = "ziglang";
    repo = pname;
    rev = version;
    hash = "sha256-bILjcKX8jPl2n1HRYvYRb7jJkobwqmSJ+hHXSn9n2ag=";
  };

  patches = [
    # glibc 2.33 support
    (fetchpatch {
      url = "https://github.com/ziglang/zig/commit/0fee4b55a8c58791238efe6bf2da5ce3435a5cc1.patch";
      sha256 = "sha256-waVtolUlmGrfiRk4tWsSOij5MfUc+g57DatC6GtSx6c=";
    })
  ];

  nativeBuildInputs = [
    cmake
    llvmPackages.llvm.dev
  ];
  buildInputs = [
    libxml2
    zlib<commit_msg>Revert "zig: add upstream patch to allow glibc 2.33 builds"<commit_after>{ lib
, fetchFromGitHub
, cmake
, llvmPackages
, libxml2
, zlib
}:

let
  inherit (llvmPackages) stdenv;
in
stdenv.mkDerivation rec {
  pname = "zig";
  version = "0.8.0";

  src = fetchFromGitHub {
    owner = "ziglang";
    repo = pname;
    rev = version;
    hash = "sha256-bILjcKX8jPl2n1HRYvYRb7jJkobwqmSJ+hHXSn9n2ag=";
  };

  nativeBuildInputs = [
    cmake
    llvmPackages.llvm.dev
  ];
  buildInputs = [
    libxml2
    zlib
{'fraction_non_alphanumeric': 0.11547911547911548, 'fraction_numerical': 0.055692055692055695, 'mean_word_length': 3.1993127147766325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '1203399', 'n_tokens_mistral': 567, 'n_tokens_neox': 539, 'n_words': 86}