Skip to content

Commit

Permalink
tzdb: 2024b (new formula)
Browse files Browse the repository at this point in the history
  • Loading branch information
paperchalice committed Dec 16, 2024
1 parent fa4e174 commit 3cc81df
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Formula/t/tzdb.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
class Tzdb < Formula
desc "Time Zone Database"
homepage "https://www.iana.org/time-zones"
url "https://data.iana.org/time-zones/releases/tzdb-2024b.tar.lz"
sha256 "22674a67786d3ec1b0547305904011cb2b9126166e72abbbea39425de5595233"
license all_of: ["BSD-3-Clause", :public_domain]

on_macos do
depends_on "gettext"
end

def localtime
etc/"localtime"
end

def install
make_args = %W[
CFLAGS=#{ENV.cflags}
USRDIR=#{prefix}
TZDEFAULT=#{localtime}
]
if OS.mac?
gettext = Formula["gettext"]
make_args[0] += " -DHAVE_GETTEXT -I#{gettext.include} -L#{gettext.lib}"
make_args << "LDLIBS=-lintl"
end

system "make", *make_args, "install"
end

def post_install
# Generate default localtime, from Makefile.
system sbin/"zic", "-l", "Factory", "-p", "-", "-t", localtime
end

test do
assert_match "UTC", shell_output("#{bin}/zdump UTC")
end
end

0 comments on commit 3cc81df

Please sign in to comment.