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 <mike@mikemcquaid.com>
master
Alexis Hildebrandt 2014-01-30 09:43:15 +01:00 committed by Mike McQuaid
parent 39cf3e7912
commit cb29a244b3
1 changed files with 14 additions and 5 deletions

View File

@ -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