<commit_before>{ stdenv, fetchFromGitHub }:

stdenv.mkDerivation rec {
  pname = "leveldb";
  version = "1.20";

  src = fetchFromGitHub {
    owner = "google";
    repo = "leveldb";
    rev = "v${version}";
    sha256 = "01kxga1hv4wp94agx5vl3ybxfw5klqrdsrb6p6ywvnjmjxm8322y";
  };

  buildPhase = ''
    make all
  '';

  installPhase = (stdenv.lib.optionalString stdenv.isDarwin ''
    for file in out-shared/*.dylib*; do
      install_name_tool -id $out/lib/$file $file
    done
  '') + # XXX consider removing above after transition to cmake in the next release
  "
    mkdir -p $out/{bin,lib,include}

    cp -r include $out
    mkdir -p $out/include/leveldb/helpers
    cp helpers/memenv/memenv.h $out/include/leveldb/helpers

    cp out-shared/lib* $out/lib
    cp out-static/lib* $out/lib

    cp out-static/leveldbutil $out/bin
  ";

  meta = with stdenv.lib; {
    homepage = https://github.com/google/leveldb;
    description = "Fast and lightweight key/value database library by Google";
    license = licenses.bsd3;
    platforms = platforms.all;
  };
}
<commit_msg>leveldb: fix rpath setting on Darwin<commit_after>{ stdenv, fetchFromGitHub }:

stdenv.mkDerivation rec {
  pname = "leveldb";
  version = "1.20";

  src = fetchFromGitHub {
    owner = "google";
    repo = "leveldb";
    rev = "v${version}";
    sha256 = "01kxga1hv4wp94agx5vl3ybxfw5klqrdsrb6p6ywvnjmjxm8322y";
  };

  buildPhase = ''
    make all
  '';

  installPhase = (stdenv.lib.optionalString stdenv.isDarwin ''
    for file in out-shared/*.dylib.*.*; do
      install_name_tool -id $out/lib/$(basename $file) $file
    done
  '') + # XXX consider removing above after transition to cmake in the next release
  "
    mkdir -p $out/{bin,lib,include}

    cp -r include $out
    mkdir -p $out/include/leveldb/helpers
    cp helpers/memenv/memenv.h $out/include/leveldb/helpers

    cp out-shared/lib* $out/lib
    cp out-static/lib* $out/lib

    cp out-static/leveldbutil $out/bin
  ";

  meta = with stdenv.lib; {
    homepage = https://github.com/google/leveldb;
    description = "Fast and lightweight key/value database library by Google";
    license = licenses.bsd3;
    platforms = platforms.all;
  };
}

{'fraction_non_alphanumeric': 0.1261384335154827, 'fraction_numerical': 0.020036429872495445, 'mean_word_length': 3.0311926605504587, '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': '4661159', 'n_tokens_mistral': 840, 'n_tokens_neox': 801, 'n_words': 180}