<commit_before>{ stdenv
, fetchurl
, gettext
, texinfo

#, adns
, bzip2
, gnutls
, libassuan
, libgcrypt
, libgpg-error
, libksba
, libusb-compat
, npth
, openldap
, pcsclite
, readline
, sqlite
, zlib

, channel ? "2.1"
}:

let
  inherit (stdenv)
    targetSystem;
  inherit (stdenv.lib)
    elem
    optional
    platforms;
in

let
  sources = import ./sources.nix;

  tarballUrls = version: [
    "mirror://gnupg/gnupg/gnupg-${version}.tar.bz2"
  ];

  version = sources.${channel}.version;
in

stdenv.mkDerivation rec {
  name = "gnupg-${version}";

  src = fetchurl {
    urls = tarballUrls version;
    allowHashOutput = false;
    inherit (sources.${channel}) sha256;
  };

  nativeBuildInputs = [
    gettext
    texinfo
  ];

  buildInputs = [
    #adns
    bzip2
    gnutls
    libassuan
    libgcrypt
    libgpg-error
    libksba
    libusb-compat
    npth
    openldap
    readline
    sqlite
    zlib
  ];

  postPatch = ''
    sed -i 's,"libpcsclite\.so[^"]*","${pcsclite}/lib/libpcsclite.so",g' scd/scdaemon.c
  '';

  configureFlags = [
    "--with-pinentry-pgm=pinentry"
    "--disable-selinux-support"
    "--disable-gpg-idea"
    "--disable-gpg-cast5"
    "--disable-gpg-md5"
    "--enable-zip"
    "--enable-bzip2"
    "--with-capabilities"
    "--enable-card-support"
    "--enable-ccid-driver"
    "--enable-sqlite"
    "--disable-ntbtls"
    "--enable-gnutls"
    # "--with-adns"  # This seems to be buggy
    "--enable-ldap"
    "--with-mailprog=sendmail"
    "--with-zlib"
    "--with-bzip2"<commit_msg>gnupg: Fix libusb<commit_after>{ stdenv
, fetchurl
, gettext
, texinfo

#, adns
, bzip2
, gnutls
, libassuan
, libgcrypt
, libgpg-error
, libksba
, libusb
, npth
, openldap
, pcsclite
, readline
, sqlite
, zlib

, channel ? "2.1"
}:

let
  inherit (stdenv)
    targetSystem;
  inherit (stdenv.lib)
    elem
    optional
    platforms;
in

let
  sources = import ./sources.nix;

  tarballUrls = version: [
    "mirror://gnupg/gnupg/gnupg-${version}.tar.bz2"
  ];

  version = sources.${channel}.version;
in

stdenv.mkDerivation rec {
  name = "gnupg-${version}";

  src = fetchurl {
    urls = tarballUrls version;
    allowHashOutput = false;
    inherit (sources.${channel}) sha256;
  };

  nativeBuildInputs = [
    gettext
    texinfo
  ];

  buildInputs = [
    #adns
    bzip2
    gnutls
    libassuan
    libgcrypt
    libgpg-error
    libksba
    libusb
    npth
    openldap
    readline
    sqlite
    zlib
  ];

  postPatch = ''
    sed -i 's,"libpcsclite\.so[^"]*","${pcsclite}/lib/libpcsclite.so",g' scd/scdaemon.c
  '';

  preConfigure = ''
    export CPPFLAGS="$CPPFLAGS -I$(echo "${libusb}"/include/*)"
  '';

  configureFlags = [
    "--with-pinentry-pgm=pinentry"
    "--disable-selinux-support"
    "--disable-gpg-idea"
    "--disable-gpg-cast5"
    "--disable-gpg-md5"
    "--enable-zip"
    "--enable-bzip2"
    "--with-capabilities"
    "--enable-card-support"
    "--enable-ccid-driver"
    "--enable-sqlite"
    "--disable-ntbtls"
    "--enable-gnutls"
    # "--with-adns"  # This seems to be buggy
    "--enable-ldap"
    "--with-mailprog=sendmail"
    "--with-zlib"
    "--with-bzip2"
{'fraction_non_alphanumeric': 0.15843162256933377, 'fraction_numerical': 0.007650621613006056, 'mean_word_length': 2.422028353326063, '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': '6695865', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1244, 'n_words': 208}