mxcl/homebrew — Issue #8653: grep 2.10 (with --exclude-dir)
Author: bedge
Created: 2011-11-18 04:37:11+00:00
State: open

I wanted to add a ggrep (gnu-grep) so that I could use the --exclude-dir option.

Here's my formula:

require 'formula'

class GnuGrep < Formula
url 'http://ftp.gnu.org/gnu/grep/grep-2.10.tar.xz'
homepage 'http://www.gnu.org/software/grep/'
md5 '709915434d09f5db655e5ebd7fd6bb7f'
version '2.10'
# depends_on 'cmake'
depends_on 'xz'

def options
[['--default-names', "Do NOT prepend 'g' to the binary; will override system utils."]]
end

def install
args = ["--prefix=#{prefix}"]
args << "--program-prefix=g" unless ARGV.include? '--default-names'

system "./configure", *args
# system "cmake . #{std_cmake_parameters}"
system "make install"
end

end

Here's the error:

0 %> brew install gnu-grep
==> Downloading http://ftp.gnu.org/gnu/grep/grep-2.10.tar.xz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/gnu-grep/2.10 --program-prefix=g

==> Exit Status: 1
http://github.com/mxcl/homebrew/blob/master/Library/Formula/gnu-grep.rb#L19
==> Environment
HOMEBREW_VERSION: 0.8
HEAD: 935d2dbf88c2d4dfac1559529f6a21ce5dbfd94e
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: 8-core 64-bit sandybridge
OS X: 10.7.2
Kernel Architecture: x86_64
Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode: 4.1
GCC-4.0: N/A
GCC-4.2: build 5666
LLVM: build 2335
MacPorts or Fink? false
X11 installed? true
==> Build Flags
CC: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
CXX: /usr/bin/llvm-g++ => /usr/llvm-gcc-4.2/bin/llvm-g++-4.2
LD: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
CFLAGS: -O3 -march=core2 -w -pipe
CXXFLAGS: -O3 -march=core2 -w -pipe
MAKEFLAGS: -j8

Error: Failed executing: ./configure --prefix=/usr/local/Cellar/gnu-grep/2.10 --program-prefix=g
If `brew doctor' does not help diagnose the issue, please report the bug:
https://github.com/mxcl/homebrew/wiki/checklist-before-filing-a-new-issue
We saved the configure log, please gist it if you report the issue:
~/Library/Logs/Homebrew/config.log

./configure log looks OK.