From bfcca82b95006d737cb84c59a7fb3fcc0c70b6cc Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 10 Sep 2020 10:48:25 +0200 Subject: [PATCH 1/3] try fixing x264 --- ports/x264/portfile.cmake | 16 ++++++++++++++-- scripts/cmake/vcpkg_configure_make.cmake | 11 +++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ports/x264/portfile.cmake b/ports/x264/portfile.cmake index 1c9e32e9251816..733d3a74f5a6c2 100644 --- a/ports/x264/portfile.cmake +++ b/ports/x264/portfile.cmake @@ -27,6 +27,7 @@ endif() vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} + COPY_SOURCE NO_ADDITIONAL_PATHS OPTIONS ${OPTIONS} @@ -47,9 +48,20 @@ vcpkg_copy_tools(TOOL_NAMES x264 AUTO_CLEAN) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +if(VCPKG_TARGET_IS_WINDOWS) + set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/x264.pc") + if(EXISTS "${pcfile}") + vcpkg_string_replace("${pcfile}" "-lx264" "-llibx264") + endif() + set(pcfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/x264.pc") + if(EXISTS "${pcfile}") + vcpkg_string_replace("${pcfile}" "-lx264" "-llibx264") + endif() +endif() + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/lib/x264.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/debug/lib/x264.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/lib/libx264.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libx264.dll.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libx264.lib) else() # force U_STATIC_IMPLEMENTATION macro file(READ ${CURRENT_PACKAGES_DIR}/include/x264.h HEADER_CONTENTS) diff --git a/scripts/cmake/vcpkg_configure_make.cmake b/scripts/cmake/vcpkg_configure_make.cmake index 48937a7271939e..668316746b9342 100644 --- a/scripts/cmake/vcpkg_configure_make.cmake +++ b/scripts/cmake/vcpkg_configure_make.cmake @@ -220,10 +220,7 @@ function(vcpkg_configure_make) list(APPEND MSYS_REQUIRE_PACKAGES binutils libtool autoconf automake-wrapper automake1.16 m4) vcpkg_acquire_msys(MSYS_ROOT PACKAGES ${MSYS_REQUIRE_PACKAGES}) # This inserts msys before system32 (which masks sort.exe and find.exe) but after MSVC (which avoids masking link.exe) - string(REPLACE ";$ENV{SystemRoot}\\System32;" ";${MSYS_ROOT}/usr/share/automake-1.16;${MSYS_ROOT}/usr/bin;$ENV{SystemRoot}\\System32;" NEWPATH "$ENV{PATH}") - set(ENV{PATH} "${NEWPATH}") - set(BASH "${MSYS_ROOT}/usr/bin/bash.exe") - + set(APPEND_ENV) if (_csc_AUTOCONFIG) # --build: the machine you are building on # --host: the machine you are building for @@ -243,8 +240,14 @@ function(vcpkg_configure_make) endif() endif() debug_message("Using make triplet: ${_csc_BUILD_TRIPLET}") + set(APPEND_ENV ";${MSYS_ROOT}/usr/share/automake-1.16") endif() + string(REPLACE ";$ENV{SystemRoot}\\System32;" "${APPEND_ENV};${MSYS_ROOT}/usr/bin;$ENV{SystemRoot}\\System32;" NEWPATH "$ENV{PATH}") + string(REPLACE ";$ENV{SystemRoot}\\system32;" "${APPEND_ENV};${MSYS_ROOT}/usr/bin;$ENV{SystemRoot}\\system32;" NEWPATH "$ENV{PATH}") + set(ENV{PATH} "${NEWPATH}") + set(BASH "${MSYS_ROOT}/usr/bin/bash.exe") + macro(_vcpkg_append_to_configure_environment inoutstring var defaultval) # Allows to overwrite settings in custom triplets via the environment if(DEFINED ENV{${var}}) From 8663312f3ff487f4403169926113cff94e853a61 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 10 Sep 2020 12:35:30 +0200 Subject: [PATCH 2/3] fix remaining issues --- ports/x264/CONTROL | 2 +- ports/x264/portfile.cmake | 4 ++-- scripts/ci.baseline.txt | 3 --- scripts/cmake/vcpkg_build_make.cmake | 3 ++- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ports/x264/CONTROL b/ports/x264/CONTROL index 0a4af3912f140f..565775b153a42a 100644 --- a/ports/x264/CONTROL +++ b/ports/x264/CONTROL @@ -1,6 +1,6 @@ Source: x264 Version: 157-303c484ec828ed0 -Port-Version: 9 +Port-Version: 10 Homepage: https://github.com/mirror/x264 Description: x264 is a free software library and application for encoding video streams into the H.264/MPEG-4 AVC compression format Build-Depends: pthread (linux&osx) diff --git a/ports/x264/portfile.cmake b/ports/x264/portfile.cmake index 733d3a74f5a6c2..34fb8ef7c10174 100644 --- a/ports/x264/portfile.cmake +++ b/ports/x264/portfile.cmake @@ -51,11 +51,11 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) if(VCPKG_TARGET_IS_WINDOWS) set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/x264.pc") if(EXISTS "${pcfile}") - vcpkg_string_replace("${pcfile}" "-lx264" "-llibx264") + vcpkg_replace_string("${pcfile}" "-lx264" "-llibx264") endif() set(pcfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/x264.pc") if(EXISTS "${pcfile}") - vcpkg_string_replace("${pcfile}" "-lx264" "-llibx264") + vcpkg_replace_string("${pcfile}" "-lx264" "-llibx264") endif() endif() diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index d9a84f18e568c0..ce1c19a369c812 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1813,9 +1813,6 @@ x264:arm64-windows=fail x264:arm-uwp=fail x264:x64-uwp=fail x264:x64-osx=fail -x264:x86-windows=fail -x264:x64-windows=fail -x264:x64-windows-static=fail x265:arm64-windows=fail x265:arm-uwp=fail x265:x64-uwp=fail diff --git a/scripts/cmake/vcpkg_build_make.cmake b/scripts/cmake/vcpkg_build_make.cmake index c957fc62870e5a..991892aa67bb7f 100644 --- a/scripts/cmake/vcpkg_build_make.cmake +++ b/scripts/cmake/vcpkg_build_make.cmake @@ -70,7 +70,8 @@ function(vcpkg_build_make) set(NO_PARALLEL_MAKE_OPTS ${_bc_MAKE_OPTIONS} -j 1 --trace -f Makefile ${_bc_BUILD_TARGET}) string(REPLACE " " "\\\ " _VCPKG_PACKAGE_PREFIX ${CURRENT_PACKAGES_DIR}) - string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PACKAGE_PREFIX "${_VCPKG_PACKAGE_PREFIX}") + # Don't know why '/cygdrive' is suddenly a requirement here. (at least for x264) + string(REGEX REPLACE "([a-zA-Z]):/" "/cygdrive/\\1/" _VCPKG_PACKAGE_PREFIX "${_VCPKG_PACKAGE_PREFIX}") set(INSTALL_OPTS -j ${VCPKG_CONCURRENCY} --trace -f Makefile install DESTDIR=${_VCPKG_PACKAGE_PREFIX}) #TODO: optimize for install-data (release) and install-exec (release/debug) else() From dafb948a847a7cbe2509bdd40c58a6e80692421e Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Thu, 10 Sep 2020 15:27:35 +0200 Subject: [PATCH 3/3] Remove unnecessary COPY_SOURCE --- ports/x264/portfile.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/x264/portfile.cmake b/ports/x264/portfile.cmake index 34fb8ef7c10174..1d1bc23922f2e2 100644 --- a/ports/x264/portfile.cmake +++ b/ports/x264/portfile.cmake @@ -27,7 +27,6 @@ endif() vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} - COPY_SOURCE NO_ADDITIONAL_PATHS OPTIONS ${OPTIONS}