Formula for calc

Closes Homebrew/homebrew#474
master
Kevin Ballard 2010-01-14 16:59:03 -08:00 committed by Max Howell
parent 23341b0fdc
commit 09c3d6e712
1 changed files with 33 additions and 0 deletions

33
Formula/calc.rb Normal file
View File

@ -0,0 +1,33 @@
require 'formula'
class Calc <Formula
url 'http://www.isthe.com/chongo/src/calc/calc-2.12.4.0.tar.bz2'
md5 '2ef56695837c6e501ca80b64e0be0db6'
homepage 'http://www.isthe.com/chongo/tech/comp/calc/'
depends_on 'readline'
def install
ENV.deparallelize
ENV['EXTRA_LDFLAGS'] = ENV['LDFLAGS']
ENV['EXTRA_CFLAGS'] = ENV['CFLAGS']
inreplace "Makefile" do |s|
s.change_make_var! "INCDIR", include
s.change_make_var! "BINDIR", bin
s.change_make_var! "LIBDIR", lib
s.change_make_var! "MANDIR", man1
s.change_make_var! "CALC_SHAREDIR", "#{share}/calc"
s.change_make_var! "USE_READLINE", "-DUSE_READLINE"
readline = Formula.factory('readline')
s.change_make_var! "READLINE_LIB", "-L#{readline.lib} -lreadline"
s.change_make_var! "READLINE_EXTRAS", "-lhistory -lncurses"
s.change_make_var! "LIBCALC_SHLIB", "-single_module -undefined dynamic_lookup -dynamiclib -install_name ${LIBDIR}/libcalc${LIB_EXT_VERSION}"
s.change_make_var! "LIBCUSTCALC_SHLIB", "-single_module -undefined dynamic_lookup -dynamiclib -install_name ${LIBDIR}/libcustcalc${LIB_EXT_VERSION}"
end
system "make"
system "make install"
end
end