aom: use `ENV.runtime_cpu_detection`

Also, remove the revision bump, make the changes from #85801 conditional
on macOS, and clean up the style a little.
master
Carlo Cabrera 2021-10-15 11:02:59 +08:00 committed by BrewTestBot
parent 093d8417e3
commit bc902cb3aa
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
2 changed files with 29 additions and 18 deletions

View File

@ -5,7 +5,6 @@ class Aom < Formula
tag: "v3.2.0",
revision: "287164de79516c25c8c84fd544f67752c170082a"
license "BSD-2-Clause"
revision 1
bottle do
sha256 cellar: :any, arm64_big_sur: "6e289d13b26ea36b824c282e2dda13182d044769e5de4808cc6b400f82893f3e"
@ -16,10 +15,14 @@ class Aom < Formula
end
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "yasm" => :build
depends_on "jpeg-xl"
depends_on "libvmaf"
# `jpeg-xl` is currently not bottled on Linux
on_macos do
depends_on "pkg-config" => :build
depends_on "jpeg-xl"
depends_on "libvmaf"
end
resource "bus_qcif_15fps.y4m" do
url "https://media.xiph.org/video/derf/y4m/bus_qcif_15fps.y4m"
@ -27,22 +30,29 @@ class Aom < Formula
end
def install
mkdir "macbuild" do
args = std_cmake_args.concat(["-DCMAKE_INSTALL_RPATH=#{rpath}",
"-DCONFIG_TUNE_BUTTERAUGLI=1",
"-DCONFIG_TUNE_VMAF=1",
"-DENABLE_DOCS=off",
"-DENABLE_EXAMPLES=on",
"-DENABLE_TESTDATA=off",
"-DENABLE_TESTS=off",
"-DENABLE_TOOLS=off",
"-DBUILD_SHARED_LIBS=on"])
# Runtime CPU detection is not currently enabled for ARM on macOS.
args << "-DCONFIG_RUNTIME_CPU_DETECT=0" if Hardware::CPU.arm?
system "cmake", "..", *args
ENV.runtime_cpu_detection unless Hardware::CPU.arm?
system "make", "install"
args = std_cmake_args.concat(["-DCMAKE_INSTALL_RPATH=#{rpath}",
"-DENABLE_DOCS=off",
"-DENABLE_EXAMPLES=on",
"-DENABLE_TESTDATA=off",
"-DENABLE_TESTS=off",
"-DENABLE_TOOLS=off",
"-DBUILD_SHARED_LIBS=on"])
# Runtime CPU detection is not currently enabled for ARM on macOS.
args << "-DCONFIG_RUNTIME_CPU_DETECT=0" if Hardware::CPU.arm?
# Make unconditional when `jpeg-xl` is bottled on Linux
if OS.mac?
args += [
"-DCONFIG_TUNE_BUTTERAUGLI=1",
"-DCONFIG_RUNTIME_CPU_DETECT=1",
]
end
system "cmake", "-S", ".", "-B", "brewbuild", *args
system "cmake", "--build", "brewbuild"
system "cmake", "--install", "brewbuild"
end
test do

View File

@ -1,4 +1,5 @@
[
"aom",
"apache-arrow",
"fftw",
"libvpx",