Skip to content

Instantly share code, notes, and snippets.

@wesbland
Last active April 3, 2023 16:48
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wesbland/501063f151c1eb815d8001abf2285cbe to your computer and use it in GitHub Desktop.
Save wesbland/501063f151c1eb815d8001abf2285cbe to your computer and use it in GitHub Desktop.
Patch for GNU indent 2.2.11
diff --git c/Formula/gnu-indent.rb i/Formula/gnu-indent.rb
index b208611aeeeb..4a1e8ff93b5b 100644
--- c/Formula/gnu-indent.rb
+++ i/Formula/gnu-indent.rb
@@ -1,22 +1,17 @@
class GnuIndent < Formula
desc "C code prettifier"
homepage "https://www.gnu.org/software/indent/"
- url "https://ftp.gnu.org/gnu/indent/indent-2.2.12.tar.gz"
- mirror "https://ftpmirror.gnu.org/indent/indent-2.2.12.tar.gz"
- sha256 "e77d68c0211515459b8812118d606812e300097cfac0b4e9fb3472664263bb8b"
-
- bottle do
- rebuild 3
- sha256 "424a7f469abb096382488440e00d55021d97405d8e72948cff93fb7826f71285" => :mojave
- sha256 "ef3e9fa08a9cf100dcd9d5e85a17c88791b78fee201eba5ce8935da5072e4670" => :high_sierra
- sha256 "73fb630f7391e4598bfeb823637f67ba8741926133813f00bde91dfd8a4f2972" => :sierra
- end
+ url "https://ftp.gnu.org/gnu/indent/indent-2.2.11.tar.gz"
+ mirror "https://ftpmirror.gnu.org/indent/indent-2.2.11.tar.gz"
+ sha256 "aaff60ce4d255efb985f0eb78cca4d1ad766c6e051666073050656b6753a0893"
depends_on "gettext"
+ depends_on "texi2html"
+
+ patch :p0, :DATA
def install
args = %W[
- --disable-debug
--disable-dependency-tracking
--prefix=#{prefix}
--mandir=#{man}
@@ -53,3 +48,25 @@ class GnuIndent < Formula
EOS
end
end
+
+__END__
+--- doc/Makefile.in 2019-01-09 10:00:43.000000000 -0600
++++ doc/Makefile.in 2019-01-09 10:01:08.000000000 -0600
+@@ -663,14 +663,14 @@
+ html-split: @PACKAGE@_toc.html
+
+ @PACKAGE@.html: version.texi $(@PACKAGE@_TEXINFOS)
+- $(TEXI2HTML) -expandinfo -number -monolithic `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi`
++ $(TEXI2HTML) -expandinfo -number-sections -monolithic `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi`
+
+ @PACKAGE@_toc.html: version.texi $(@PACKAGE@_TEXINFOS)
+ case "$(TEXI2HTML)" in \
+ *"/missing texi2html") \
+- $(TEXI2HTML) -expand info -number -nomenu -split section `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi` || exit 0 ;; \
++ $(TEXI2HTML) -expand info -number-sections -nomenu -split section `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi` || exit 0 ;; \
+ *) $(RM) @PACKAGE@_*.html ; \
+- $(TEXI2HTML) -expand info -number -nomenu -split section `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi` ;; \
++ $(TEXI2HTML) -expand info -number-sections -nomenu -split section `if test -f @PACKAGE@.texinfo; then echo @PACKAGE@.texinfo; else echo $(srcdir)/@PACKAGE@.texinfo; fi` ;; \
+ esac
+
+ install-html-monolithic: @PACKAGE@.html
@wesbland
Copy link
Author

You can apply this with the usual patch -p1 < gnu-indent.patch. This is not designed to be a git patch so you'll still be able to update your Homebrew directory correctly.

Once you apply this patch, you can run:

brew install gnu-indent

This will (depending on your current status) install GNU indent 2.2.11. To keep that version installed run:

brew pin gnu-indent

This will prevent Homebrew from updating gnu-indent until you unpin it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment