homebrew-core/Formula/libidn2.rb
2019-01-08 07:24:47 +08:00

51 lines
1.7 KiB
Ruby

class Libidn2 < Formula
desc "International domain name library (IDNA2008, Punycode and TR46)"
homepage "https://www.gnu.org/software/libidn/#libidn2"
url "https://ftp.gnu.org/gnu/libidn/libidn2-2.1.0.tar.gz"
mirror "https://ftpmirror.gnu.org/libidn/libidn2-2.1.0.tar.gz"
sha256 "032398dbaa9537af43f51a8d94e967e3718848547b1b2a4eb3138b20cad11d32"
bottle do
sha256 "5cd79173915c82157cfda0749859b3bc7030579fce4f4312c09e65e70b1eb4ec" => :mojave
sha256 "a75148810411495af4852311faad566c7b0a9ae815866d1dc287909f00888e33" => :high_sierra
sha256 "e4ccd2e935f8fa8e37d46e075d92388b9847c362218e597ea2b5409aaf5eee33" => :sierra
end
head do
url "https://gitlab.com/libidn/libidn2.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "gengetopt" => :build
depends_on "libtool" => :build
end
depends_on "pkg-config" => :build
depends_on "gettext"
depends_on "libunistring"
def install
if build.head?
ENV["GEM_HOME"] = buildpath/"gem_home"
system "gem", "install", "ronn"
ENV.prepend_path "PATH", buildpath/"gem_home/bin"
system "./bootstrap"
end
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--with-libintl-prefix=#{Formula["gettext"].opt_prefix}",
"--with-packager=Homebrew"
system "make", "install"
end
test do
ENV.delete("LC_CTYPE")
ENV["CHARSET"] = "UTF-8"
output = shell_output("#{bin}/idn2 räksmörgås.se")
assert_equal "xn--rksmrgs-5wao1o.se", output.chomp
output = shell_output("#{bin}/idn2 blåbærgrød.no")
assert_equal "xn--blbrgrd-fxak7p.no", output.chomp
end
end