diff options
| author | Alexis Hildebrandt | 2014-07-08 07:28:37 +0200 |
|---|---|---|
| committer | Jack Nagel | 2014-07-11 14:27:04 -0500 |
| commit | 5587dcd91dba392d89a120b01f0b49f59d2ce9ce (patch) | |
| tree | 7f6c6390ed806fc5ab38ef4a65f1780a9e6a93d0 /Library/Formula | |
| parent | e2ad524469b6faac344648510d1ea5ad9ddec206 (diff) | |
| download | homebrew-5587dcd91dba392d89a120b01f0b49f59d2ce9ce.tar.bz2 | |
ledger: install manpage, add with-docs option
use single quotes instead of double quotes
Closes #30729.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/ledger.rb | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/Library/Formula/ledger.rb b/Library/Formula/ledger.rb index 20115db69..def94ecff 100644 --- a/Library/Formula/ledger.rb +++ b/Library/Formula/ledger.rb @@ -1,7 +1,7 @@ -require 'formula' +require "formula" class Ledger < Formula - homepage 'http://ledger-cli.org' + homepage "http://ledger-cli.org" stable do url "https://github.com/ledger/ledger/archive/v3.0.3.tar.gz" @@ -20,7 +20,8 @@ class Ledger < Formula head "https://github.com/ledger/ledger.git", :branch => "master" - option 'debug', 'Build with debugging symbols enabled' + option "debug", "Build with debugging symbols enabled" + option "with-docs", "Build HTML documentation" depends_on "cmake" => :build depends_on "ninja" => :build @@ -42,27 +43,35 @@ class Ledger < Formula flavor = build.include?("debug") ? "debug" : "opt" + opts = %W[-- -DBUILD_DOCS=1] args = %W[ - --prefix=#{prefix} - #{flavor} make install -N -j#{ENV.make_jobs} + --ninja --jobs=#{ENV.make_jobs} --output=build + --prefix=#{prefix} --boost=#{Formula["boost"].opt_prefix} ] - if build.with? 'python' + if build.with? "docs" + opts << "-DBUILD_WEB_DOCS=1" + end + + if build.with? "python" # Per #25118, CMake does a poor job of detecting a brewed Python. # We need to tell CMake explicitly where our default python lives. # Inspired by # https://github.com/Homebrew/homebrew/blob/51d054c/Library/Formula/opencv.rb - args << "--python" << "--" + args << "--python" python_prefix = `python-config --prefix`.strip - args << "-DPYTHON_LIBRARY=#{python_prefix}/Python" - args << "-DPYTHON_INCLUDE_DIR=#{python_prefix}/Headers" + opts << "-DPYTHON_LIBRARY=#{python_prefix}/Python" + opts << "-DPYTHON_INCLUDE_DIR=#{python_prefix}/Headers" end - system "./acprep", *args - (share+'ledger/examples').install Dir['test/input/*.dat'] - (share+'ledger').install 'contrib' + args += opts + + system "./acprep", flavor, "make", "doc", *args + system "./acprep", flavor, "make", "install", *args + (share+"ledger/examples").install Dir["test/input/*.dat"] + (share+"ledger").install "contrib" (share+"ledger").install "python/demo.py" if build.with? "python" end @@ -76,7 +85,7 @@ class Ledger < Formula assert_equal " $-2,500.00 Equity", balance.read.chomp assert_equal 0, $?.exitstatus - if build.with? 'python' + if build.with? "python" system "python", "#{share}/ledger/demo.py" end end |
