Skip to content

Commit

Permalink
global: Rebuild PHP parser for GNU GLOBAL.
Browse files Browse the repository at this point in the history
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 Homebrew#13814.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
  • Loading branch information
arnested authored and adamv committed Oct 31, 2012
1 parent 633d083 commit f7ae6b3
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions Library/Formula/global.rb
Expand Up @@ -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

0 comments on commit f7ae6b3

Please sign in to comment.