aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorArne Jørgensen2012-05-31 20:45:28 +0200
committerAdam Vandenberg2012-10-31 12:32:11 -0700
commitf7ae6b376c9e53ae14c7c4bac4d570ef701a9d83 (patch)
treee489492c46918908666a2c42a018be2803075aba /Library/Formula
parent633d083ed5129225259f830090145db3473aa673 (diff)
downloadhomebrew-f7ae6b376c9e53ae14c7c4bac4d570ef701a9d83.tar.bz2
global: Rebuild PHP parser for GNU GLOBAL.
GNU GLOBAL is distributed with a PHP parser generated with an older version of flex(1). That parser has some limitation (see http://comments.gmane.org/gmane.comp.gnu.global.bugs/1439). Added a rebuild of the PHP parser to the install target. Closes #13814. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/global.rb33
1 files changed, 31 insertions, 2 deletions
diff --git a/Library/Formula/global.rb b/Library/Formula/global.rb
index ad8b61f16..f4e0b946e 100644
--- a/Library/Formula/global.rb
+++ b/Library/Formula/global.rb
@@ -6,13 +6,42 @@ class Global < Formula
mirror 'http://ftp.gnu.org/gnu/global/global-6.2.4.tar.gz'
sha1 'fff915079e7099de0174c47a1a8f6a5b870517d5'
+ option "without-rebuilding-php-parser", "Don't rebuild PHP parser; use provied parser"
+
def install
- system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking"
+ # Rebuilding the PHP parser, see:
+ # http://comments.gmane.org/gmane.comp.gnu.global.bugs/1439
+ unless build.include? "without-rebuilding-php-parser"
+ system "flex -o libparser/php.c libparser/php.l"
+ end
+
+ system "./configure", "--disable-dependency-tracking",
+ "--prefix=#{prefix}"
system "make install"
# we copy these in already
- cd share+'gtags' do
+ cd share/'gtags' do
rm %w[README COPYING LICENSE INSTALL ChangeLog AUTHORS]
end
end
+
+ def caveats; <<-EOS.undent
+ GNU GLOBAL is distributed with a PHP parser generated with an
+ old version of flex(1). That parser has some limitation. See:
+ http://comments.gmane.org/gmane.comp.gnu.global.bugs/1439
+
+ Installing GNU GLOBAL with Homebrew will therefor rebuild the
+ PHP parser using Mac OS X' newer version of flex(1) which
+ generates a parser without the limit.
+
+ You can install GNU GLOBAL without rebuilding the PHP parser
+ (and instead use the parser distributed by GNU GLOBAL) by using
+ the option '--without-rebuilding-php-parser':
+
+ brew install global --without-rebuilding-php-parser
+
+ Use i.e. if you want to be sure whether a problem is caused by
+ the rebuild parser or some other thing in GNU GLOBAL.
+ EOS
+ end
end