Merge pull request #207020 from Homebrew/bump-qpdf-11.10.0
[Homebrew/homebrew-core.git] / Formula / g / gspell.rb
blob0c3f702ea83db51d8384827a167d1c596dc78f09
1 class Gspell < Formula
2   desc "Flexible API to implement spellchecking in GTK+ applications"
3   homepage "https://gitlab.gnome.org/GNOME/gspell"
4   url "https://download.gnome.org/sources/gspell/1.14/gspell-1.14.0.tar.xz"
5   sha256 "64ea1d8e9edc1c25b45a920e80daf67559d1866ffcd7f8432fecfea6d0fe8897"
6   license "LGPL-2.1-or-later"
7   revision 2
9   bottle do
10     sha256 arm64_sequoia: "03106944ffad6a23ddd95ca647a7808698374337309aba617c63d11eb4a47130"
11     sha256 arm64_sonoma:  "3c67a5a4434cc8faa2b0abe80843891a565dd81afdca0e4aff24b71ae2896f6f"
12     sha256 arm64_ventura: "9a1ea15e3f7b7b0c7213d63f565cad2e312fae9a6f5c1ef4b76c632d3f43b831"
13     sha256 sonoma:        "055cb331155fc7a4627c5e27f09491285922fe28967fb2e3af7296711ce961e0"
14     sha256 ventura:       "5713495649b5b21951f2e39574b9335333298276f9c96dfe5ffb3cf03f5e96e8"
15     sha256 x86_64_linux:  "b6fa120befbae62fff98ae659831ef563b621fe32e8b1c137b79cb401360feed"
16   end
18   depends_on "gobject-introspection" => :build
19   depends_on "meson" => :build
20   depends_on "ninja" => :build
21   depends_on "pkgconf" => [:build, :test]
22   depends_on "vala" => :build
24   depends_on "at-spi2-core"
25   depends_on "cairo"
26   depends_on "enchant"
27   depends_on "gdk-pixbuf"
28   depends_on "glib"
29   depends_on "gtk+3"
30   depends_on "harfbuzz"
31   depends_on "icu4c@76"
32   depends_on "pango"
34   on_macos do
35     depends_on "gettext"
36   end
38   def install
39     args = %w[
40       -Dgtk_doc=false
41       -Dtests=false
42       -Dinstall_tests=false
43     ]
45     system "meson", "setup", "build", *args, *std_meson_args
46     system "meson", "compile", "-C", "build", "--verbose"
47     system "meson", "install", "-C", "build"
48   end
50   test do
51     (testpath/"test.c").write <<~C
52       #include <gspell/gspell.h>
54       int main(int argc, char *argv[]) {
55         const GList *list = gspell_language_get_available();
56         return 0;
57       }
58     C
60     icu4c = deps.map(&:to_formula).find { |f| f.name.match?(/^icu4c@\d+$/) }
61     ENV.prepend_path "PKG_CONFIG_PATH", icu4c.opt_lib/"pkgconfig"
62     flags = shell_output("pkgconf --cflags --libs gspell-1").chomp.split
63     system ENV.cc, "test.c", "-o", "test", *flags
64     ENV["G_DEBUG"] = "fatal-warnings"
66     # This test will fail intentionally when iso-codes gets updated.
67     # Resolve by increasing the `revision` on this formula.
68     system "./test"
69   end
70 end