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'
|
2011-09-12 00:21:30 +00:00
|
|
|
url 'ftp://ftp.newartisans.com/pub/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
|
|
|
|
2011-05-27 05:02:55 +00:00
|
|
|
head 'https://github.com/jwiegley/ledger.git', :branch => 'next'
|
2010-03-13 09:10:05 +00:00
|
|
|
|
2012-09-05 11:24:31 +00:00
|
|
|
option 'debug', 'Build with debugging symbols enabled'
|
|
|
|
option 'python', 'Enable Python support'
|
|
|
|
option 'time-colon', 'Apply time-colon patch'
|
2012-09-03 21:00:00 +00:00
|
|
|
|
2010-03-13 09:10:05 +00:00
|
|
|
depends_on 'gettext'
|
|
|
|
depends_on 'boost'
|
|
|
|
depends_on 'mpfr'
|
|
|
|
depends_on 'gmp'
|
|
|
|
depends_on 'pcre'
|
|
|
|
depends_on 'expat'
|
2012-09-05 11:24:31 +00:00
|
|
|
depends_on 'cmake' if build.head?
|
|
|
|
|
|
|
|
def patches
|
|
|
|
p = {:p1 => []}
|
|
|
|
p[:p1] << 'https://raw.github.com/gist/856799/66158f9f3b732d658f5d0784407ec63a0be33746/ledger_time_colon.patch' if build.include? 'time-colon'
|
|
|
|
p
|
|
|
|
end
|
2010-03-13 09:10:05 +00:00
|
|
|
|
|
|
|
def install
|
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?
|
2012-09-05 11:24:31 +00:00
|
|
|
args = [((build.include? 'debug') ? 'debug' : 'opt'), "make", "-j#{ENV.make_jobs}", "--output=build"]
|
|
|
|
args << '--python' if build.include? 'python'
|
|
|
|
system "./acprep", *args
|
|
|
|
system "cmake", "-D", "CMAKE_INSTALL_PREFIX=#{prefix}", "-P", "build/cmake_install.cmake"
|
2012-09-03 21:00:00 +00:00
|
|
|
else
|
|
|
|
system "./configure", "--disable-debug", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}"
|
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
|