Skip to content

Commit

Permalink
[libvpx] switch from yasm to nasm (#14545)
Browse files Browse the repository at this point in the history
* [libvpx] switch from yasm to nasm

* [vcpkg] install nasm on azure for osx

* Revert "[vcpkg] install nasm on azure for osx"

This reverts commit f65ad1b.

* [VMSS] Install nasm on OSX

* [libvpx] bump port version

* [libvpx] Add --as=nasm for non-MSVC triplets

* [libvpx] Fix nasm debug format flag

* Back out nasm change applied in #15258

Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
Co-authored-by: Long Nguyen <nguyen.long.908132@gmail.com>
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
  • Loading branch information
4 people committed Dec 29, 2020
1 parent 8f8f716 commit ba1c3aa
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 4 deletions.
22 changes: 22 additions & 0 deletions ports/libvpx/0001-vcxproj-nasm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/build/make/gen_msvs_vcxproj.sh b/build/make/gen_msvs_vcxproj.sh
index bb1c31d23..b634b0609 100755
--- a/build/make/gen_msvs_vcxproj.sh
+++ b/build/make/gen_msvs_vcxproj.sh
@@ -247,13 +247,13 @@ libs=${libs// /;}
case "$target" in
x86_64*)
platforms[0]="x64"
- asm_Debug_cmdline="yasm -Xvc -g cv8 -f win64 ${yasmincs} &quot;%(FullPath)&quot;"
- asm_Release_cmdline="yasm -Xvc -f win64 ${yasmincs} &quot;%(FullPath)&quot;"
+ asm_Debug_cmdline="nasm -Xvc -gcv8 -f win64 ${yasmincs} &quot;%(FullPath)&quot;"
+ asm_Release_cmdline="nasm -Xvc -f win64 ${yasmincs} &quot;%(FullPath)&quot;"
;;
x86*)
platforms[0]="Win32"
- asm_Debug_cmdline="yasm -Xvc -g cv8 -f win32 ${yasmincs} &quot;%(FullPath)&quot;"
- asm_Release_cmdline="yasm -Xvc -f win32 ${yasmincs} &quot;%(FullPath)&quot;"
+ asm_Debug_cmdline="nasm -Xvc -gcv8 -f win32 ${yasmincs} &quot;%(FullPath)&quot;"
+ asm_Release_cmdline="nasm -Xvc -f win32 ${yasmincs} &quot;%(FullPath)&quot;"
;;
arm64*)
platforms[0]="ARM64"
21 changes: 21 additions & 0 deletions ports/libvpx/0002-Fix-nasm-debug-format-flag.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/build/make/configure.sh b/build/make/configure.sh
index 206b54f..49cd13e 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -1361,12 +1361,14 @@ EOF
case ${tgt_os} in
win32)
add_asflags -f win32
- enabled debug && add_asflags -g cv8
+ enabled debug && [ "${AS}" = yasm ] && add_asflags -g cv8
+ enabled debug && [ "${AS}" = nasm ] && add_asflags -gcv8
EXE_SFX=.exe
;;
win64)
add_asflags -f win64
- enabled debug && add_asflags -g cv8
+ enabled debug && [ "${AS}" = yasm ] && add_asflags -g cv8
+ enabled debug && [ "${AS}" = nasm ] && add_asflags -gcv8
EXE_SFX=.exe
;;
linux*|solaris*|android*)
3 changes: 1 addition & 2 deletions ports/libvpx/CONTROL
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Source: libvpx
Version: 1.9.0
Port-Version: 4
Port-Version: 5
Homepage: https://github.com/webmproject/libvpx
Description: The reference software implementation for the video coding formats VP8 and VP9.
Supports: !(uwp&arm)
Build-Depends: yasm-tool-helper
11 changes: 9 additions & 2 deletions ports/libvpx/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ vcpkg_from_github(
REF v${LIBVPX_VERSION}
SHA512 8d544552b35000ea5712aec220b78bb5f7dc210704b2f609365214cb95a4f5a0e343b362723d829cb4a9ac203b10d5443700ba84b28fd6b2fefbabb40663e298
HEAD_REF master
PATCHES
0001-vcxproj-nasm.patch
0002-Fix-nasm-debug-format-flag.patch
)

vcpkg_find_acquire_program(PERL)
Expand All @@ -23,8 +26,9 @@ else()
set(ENV{PATH} "${MSYS_ROOT}/usr/bin:$ENV{PATH}:${PERL_EXE_PATH}")
endif()

include(${CURRENT_INSTALLED_DIR}/share/yasm-tool-helper/yasm-tool-helper.cmake)
yasm_tool_helper(PREPEND_TO_PATH OUT_VAR ENV{AS})
vcpkg_find_acquire_program(NASM)
get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
vcpkg_add_to_path(${NASM_EXE_PATH})

if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)

Expand Down Expand Up @@ -64,6 +68,7 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
--disable-examples
--disable-tools
--disable-docs
--as=nasm
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}"
LOGNAME configure-${TARGET_TRIPLET})

Expand Down Expand Up @@ -164,6 +169,7 @@ else()
--target=${LIBVPX_TARGET}
${OPTIONS}
${OPTIONS_RELEASE}
--as=nasm
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel"
LOGNAME configure-${TARGET_TRIPLET}-rel)

Expand Down Expand Up @@ -196,6 +202,7 @@ else()
--target=${LIBVPX_TARGET}
${OPTIONS}
${OPTIONS_DEBUG}
--as=nasm
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg"
LOGNAME configure-${TARGET_TRIPLET}-dbg)

Expand Down

0 comments on commit ba1c3aa

Please sign in to comment.