From d60085ac6656218bcad78e61afaa7efed7b1f5bf Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Wed, 14 Dec 2022 18:42:01 -0500 Subject: [PATCH] cpuid 2.2.2 (new formula) Closes #118191. Signed-off-by: Rui Chen Signed-off-by: Patrick Linnane Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> --- Formula/cpuid.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Formula/cpuid.rb diff --git a/Formula/cpuid.rb b/Formula/cpuid.rb new file mode 100644 index 00000000000..0e4fd0491b1 --- /dev/null +++ b/Formula/cpuid.rb @@ -0,0 +1,21 @@ +class Cpuid < Formula + desc "CPU feature identification for Go" + homepage "https://github.com/klauspost/cpuid" + url "https://github.com/klauspost/cpuid/archive/refs/tags/v2.2.2.tar.gz" + sha256 "bd65882ac77c56cc4a8af5c7c72aa10818ae0b53b9a6928c6d02294e23798344" + license "MIT" + head "https://github.com/klauspost/cpuid.git", branch: "master" + + depends_on "go" => :build + + def install + system "go", "build", *std_go_args(ldflags: "-s -w"), "./cmd/cpuid" + end + + test do + json = shell_output("#{bin}/cpuid -json") + assert_match "BrandName", json + assert_match "VendorID", json + assert_match "VendorString", json + end +end