mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-28 19:13:20 +03:00
vcpkg deps (#8764)
* Revert "Revert vcpkg ffmpeg (#8751)" This reverts commit5c16a8302e. * vcpkg: Reland ffmpeg and try to fix sciter build Signed-off-by: Vasyl Gello <vasek.gello@gmail.com> * vcpkg: Detect AVX2 by requiring __m256i (ubuntu18.04 sciter) Signed-off-by: Vasyl Gello <vasek.gello@gmail.com> * Install nasm from debian buster and python3.7 ... from ubuntu universe [Skip CI] * vcpkg: Add libyuv port with fix for windows Fromabc59feabfFound by @deep-soft Signed-off-by: Vasyl Gello <vasek.gello@gmail.com> * Bump vcpkg baseline to 2024.07.12 Signed-off-by: Vasyl Gello <vasek.gello@gmail.com> * Fix F-Droid version action I thought the latest release will be updated by the time hook starts but it is not the case. Get tag from GITHUB_REF instead if GITHUB_REF_TYPE is "tag". Signed-off-by: Vasyl Gello <vasek.gello@gmail.com> --------- Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
This commit is contained in:
80
res/vcpkg/libyuv/fix-cmakelists.patch
Normal file
80
res/vcpkg/libyuv/fix-cmakelists.patch
Normal file
@@ -0,0 +1,80 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index bc641685..42e72a39 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1,19 +1,22 @@
|
||||
+CMAKE_MINIMUM_REQUIRED( VERSION 3.12 )
|
||||
+
|
||||
# CMakeLists for libyuv
|
||||
# Originally created for "roxlu build system" to compile libyuv on windows
|
||||
# Run with -DTEST=ON to build unit tests
|
||||
|
||||
PROJECT ( YUV C CXX ) # "C" is required even for C++ projects
|
||||
-CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 )
|
||||
OPTION( TEST "Built unit tests" OFF )
|
||||
|
||||
+SET( CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON )
|
||||
+
|
||||
SET ( ly_base_dir ${PROJECT_SOURCE_DIR} )
|
||||
SET ( ly_src_dir ${ly_base_dir}/source )
|
||||
SET ( ly_inc_dir ${ly_base_dir}/include )
|
||||
SET ( ly_tst_dir ${ly_base_dir}/unit_test )
|
||||
SET ( ly_lib_name yuv )
|
||||
SET ( ly_lib_static ${ly_lib_name} )
|
||||
-SET ( ly_lib_shared ${ly_lib_name}_shared )
|
||||
|
||||
+FILE ( GLOB_RECURSE ly_include_files ${ly_inc_dir}/libyuv/*.h )
|
||||
FILE ( GLOB_RECURSE ly_source_files ${ly_src_dir}/*.cc )
|
||||
LIST ( SORT ly_source_files )
|
||||
|
||||
@@ -28,27 +31,20 @@ endif()
|
||||
|
||||
# this creates the static library (.a)
|
||||
ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} )
|
||||
-
|
||||
-# this creates the shared library (.so)
|
||||
-ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} )
|
||||
-SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" )
|
||||
-SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" )
|
||||
-if(WIN32)
|
||||
- SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES IMPORT_PREFIX "lib" )
|
||||
-endif()
|
||||
+SET_TARGET_PROPERTIES ( ${ly_lib_static} PROPERTIES PUBLIC_HEADER include/libyuv.h )
|
||||
|
||||
# this creates the conversion tool
|
||||
ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc )
|
||||
-TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} )
|
||||
+TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} )
|
||||
|
||||
# this creates the yuvconstants tool
|
||||
-ADD_EXECUTABLE ( yuvconstants ${ly_base_dir}/util/yuvconstants.c )
|
||||
-TARGET_LINK_LIBRARIES ( yuvconstants ${ly_lib_static} )
|
||||
+ADD_EXECUTABLE ( yuvconstants ${ly_base_dir}/util/yuvconstants.c )
|
||||
+TARGET_LINK_LIBRARIES ( yuvconstants ${ly_lib_static} )
|
||||
|
||||
find_package ( JPEG )
|
||||
if (JPEG_FOUND)
|
||||
- include_directories( ${JPEG_INCLUDE_DIR} )
|
||||
- target_link_libraries( ${ly_lib_shared} ${JPEG_LIBRARY} )
|
||||
+ include_directories( ${JPEG_INCLUDE_DIR})
|
||||
+ target_link_libraries(${ly_lib_static} PUBLIC ${JPEG_LIBRARY})
|
||||
add_definitions( -DHAVE_JPEG )
|
||||
endif()
|
||||
|
||||
@@ -89,12 +85,11 @@ if(TEST)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
-
|
||||
# install the conversion tool, .so, .a, and all the header files
|
||||
-INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin )
|
||||
-INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib )
|
||||
-INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin )
|
||||
-INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include )
|
||||
+INSTALL ( TARGETS yuvconvert DESTINATION tools )
|
||||
+INSTALL ( FILES ${ly_include_files} DESTINATION include/libyuv )
|
||||
+INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-targets DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include )
|
||||
+INSTALL( EXPORT libyuv-targets DESTINATION share/cmake/libyuv/ EXPORT_LINK_INTERFACE_LIBRARIES )
|
||||
|
||||
# create the .deb and .rpm packages using cpack
|
||||
INCLUDE ( CM_linux_packages.cmake )
|
||||
5
res/vcpkg/libyuv/libyuv-config.cmake
Normal file
5
res/vcpkg/libyuv/libyuv-config.cmake
Normal file
@@ -0,0 +1,5 @@
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(JPEG)
|
||||
|
||||
set(libyuv_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/../../include")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/libyuv-targets.cmake")
|
||||
81
res/vcpkg/libyuv/portfile.cmake
Normal file
81
res/vcpkg/libyuv/portfile.cmake
Normal file
@@ -0,0 +1,81 @@
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
vcpkg_from_git(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
URL https://chromium.googlesource.com/libyuv/libyuv
|
||||
REF 0faf8dd0e004520a61a603a4d2996d5ecc80dc3f
|
||||
# Check https://chromium.googlesource.com/libyuv/libyuv/+/refs/heads/main/include/libyuv/version.h for a version!
|
||||
PATCHES
|
||||
fix-cmakelists.patch
|
||||
)
|
||||
|
||||
vcpkg_cmake_get_vars(cmake_vars_file)
|
||||
include("${cmake_vars_file}")
|
||||
if (VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND NOT VCPKG_TARGET_IS_UWP)
|
||||
# Most of libyuv accelerated features need to be compiled by clang/gcc, so force use clang-cl, otherwise the performance is too poor.
|
||||
# Manually build the port with clang-cl when using MSVC as compiler
|
||||
|
||||
message(STATUS "Set compiler to clang-cl when using MSVC")
|
||||
|
||||
# https://github.com/microsoft/vcpkg/pull/10398
|
||||
set(VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK enabled)
|
||||
|
||||
vcpkg_find_acquire_program(CLANG)
|
||||
if (CLANG MATCHES "-NOTFOUND")
|
||||
message(FATAL_ERROR "Clang is required.")
|
||||
endif ()
|
||||
get_filename_component(CLANG "${CLANG}" DIRECTORY)
|
||||
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
|
||||
set(CLANG_TARGET "arm")
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
|
||||
set(CLANG_TARGET "aarch64")
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
||||
set(CLANG_TARGET "i686")
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||
set(CLANG_TARGET "x86_64")
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported target architecture")
|
||||
endif()
|
||||
|
||||
set(CLANG_TARGET "${CLANG_TARGET}-pc-windows-msvc")
|
||||
|
||||
message(STATUS "Using clang target ${CLANG_TARGET}")
|
||||
string(APPEND VCPKG_DETECTED_CMAKE_CXX_FLAGS --target=${CLANG_TARGET})
|
||||
string(APPEND VCPKG_DETECTED_CMAKE_C_FLAGS --target=${CLANG_TARGET})
|
||||
|
||||
set(BUILD_OPTIONS
|
||||
-DCMAKE_CXX_COMPILER=${CLANG}/clang-cl.exe
|
||||
-DCMAKE_C_COMPILER=${CLANG}/clang-cl.exe
|
||||
-DCMAKE_CXX_FLAGS=${VCPKG_DETECTED_CMAKE_CXX_FLAGS}
|
||||
-DCMAKE_C_FLAGS=${VCPKG_DETECTED_CMAKE_C_FLAGS})
|
||||
endif ()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
DISABLE_PARALLEL_CONFIGURE
|
||||
OPTIONS
|
||||
${BUILD_OPTIONS}
|
||||
OPTIONS_DEBUG
|
||||
-DCMAKE_DEBUG_POSTFIX=d
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH share/cmake/libyuv)
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/libyuv-config.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT} COPYONLY)
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
|
||||
vcpkg_cmake_get_vars(cmake_vars_file)
|
||||
include("${cmake_vars_file}")
|
||||
if (VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
message(WARNING "Use MSVC to compile libyuv results in a very slow library. (https://github.com/microsoft/vcpkg/issues/28446)")
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage-msvc" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME "usage")
|
||||
else ()
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
endif ()
|
||||
4
res/vcpkg/libyuv/usage
Normal file
4
res/vcpkg/libyuv/usage
Normal file
@@ -0,0 +1,4 @@
|
||||
libyuv provides CMake targets:
|
||||
|
||||
find_package(libyuv CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE yuv)
|
||||
9
res/vcpkg/libyuv/usage-msvc
Normal file
9
res/vcpkg/libyuv/usage-msvc
Normal file
@@ -0,0 +1,9 @@
|
||||
libyuv provides CMake targets:
|
||||
|
||||
find_package(libyuv CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE yuv)
|
||||
|
||||
# WARNING
|
||||
# You are using MSVC to compile libyuv, which results in a very slow library.
|
||||
# MSVC won't compile any of the acceleration codes.
|
||||
# See workarounds: https://github.com/microsoft/vcpkg/issues/28446
|
||||
22
res/vcpkg/libyuv/vcpkg.json
Normal file
22
res/vcpkg/libyuv/vcpkg.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "libyuv",
|
||||
"version": "1857",
|
||||
"description": "libyuv is an open source project that includes YUV scaling and conversion functionality",
|
||||
"homepage": "https://chromium.googlesource.com/libyuv/libyuv",
|
||||
"license": null,
|
||||
"dependencies": [
|
||||
"libjpeg-turbo",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-get-vars",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user