class Gettext < Formula desc "GNU internationalization (i18n) and localization (l10n) library" homepage "https://www.gnu.org/software/gettext/" url "https://ftp.gnu.org/gnu/gettext/gettext-0.23.1.tar.gz" mirror "https://ftpmirror.gnu.org/gettext/gettext-0.23.1.tar.gz" mirror "http://ftp.gnu.org/gnu/gettext/gettext-0.23.1.tar.gz" sha256 "52a578960fe308742367d75cd1dff8552c5797bd0beba7639e12bdcda28c0e49" license "GPL-3.0-or-later" depends_on "libunistring" uses_from_macos "libxml2" uses_from_macos "ncurses" on_linux do depends_on "acl" end def install # macOS iconv implementation is slightly broken since Sonoma. # This is also why we skip `make check`. # upstream bug report, https://savannah.gnu.org/bugs/index.php?66541 ENV["am_cv_func_iconv_works"] = "yes" if OS.mac? && MacOS.version == :sequoia args = [ "--with-libunistring-prefix=#{Formula["libunistring"].opt_prefix}", "--disable-silent-rules", "--with-included-glib", "--with-included-libcroco", "--with-emacs", "--with-lispdir=#{elisp}", "--disable-java", "--disable-csharp", # Don't use VCS systems to create these archives "--without-git", "--without-cvs", "--without-xz", ] args << if OS.mac? # Ship libintl.h. Disabled on linux as libintl.h is provided by glibc # https://gcc-help.gcc.gnu.narkive.com/CYebbZqg/cc1-undefined-reference-to-libintl-textdomain # There should never be a need to install gettext's libintl.h on # GNU/Linux systems using glibc. If you have it installed you've borked # your system somehow. "--with-included-gettext" else "--with-libxml2-prefix=#{Formula["libxml2"].opt_prefix}" end system "./configure", *std_configure_args, *args system "make" ENV.deparallelize # install doesn't support multiple make jobs system "make", "install" end test do system bin/"gettext", "test" end end