From 4a190d9bb5d61c0c7363e758e94fc32bdaf8b262 Mon Sep 17 00:00:00 2001 From: jidicula Date: Tue, 2 May 2023 21:58:50 -0400 Subject: [PATCH] fix(build): Add grep as build-time dependency I found that on my system, I had a different incompatible version of grep from a plan9 installation on my PATH that was superseding the builtin grep on one of my Macs. This explains why the `with-native-comp` build was failing on one of my Macs but not the other - the Mac with the successful emacs-plus@28 `with-native-comp` build only had the built-in version of grep on its PATH. Adding GNU grep as a build-time dependency will include it in the `gnubin` directory, which is prepended to the PATH in each formula. I've also added an explicit PATH prepending step for each of the GNU build-time dependencies. This indicates the coupling of those dependencies with the `gnubin` PATH prepending. Related to d12frosted/homebrew-emacs-plus#555 and d12frosted/homebrew-emacs-plus#556 --- Formula/emacs-plus@28.rb | 1 + Formula/emacs-plus@29.rb | 3 +++ Formula/emacs-plus@30.rb | 1 + Library/EmacsBase.rb | 1 + 4 files changed, 6 insertions(+) diff --git a/Formula/emacs-plus@28.rb b/Formula/emacs-plus@28.rb index 4a7c3192..af318a1c 100644 --- a/Formula/emacs-plus@28.rb +++ b/Formula/emacs-plus@28.rb @@ -36,6 +36,7 @@ class EmacsPlusAT28 < EmacsBase depends_on "autoconf" => :build depends_on "gnu-sed" => :build depends_on "gnu-tar" => :build + depends_on "grep" => :build depends_on "awk" => :build depends_on "coreutils" => :build depends_on "pkg-config" => :build diff --git a/Formula/emacs-plus@29.rb b/Formula/emacs-plus@29.rb index b543423b..ff4c1f9a 100644 --- a/Formula/emacs-plus@29.rb +++ b/Formula/emacs-plus@29.rb @@ -30,6 +30,7 @@ class EmacsPlusAT29 < EmacsBase depends_on "autoconf" => :build depends_on "gnu-sed" => :build depends_on "gnu-tar" => :build + depends_on "grep" => :build depends_on "awk" => :build depends_on "coreutils" => :build depends_on "pkg-config" => :build @@ -156,6 +157,8 @@ def install args << "--with-xwidgets" if build.with? "xwidgets" ENV.prepend_path "PATH", Formula["gnu-sed"].opt_libexec/"gnubin" + ENV.prepend_path "PATH", Formula["gnu-tar"].opt_libexec/"gnubin" + ENV.prepend_path "PATH", Formula["grep"].opt_libexec/"gnubin" system "./autogen.sh" if (build.with? "cocoa") && (build.without? "x11") diff --git a/Formula/emacs-plus@30.rb b/Formula/emacs-plus@30.rb index e0762565..83559a91 100644 --- a/Formula/emacs-plus@30.rb +++ b/Formula/emacs-plus@30.rb @@ -30,6 +30,7 @@ class EmacsPlusAT30 < EmacsBase depends_on "autoconf" => :build depends_on "gnu-sed" => :build depends_on "gnu-tar" => :build + depends_on "grep" => :build depends_on "awk" => :build depends_on "coreutils" => :build depends_on "pkg-config" => :build diff --git a/Library/EmacsBase.rb b/Library/EmacsBase.rb index 188be048..35621c1f 100644 --- a/Library/EmacsBase.rb +++ b/Library/EmacsBase.rb @@ -78,6 +78,7 @@ def expand_path } system "which", "tar" system "which", "ls" + system "which", "grep" end end