<commit_before>{ stdenv, fetchurl, jre, makeWrapper, bash, coreutils, gnugrep, gnused,
  majorVersion ? "1.0" }:

let
  versionMap = {
    "0.9" = {
      kafkaVersion = "0.9.0.1";
      scalaVersion = "2.11";
      sha256 = "0ykcjv5dz9i5bws9my2d60pww1g9v2p2nqr67h0i2xrjm7az8a6v";
    };
    "0.10" = {
      kafkaVersion = "0.10.2.2";
      scalaVersion = "2.12";
      sha256 = "13wibnz7n7znv2g13jlpkz1r0y73qy5b02pdqhsq7cl72h9s6wms";
    };
    "0.11" = {
      kafkaVersion = "0.11.0.3";
      scalaVersion = "2.12";
      sha256 = "0zkzp9a8lcfcpavks131119v10hpn90sc0pw4f90jc4zn2yw3rgd";
    };
    "1.0" = {
      kafkaVersion = "1.0.2";
      scalaVersion = "2.12";
      sha256 = "0cmq8ww1lbkp3ipy9d1q8c1yz4kfwj0v4ynnhsk1i48sqlmvwybj";
    };
    "1.1" = {
      kafkaVersion = "1.1.1";
      scalaVersion = "2.12";
      sha256 = "13vg0wm2fsd06pfw05m4bhcgbjmb2bmd4i31zfs48w0f7hjc8qf2";
    };
    "2.0" = {
      kafkaVersion = "2.0.1";
      scalaVersion = "2.12";
      sha256 = "0i62q3542cznf711kiskaa30l06gq9ckszlxja4k1vs1flxz5khl";
    };
    "2.1" = {
      kafkaVersion = "2.1.0";
      scalaVersion = "2.12";
      sha256 = "11jgxyqxsw4hc85ba2czc8wdzlnywyb4ab8qd5f2y27mhak482x7";
    };
  };
in

with versionMap.${majorVersion};

stdenv.mkDerivation rec {
  version = "${scalaVersion}-${kafkaVersion}";
  name = "apache-kafka-${version}";

  src = fetchurl {
    url = "mirror://apache/kafka/${kafkaVersion}/kafka_${version}.tgz";
    inherit sha256;
  };

  buildInputs = [ jre makeWrapper bash gnugrep gnused coreutils ];

  installPhase = ''
    mkdir -p $out
    cp -R config libs $out

    mkdir -p $out/bin
    cp bin/kafka* $out/bin
    cp bin/connect* $out/bin
<commit_msg>kafka: 2.1.0 -> 2.1.1<commit_after>{ stdenv, fetchurl, jre, makeWrapper, bash, coreutils, gnugrep, gnused,
  majorVersion ? "1.0" }:

let
  versionMap = {
    "0.9" = {
      kafkaVersion = "0.9.0.1";
      scalaVersion = "2.11";
      sha256 = "0ykcjv5dz9i5bws9my2d60pww1g9v2p2nqr67h0i2xrjm7az8a6v";
    };
    "0.10" = {
      kafkaVersion = "0.10.2.2";
      scalaVersion = "2.12";
      sha256 = "13wibnz7n7znv2g13jlpkz1r0y73qy5b02pdqhsq7cl72h9s6wms";
    };
    "0.11" = {
      kafkaVersion = "0.11.0.3";
      scalaVersion = "2.12";
      sha256 = "0zkzp9a8lcfcpavks131119v10hpn90sc0pw4f90jc4zn2yw3rgd";
    };
    "1.0" = {
      kafkaVersion = "1.0.2";
      scalaVersion = "2.12";
      sha256 = "0cmq8ww1lbkp3ipy9d1q8c1yz4kfwj0v4ynnhsk1i48sqlmvwybj";
    };
    "1.1" = {
      kafkaVersion = "1.1.1";
      scalaVersion = "2.12";
      sha256 = "13vg0wm2fsd06pfw05m4bhcgbjmb2bmd4i31zfs48w0f7hjc8qf2";
    };
    "2.0" = {
      kafkaVersion = "2.0.1";
      scalaVersion = "2.12";
      sha256 = "0i62q3542cznf711kiskaa30l06gq9ckszlxja4k1vs1flxz5khl";
    };
    "2.1" = {
      kafkaVersion = "2.1.1";
      scalaVersion = "2.12";
      sha256 = "1gm7xiqkbg415mbj9mlazcndmky81xvg4wmz0h94yv1whp7fslr0";
    };
  };
in

with versionMap.${majorVersion};

stdenv.mkDerivation rec {
  version = "${scalaVersion}-${kafkaVersion}";
  name = "apache-kafka-${version}";

  src = fetchurl {
    url = "mirror://apache/kafka/${kafkaVersion}/kafka_${version}.tgz";
    inherit sha256;
  };

  buildInputs = [ jre makeWrapper bash gnugrep gnused coreutils ];

  installPhase = ''
    mkdir -p $out
    cp -R config libs $out

    mkdir -p $out/bin
    cp bin/kafka* $out/bin
    cp bin/connect* $out/bin

{'fraction_non_alphanumeric': 0.14911764705882352, 'fraction_numerical': 0.12823529411764706, 'mean_word_length': 2.7663344407530452, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, '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': '509211', 'n_tokens_mistral': 1762, 'n_tokens_neox': 1577, 'n_words': 206}