From cb29a244b3701d6c4d03c9786473e393e1719e66 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Thu, 30 Jan 2014 09:43:15 +0100 Subject: [PATCH] ledger: fix installation of python bindings the upstream repository fixed the issue. https://github.com/ledger/ledger/pull/231 Closes Homebrew/homebrew#26225. Signed-off-by: Mike McQuaid --- Formula/ledger.rb | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Formula/ledger.rb b/Formula/ledger.rb index f497d2a771d..d922d163316 100644 --- a/Formula/ledger.rb +++ b/Formula/ledger.rb @@ -27,18 +27,16 @@ class Ledger < Formula depends_on :python => :optional def install - opoo "Homebrew: Sorry, python bindings for --HEAD seem not to install. Help us fixing this!" if build.with? 'python' - # find Homebrew's libpcre ENV.append 'LDFLAGS', "-L#{HOMEBREW_PREFIX}/lib" if build.head? - args = [((build.include? 'debug') ? 'debug' : 'opt'), "make", "-N", "-j#{ENV.make_jobs}", "--output=build"] - args << '--python' if build.with? 'python' # Support homebrew not at /usr/local. Also support Xcode-only setups: inreplace 'acprep', 'search_prefixes = [', "search_prefixes = ['#{HOMEBREW_PREFIX}','#{MacOS.sdk_path}/usr'," + args = [((build.include? 'debug') ? 'debug' : 'opt'), "make", "install", "-N", "-j#{ENV.make_jobs}", "--output=build"] + args << '--python' if build.with? 'python' system "./acprep", "--prefix=#{prefix}", *args - system "cmake", "-P", "build/cmake_install.cmake", "-DUSE_PYTHON=ON" + (share+'ledger').install 'python/demo.py', 'test/input/sample.dat' else args = [] if build.with? 'libofx' @@ -51,6 +49,17 @@ class Ledger < Formula system 'make' ENV.deparallelize system 'make install' + (share+'ledger').install 'sample.dat', Dir['scripts'] + end + end + + test do + output = `#{bin}/ledger --file #{share}/ledger/sample.dat balance --collapse equity` + assert_equal ' $-2,500.00 Equity', output.split(/\n/)[0] + assert_equal 0, $?.exitstatus + + if build.head? and build.with? 'python' + system "python", "#{share}/ledger/demo.py" end end end