29 lines
1 KiB
Ruby
29 lines
1 KiB
Ruby
class ArduinoCli < Formula
|
|
desc "Arduino command-line interface"
|
|
homepage "https://github.com/arduino/arduino-cli"
|
|
url "https://github.com/arduino/arduino-cli.git",
|
|
:tag => "0.6.0",
|
|
:revision => "3a08b07d458ef65fdefe88a7d71056227f626f5a"
|
|
head "https://github.com/arduino/arduino-cli.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "878a5c5b6b9c25e1e1a7d703876dda604cae63a3efee21039e6d3ba44f43eb43" => :mojave
|
|
sha256 "d96cc41349e79283cc17ab01ef2643badb8f835c38a6e1d6873a0aa35ed97bfc" => :high_sierra
|
|
end
|
|
|
|
depends_on "go" => :build
|
|
|
|
def install
|
|
commit = Utils.popen_read("git", "rev-parse", "HEAD").chomp
|
|
system "go", "build", "-ldflags",
|
|
"-s -w -X github.com/arduino/arduino-cli/version.versionString=#{version} " \
|
|
"-X github.com/arduino/arduino-cli/version.commit=#{commit}",
|
|
"-o", bin/"arduino-cli"
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/arduino-cli", "sketch", "new", "test_sketch"
|
|
assert File.directory?("#{testpath}/test_sketch")
|
|
end
|
|
end
|