<commit_before>{stdenv, lib, fetchFromGitHub, dmd, curl}:

stdenv.mkDerivation rec {
  name = "dtools-${version}";
  version = "2.075.1";

  src = fetchFromGitHub {
    owner = "dlang";
    repo = "tools";
    rev = "v${version}";
    sha256 = "0lxn400s9las9hq6h9vj4mis2jr662k2yw0zcrvqcm1yg9pd245d";
  };

  postPatch = ''
      substituteInPlace posix.mak \
          --replace "../dmd/generated/\$(OS)/release/\$(MODEL)/dmd" ${dmd.out}/bin/dmd

      substituteInPlace posix.mak \
          --replace gcc $CC

      # To fix rdmd test with newer phobos
      substituteInPlace rdmd.d \
          --replace " std.stdiobase," ""
  '';

  nativeBuildInputs = [ dmd ];
  buildInputs = [ curl ];

  buildPhase = ''
    make -f posix.mak DMD=${dmd.out}/bin/dmd INSTALL_DIR=$out
  '';

  doCheck = true;

  checkPhase = ''
      export BITS=${builtins.toString stdenv.hostPlatform.parsed.cpu.bits}
      export OSNAME=${if stdenv.hostPlatform.isDarwin then "osx" else stdenv.hostPlatform.parsed.kernel.name}
      ./generated/$OSNAME/$BITS/rdmd -main -unittest rdmd.d
      ${dmd.out}/bin/dmd rdmd_test.d
      ./rdmd_test
    '';

  installPhase = ''
    mkdir -p $out/bin
    ${
      let bits = builtins.toString stdenv.hostPlatform.parsed.cpu.bits;
      osname = if stdenv.hostPlatform.isDarwin then "osx" else stdenv.hostPlatform.parsed.kernel.name; in
      "find $PWD/generated/${osname}/${bits} -perm /a+x -type f -exec cp {} $out/bin \\;"
    }
	'';

  meta = with stdenv.lib; {
    description = "Ancillary tools for the D programming language compiler";
    homepage = https://github.com/dlang/tools;
    license = lib.licenses.boost;
    maintainers = with maintainers; [ ThomasMader ];
    platforms = stdenv.lib.platforms.unix;
  };
}
<commit_msg>dtools: 2.075.1 -> 2.078.0<commit_after>{stdenv, lib, fetchFromGitHub, dmd, curl}:

stdenv.mkDerivation rec {
  name = "dtools-${version}";
  version = "2.078.0";

  srcs = [
    (fetchFromGitHub {
      owner = "dlang";
      repo = "dmd";
      rev = "v${version}";
      sha256 = "1ia4swyq0xqppnpmcalh2yxywdk2gv3kvni2abx1mq6wwqgmwlcr";
      name = "dmd";
    })
    (fetchFromGitHub {
      owner = "dlang";
      repo = "tools";
      rev = "v${version}";
      sha256 = "1cydhn8g0h9i9mygzi80fb5fz3z1f6m8b9gypdvmyhkkzg63kf12";
      name = "dtools";
    })
  ];

  sourceRoot = ".";

  postUnpack = ''
      mv dmd dtools
      cd dtools
  '';

  postPatch = ''
      substituteInPlace posix.mak \
          --replace "../dmd/generated/\$(OS)/release/\$(MODEL)/dmd" ${dmd.out}/bin/dmd

      substituteInPlace posix.mak \
          --replace gcc $CC

      # To fix rdmd test with newer phobos
      substituteInPlace rdmd.d \
          --replace " std.stdiobase," ""
  '';

  nativeBuildInputs = [ dmd ];
  buildInputs = [ curl ];

  makeCmd = ''
    make -f posix.mak DMD=${dmd.out}/bin/dmd DMD_DIR=dmd
  '';

  buildPhase = ''
    $makeCmd
  '';

  doCheck = true;

  checkPhase = ''
      $makeCmd test_rdmd
    '';

  installPhase = ''
      $makeCmd INSTALL_DIR=$out install
	'';

  meta = with stdenv.lib; {
    description = "Ancillary tools for the D programming language compiler";
    homepage = https://github.com/dlang/tools;
    license = lib.licenses.boost;
    maintainers = with maintainers; [ ThomasMader ];
    platforms = stdenv.lib.platforms.unix;
  };
}

{'fraction_non_alphanumeric': 0.14739364889155182, 'fraction_numerical': 0.022468544038346316, 'mean_word_length': 2.5787781350482315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '6634365', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1249, 'n_words': 228}