aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/whitedb.rb
blob: 052a4474bae18843cc75b5af1d1926093cf14565 (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
require "formula"

class Whitedb < Formula
  homepage "http://whitedb.org/"
  url "http://whitedb.org/whitedb-0.7.2.tar.gz"
  sha1 "055b6162e4c0eb225ab95347643fda583c0bbddd"

  depends_on "python" => :optional

  def install
    # https://github.com/priitj/whitedb/issues/15
    ENV.append "CFLAGS", "-std=gnu89"

    args = ["--prefix=#{prefix}"]
    args << "--with-python" if build.with? "python"
    system "./configure", *args

    system "make"
    system "make", "install"
  end

  test do
    system "#{bin}/wgdb", "create", "512k"
    system "#{bin}/wgdb", "add", "42"
    system "#{bin}/wgdb", "select", "1"
    system "#{bin}/wgdb", "free"
  end
end