Skip to content

Instantly share code, notes, and snippets.

@kbeckmann
Created April 11, 2018 21:55
Show Gist options
  • Save kbeckmann/78d7c457a53b396a2dfe5e2bef33200c to your computer and use it in GitHub Desktop.
Save kbeckmann/78d7c457a53b396a2dfe5e2bef33200c to your computer and use it in GitHub Desktop.
openocd brew formula with all features enabled and pull from mirror (that build)
class OpenOcd < Formula
desc "On-chip debugging, in-system programming and boundary-scan testing"
homepage "https://sourceforge.net/projects/openocd/"
url "https://downloads.sourceforge.net/project/openocd/openocd/0.10.0/openocd-0.10.0.tar.bz2"
sha256 "7312e7d680752ac088b8b8f2b5ba3ff0d30e0a78139531847be4b75c101316ae"
bottle do
rebuild 1
sha256 "eab0153f54c97d4922386996d7517b6dc22c8e418b620ba42dd6f190fc0c48f7" => :high_sierra
sha256 "281978e21362ed00dd198715825d77f0f2aeb64ad99954714a34ce128e1a0df8" => :sierra
sha256 "e1fc5f8a8bf079954a56459b330313cd82a69a219114821c14f9d3df2fd3ea25" => :el_capitan
sha256 "568ae702a3488805b8651b5456346c9484ca6f8486a09f3c2a4473664370a481" => :yosemite
end
head do
url "git://repo.or.cz/openocd.git"
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-aice
--enable-armjtagew
--enable-at91rm9200
--enable-bcm2835gpio
--enable-buspirate
--enable-cmsis-dap
--enable-dummy
--enable-ep93xx
--enable-ftdi
--enable-ioutil
--enable-jlink
--enable-jtag_vpi
--enable-legacy-ft2232_libftdi
--enable-opendous
--enable-openjtag_ftdi
--enable-osbdm
--enable-presto_libftdi
--enable-remote-bitbang
--enable-rlink
--enable-stlink
--enable-ti-icdi
--enable-ulink
--enable-usb-blaster-2
--enable-usb_blaster_libftdi
--enable-usbprog
--enable-vsllink
]
ENV["CCACHE"] = "none"
system "./bootstrap", "nosubmodule" if build.head?
system "./configure", *args
system "make", "-j8", "install"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment