<commit_before>{ boost, cmake, fetchFromGitHub, gtest, libpcap, openssl, stdenv }:

stdenv.mkDerivation rec {
  name = "libtins-${version}";
  version = "4.0";
  
  src = fetchFromGitHub {
    owner = "mfontanini";
    repo = "libtins";
    rev = "v${version}";
    sha256 = "13sdqad976j7gq2k1il6g51yxwr8rlqdkzf1kj9mzhihjq8541qs";
  };

  postPatch = ''
    rm -rf googletest
    cp -r ${gtest.src}/googletest googletest
    chmod -R a+w googletest
  '';

  nativeBuildInputs = [ cmake gtest ];
  buildInputs = [
    openssl
    libpcap
    boost
  ];

  configureFlags = [
    "--with-boost-libdir=${boost.out}/lib"
    "--with-boost=${boost.dev}"
  ];

  enableParallelBuilding = true;
  doCheck = true;
  checkPhase = "make tests && LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib make test";

  meta = with stdenv.lib; {
    description = "High-level, multiplatform C++ network packet sniffing and crafting library";
    homepage = https://libtins.github.io/;
    license = stdenv.lib.licenses.bsd2;
    maintainers = with maintainers; [ fdns ];
    platforms = stdenv.lib.platforms.unix;
  };
}<commit_msg>libtins: fix test on darwin<commit_after>{ boost, cmake, fetchFromGitHub, gtest, libpcap, openssl, stdenv }:

stdenv.mkDerivation rec {
  name = "libtins-${version}";
  version = "4.0";
  
  src = fetchFromGitHub {
    owner = "mfontanini";
    repo = "libtins";
    rev = "v${version}";
    sha256 = "13sdqad976j7gq2k1il6g51yxwr8rlqdkzf1kj9mzhihjq8541qs";
  };

  postPatch = ''
    rm -rf googletest
    cp -r ${gtest.src}/googletest googletest
    chmod -R a+w googletest
  '';

  nativeBuildInputs = [ cmake gtest ];
  buildInputs = [
    openssl
    libpcap
    boost
  ];

  configureFlags = [
    "--with-boost-libdir=${boost.out}/lib"
    "--with-boost=${boost.dev}"
  ];

  enableParallelBuilding = true;
  doCheck = true;
  preCheck = ''
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
    export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PWD/lib
  '';
  checkTarget = "tests test";

  meta = with stdenv.lib; {
    description = "High-level, multiplatform C++ network packet sniffing and crafting library";
    homepage = https://libtins.github.io/;
    license = stdenv.lib.licenses.bsd2;
    maintainers = with maintainers; [ fdns ];
    platforms = stdenv.lib.platforms.unix;
  };
}
{'fraction_non_alphanumeric': 0.1364031277150304, 'fraction_numerical': 0.020851433536055605, 'mean_word_length': 3.296641791044776, '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': '1207306', 'n_tokens_mistral': 916, 'n_tokens_neox': 869, 'n_words': 164}