diff options
| author | Ming-Hsien Tsai | 2012-09-10 11:42:11 +0800 |
|---|---|---|
| committer | Adam Vandenberg | 2012-12-16 22:45:58 -0800 |
| commit | ecd40eee5ce798259783aad8d51428e63ab798d7 (patch) | |
| tree | 5e443313641304ea403b6133b6519ec53e83710f /Library | |
| parent | a6a4d30e321c7cd1fad8381080e5fd032667886f (diff) | |
| download | homebrew-ecd40eee5ce798259783aad8d51428e63ab798d7.tar.bz2 | |
Proof General 4.1
Closes #14827.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/proof-general.rb | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/Library/Formula/proof-general.rb b/Library/Formula/proof-general.rb new file mode 100644 index 000000000..734cb92bd --- /dev/null +++ b/Library/Formula/proof-general.rb @@ -0,0 +1,64 @@ +require 'formula' + +class ProofGeneral < Formula + homepage 'http://proofgeneral.inf.ed.ac.uk' + url 'http://proofgeneral.inf.ed.ac.uk/releases/ProofGeneral-4.1.tgz' + sha1 '0dd18bd0bdad8faab76f61bffc8e432c3ed7aeaf' + + option 'with-doc', 'Install documentations' + option 'with-emacs=</path/to/emacs>', 'Re-compile the lisp files with a specified emacs' + + def which_emacs + ARGV.each do |a| + if a.index('--with-emacs') + emacs = a.sub('--with-emacs=', '') + raise "#{emacs} not found" if not File.exists? "#{emacs}" + ohai "Use Emacs: #{emacs}" + + version = `#{emacs} --version | grep -Eo "GNU Emacs \\d+(\\.\\d+)+"`.gsub /\n/, "" + ohai "Emacs version: #{version}" + major = `echo "#{version}" | awk {'print $3'} | cut -d "." -f 1`.gsub /\n/, "" + raise "Only Emacs of major version 23 is supported." if major != "23" + return emacs + end + end + return "" + end + + def install + emacs = which_emacs + args = ["PREFIX=#{prefix}", + "DEST_PREFIX=#{prefix}", + "ELISPP=share/emacs/site-lisp/ProofGeneral", + "ELISP_START=#{share}/emacs/site-lisp/site-start.d", + "EMACS=#{emacs}"]; + + Dir.chdir "ProofGeneral" do + if emacs != "" + system "make clean" + system "make", "compile", *args + end + system "make", "install", *args + man1.install "doc/proofgeneral.1" + info.install "doc/ProofGeneral.info", "doc/PG-adapting.info" + + doc.install "doc/ProofGeneral", "doc/PG-adapting" if build.include? 'with-doc' + end + end + + def caveats + doc = "" + if build.include? 'with-doc' + doc += <<-EOS.undent + The HTML documentations are available in: + #{HOMEBREW_PREFIX}/share/doc/proof-general + EOS + end + + <<-EOS.undent + To use ProofGeneral with Emacs, add the following line to your ~/.emacs file: + (load-file "#{HOMEBREW_PREFIX}/share/emacs/site-lisp/ProofGeneral/generic/proof-site.el") + #{doc} + EOS + end +end |
