aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/dtc.rb
blob: d933c232ab2bb139c19b58b5e236ea4757e3211e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require "formula"

class Dtc < Formula
  homepage "http://www.devicetree.org/"
  url "http://ftp.debian.org/debian/pool/main/d/device-tree-compiler/device-tree-compiler_1.4.0+dfsg.orig.tar.gz"
  sha1 "2f9697aa7dbc3036f43524a454bdf28bf7e0f701"

  def install
    system "make"
    system "make", "DESTDIR=#{prefix}", "PREFIX=", "install"
    mv lib/"libfdt.dylib.1", lib/"libfdt.1.dylib"
  end

  test do
    (testpath/'test.dts').write <<-EOS.undent
      /dts-v1/;
      / {
      };
    EOS
    system "#{bin}/dtc", "test.dts"
  end
end