homebrew-core/Formula/dwdiff.rb
2018-11-29 12:41:39 +01:00

38 lines
1.2 KiB
Ruby

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.1.tar.bz2"
sha256 "9745860faad6cb58744c7c45d16c0c7e222896c80d0cd7208dd36126d1a98c8b"
revision 5
bottle do
sha256 "a6119a2a78646ea1ddb39ab180e349da730328e92873498c32bac2055b01192d" => :mojave
sha256 "c3683e42a3b83a3e80f2d95235f09acc841363c67159757da34ff4b644a51d9f" => :high_sierra
sha256 "e270df201036894a6e734c86eb48a0990542330bfe9fd11de3bd8314751729eb" => :sierra
end
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