<commit_before>{ stdenv, fetchurl, python, makeWrapper, gawk, bash, getopt, procps
, which, jre, version, sha256, ...
}:

let
  libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc ];
  binPath = with stdenv.lib; makeBinPath ([
    bash
    getopt
    gawk
    which
    jre
    procps
  ]);
in

stdenv.mkDerivation rec {
  name = "cassandra-${version}";
  inherit version;

  src = fetchurl {
    inherit sha256;
    url = "mirror://apache/cassandra/${version}/apache-${name}-bin.tar.gz";
  };

  nativeBuildInputs = [ makeWrapper ];

  installPhase = ''
    mkdir $out
    mv * $out

    # Clean up documentation.
    mkdir -p $out/share/doc/${name}
    mv $out/CHANGES.txt \
       $out/LICENSE.txt \
       $out/NEWS.txt \
       $out/NOTICE.txt \
       $out/javadoc \
       $out/share/doc/${name}

    if [[ -d $out/doc ]]; then
      mv "$out/doc/"* $out/share/doc/${name}
      rmdir $out/doc
    fi

    for cmd in bin/cassandra bin/nodetool bin/sstablekeys \
      bin/sstableloader bin/sstableupgrade \
      tools/bin/cassandra-stress tools/bin/cassandra-stressd \
      tools/bin/sstablemetadata tools/bin/sstableofflinerelevel \
      tools/bin/token-generator tools/bin/sstablelevelreset; do

      # check if file exists because some bin tools don't exist across all
      # cassandra versions
      if [ -f $out/$cmd ]; then
        wrapProgram $out/$cmd \
          --suffix-each LD_LIBRARY_PATH : ${libPath} \<commit_msg>cassandra: Wrap new binaries (#59090)<commit_after>{ stdenv, fetchurl, python, makeWrapper, gawk, bash, getopt, procps
, which, jre, version, sha256, coreutils, ...
}:

let
  libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc ];
  binPath = with stdenv.lib; makeBinPath ([
    bash
    getopt
    gawk
    which
    jre
    procps
  ]);
in

stdenv.mkDerivation rec {
  name = "cassandra-${version}";
  inherit version;

  src = fetchurl {
    inherit sha256;
    url = "mirror://apache/cassandra/${version}/apache-${name}-bin.tar.gz";
  };

  nativeBuildInputs = [ makeWrapper ];

  installPhase = ''
    mkdir $out
    mv * $out

    # Clean up documentation.
    mkdir -p $out/share/doc/${name}
    mv $out/CHANGES.txt \
       $out/LICENSE.txt \
       $out/NEWS.txt \
       $out/NOTICE.txt \
       $out/javadoc \
       $out/share/doc/${name}

    if [[ -d $out/doc ]]; then
      mv "$out/doc/"* $out/share/doc/${name}
      rmdir $out/doc
    fi


    for cmd in bin/cassandra \
               bin/nodetool \
               bin/sstablekeys \
               bin/sstableloader \
               bin/sstablescrub \
               bin/sstableupgrade \
               bin/sstableutil \
               bin/sstableverify \
               tools/bin/cassandra-stress \
               tools/bin/cassandra-stressd \
               tools/bin/sstabledump \
               tools/bin/sstableexpiredblockers \
               tools/bin/sstablelevelreset \
               tools/bin/sstablemetadata \
               tools/bin/sstableofflinerelevel \
               tools/bin/sstablerepairedset \
               tools/bin/sstablesplit \
               tools/bin/token-generator; do

      # check if file exists because some bin tools don't exist across all
      # cassandra versions
      if [ -f $out/$cmd ]; then
        makeWrapper $out/$cmd $out/bin/$(${coreutils}/bin/basename "$cmd") \
          --suffix-each LD_LIBRARY_PATH : ${libPath} \
{'fraction_non_alphanumeric': 0.12470379146919432, 'fraction_numerical': 0.005035545023696682, 'mean_word_length': 1.962280701754386, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '6332064', 'n_tokens_mistral': 1175, 'n_tokens_neox': 1114, 'n_words': 230}