<commit_before>{ stdenv, fetchgit, sqlite, pkgconfig
, buildllvmsparse ? true
, buildc2xml ? true
, llvm ? null, libxml2 ? null
}:

assert buildllvmsparse -> llvm != null;
assert buildc2xml -> libxml2 != null;

stdenv.mkDerivation {
  name = "smatch";

  src = fetchgit {
    url = git://repo.or.cz/smatch.git;
    rev = "23656e3e578b700cbf96d043f039e6341a3ba5b9";
    sha256 = "09a44967d4cff026c67062f778e251d0b432af132e9d59a47b7d3167f379adfa";
  };

  buildInputs = [sqlite pkgconfig]
   ++ stdenv.lib.optional buildllvmsparse llvm
   ++ stdenv.lib.optional buildc2xml libxml2;

  installFlags = "DESTDIR=$(out)";

  meta = {
    description = "A semantic analysis tool for C";
    homepage = "http://smatch.sourceforge.net/";
    license = "free"; /* OSL, see http://www.opensource.org */
  };
}<commit_msg>smatch: install files in the right place<commit_after>{ stdenv, fetchgit, sqlite, pkgconfig
, buildllvmsparse ? true
, buildc2xml ? true
, llvm ? null, libxml2 ? null
}:

assert buildllvmsparse -> llvm != null;
assert buildc2xml -> libxml2 != null;

stdenv.mkDerivation {
  name = "smatch";

  src = fetchgit {
    url = git://repo.or.cz/smatch.git;
    rev = "23656e3e578b700cbf96d043f039e6341a3ba5b9";
    sha256 = "09a44967d4cff026c67062f778e251d0b432af132e9d59a47b7d3167f379adfa";
  };

  buildInputs = [sqlite pkgconfig]
   ++ stdenv.lib.optional buildllvmsparse llvm
   ++ stdenv.lib.optional buildc2xml libxml2;

  preBuild =
    '' sed -i Makefile \
           -e "s|^PREFIX=.*|PREFIX = $out|g"
    '';

  meta = {
    description = "A semantic analysis tool for C";
    homepage = "http://smatch.sourceforge.net/";
    license = "free"; /* OSL, see http://www.opensource.org */
  };
}
{'fraction_non_alphanumeric': 0.13329418672930124, 'fraction_numerical': 0.0916030534351145, 'mean_word_length': 3.6430517711171664, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 12}, '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': '5894492', 'n_tokens_mistral': 747, 'n_tokens_neox': 662, 'n_words': 127}