2010-03-13 09:10:05 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Ledger < Formula
|
2012-02-24 22:51:33 +00:00
|
|
|
homepage 'http://ledger-cli.org'
|
2013-04-13 15:46:22 +00:00
|
|
|
url 'https://github.com/downloads/ledger/ledger/ledger-2.6.3.tar.gz'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '5b8e7d8199acb116f13720a5a469fff1f14b4041'
|
2012-02-24 22:51:33 +00:00
|
|
|
|
2013-05-13 18:06:08 +00:00
|
|
|
head 'https://github.com/ledger/ledger.git', :branch => 'master'
|
2010-03-13 09:10:05 +00:00
|
|
|
|
2012-09-05 11:24:31 +00:00
|
|
|
option 'debug', 'Build with debugging symbols enabled'
|
2012-09-03 21:00:00 +00:00
|
|
|
|
2010-03-13 09:10:05 +00:00
|
|
|
depends_on 'boost'
|
2013-09-07 13:16:14 +00:00
|
|
|
depends_on 'gmp'
|
2013-01-21 09:33:56 +00:00
|
|
|
depends_on :python => :optional
|
2013-05-13 18:06:08 +00:00
|
|
|
if build.head?
|
|
|
|
depends_on 'cmake' => :build
|
|
|
|
depends_on 'ninja' => :build
|
|
|
|
depends_on 'mpfr'
|
|
|
|
else
|
|
|
|
depends_on 'gettext'
|
|
|
|
depends_on 'pcre'
|
|
|
|
depends_on 'expat'
|
|
|
|
depends_on 'libofx' => :optional
|
|
|
|
end
|
2012-09-05 11:24:31 +00:00
|
|
|
|
2010-03-13 09:10:05 +00:00
|
|
|
def install
|
2013-01-21 09:33:56 +00:00
|
|
|
opoo "Homebrew: Sorry, python bindings for --HEAD seem not to install. Help us fixing this!" if build.with? 'python'
|
|
|
|
|
2012-02-24 22:51:33 +00:00
|
|
|
# find Homebrew's libpcre
|
|
|
|
ENV.append 'LDFLAGS', "-L#{HOMEBREW_PREFIX}/lib"
|
|
|
|
|
2012-09-03 21:00:00 +00:00
|
|
|
if build.head?
|
2013-05-13 18:06:08 +00:00
|
|
|
args = [((build.include? 'debug') ? 'debug' : 'opt'), "make", "-N", "-j#{ENV.make_jobs}", "--output=build"]
|
2013-01-21 09:33:56 +00:00
|
|
|
if build.with? 'python'
|
|
|
|
args << '--python'
|
|
|
|
# acprep picks up system python because CMake is used
|
|
|
|
inreplace 'acprep', "self.configure_args = []",
|
|
|
|
"self.configure_args = ['-DPYTHON_INCLUDE_DIR=#{python.incdir}', '-DPYTHON_LIBRARY=#{python.libdir}/lib#{python.xy}.dylib']"
|
|
|
|
end
|
|
|
|
# Support homebrew not at /usr/local. Also support Xcode-only setups:
|
|
|
|
inreplace 'acprep', 'search_prefixes = [', "search_prefixes = ['#{HOMEBREW_PREFIX}','#{MacOS.sdk_path}/usr',"
|
|
|
|
system "./acprep", "--prefix=#{prefix}", *args
|
|
|
|
system "cmake", "-P", "build/cmake_install.cmake", "-DUSE_PYTHON=ON"
|
2012-09-03 21:00:00 +00:00
|
|
|
else
|
2013-01-28 00:23:35 +00:00
|
|
|
args = []
|
|
|
|
if build.with? 'libofx'
|
|
|
|
args << "--enable-ofx"
|
|
|
|
# the libofx.h appears to have moved to a subdirectory
|
|
|
|
ENV.append 'CXXFLAGS', "-I#{Formula.factory('libofx').opt_prefix}/include/libofx"
|
|
|
|
end
|
2012-09-03 21:00:00 +00:00
|
|
|
system "./configure", "--disable-debug", "--disable-dependency-tracking",
|
2013-01-28 00:23:35 +00:00
|
|
|
"--prefix=#{prefix}", *args
|
2012-09-05 11:24:31 +00:00
|
|
|
system 'make'
|
|
|
|
ENV.deparallelize
|
|
|
|
system 'make install'
|
2010-03-13 09:10:05 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|