|
| 1 | +class Icu4cAT76 < Formula |
| 2 | + desc "C/C++ and Java libraries for Unicode and globalization" |
| 3 | + homepage "https://icu.unicode.org/home" |
| 4 | + url "https://github.com/unicode-org/icu/releases/download/release-76-1/icu4c-76_1-src.tgz" |
| 5 | + version "76.1" |
| 6 | + sha256 "dfacb46bfe4747410472ce3e1144bf28a102feeaa4e3875bac9b4c6cf30f4f3e" |
| 7 | + license "ICU" |
| 8 | + |
| 9 | + # We allow the livecheck to detect new `icu4c` major versions in order to |
| 10 | + # automate version bumps. To make sure PRs are created correctly, we output |
| 11 | + # an error during installation to notify when a new formula is needed. |
| 12 | + livecheck do |
| 13 | + url :stable |
| 14 | + regex(/^release[._-]v?(\d+(?:[.-]\d+)+)$/i) |
| 15 | + strategy :git do |tags, regex| |
| 16 | + tags.filter_map { |tag| tag[regex, 1]&.tr("-", ".") } |
| 17 | + end |
| 18 | + end |
| 19 | + |
| 20 | + bottle do |
| 21 | + sha256 cellar: :any, arm64_sequoia: "864ab79f49fd097e8537c281af64e3987d085c753086c60cde74fc84f55ee771" |
| 22 | + sha256 cellar: :any, arm64_sonoma: "2b28efee579ee1a87cb4264e4ea714dd4af6edf59fa2e29955ffe4408428d726" |
| 23 | + sha256 cellar: :any, arm64_ventura: "7ca03c808b01c40b270146e476bfcb18367f830e9f1722c9effc4f1c5954b20f" |
| 24 | + sha256 cellar: :any, sonoma: "30d9e64dbac8658ab81012ccfe1e52f87cd1ec8cb247b562d4484665ef6b5247" |
| 25 | + sha256 cellar: :any, ventura: "6d57d5ff7ed6d83916f9c47aa82eb84d1555fc23f8c779491e42e71817d8b2ad" |
| 26 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "a0e8e698c09aee143fce7529fcdf776be98d15f3a000ed8c3e74dc387ce364ac" |
| 27 | + end |
| 28 | + |
| 29 | + # TODO: Switch keg_only reason after renaming `icu4c` formula to `icu4c@75` and updating alias to `icu4c@76` |
| 30 | + # keg_only :provided_by_macos, "macOS provides libicucore.dylib (but nothing else)" |
| 31 | + keg_only :versioned_formula |
| 32 | + |
| 33 | + def install |
| 34 | + odie "Major version bumps need a new formula!" if version.major.to_s != name[/@(\d+)$/, 1] |
| 35 | + |
| 36 | + args = %w[ |
| 37 | + --disable-samples |
| 38 | + --disable-tests |
| 39 | + --enable-static |
| 40 | + --with-library-bits=64 |
| 41 | + ] |
| 42 | + |
| 43 | + cd "source" do |
| 44 | + system "./configure", *args, *std_configure_args |
| 45 | + system "make" |
| 46 | + system "make", "install" |
| 47 | + end |
| 48 | + end |
| 49 | + |
| 50 | + test do |
| 51 | + if File.exist? "/usr/share/dict/words" |
| 52 | + system bin/"gendict", "--uchars", "/usr/share/dict/words", "dict" |
| 53 | + else |
| 54 | + (testpath/"hello").write "hello\nworld\n" |
| 55 | + system bin/"gendict", "--uchars", "hello", "dict" |
| 56 | + end |
| 57 | + end |
| 58 | +end |
0 commit comments