class Ledger < Formula desc "Command-line, double-entry accounting tool" homepage "https://ledger-cli.org/" url "https://github.com/ledger/ledger/archive/v3.1.3.tar.gz" sha256 "b248c91d65c7a101b9d6226025f2b4bf3dabe94c0c49ab6d51ce84a22a39622b" head "https://github.com/ledger/ledger.git" bottle do sha256 "b225b9fde9487458e32499fc039810a9aa7f73d6744b9132f5326d8c20524563" => :mojave sha256 "95a13d2f8ccf38bcd91030dd86e8abaf39a018ef5ddd0303db772b3380ca6758" => :high_sierra sha256 "8ce321281434ebc6852924f117f34bd932a21d190870edf2bec9887e4e99ecdb" => :sierra end depends_on "cmake" => :build depends_on "boost" depends_on "boost-python" depends_on "gmp" depends_on "mpfr" depends_on "python@2" def install ENV.cxx11 args = %W[ --jobs=#{ENV.make_jobs} --output=build --prefix=#{prefix} --boost=#{Formula["boost"].opt_prefix} --python -- -DBUILD_DOCS=1 -DBUILD_WEB_DOCS=1 -DUSE_PYTHON27_COMPONENT=1 ] system "./acprep", "opt", "make", *args system "./acprep", "opt", "make", "doc", *args system "./acprep", "opt", "make", "install", *args (pkgshare/"examples").install Dir["test/input/*.dat"] pkgshare.install "contrib" pkgshare.install "python/demo.py" elisp.install Dir["lisp/*.el", "lisp/*.elc"] bash_completion.install pkgshare/"contrib/ledger-completion.bash" end test do balance = testpath/"output" system bin/"ledger", "--args-only", "--file", "#{pkgshare}/examples/sample.dat", "--output", balance, "balance", "--collapse", "equity" assert_equal " $-2,500.00 Equity", balance.read.chomp assert_equal 0, $CHILD_STATUS.exitstatus system "python", pkgshare/"demo.py" end end