From 37f6454cc92cd96f904b2864b62ce9f7bcf425ef Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Tue, 14 Oct 2025 11:08:23 +0200 Subject: [PATCH 1/3] fix nasm detection with nasm 3 Backports upstream fix. --- 0001-cmake-fix-nasm-detection-w-3.0.patch | 41 +++++++++++++++++++++++ aom.spec | 2 ++ 2 files changed, 43 insertions(+) create mode 100644 0001-cmake-fix-nasm-detection-w-3.0.patch diff --git a/0001-cmake-fix-nasm-detection-w-3.0.patch b/0001-cmake-fix-nasm-detection-w-3.0.patch new file mode 100644 index 0000000..eef863c --- /dev/null +++ b/0001-cmake-fix-nasm-detection-w-3.0.patch @@ -0,0 +1,41 @@ +From 6d2b7f71b98bfa28e372b1f2d85f137280bdb3de Mon Sep 17 00:00:00 2001 +From: James Zern +Date: Tue, 7 Oct 2025 14:08:44 -0700 +Subject: [PATCH] cmake: fix nasm detection w/3.0 + +nasm 3.0 separated Oflags (-Ox) output to `-hO` which is used to +validate the nasm binary. This change is compatible with older versions +(tested with NASM version 2.16.03 & 2.13.02). + +Bug: aomedia:448994065 +Fixed: aomedia:448994065 +Change-Id: I704dcfe39ac6e68bc4d5b9e409fb59a0d277170e +--- + build/cmake/aom_optimization.cmake | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/build/cmake/aom_optimization.cmake b/build/cmake/aom_optimization.cmake +index 9cc34de362..2750a0be41 100644 +--- a/build/cmake/aom_optimization.cmake ++++ b/build/cmake/aom_optimization.cmake +@@ -212,7 +212,7 @@ endfunction() + # Currently checks only for presence of required object formats and support for + # the -Ox argument (multipass optimization). + function(test_nasm) +- execute_process(COMMAND ${CMAKE_ASM_NASM_COMPILER} -hf ++ execute_process(COMMAND ${CMAKE_ASM_NASM_COMPILER} -hO + OUTPUT_VARIABLE nasm_helptext) + + if(NOT "${nasm_helptext}" MATCHES "-Ox") +@@ -220,6 +220,8 @@ function(test_nasm) + FATAL_ERROR "Unsupported nasm: multipass optimization not supported.") + endif() + ++ execute_process(COMMAND ${CMAKE_ASM_NASM_COMPILER} -hf ++ OUTPUT_VARIABLE nasm_helptext) + if("${AOM_TARGET_CPU}" STREQUAL "x86") + if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin") + if(NOT "${nasm_helptext}" MATCHES "macho32") +-- +2.51.0 + diff --git a/aom.spec b/aom.spec index 1fe6de3..3fbcb06 100644 --- a/aom.spec +++ b/aom.spec @@ -20,6 +20,8 @@ Summary: Royalty-free next-generation video format License: BSD-3-Clause URL: http://aomedia.org/ Source: https://aomedia.googlesource.com/%{name}/+archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +# https://aomedia.issues.chromium.org/issues/448994065 +Patch: 0001-cmake-fix-nasm-detection-w-3.0.patch BuildRequires: gcc-c++ BuildRequires: gcc From 2f8edd40b3eb7e3202f53a58d4cec15ca4b90577 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Tue, 30 Dec 2025 21:10:37 +0100 Subject: [PATCH 2/3] drop aom_static from installed .cmake files We don't ship it anyway, and it breaks AOM detection using cmake. - libaom-devel: add explicit dependency on main package for aomdec binary expected by cmake files --- aom-nostatic.patch | 12 ++++++++++++ aom.spec | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 aom-nostatic.patch diff --git a/aom-nostatic.patch b/aom-nostatic.patch new file mode 100644 index 0000000..acd6941 --- /dev/null +++ b/aom-nostatic.patch @@ -0,0 +1,12 @@ +diff -up aom-3.13.1/build/cmake/aom_install.cmake.orig aom-3.13.1/build/cmake/aom_install.cmake +--- aom-3.13.1/build/cmake/aom_install.cmake.orig 2025-09-07 16:11:27.789000000 +0200 ++++ aom-3.13.1/build/cmake/aom_install.cmake 2025-12-30 21:08:54.594005985 +0100 +@@ -79,7 +79,7 @@ macro(setup_aom_install_targets) + endif() + + if(BUILD_SHARED_LIBS) +- set(AOM_INSTALL_LIBS aom aom_static) ++ set(AOM_INSTALL_LIBS aom) + else() + set(AOM_INSTALL_LIBS aom) + endif() diff --git a/aom.spec b/aom.spec index 3fbcb06..75544c6 100644 --- a/aom.spec +++ b/aom.spec @@ -22,6 +22,8 @@ URL: http://aomedia.org/ Source: https://aomedia.googlesource.com/%{name}/+archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz # https://aomedia.issues.chromium.org/issues/448994065 Patch: 0001-cmake-fix-nasm-detection-w-3.0.patch +# Building static library breaks .cmake files if we don't ship it, so drop it +Patch: aom-nostatic.patch BuildRequires: gcc-c++ BuildRequires: gcc @@ -67,6 +69,8 @@ video format. %package -n libaom-devel Summary: Development files for aom +# cmake files assume /usr/bin/aomdec is present +Requires: aom%{?_isa} = %{version}-%{release} Requires: libaom%{?_isa} = %{version}-%{release} %description -n libaom-devel @@ -108,7 +112,6 @@ sed -i "s@GENERATE_LATEX = YES@GENERATE_LATEX = NO@" libs.doxy_t %install %cmake3_install -rm -rvf %{buildroot}%{_libdir}/libaom.a %files %doc AUTHORS CHANGELOG README.md From a6b34154ea58813f669470b33fa7d7e4ee1291b9 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Mon, 5 Jan 2026 15:38:15 +0100 Subject: [PATCH 3/3] stop exporting AOM_STATIC_LIBRARIES in CMake config The variable references the AOM::aom_static target which we're patching out. Resolves rhbz#2426269 . --- aom-nostatic.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/aom-nostatic.patch b/aom-nostatic.patch index acd6941..1755b03 100644 --- a/aom-nostatic.patch +++ b/aom-nostatic.patch @@ -10,3 +10,20 @@ diff -up aom-3.13.1/build/cmake/aom_install.cmake.orig aom-3.13.1/build/cmake/ao else() set(AOM_INSTALL_LIBS aom) endif() +diff -up aom-3.13.1/build/cmake/config.cmake.in.orig aom-3.13.1/build/cmake/config.cmake.in +--- aom-3.13.1/build/cmake/config.cmake.in.orig 2025-09-07 16:11:27.791000000 +0200 ++++ aom-3.13.1/build/cmake/config.cmake.in 2026-01-05 15:35:24.588489147 +0100 +@@ -10,13 +10,6 @@ include("${CMAKE_CURRENT_LIST_DIR}/@AOM_ + + set_and_check(@PROJECT_NAME@_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") + +-# @PROJECT_NAME@::aom_static is defined only if BUILD_SHARED_LIBS=1 when libaom +-# was configured. When it is false, @PROJECT_NAME@::aom is a static library. +-if(TARGET @PROJECT_NAME@::aom_static) +- set(@PROJECT_NAME@_STATIC_LIBRARIES "@PROJECT_NAME@::aom_static") +-else() +- set(@PROJECT_NAME@_STATIC_LIBRARIES "@PROJECT_NAME@::aom") +-endif() + set(@PROJECT_NAME@_LIBRARIES "@PROJECT_NAME@::aom") + + check_required_components(@PROJECT_NAME@)