77 lines
2.7 KiB
Ruby
77 lines
2.7 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.2.1.tar.gz"
|
|
sha256 "92bf09bc385b171987f456fe3ee9fa998ed5e40b97b3acdd562b663aa364384a"
|
|
license "BSD-3-Clause"
|
|
revision 9
|
|
head "https://github.com/ledger/ledger.git", branch: "master"
|
|
|
|
livecheck do
|
|
url :stable
|
|
regex(/^v?(\d+(?:\.\d+)+)$/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any, arm64_monterey: "101d38b9ad9bbee38049c084211f1d44b1fe2880e33c80350c0e16b8ab8dec34"
|
|
sha256 cellar: :any, arm64_big_sur: "af728a87cae6e3cc0b0b9d1809665b7914af34dd7276bf53ae56b5e3bed685ee"
|
|
sha256 cellar: :any, monterey: "a1388b6e16fc8ec03d26a29eb68863f828887a87df31ce8f6bb094527d81868a"
|
|
sha256 cellar: :any, big_sur: "78ae068b488f4797d71f626837489a593d74224b89e085558a5e7c95b14441a4"
|
|
sha256 cellar: :any, catalina: "9fe8c7132791596222ce22133bb3a194b4e59b00761616a2abab6f1e5909ca77"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "2ed433809b3e7e9db34611bfab79ad6186b78dbce97da6a4e7f9ab55be343963"
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "boost"
|
|
depends_on "gmp"
|
|
depends_on "mpfr"
|
|
depends_on "python@3.10"
|
|
|
|
uses_from_macos "groff"
|
|
uses_from_macos "libedit"
|
|
|
|
# Compatibility with Boost 1.76
|
|
# https://github.com/ledger/ledger/issues/2030
|
|
# https://github.com/ledger/ledger/pull/2036
|
|
patch do
|
|
url "https://github.com/ledger/ledger/commit/e60717ccd78077fe4635315cb2657d1a7f539fca.patch?full_index=1"
|
|
sha256 "edba1dd7bde707f510450db3197922a77102d5361ed7a5283eb546fbf2221495"
|
|
end
|
|
|
|
def install
|
|
ENV.cxx11
|
|
ENV.prepend_path "PATH", Formula["python@3.10"].opt_libexec/"bin"
|
|
|
|
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
|
|
-DPython_FIND_VERSION_MAJOR=3
|
|
] + std_cmake_args
|
|
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
|