Skip to content

x265: add workaround for CMake 4 #220002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Formula/x/x265.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ class X265 < Formula
depends_on "nasm" => :build
end

# cmake 4 workaround, remove in next release
patch do
url "https://bitbucket.org/multicoreware/x265_git/commits/b354c009a60bcd6d7fc04014e200a1ee9c45c167/raw"
sha256 "cc24fae87d3af05af3a5ab57041cabc4fb4dc93a6d575d69dd23831fe0856204"
end
patch do
url "https://bitbucket.org/multicoreware/x265_git/commits/51ae8e922bcc4586ad4710812072289af91492a8/raw"
sha256 "4ee41ef60ce1f992b4d23f2f76e2113fb8eac936429d4905507370d345a403bd"
end

def install
ENV.runtime_cpu_detection
# Build based off the script at ./build/linux/multilib.sh
Expand All @@ -33,11 +43,13 @@ def install
-DCMAKE_INSTALL_RPATH=#{rpath}
]
args << "-DENABLE_SVE2=OFF" if OS.linux? && Hardware::CPU.arm?
args << "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" # FIXME: Workaround for CMake 4.
high_bit_depth_args = %w[
-DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF
-DENABLE_SHARED=OFF -DENABLE_CLI=OFF
]
high_bit_depth_args << "-DENABLE_SVE2=OFF" if OS.linux? && Hardware::CPU.arm?
high_bit_depth_args << "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" # FIXME: Workaround for CMake 4.

(buildpath/"8bit").mkpath
system "cmake", "-S", buildpath/"source", "-B", "10bit",
Expand Down
Loading