From 98354b0785be44ede08bc685c69a8f9b5243e802 Mon Sep 17 00:00:00 2001 From: Sylvain Prevost Date: Wed, 2 Feb 2022 12:21:18 -0600 Subject: [PATCH 1/3] [x264] enable cross-compile settings propagation for arm64-linux. --- ports/x264/portfile.cmake | 29 +++++++++++++++++++++++++++++ ports/x264/vcpkg.json | 6 +++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/ports/x264/portfile.cmake b/ports/x264/portfile.cmake index 33e6979ac0e776..b5961f55e01591 100644 --- a/ports/x264/portfile.cmake +++ b/ports/x264/portfile.cmake @@ -32,6 +32,35 @@ if(VCPKG_TARGET_IS_LINUX) list(APPEND OPTIONS --enable-pic) endif() +vcpkg_cmake_get_vars(cmake_vars_file) +include("${cmake_vars_file}") + +if (VCPKG_DETECTED_CMAKE_CROSSCOMPILING STREQUAL "TRUE") + if (VCPKG_TARGET_IS_LINUX) + if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + list(APPEND OPTIONS --host=aarch64-linux) + if (DEFINED ENV{CROSS_PREFIX}) + # allow toolchain to specify the cross-prefix + set(cross_prefix $ENV{CROSS_PREFIX}) + else() + # attempt to determine the cross-prefix from VCPKG_DETECTED_CMAKE_C/CXX_COMPILER using the most likely naming conventions + if (${VCPKG_DETECTED_CMAKE_C_COMPILER} MATCHES ".*-gcc") + string(REGEX REPLACE "gcc$" "" full_cross_prefix ${VCPKG_DETECTED_CMAKE_C_COMPILER}) + get_filename_component(cross_prefix ${full_cross_prefix} NAME) + elseif (${VCPKG_DETECTED_CMAKE_CXX_COMPILER} MATCHES ".*-g\\+\\+") + string(REGEX REPLACE "g\\+\\+$" "" full_cross_prefix ${VCPKG_DETECTED_CMAKE_CXX_COMPILER}) + get_filename_component(cross_prefix ${full_cross_prefix} NAME) + else() + message(AUTHOR_WARNING "Could not self-determine cross-prefix. Will attempt to use 'aarch64-linux-gnu-'. You should use ENV{CROSS_PREFIX} in your toolchain to override it.") + set(cross_prefix "aarch64-linux-gnu-") + endif() + endif() + list(APPEND OPTIONS --cross-prefix=${cross_prefix}) + list(APPEND OPTIONS --disable-asm) + endif() + endif() +endif() + vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} NO_ADDITIONAL_PATHS diff --git a/ports/x264/vcpkg.json b/ports/x264/vcpkg.json index 436cf0b5efd276..a00c0cfc500bec 100644 --- a/ports/x264/vcpkg.json +++ b/ports/x264/vcpkg.json @@ -1,11 +1,15 @@ { "name": "x264", "version-string": "164-5db6aa6cab1b146", - "port-version": 4, + "port-version": 5, "description": "x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format", "homepage": "https://github.com/mirror/x264", "supports": "!(arm & windows)", "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, { "name": "pthread", "platform": "linux & osx" From 895ae0f123943225859463bcf0cecf862f596df4 Mon Sep 17 00:00:00 2001 From: Sylvain Prevost Date: Wed, 2 Feb 2022 12:22:38 -0600 Subject: [PATCH 2/3] [x264] update baseline version. --- ports/x264/vcpkg.json | 8 ++++---- versions/baseline.json | 2 +- versions/x-/x264.json | 5 +++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ports/x264/vcpkg.json b/ports/x264/vcpkg.json index a00c0cfc500bec..2eb3339bccbdfd 100644 --- a/ports/x264/vcpkg.json +++ b/ports/x264/vcpkg.json @@ -6,13 +6,13 @@ "homepage": "https://github.com/mirror/x264", "supports": "!(arm & windows)", "dependencies": [ - { - "name": "vcpkg-cmake", - "host": true - }, { "name": "pthread", "platform": "linux & osx" + }, + { + "name": "vcpkg-cmake", + "host": true } ] } diff --git a/versions/baseline.json b/versions/baseline.json index 594762a138133b..75ed48959d10f1 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7366,7 +7366,7 @@ }, "x264": { "baseline": "164-5db6aa6cab1b146", - "port-version": 4 + "port-version": 5 }, "x265": { "baseline": "3.4", diff --git a/versions/x-/x264.json b/versions/x-/x264.json index bd8a969ea8dad4..f866b55865254e 100644 --- a/versions/x-/x264.json +++ b/versions/x-/x264.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "387ccad820c889bcffccfa2d74fac3b0d41197b1", + "version-string": "164-5db6aa6cab1b146", + "port-version": 5 + }, { "git-tree": "7eea109502309e62a578bcc69811ad0659e00f9d", "version-string": "164-5db6aa6cab1b146", From 86968fcf0597c4ded65e7d37b6c65ae7729dbf4b Mon Sep 17 00:00:00 2001 From: Sylvain Prevost Date: Wed, 2 Feb 2022 14:19:36 -0600 Subject: [PATCH 3/3] [x264] update SHA1 (mismatch due to operator err - formatting applied along with x-add-version). --- versions/x-/x264.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/x-/x264.json b/versions/x-/x264.json index f866b55865254e..f7e10cd08c6f83 100644 --- a/versions/x-/x264.json +++ b/versions/x-/x264.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "387ccad820c889bcffccfa2d74fac3b0d41197b1", + "git-tree": "063705300826104f0616ff931ff1b0dadb279c77", "version-string": "164-5db6aa6cab1b146", "port-version": 5 },