<commit_before>require 'formula'

class OpenOcd < Formula
  homepage 'http://sourceforge.net/projects/openocd/'
  url 'https://downloads.sourceforge.net/project/openocd/openocd/0.8.0/openocd-0.8.0.tar.bz2'
  sha1 '10bf9eeb54e03083cb1a101785b2d69fbdf18f31'

  head do
    url 'git://git.code.sf.net/p/openocd/code'

    depends_on :autoconf
    depends_on :automake
    depends_on :libtool
  end


  option 'enable-cmsis-dap', 'Enable building support for devices using CMSIS-DAP'
  option 'enable-ft2232_libftdi', 'Enable building support for FT2232 based devices with libftdi driver'
  option 'enable-ft2232_ftd2xx',  'Enable building support for FT2232 based devices with FTD2XX driver'

  depends_on 'pkg-config' => :build
  depends_on 'libusb-compat'
  depends_on 'libftdi0' if build.include? 'enable-ft2232_libftdi'
  depends_on 'hidapi' if build.include? 'enable-cmsis-dap'

  def install
    args = %W[
      --disable-dependency-tracking
      --prefix=#{prefix}
      --enable-ftdi
      --enable-arm-jtag-ew
      --enable-jlink
      --enable-rlink
      --enable-stlink
      --enable-ulink
      --enable-usbprog
      --enable-vsllink
      --enable-ep93xx
      --enable-at91rm9200
      --enable-ecosboard
      --enable-opendous
      --enable-osbdm
      --enable-buspirate
    ]

    if build.include? "enable-ft2232_libftdi"
      args << "--enable-ft2232_libftdi"
      args << "--enable-presto_libftdi"
      args << "--enable-usb_blaster_libftdi"
    end

    if build.include? "enable-ft2232_ftd2xx"
      args << "--enable-ft2232_ftd2xx"
      args << "--enable-presto_ftd2xx"
    end

    if build.include? "enable-cmsis-dap"
      args << "--enable-cmsis-dap"
    end

    ENV['CCACHE'] = 'none'

    system "./bootstrap", "nosubmodule" if build.head?
    system "./configure", *args
    system "make install"
  end
end<commit_msg>open-ocd: bring in line with upstream recommendations<commit_after>require 'formula'

class OpenOcd < Formula
  homepage 'http://sourceforge.net/projects/openocd/'
  url 'https://downloads.sourceforge.net/project/openocd/openocd/0.8.0/openocd-0.8.0.tar.bz2'
  sha1 '10bf9eeb54e03083cb1a101785b2d69fbdf18f31'

  head do
    url 'git://git.code.sf.net/p/openocd/code'

    depends_on :autoconf
    depends_on :automake
    depends_on 'texinfo' => :build
  end


  option 'with-hidapi', 'Enable building support for devices using HIDAPI (CMSIS-DAP)'
  option 'with-libftdi', 'Enable building support for libftdi-based drivers (USB-Blaster, ASIX Presto, OpenJTAG)'
  option 'with-libusb',  'Enable building support for all other USB adapters'

  depends_on 'pkg-config' => :build
  depends_on :libtool
  depends_on 'libusb' => :recommended
  # some drivers are still not converted to libusb-1.0
  depends_on 'libusb-compat' if build.with? 'libusb'
  depends_on 'libftdi' => :recommended
  depends_on 'hidapi' => :recommended

  def install
    # all the libusb and hidapi-based drivers are auto-enabled when
    # the corresponding libraries are present in the system
    args = %W[
      --disable-dependency-tracking
      --prefix=#{prefix}
      --enable-dummy
      --enable-buspirate
      --enable-jtag_vpi
      --enable-remote-bitbang
    ]

    if build.with? "libftdi"
      args << "--enable-usb_blaster_libftdi"
      args << "--enable-presto_libftdi"
      args << "--enable-openjtag_ftdi"
      args << "--enable-legacy-ft2232_libftdi"
    end

    ENV['CCACHE'] = 'none'

    system "./bootstrap", "nosubmodule" if build.head?
    system "./configure", *args
    system "make install"
  end
end
{'fraction_non_alphanumeric': 0.12289562289562289, 'fraction_numerical': 0.03367003367003367, 'mean_word_length': 2.9611111111111112, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, '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': '7527950', 'n_tokens_mistral': 1336, 'n_tokens_neox': 1269, 'n_words': 270}