From 3c466eb80c705ec42dbb278351e2ef2f5253b622 Mon Sep 17 00:00:00 2001 From: "Matthias C. M. Troffaes" Date: Thu, 28 Jan 2021 02:29:58 +0000 Subject: [PATCH] [ffmpeg] use nasm instead of yasm (#14547) * [ffmpeg] use nasm instead of yasm * [ffmpeg] bump port version * [ffmpeg] remove old yasm path reference * update baseline * [ffmpeg] fall back to yasm on x86 * [ffmpeg] add comment in portfile about issue with ffmpeg nasm build for future reference * [ffmpeg] update git-tree Co-authored-by: JackBoosY --- ports/ffmpeg/CONTROL | 2 +- ports/ffmpeg/portfile.cmake | 16 ++++++++++++---- versions/baseline.json | 2 +- versions/f-/ffmpeg.json | 5 +++++ 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index 49db6d023db2bb..c58ac743981866 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -1,6 +1,6 @@ Source: ffmpeg Version: 4.3.1 -Port-Version: 9 +Port-Version: 10 Homepage: https://ffmpeg.org Description: a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations. diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index c41f37c7c12276..3f0b7f457d0f49 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -23,8 +23,17 @@ if (SOURCE_PATH MATCHES " ") message(FATAL_ERROR "Error: ffmpeg will not build with spaces in the path. Please use a directory with no spaces") endif() -vcpkg_find_acquire_program(YASM) -get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) + +if(${VCPKG_TARGET_ARCHITECTURE} STREQUAL x86) + # ffmpeg nasm build gives link error on x86, so fall back to yasm + vcpkg_find_acquire_program(YASM) + get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) + vcpkg_add_to_path(${YASM_EXE_PATH}) +else() + vcpkg_find_acquire_program(NASM) + get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) + vcpkg_add_to_path(${NASM_EXE_PATH}) +endif() if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) #We're assuming that if we're building for Windows we're using MSVC @@ -35,8 +44,7 @@ else() set(LIB_PATH_VAR "LIBRARY_PATH") endif() -set(ENV{PATH} "$ENV{PATH}${VCPKG_HOST_PATH_SEPARATOR}${YASM_EXE_PATH}") -set(OPTIONS "--enable-asm --enable-yasm --disable-doc --enable-debug --enable-runtime-cpudetect") +set(OPTIONS "--enable-asm --enable-x86asm --disable-doc --enable-debug --enable-runtime-cpudetect") if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") diff --git a/versions/baseline.json b/versions/baseline.json index bad41c178cdcf1..ef7e997e47a977 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1878,7 +1878,7 @@ }, "ffmpeg": { "baseline": "4.3.1", - "port-version": 9 + "port-version": 10 }, "ffnvcodec": { "baseline": "10.0.26.0", diff --git a/versions/f-/ffmpeg.json b/versions/f-/ffmpeg.json index a9bdb56b99701e..a2ddd9b009ddeb 100644 --- a/versions/f-/ffmpeg.json +++ b/versions/f-/ffmpeg.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "93395ca1a700faa1c8c6ce04ef4a6dfa26e9fade", + "version-string": "4.3.1", + "port-version": 10 + }, { "git-tree": "f591a51746536b99b4621d39ea7e0dcd8a693016", "version-string": "4.3.1",