class Dwdiff < Formula desc "Diff that operates at the word level" homepage "https://os.ghalkes.nl/dwdiff.html" url "https://os.ghalkes.nl/dist/dwdiff-2.1.4.tar.bz2" sha256 "df16fec44dcb467d65a4246a43628f93741996c1773e930b90c6dde22dd58e0a" license "GPL-3.0-only" revision 1 livecheck do url "https://os.ghalkes.nl/dist/" regex(/href=.*?dwdiff[._-]v?(\d+(?:\.\d+)+)\.t/i) end bottle do sha256 arm64_big_sur: "21f7d3d86cf97118fd664bf3a46c29193b2c851dd16d3fe369cba0e0eda1c654" sha256 big_sur: "156bb6d1e3adeac2f3b7da5f2eb3048d77551983ed27e037e202372cc2656bbc" sha256 catalina: "53f6654a86ca81c164cb75c1a49afefff9ff492717f87344070e02694d87ed3c" sha256 mojave: "f128821bf6e00913517c61a523a9c0b2ce3b882be4c56a06bd8f1dc1ca3f0673" end depends_on "pkg-config" => :build depends_on "gettext" depends_on "icu4c" def install gettext = Formula["gettext"] icu4c = Formula["icu4c"] ENV.append "CFLAGS", "-I#{gettext.include} -I#{icu4c.include}" ENV.append "LDFLAGS", "-L#{gettext.lib} -L#{icu4c.lib} -lintl" system "./configure", "--prefix=#{prefix}" system "make", "install" # Remove non-English man pages (man/"nl").rmtree (man/"nl.UTF-8").rmtree (share/"locale/nl").rmtree end test do (testpath/"a").write "I like beers" (testpath/"b").write "I like formulae" diff = shell_output("#{bin}/dwdiff a b", 1) assert_equal "I like [-beers-] {+formulae+}", diff end end