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

George Plymale II georgedp at orbitalimpact.com
Sat Jun 30 06:39:33 UTC 2018


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)

So far, I have tested installing the vim and bash ports with this code
in place and the installation of each did indeed detect the gnubin
version of grep, so all seems well for the ports that use grep as a
build dependency (although I probably need to test more than just those
two ports). However, I have run into a bit of a snag with a couple of
particular ports which are actually scripts instead of binaries. They
are, namely, `p5-config-autoconf' and `vcs'. The former is a Perl
program and the latter is a shell script. Since these programs actually
rely on GNU grep during runtime, I guess they need to be modified to
look for ggrep or to have a special PATH configuration. I am not sure of
the best way to do either of those. Do you or does anyone else have
suggestions on what should be done here?

Thanks,
- George Plymale II


More information about the macports-dev mailing list