[macports-ports] branch master updated: grep: add new variant to install as ggrep

Rainer Müller raimue at macports.org
Sat Jun 30 13:13:59 UTC 2018

On 2018-06-30 08:39, George Plymale II wrote:
> Ryan Schmidt <ryandesign at macports.org> writes:
>> Do all of the ports that declare the dependency "bin:grep:grep" already know that they should alternately look for a binary called "ggrep"? I don't know, and figuring that out and making any necessary adjustments to the programs and/or their build systems would be part of the task. Possible adjustments that could me made would include modifying e.g. configure scripts to check for ggrep in addition to grep, or modifying the PATH seen by configure scripts to add /opt/local/libexec/gnubin so that the "grep" binary there is found, or changing the dependency to "port:grep" and modifying the port to always look for a binary "ggrep" instead of "grep".
> Thanks for your suggestions, Ryan. I have now covered the ports which
> use grep as a build dependency by following your suggestion of putting
> /opt/local/libexec/gnubin in front of the PATH. This seemed to be the
> path of least resistance and of the least potential problems. The code I
> added to each such Portfile is this:
> # To find GNU grep instead of system grep
> configure.env-append PATH=${prefix}/libexec/gnubin:$env(PATH)

I do not think this is the way we want to go forward. This also exposes
all other g* tools and not just grep. I expect this to introduce new
problems. Some build scripts make assumptions about the userland tools
and expect BSD syntax when running on macOS.

If we chose to install grep as ggrep by default, why would we even need
to expose it at all? What problem are you trying to solve here? Are
there ports that require GNU grep and do not work with the BSD grep at

If grep is installed as ggrep, just just remove the dependency on
bin:grep:grep and be done.


More information about the macports-dev mailing list