diff --git a/Formula/g/gpatch.rb b/Formula/g/gpatch.rb new file mode 100644 index 00000000000..1964e4aabe9 --- /dev/null +++ b/Formula/g/gpatch.rb @@ -0,0 +1,31 @@ +class Gpatch < Formula + desc "Apply a diff file to an original" + homepage "https://savannah.gnu.org/projects/patch/" + url "https://ftp.gnu.org/gnu/patch/patch-2.7.6.tar.xz" + mirror "https://ftpmirror.gnu.org/patch/patch-2.7.6.tar.xz" + sha256 "ac610bda97abe0d9f6b7c963255a11dcb196c25e337c61f94e4778d632f1d8fd" + license "GPL-3.0-or-later" + + bottle do + root_url "https://github.com/gromgit/homebrew-core-aarch64_linux/releases/download/gpatch-2.7.6" + sha256 cellar: :any_skip_relocation, aarch64_linux: "00455ac03636a8cdbf9305fbd0a3751c5ae3686d5842392b1b2ce26a37b4de71" + end + + def install + system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" + system "make", "install" + end + + test do + testfile = testpath/"test" + testfile.write "homebrew\n" + patch = <<~EOS + 1c1 + < homebrew + --- + > hello + EOS + pipe_output("#{bin}/patch #{testfile}", patch) + assert_equal "hello", testfile.read.chomp + end +end