<commit_before>{ stdenv
, autoconf
, automake
, elfutils
, fetchFromGitHub
, fetchTritonPatch
, fetchurl
, lib
, libtool

, libaio
, libtirpc
, openssl
, python2
, python3
, perl
, systemd_lib
, util-linux_lib
, zlib

, channel
}:

let
  common = (import ./common.nix {
    inherit
      fetchFromGitHub
      fetchTritonPatch
      fetchurl
      stdenv;
  })."${channel}";
in
stdenv.mkDerivation rec {
  name = "zfs-user-${common.version or common.date}";

  inherit (common) src;

  nativeBuildInputs = [
    autoconf
    automake
    libtool
  ];

  buildInputs = [
    libaio
    libtirpc
    openssl
    python2
    python3
    perl
    systemd_lib
    util-linux_lib
    zlib
  ];

  # for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work
  NIX_CFLAGS_LINK = "-lgcc_s";

  inherit (common) patches;

  preConfigure = ''
    test -f configure || ./autogen.sh

    configureFlagsArray+=(
      "--with-mounthelperdir=$out/bin"
      "--with-udevdir=$out/lib/udev"
      "--with-systemdunitdir=$out/etc/systemd/system"
      "--with-systemdpresetdir=$out/etc/systemd/system-preset"
      "--with-systemdmodulesloaddir=$out/etc/module-load.d"
      "--with-systemdgeneratordir=$out/lib/systemd/system-generators"
      "--with-dracutdir=$TMPDIR"
    )
  '';

  configureFlags = [
    "--sysconfdir=/etc"
    "--localstatedir=/var"
    "--enable-systemd"
    "--disable-sysvinit"
    "--with-config=user"
    #"--with-qat"
    "--with-tirpc"
  ];

  preInstall = ''
    installFlagsArray+=(
      "sysconfdir=$out/etc"
    )
  '';

  postInstall = ''
    # Remove test code
    rm -r "$out"/share/zfs

    # Remove initrd stuff
    rm -r "$out"/share/initramfs-tools
  '';

  passthru = {
    inherit channel;
  };

  meta = with lib; {
    description = "ZFS Filesystem Linux Kernel module";
    homepage = http://zfsonlinux.org/;
    license = licenses.cddl;
    maintainers = with maintainers; [
      wkennington
    ];
    platforms = with platforms;
      x86_64-linux;
  };<commit_msg>zfs: Fix for glibc 2.28<commit_after>{ stdenv
, autoconf
, automake
, elfutils
, fetchFromGitHub
, fetchTritonPatch
, fetchurl
, lib
, libtool

, libaio
, libtirpc
, openssl
, python2
, python3
, perl
, systemd_lib
, util-linux_lib
, zlib

, channel
}:

let
  common = (import ./common.nix {
    inherit
      fetchFromGitHub
      fetchTritonPatch
      fetchurl
      stdenv;
  })."${channel}";
in
stdenv.mkDerivation rec {
  name = "zfs-user-${common.version or common.date}";

  inherit (common) src;

  nativeBuildInputs = [
    autoconf
    automake
    libtool
  ];

  buildInputs = [
    libaio
    libtirpc
    openssl
    python2
    python3
    perl
    systemd_lib
    util-linux_lib
    zlib
  ];

  inherit (common) patches;

  preConfigure = ''
    test -f configure || ./autogen.sh

    configureFlagsArray+=(
      "--with-mounthelperdir=$out/bin"
      "--with-udevdir=$out/lib/udev"
      "--with-systemdunitdir=$out/etc/systemd/system"
      "--with-systemdpresetdir=$out/etc/systemd/system-preset"
      "--with-systemdmodulesloaddir=$out/etc/module-load.d"
      "--with-systemdgeneratordir=$out/lib/systemd/system-generators"
      "--with-dracutdir=$TMPDIR"
    )
  '';

  configureFlags = [
    "--sysconfdir=/etc"
    "--localstatedir=/var"
    "--enable-systemd"
    "--disable-sysvinit"
    "--with-config=user"
    #"--with-qat"
    "--with-tirpc"
  ];

  preInstall = ''
    installFlagsArray+=(
      "sysconfdir=$out/etc"
    )
  '';

  # Needed for rpc headers
  NIX_CFLAGS_COMPILE = "-I${libtirpc}/include/tirpc";

  postInstall = ''
    # Remove test code
    rm -r "$out"/share/zfs

    # Remove initrd stuff
    rm -r "$out"/share/initramfs-tools
  '';

  passthru = {
    inherit channel;
  };

  meta = with lib; {
    description = "ZFS Filesystem Linux Kernel module";
    homepage = http://zfsonlinux.org/;
    license = licenses.cddl;
    maintainers = with maintainers; [
      wkennington
    ];
    platforms = with platforms;
      x86_64-linux;
  };
{'fraction_non_alphanumeric': 0.13665835411471322, 'fraction_numerical': 0.004738154613466334, 'mean_word_length': 2.503056768558952, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '2863215', 'n_tokens_mistral': 1505, 'n_tokens_neox': 1458, 'n_words': 261}