diff options
| author | Adam Vandenberg | 2013-07-08 09:39:31 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2013-07-08 09:57:43 -0700 |
| commit | 37ddd1f2e8d6426f2101098dfbff481cf1ac328a (patch) | |
| tree | f746681019072c6d383d77d298b48306614a8f62 /Library/Formula | |
| parent | 990de67129b64aa5dba5d494a21d1c30a93bb6c5 (diff) | |
| download | homebrew-37ddd1f2e8d6426f2101098dfbff481cf1ac328a.tar.bz2 | |
proof-general: support Emacs 24.x
Use upstream suggestion to support Emacs 24.x
Closes #21061.
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/proof-general.rb | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/Library/Formula/proof-general.rb b/Library/Formula/proof-general.rb index 17785fe9d..86ba37e8c 100644 --- a/Library/Formula/proof-general.rb +++ b/Library/Formula/proof-general.rb @@ -1,28 +1,38 @@ require 'formula' +require 'ostruct' class ProofGeneral < Formula homepage 'http://proofgeneral.inf.ed.ac.uk' url 'http://proofgeneral.inf.ed.ac.uk/releases/ProofGeneral-4.2.tgz' sha1 'c8d2e4457478b9dbf4080d3cf8255325fcffe619' - option 'with-doc', 'Install documentations' - option 'with-emacs=</path/to/emacs>', 'Re-compile the lisp files with a specified emacs' + option 'with-doc', 'Install HTML documentation' + option 'with-emacs', 'Re-compile lisp files with 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}" + if a.index('--with-emacs=') + emacs_binary = a.sub('--with-emacs=', '') + raise "#{emacs_binary} not found" if not File.exists? "#{emacs_binary}" - 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 + version_info = `#{emacs_binary} --version` + version_info =~ /GNU Emacs (\d+)\./ + major = $1 + + if major != '23' && major != '24' + raise "Emacs 23.x or 24.x is required; #{major}.x provided." + end + + return OpenStruct.new( + :binary => emacs_binary, + :major => major, + :empty? => false) end end - return "" + return OpenStruct.new( + :binary => "", + :major => 0, + :empty? => true) end def install @@ -31,10 +41,14 @@ class ProofGeneral < Formula "DEST_PREFIX=#{prefix}", "ELISPP=share/emacs/site-lisp/ProofGeneral", "ELISP_START=#{share}/emacs/site-lisp/site-start.d", - "EMACS=#{emacs}"]; + "EMACS=#{emacs.binary}"]; Dir.chdir "ProofGeneral" do - if emacs != "" + unless emacs.empty? + # http://proofgeneral.inf.ed.ac.uk/trac/ticket/458 + if emacs.major == "24" + inreplace 'Makefile', '(setq byte-compile-error-on-warn t)', '' + end system "make clean" system "make", "compile", *args end @@ -50,8 +64,8 @@ class ProofGeneral < Formula doc = "" if build.include? 'with-doc' doc += <<-EOS.undent - The HTML documentations are available in: - #{HOMEBREW_PREFIX}/share/doc/proof-general + HTML documentation is available in: + #{HOMEBREW_PREFIX}/share/doc/proof-general EOS end |
