aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorAlexis Hildebrandt2014-01-30 09:43:15 +0100
committerMike McQuaid2014-01-30 09:43:15 +0100
commitf80ec1f5a0c4ed9c264ecc3a38e7a2311ce2deb2 (patch)
treeccebfd8f8ef4ea14334956650de4f356fe5cad80 /Library/Formula
parent95bec93c8821793692b646a49da6e516125c463f (diff)
downloadhomebrew-f80ec1f5a0c4ed9c264ecc3a38e7a2311ce2deb2.tar.bz2
ledger: fix installation of python bindings
the upstream repository fixed the issue. https://github.com/ledger/ledger/pull/231 Closes #26225. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/ledger.rb19
1 files changed, 14 insertions, 5 deletions
diff --git a/Library/Formula/ledger.rb b/Library/Formula/ledger.rb
index f497d2a77..d922d1633 100644
--- a/Library/Formula/ledger.rb
+++ b/Library/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