24b77cddf8
- In 47053, we removed `depends_on python` etc because "building without
Python" was a success. Turns out, [installing this formula still uses
Python 2](cd7297ed44/acprep (L1)
).
- This makes the system Python 2 dependency explicit on macOS, so we
don't make [mistakes](https://github.com/Homebrew/linuxbrew-core/pull/17943) on Linux.
54 lines
1.6 KiB
Ruby
54 lines
1.6 KiB
Ruby
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"
|
|
revision 3
|
|
head "https://github.com/ledger/ledger.git"
|
|
|
|
bottle do
|
|
sha256 "234dc4b8adcb8451371c315dac7723b105a4ef43c6063b97c4404a3b7dae2adf" => :catalina
|
|
sha256 "ddf29cbd23664598d498e68336b4a592af008a7a3f5435357ef110fd3aa06c8c" => :mojave
|
|
sha256 "b332e8d85f3fe09a48cb0ef514447012e5db61c51540bbb279ef800f701ff48f" => :high_sierra
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "boost"
|
|
depends_on "gmp"
|
|
depends_on "mpfr"
|
|
uses_from_macos "python@2"
|
|
|
|
def install
|
|
ENV.cxx11
|
|
|
|
args = %W[
|
|
--jobs=#{ENV.make_jobs}
|
|
--output=build
|
|
--prefix=#{prefix}
|
|
--boost=#{Formula["boost"].opt_prefix}
|
|
--
|
|
-DBUILD_DOCS=1
|
|
-DBUILD_WEB_DOCS=1
|
|
-DBoost_NO_BOOST_CMAKE=ON
|
|
]
|
|
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"
|
|
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
|
|
end
|
|
end
|