<commit_before>{ stdenv, fetchFromGitHub, kernel, kmod, perl, patchutils, perlPackages }:
let
  media = fetchFromGitHub {
    owner = "tbsdtv";
    repo = "linux_media";
    rev = "14ebbec91f2cd0423aaf859fc6e6d5d986397cd4";
    sha256 = "1cmqj3kby8sxfcpvslbxywr95529vjxzbn800fdp35lka1fv962h";
  };
  build = fetchFromGitHub {
    owner = "tbsdtv";
    repo = "media_build";
    rev = "c340e29a4047e43f7ea7ebf19e1e28c1f2112d05";
    sha256 = "0hfn1j9qk8lh30z3ywj22qky480nsf8z2iag2bqhrhy4375vjlbl";
  };
in stdenv.mkDerivation {
  name = "tbs-2017-11-05-${kernel.version}";

  srcs = [ media build ];
  sourceRoot = "${build.name}";

  preConfigure = ''
    make dir DIR=../${media.name}
  '';

  postPatch = ''
    patchShebangs .

    sed -i v4l/Makefile \
      -i v4l/scripts/make_makefile.pl \
      -e 's,/sbin/depmod,${kmod}/bin/depmod,g' \
      -e 's,/sbin/lsmod,${kmod}/bin/lsmod,g'

    sed -i v4l/Makefile \
      -e 's,^OUTDIR ?= /lib/modules,OUTDIR ?= ${kernel.dev}/lib/modules,' \
      -e 's,^SRCDIR ?= /lib/modules,SRCDIR ?= ${kernel.dev}/lib/modules,'
  '';

  buildFlags = [ "VER=${kernel.modDirVersion}" ];
  installFlags = [ "DESTDIR=$(out)" ];

  hardeningDisable = [ "pic" "format" ];
  nativeBuildInputs = [ patchutils kmod perl perlPackages.ProcProcessTable ];

  meta = with stdenv.lib; {
    homepage = https://www.tbsdtv.com/;
    license = licenses.gpl2;
    maintainers = with maintainers; [ ck3d ];
    priority = 20;
  };
}<commit_msg>tbs: updated to kernel-4.14<commit_after>{ stdenv, lib, fetchFromGitHub, kernel, kmod, perl, patchutils, perlPackages, libelf }:
let

  media = fetchFromGitHub rec {
    name = repo;
    owner = "tbsdtv";
    repo = "linux_media";
    rev = "efe31531b77efd3a4c94516504a5823d31cdc776";
    sha256 = "1533qi3sb91v00289hl5zaj4l35r2sf9fqc6z5ky1vbb7byxgnlr";
  };

  build = fetchFromGitHub rec {
    name = repo;
    owner = "tbsdtv";
    repo = "media_build";
    rev = "a0d62eba4d429e0e9d2c2f910fb203e817cac84b";
    sha256 = "1329s7w9xlqjqwkpaqsd6b5dmzhm97jw0c7c7zzmmbdkl289i4i4";
  };

in stdenv.mkDerivation {
  name = "tbs-2018.04.18-${kernel.version}";

  srcs = [ media build ];
  sourceRoot = "${build.name}";

  preConfigure = ''
    make dir DIR=../${media.name}
  '';

  postPatch = ''
    patchShebangs .

    sed -i v4l/Makefile \
      -i v4l/scripts/make_makefile.pl \
      -e 's,/sbin/depmod,${kmod}/bin/depmod,g' \
      -e 's,/sbin/lsmod,${kmod}/bin/lsmod,g'

    sed -i v4l/Makefile \
      -e 's,^OUTDIR ?= /lib/modules,OUTDIR ?= ${kernel.dev}/lib/modules,' \
      -e 's,^SRCDIR ?= /lib/modules,SRCDIR ?= ${kernel.dev}/lib/modules,'
  '';

  buildFlags = [ "VER=${kernel.modDirVersion}" ];
  installFlags = [ "DESTDIR=$(out)" ];

  hardeningDisable = [ "pic" "format" ];

  nativeBuildInputs = [ patchutils kmod perl perlPackages.ProcProcessTable ]
  ++ lib.optional (lib.versionAtLeast kernel.version "4.14") [ libelf ];

  meta = with lib; {
    homepage = https://www.tbsdtv.com/;
    description = "Linux driver for TBSDTV cards";
    license = licenses.gpl2;
    maintainers = with maintainers; [ ck3d ];
    priority = 20;
  };
}
{'fraction_non_alphanumeric': 0.15838409746713691, 'fraction_numerical': 0.07021481243988457, 'mean_word_length': 3.2739726027397262, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4109376', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1309, 'n_words': 200}