2011-03-10 05:11:03 +00:00
|
|
|
class Calc < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Arbitrary precision calculator"
|
2014-05-21 00:33:35 +00:00
|
|
|
homepage "http://www.isthe.com/chongo/tech/comp/calc/"
|
2015-02-05 23:49:16 +00:00
|
|
|
url "http://www.isthe.com/chongo/src/calc/calc-2.12.5.0.tar.bz2"
|
2015-08-03 12:55:31 +00:00
|
|
|
sha256 "a0e7b47af38330f188970998c8e5039134dadf6f2e3f2c00d7efdae272a4338d"
|
2010-01-15 00:59:03 +00:00
|
|
|
|
2015-02-05 23:59:32 +00:00
|
|
|
bottle do
|
2015-09-24 05:04:39 +00:00
|
|
|
sha256 "f68eb0e031534c68f3fb1c2c1d53a90c343f281b81f998cf4bfc9745a0b8d306" => :el_capitan
|
2015-11-19 15:45:31 +00:00
|
|
|
sha256 "d19d417a55f14e96a944c4eb12869b93a26d0e5d74a65898c8225a3c00b9d050" => :yosemite
|
|
|
|
sha256 "4fe6049dd1e184c4996c606c9b25c7f8fde40f2a5dab5c6eda251125db5328e0" => :mavericks
|
|
|
|
sha256 "eb87150f3af2f86480594d99558e637ed063b6a3a3cff38331d46638e02af245" => :mountain_lion
|
2015-02-05 23:59:32 +00:00
|
|
|
end
|
|
|
|
|
2014-05-21 00:33:35 +00:00
|
|
|
depends_on "readline"
|
2010-01-15 00:59:03 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
ENV.deparallelize
|
|
|
|
|
2014-05-21 00:33:35 +00:00
|
|
|
ENV["EXTRA_CFLAGS"] = ENV.cflags
|
|
|
|
ENV["EXTRA_LDFLAGS"] = ENV.ldflags
|
2010-01-15 00:59:03 +00:00
|
|
|
|
2014-05-21 00:33:35 +00:00
|
|
|
readline = Formula["readline"]
|
2010-01-15 00:59:03 +00:00
|
|
|
inreplace "Makefile" do |s|
|
2014-06-27 19:38:30 +00:00
|
|
|
s.change_make_var! "INCDIR", "#{MacOS.sdk_path}/usr/include"
|
2010-01-15 00:59:03 +00:00
|
|
|
s.change_make_var! "BINDIR", bin
|
|
|
|
s.change_make_var! "LIBDIR", lib
|
|
|
|
s.change_make_var! "MANDIR", man1
|
2014-06-27 19:38:30 +00:00
|
|
|
s.change_make_var! "CALC_INCDIR", "#{include}/calc"
|
2016-01-20 21:06:19 +00:00
|
|
|
s.change_make_var! "CALC_SHAREDIR", pkgshare
|
2010-01-15 00:59:03 +00:00
|
|
|
s.change_make_var! "USE_READLINE", "-DUSE_READLINE"
|
|
|
|
s.change_make_var! "READLINE_LIB", "-L#{readline.lib} -lreadline"
|
|
|
|
s.change_make_var! "READLINE_EXTRAS", "-lhistory -lncurses"
|
|
|
|
end
|
|
|
|
|
|
|
|
system "make"
|
2014-05-21 00:33:35 +00:00
|
|
|
system "make", "install"
|
2014-02-09 13:56:22 +00:00
|
|
|
libexec.install "#{bin}/cscript"
|
2010-01-15 00:59:03 +00:00
|
|
|
end
|
2014-02-05 21:11:28 +00:00
|
|
|
|
|
|
|
test do
|
2014-05-04 19:12:41 +00:00
|
|
|
assert_equal "11", shell_output("#{bin}/calc 0xA + 1").strip
|
2014-02-05 21:11:28 +00:00
|
|
|
end
|
2010-01-15 00:59:03 +00:00
|
|
|
end
|