Merge pull request #207020 from Homebrew/bump-qpdf-11.10.0
[Homebrew/homebrew-core.git] / Formula / g / gettext.rb
blobdd2bc1f59c1fb4e3402c1d8e19e56bd3ea9f55bd
1 class Gettext < Formula
2   desc "GNU internationalization (i18n) and localization (l10n) library"
3   homepage "https://www.gnu.org/software/gettext/"
4   url "https://ftp.gnu.org/gnu/gettext/gettext-0.23.1.tar.gz"
5   mirror "https://ftpmirror.gnu.org/gettext/gettext-0.23.1.tar.gz"
6   mirror "http://ftp.gnu.org/gnu/gettext/gettext-0.23.1.tar.gz"
7   sha256 "52a578960fe308742367d75cd1dff8552c5797bd0beba7639e12bdcda28c0e49"
8   license "GPL-3.0-or-later"
10   bottle do
11     sha256 arm64_sequoia: "9179f473099573a8c4a42f70e39f1a36376914d6b634e0975b5cb514dcecb4ee"
12     sha256 arm64_sonoma:  "f3b350830a3da3a44f3981838651accad39c14a3bd0ceac8d4a3c94eb7b24c02"
13     sha256 arm64_ventura: "2e98d7dae6dce086135060db70e767c5bfb0bcb8d190eea5f0a4c192315f2b0f"
14     sha256 sonoma:        "89b1b668765938504ce64f991cf6b81fc96765f5dec84bbf64c007c3d811b8fe"
15     sha256 ventura:       "fffb8da1a3258ca710829d0b9cf048d2a3434625e3fc202d845b0238ccc16d0f"
16     sha256 x86_64_linux:  "a3f66e4195312f949e9b94b12de4d888945150b3e4dccfcb67403fde034ed073"
17   end
19   depends_on "libunistring"
21   uses_from_macos "libxml2"
22   uses_from_macos "ncurses"
24   on_linux do
25     depends_on "acl"
26   end
28   def install
29     # macOS iconv implementation is slightly broken since Sonoma.
30     # This is also why we skip `make check`.
31     # upstream bug report, https://savannah.gnu.org/bugs/index.php?66541
32     ENV["am_cv_func_iconv_works"] = "yes" if OS.mac? && MacOS.version == :sequoia
34     args = [
35       "--with-libunistring-prefix=#{Formula["libunistring"].opt_prefix}",
36       "--disable-silent-rules",
37       "--with-included-glib",
38       "--with-included-libcroco",
39       "--with-emacs",
40       "--with-lispdir=#{elisp}",
41       "--disable-java",
42       "--disable-csharp",
43       # Don't use VCS systems to create these archives
44       "--without-git",
45       "--without-cvs",
46       "--without-xz",
47     ]
48     args << if OS.mac?
49       # Ship libintl.h. Disabled on linux as libintl.h is provided by glibc
50       # https://gcc-help.gcc.gnu.narkive.com/CYebbZqg/cc1-undefined-reference-to-libintl-textdomain
51       # There should never be a need to install gettext's libintl.h on
52       # GNU/Linux systems using glibc. If you have it installed you've borked
53       # your system somehow.
54       "--with-included-gettext"
55     else
56       "--with-libxml2-prefix=#{Formula["libxml2"].opt_prefix}"
57     end
59     system "./configure", *std_configure_args, *args
60     system "make"
61     ENV.deparallelize # install doesn't support multiple make jobs
62     system "make", "install"
63   end
65   test do
66     system bin/"gettext", "test"
67   end
68 end