diff mbox series

[meta-multimedia] x265: fix build with cmake 4

Message ID 20250710075042.515930-1-f_l_k@t-online.de
State New
Headers show
Series [meta-multimedia] x265: fix build with cmake 4 | expand

Commit Message

Markus Volk July 10, 2025, 7:50 a.m. UTC
Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 .../0001-x265-fix-build-with-cmake-4.patch    | 63 +++++++++++++++++++
 .../recipes-multimedia/x265/x265_4.1.bb       |  1 +
 2 files changed, 64 insertions(+)
 create mode 100644 meta-multimedia/recipes-multimedia/x265/x265/0001-x265-fix-build-with-cmake-4.patch
diff mbox series

Patch

diff --git a/meta-multimedia/recipes-multimedia/x265/x265/0001-x265-fix-build-with-cmake-4.patch b/meta-multimedia/recipes-multimedia/x265/x265/0001-x265-fix-build-with-cmake-4.patch
new file mode 100644
index 0000000000..f218fec5f7
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/x265/x265/0001-x265-fix-build-with-cmake-4.patch
@@ -0,0 +1,63 @@ 
+From de68f4d02946d588af6a0c21cf966288c40b039f Mon Sep 17 00:00:00 2001
+From: Markus Volk <f_l_k@t-online.de>
+Date: Thu, 10 Jul 2025 09:04:27 +0200
+Subject: [PATCH] x265: fix build with cmake 4
+
+drop policies that have been removed in cmake 4 and allow to build
+with 4.0
+
+Signed-off-by: Markus Volk <f_l_k@t-online.de>
+
+Upstream-Status: Submitted [https://github.com/videolan/x265/pull/17]
+---
+ source/CMakeLists.txt              | 8 +-------
+ source/dynamicHDR10/CMakeLists.txt | 4 ++--
+ 2 files changed, 3 insertions(+), 9 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5c6dda9e8..bd9e0f8d9 100755
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -6,18 +6,12 @@ if(NOT CMAKE_BUILD_TYPE)
+         FORCE)
+ endif()
+ message(STATUS "cmake version ${CMAKE_VERSION}")
+-if(POLICY CMP0025)
+-    cmake_policy(SET CMP0025 OLD) # report Apple's Clang as just Clang
+-endif()
+ if(POLICY CMP0042)
+     cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH
+ endif()
+-if(POLICY CMP0054)
+-    cmake_policy(SET CMP0054 OLD) # Only interpret if() arguments as variables or keywords when unquoted
+-endif()
+ 
+ project (x265)
+-cmake_minimum_required (VERSION 2.8.8) # OBJECT libraries require 2.8.8
++cmake_minimum_required (VERSION 2.8.8...4.0) # OBJECT libraries require 2.8.8
+ include(CheckIncludeFiles)
+ include(CheckFunctionExists)
+ include(CheckSymbolExists)
+diff --git a/dynamicHDR10/CMakeLists.txt b/dynamicHDR10/CMakeLists.txt
+index 22fb79d44..03c866b1f 100644
+--- a/dynamicHDR10/CMakeLists.txt
++++ b/dynamicHDR10/CMakeLists.txt
+@@ -10,7 +10,7 @@ add_library(dynamicHDR10 OBJECT
+     hdr10plus.h
+     api.cpp )
+ 
+-cmake_minimum_required (VERSION 2.8.11)
++cmake_minimum_required (VERSION 2.8.11...4.0)
+ project(dynamicHDR10)
+ include(CheckIncludeFiles)
+ include(CheckFunctionExists)
+@@ -150,4 +150,4 @@ set(BIN_INSTALL_DIR bin CACHE STRING "Install location of executables")
+ option(ENABLE_SHARED "Build shared library" OFF)
+ 
+ install(FILES hdr10plus.h DESTINATION include)
+-endif()
+\ No newline at end of file
++endif()
+-- 
+2.49.0
+
diff --git a/meta-multimedia/recipes-multimedia/x265/x265_4.1.bb b/meta-multimedia/recipes-multimedia/x265/x265_4.1.bb
index dedc3aa4d3..79dd99220e 100644
--- a/meta-multimedia/recipes-multimedia/x265/x265_4.1.bb
+++ b/meta-multimedia/recipes-multimedia/x265/x265_4.1.bb
@@ -11,6 +11,7 @@  DEPENDS = "nasm-native gnutls zlib libpcre numactl"
 SRC_URI = " \
     https://bitbucket.org/multicoreware/x265_git/downloads/x265_${PV}.tar.gz \
     file://0001-json11.cpp-Include-cstdint.patch \
+    file://0001-x265-fix-build-with-cmake-4.patch \
 "
 SRC_URI[sha256sum] = "a31699c6a89806b74b0151e5e6a7df65de4b49050482fe5ebf8a4379d7af8f29"
 S = "${UNPACKDIR}/x265_${PV}/source"