<commit_before>{ stdenv, fetchzip, kernel }:

let
  sourceAttrs = (import ./source.nix) { inherit fetchzip; };
in

stdenv.mkDerivation {
  name = "jool-${sourceAttrs.version}-${kernel.version}";

  src = sourceAttrs.src;

  prePatch = ''
    sed -e 's@/lib/modules/\$(.*)@${kernel.dev}/lib/modules/${kernel.modDirVersion}@' -i mod/*/Makefile
  '';

  buildPhase = ''
    make -C mod
  '';

  installPhase = ''
    make -C mod modules_install INSTALL_MOD_PATH=$out
  '';

  meta = with stdenv.lib; {
    homepage = https://www.jool.mx/;
    description = "Fairly compliant SIIT and Stateful NAT64 for Linux - kernel modules";
    platforms = platforms.linux;
    maintainers = with maintainers; [ fpletz ];
  };
}<commit_msg>jool: mark broken for kernel versions > 4.3<commit_after>{ stdenv, fetchzip, kernel }:

let
  sourceAttrs = (import ./source.nix) { inherit fetchzip; };
in

stdenv.mkDerivation {
  name = "jool-${sourceAttrs.version}-${kernel.version}";

  src = sourceAttrs.src;

  prePatch = ''
    sed -e 's@/lib/modules/\$(.*)@${kernel.dev}/lib/modules/${kernel.modDirVersion}@' -i mod/*/Makefile
  '';

  buildPhase = ''
    make -C mod
  '';

  installPhase = ''
    make -C mod modules_install INSTALL_MOD_PATH=$out
  '';

  meta = with stdenv.lib; {
    homepage = https://www.jool.mx/;
    description = "Fairly compliant SIIT and Stateful NAT64 for Linux - kernel modules";
    platforms = platforms.linux;
    maintainers = with maintainers; [ fpletz ];
    # kernel version 4.3 is the most recent supported version
    broken = builtins.compareVersions kernel.version "4.3" == 1;
  };
}
{'fraction_non_alphanumeric': 0.1545171339563863, 'fraction_numerical': 0.006853582554517134, 'mean_word_length': 3.248677248677249, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '6331099', 'n_tokens_mistral': 570, 'n_tokens_neox': 555, 'n_words': 128}