blob: c7e6d3911c03d76a4245ddc590d4612799643a29 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 | 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" => :build
    depends_on "automake" => :build
    depends_on "libtool" => :build
    depends_on "texinfo" => :build
  end
  option 'without-hidapi', 'Disable building support for devices using HIDAPI (CMSIS-DAP)'
  option 'without-libftdi', 'Disable building support for libftdi-based drivers (USB-Blaster, ASIX Presto, OpenJTAG)'
  option 'without-libusb',  'Disable building support for all other USB adapters'
  depends_on 'pkg-config' => :build
  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
 |