<commit_before>{stdenv, fetchurl, libusb}:

stdenv.mkDerivation rec {
  name = "libftdi-0.20";

  src = fetchurl {
    url = "https://www.intra2net.com/en/developer/libftdi/download/${name}.tar.gz";
    sha256 = "13l39f6k6gff30hsgh0wa2z422g9pyl91rh8a8zz6f34k2sxaxii";
  };

  buildInputs = [ libusb ];

  propagatedBuildInputs = [ libusb ];

  # Hack to avoid TMPDIR in RPATHs.
  preFixup = ''rm -rf "$(pwd)" '';
  configureFlags = [ "--with-async-mode" ];

  # allow async mode. from ubuntu. see:
  #   https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/libftdi/trusty/view/head:/debian/patches/04_async_mode.diff
  patchPhase = ''
    substituteInPlace ./src/ftdi.c \
      --replace "ifdef USB_CLASS_PTP" "if 0"
  '';

  meta = {
    description = "A library to talk to FTDI chips using libusb";
    homepage = https://www.intra2net.com/en/developer/libftdi/;
    license = stdenv.lib.licenses.lgpl21;
    platforms = stdenv.lib.platforms.linux;
  };
}<commit_msg>libftdi: extend platforms and fix on Darwin<commit_after>{stdenv, fetchurl, libusb}:

with stdenv; mkDerivation rec {
  name = "libftdi-0.20";

  src = fetchurl {
    url = "https://www.intra2net.com/en/developer/libftdi/download/${name}.tar.gz";
    sha256 = "13l39f6k6gff30hsgh0wa2z422g9pyl91rh8a8zz6f34k2sxaxii";
  };

  buildInputs = [ libusb ];

  propagatedBuildInputs = [ libusb ];

  # Hack to avoid TMPDIR in RPATHs.
  preFixup = ''rm -rf "$(pwd)" '';
  configureFlags = lib.optional (!isDarwin) [ "--with-async-mode" ];

  # allow async mode. from ubuntu. see:
  #   https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/libftdi/trusty/view/head:/debian/patches/04_async_mode.diff
  patchPhase = ''
    substituteInPlace ./src/ftdi.c \
      --replace "ifdef USB_CLASS_PTP" "if 0"
  '';

  meta = {
    description = "A library to talk to FTDI chips using libusb";
    homepage = https://www.intra2net.com/en/developer/libftdi/;
    license = lib.licenses.lgpl21;
    platforms = lib.platforms.all;
  };
}
{'fraction_non_alphanumeric': 0.14772158237356034, 'fraction_numerical': 0.03505257886830245, 'mean_word_length': 3.391208791208791, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2132183', 'n_tokens_mistral': 828, 'n_tokens_neox': 765, 'n_words': 132}