blob: 49fe8f8b22c87343978540e6be9cbd7bbc72f8d3 (
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
 | require "formula"
class Gputils < Formula
  homepage "http://gputils.sourceforge.net/"
  url "https://downloads.sourceforge.net/project/gputils/gputils/1.4.0/gputils-1.4.0-1.tar.gz"
  sha1 "26593b7237b0c436b4482d1038216b467ec660b7"
  bottle do
    sha1 "8990a94d132cc92b08518767ecaa25c93246f7cb" => :yosemite
    sha1 "2536c92c27e1982743965fa4c5c3bbae997105e1" => :mavericks
    sha1 "b4ef0c6743be8f8b0cd11e7148cee046f8780d59" => :mountain_lion
  end
  def install
    system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking"
    system "make install"
  end
  test do
    # assemble with gpasm
    (testpath/"test.asm").write " movlw 0x42\n end\n"
    system "#{bin}/gpasm -p p16f84 test.asm"
    assert File.exist?("test.hex")
    # disassemble with gpdasm
    output = `#{bin}/gpdasm -p p16f84 test.hex`
    assert_equal "0000:  3042  movlw   0x42\n", output
    assert_equal 0, $?.exitstatus
  end
end
 |