Skip to content

Commit 2a08bc9

Browse files
PatTheMavRytoEX
authored andcommitted
deps.ffmpeg: Backport AOM upstream fix for nasm detection
1 parent f0d476a commit 2a08bc9

File tree

5 files changed

+63
-1
lines changed

5 files changed

+63
-1
lines changed

deps.ffmpeg/40-aom.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ param(
44
[string] $Uri = 'https://aomedia.googlesource.com/aom.git',
55
[string] $Hash = 'd772e334cc724105040382a977ebb10dfd393293',
66
[array] $Targets = @('x64', 'arm64'),
7+
[array] $Patches = @(
8+
@{
9+
PatchFile = "${PSScriptRoot}/patches/aom/0002-windows-fix-cmake-nasm-detection.patch"
10+
HashSum = "9455ba4f016ac8ec8e9604b38af8c89238bed1a4b74c04bd4d250b95c96531fe"
11+
}
12+
),
713
[array] $FixupPatches = @(
814
@{
915
PatchFile = "${PSScriptRoot}/patches/aom/0001-windows-pkg-config-fix.patch"
@@ -28,6 +34,16 @@ function Clean {
2834
}
2935
}
3036

37+
function Patch {
38+
Log-Information "Patch (${Target})"
39+
Set-Location $Path
40+
41+
$Patches | ForEach-Object {
42+
$Params = $_
43+
Safe-Patch @Params
44+
}
45+
}
46+
3147
function Configure {
3248
Log-Information "Configure (${Target})"
3349
Set-Location $Path

deps.ffmpeg/40-aom.zsh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ local version='3.13.1'
66
local url='https://aomedia.googlesource.com/aom.git'
77
local hash='d772e334cc724105040382a977ebb10dfd393293'
88
local -a patches=(
9-
"windows ${0:a:h}/patches/libaom/0001-force-threading-shim-usage.patch \
9+
"windows ${0:a:h}/patches/aom/0001-force-threading-shim-usage.patch \
1010
6fa9ca74001c5fa3a6521a2b4944be2a8b4350d31c0234aede9a7052a8f1890b"
11+
"macos ${0:a:h}/patches/aom/0002-fix-cmake-nasm-detection.patch \
12+
47d926731a31990b432f188e7e16628bd2ca334f5b71fe55241d7b845884a35d"
1113
)
1214

1315
## Dependency Overrides

deps.ffmpeg/patches/libaom/0001-force-threading-shim-usage.patch renamed to deps.ffmpeg/patches/aom/0001-force-threading-shim-usage.patch

File renamed without changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/build/cmake/aom_optimization.cmake b/build/cmake/aom_optimization.cmake
2+
index 9cc34de..2750a0b 100644
3+
--- a/build/cmake/aom_optimization.cmake
4+
+++ b/build/cmake/aom_optimization.cmake
5+
@@ -212,7 +212,7 @@
6+
# Currently checks only for presence of required object formats and support for
7+
# the -Ox argument (multipass optimization).
8+
function(test_nasm)
9+
- execute_process(COMMAND ${CMAKE_ASM_NASM_COMPILER} -hf
10+
+ execute_process(COMMAND ${CMAKE_ASM_NASM_COMPILER} -hO
11+
OUTPUT_VARIABLE nasm_helptext)
12+
13+
if(NOT "${nasm_helptext}" MATCHES "-Ox")
14+
@@ -220,6 +220,8 @@
15+
FATAL_ERROR "Unsupported nasm: multipass optimization not supported.")
16+
endif()
17+
18+
+ execute_process(COMMAND ${CMAKE_ASM_NASM_COMPILER} -hf
19+
+ OUTPUT_VARIABLE nasm_helptext)
20+
if("${AOM_TARGET_CPU}" STREQUAL "x86")
21+
if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin")
22+
if(NOT "${nasm_helptext}" MATCHES "macho32")
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/build/cmake/aom_optimization.cmake b/build/cmake/aom_optimization.cmake
2+
index 9cc34de..2750a0b 100644
3+
--- a/build/cmake/aom_optimization.cmake
4+
+++ b/build/cmake/aom_optimization.cmake
5+
@@ -212,7 +212,7 @@
6+
# Currently checks only for presence of required object formats and support for
7+
# the -Ox argument (multipass optimization).
8+
function(test_nasm)
9+
- execute_process(COMMAND ${CMAKE_ASM_NASM_COMPILER} -hf
10+
+ execute_process(COMMAND ${CMAKE_ASM_NASM_COMPILER} -hO
11+
OUTPUT_VARIABLE nasm_helptext)
12+
13+
if(NOT "${nasm_helptext}" MATCHES "-Ox")
14+
@@ -220,6 +220,8 @@
15+
FATAL_ERROR "Unsupported nasm: multipass optimization not supported.")
16+
endif()
17+
18+
+ execute_process(COMMAND ${CMAKE_ASM_NASM_COMPILER} -hf
19+
+ OUTPUT_VARIABLE nasm_helptext)
20+
if("${AOM_TARGET_CPU}" STREQUAL "x86")
21+
if("${AOM_TARGET_SYSTEM}" STREQUAL "Darwin")
22+
if(NOT "${nasm_helptext}" MATCHES "macho32")

0 commit comments

Comments
 (0)