aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorAlexis Hildebrandt2014-03-10 14:27:18 +0100
committerMike McQuaid2014-03-27 11:13:23 +0000
commit3d9fbf506ad977c361dfa05aba38d8f767ab58ac (patch)
treef44a0f3c6844f0b4da44529dbfd0773bcf0e97df /Library/Formula
parentfe7243285b74f4fcbcea19c7d2e9bd03b0c8cc29 (diff)
downloadhomebrew-3d9fbf506ad977c361dfa05aba38d8f767ab58ac.tar.bz2
ledger 3.0.1
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/ledger.rb85
1 files changed, 34 insertions, 51 deletions
diff --git a/Library/Formula/ledger.rb b/Library/Formula/ledger.rb
index 13726f0e4..81ade4040 100644
--- a/Library/Formula/ledger.rb
+++ b/Library/Formula/ledger.rb
@@ -2,75 +2,58 @@ require 'formula'
class Ledger < Formula
homepage 'http://ledger-cli.org'
+ url 'https://github.com/ledger/ledger/archive/v3.0.1.tar.gz'
+ sha1 'cb0891f4770a33ba5cdbd6693b400ec0ff0b81da'
+ head 'https://github.com/ledger/ledger.git', :branch => 'master'
- stable do
- url 'https://github.com/downloads/ledger/ledger/ledger-2.6.3.tar.gz'
- sha1 '5b8e7d8199acb116f13720a5a469fff1f14b4041'
-
- depends_on 'gettext'
- depends_on 'pcre'
- depends_on 'expat'
- depends_on 'libofx' => :optional
- end
-
- head do
- url 'https://github.com/ledger/ledger.git', :branch => 'master'
- depends_on 'cmake' => :build
- depends_on 'ninja' => :build
- depends_on 'mpfr'
+ resource 'utfcpp' do
+ url "http://downloads.sourceforge.net/project/utfcpp/utf8cpp_2x/Release%202.3.4/utf8_v2_3_4.zip"
+ sha1 "638910adb69e4336f5a69c338abeeea88e9211ca"
end
option 'debug', 'Build with debugging symbols enabled'
+ depends_on 'gettext'
depends_on 'boost'
+ depends_on 'mpfr'
depends_on 'gmp'
depends_on :python => :optional
+ depends_on 'cmake' => :build
+ depends_on 'ninja' => :build
def install
- # find Homebrew's libpcre
- ENV.append 'LDFLAGS', "-L#{HOMEBREW_PREFIX}/lib"
-
- if build.head?
- # 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"]
-
- 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' << '--'
-
- python_prefix = `python-config --prefix`.strip
- args << "-DPYTHON_LIBRARY='#{python_prefix}/Python'"
- args << "-DPYTHON_INCLUDE_DIR='#{python_prefix}/Headers'"
- end
+ (buildpath/'lib/utfcpp').install resource('utfcpp')
+
+ # 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"]
+
+ 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' << '--'
+
+ python_prefix = `python-config --prefix`.strip
+ args << "-DPYTHON_LIBRARY='#{python_prefix}/Python'"
+ args << "-DPYTHON_INCLUDE_DIR='#{python_prefix}/Headers'"
+ end
- system "./acprep", "--prefix=#{prefix}", *args
- (share+'ledger').install 'python/demo.py', 'test/input/sample.dat', Dir['contrib']
- else
- args = []
- if build.with? 'libofx'
- args << "--enable-ofx"
- # the libofx.h appears to have moved to a subdirectory
- ENV.append 'CXXFLAGS', "-I#{Formula["libofx"].opt_include}/libofx"
- end
- system "./configure", "--disable-debug", "--disable-dependency-tracking",
- "--prefix=#{prefix}", *args
- system 'make'
- ENV.deparallelize
- system 'make install'
- (share+'ledger').install 'sample.dat', Dir['scripts']
+ system "./acprep", "--prefix=#{prefix}", *args
+ (share+'ledger/examples').install Dir['test/input/*.dat']
+ (share+'ledger').install 'contrib'
+ if build.with? 'python'
+ (share+'ledger').install 'python/demo.py'
end
end
test do
- output = `#{bin}/ledger --file #{share}/ledger/sample.dat balance --collapse equity`
+ output = `#{bin}/ledger --file #{share}/ledger/examples/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'
+ if build.with? 'python'
system "python", "#{share}/ledger/demo.py"
end
end