diff --git a/.gitignore b/.gitignore index 86fd538f6d80b7..43f63c0dfc1cdb 100644 --- a/.gitignore +++ b/.gitignore @@ -304,6 +304,14 @@ __pycache__/ !triplets/community/x86-windows-static.cmake !triplets/community/x86-windows-static-md.cmake !triplets/community/x64-osx-dynamic.cmake +!triplets/community/x64-android.cmake +!triplets/community/x86-android.cmake +!triplets/community/arm-android.cmake +!triplets/community/arm64-android.cmake +!triplets/community/arm64-ios.cmake +!triplets/community/arm-ios.cmake +!triplets/community/x64-ios.cmake +!triplets/community/x86-ios.cmake !triplets/arm-uwp.cmake !triplets/x64-uwp.cmake !triplets/x64-windows.cmake @@ -320,3 +328,5 @@ __pycache__/ # vcpkg - End ############################################################ archives +.DS_Store +prefab/ \ No newline at end of file diff --git a/docs/specifications/prefab.md b/docs/specifications/prefab.md new file mode 100644 index 00000000000000..bb0479c4c5c6df --- /dev/null +++ b/docs/specifications/prefab.md @@ -0,0 +1,124 @@ +## Exporting to Android Archives (AAR files) + +Vcpkg current supports exporting to android archive files([AAR files](https://developer.android.com/studio/projects/android-library)). Once the archive is created it can imported in Android Studio as a native dependent. The archive is automatically consumed using [android studio's prefab tool](https://github.com/google/prefab). For more information on Prefab checkout the following article ["Native Dependencies in Android Studio 4.0"](https://android-developers.googleblog.com/2020/02/native-dependencies-in-android-studio-40.html) and the documentation on how to use prefab on [https://google.github.io/prefab/](https://google.github.io/prefab). + +#### To support export to android the following tools should be available; + +- `maven ` +- `ndk ` +- `7zip ` or `zip ` + +**Android triplets that support the following architectures arm64-v8a, armeabi-v7a, x86_64 x86 must be present** + +#### An example of a triplet configuration targeting android would be + +```cmake +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_CMAKE_SYSTEM_NAME Android) +``` + +The following table outlines the mapping from vcpkg architectures to android architectures + +|vcpkg architecture | android architecture | +|-------------------|----------------------| +|arm64 | arm64-v8a | +|arm | armeabi-v7a | +|x64 | x86_64 | +|x86 | x86 | + +**Please note the four architectures are required. If any is missing the export will fail** +**To export the following environment `ANDROID_NDK_HOME` variable is required for exporting** + +#### Example exporting [jsoncpp] +The `--prefab-maven` flag is option. Only call it when you have maven installed +``` +./vcpkg export --triplet x64-android jsoncpp --prefab --prefab-maven +``` + +``` +The following packages are already built and will be exported: + jsoncpp:x86-android +Exporting package jsoncpp... +[INFO] Scanning for projects... +[INFO] +[INFO] ------------------< org.apache.maven:standalone-pom >------------------- +[INFO] Building Maven Stub Project (No POM) 1 +[INFO] --------------------------------[ pom ]--------------------------------- +[INFO] +[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom --- +[INFO] Installing/prefab/jsoncpp/jsoncpp-1.9.2.aar to /.m2/repository/com/vcpkg/ndk/support/jsoncpp/1.9.2/jsoncpp-1.9.2.aar +[INFO] Installing /prefab/jsoncpp/pom.xml to /.m2/repository/com/vcpkg/ndk/support/jsoncpp/1.9.2/jsoncpp-1.9.2.pom +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD SUCCESS +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 0.301 s +[INFO] Finished at: 2020-03-01T10:18:15Z +[INFO] ------------------------------------------------------------------------ +In app/build.gradle + + com.vcpkg.ndk.support:jsoncpp:1.9.2 + +And cmake flags + + externalNativeBuild { + cmake { + arguments '-DANDROID_STL=c++_shared' + cppFlags "-std=c++17" + } + } + +In gradle.properties + + android.enablePrefab=true + android.enableParallelJsonGen=false + android.prefabVersion=${prefab.version} + +Successfuly exported jsoncpp. Checkout /prefab/jsoncpp/aar +``` + +#### The output directory after export +``` +prefab +└── jsoncpp + ├── aar + │   ├── AndroidManifest.xml + │   ├── META-INF + │   │   └── LICENCE + │   └── prefab + │   ├── modules + │   │   └── jsoncpp + │   │   ├── include + │   │   │   └── json + │   │   │   ├── allocator.h + │   │   │   ├── assertions.h + │   │   │   ├── autolink.h + │   │   │   ├── config.h + │   │   │   ├── forwards.h + │   │   │   ├── json.h + │   │   │   ├── json_features.h + │   │   │   ├── reader.h + │   │   │   ├── value.h + │   │   │   ├── version.h + │   │   │   └── writer.h + │   │   ├── libs + │   │   │   ├── android.arm64-v8a + │   │   │   │   ├── abi.json + │   │   │   │   └── libjsoncpp.so + │   │   │   ├── android.armeabi-v7a + │   │   │   │   ├── abi.json + │   │   │   │   └── libjsoncpp.so + │   │   │   ├── android.x86 + │   │   │   │   ├── abi.json + │   │   │   │   └── libjsoncpp.so + │   │   │   └── android.x86_64 + │   │   │   ├── abi.json + │   │   │   └── libjsoncpp.so + │   │   └── module.json + │   └── prefab.json + ├── jsoncpp-1.9.2.aar + └── pom.xml + +13 directories, 25 files +``` diff --git a/docs/users/triplets.md b/docs/users/triplets.md index 08047565199122..30fd66eea8608e 100644 --- a/docs/users/triplets.md +++ b/docs/users/triplets.md @@ -140,6 +140,10 @@ Sets the minimum macOS version for compiled binaries. This also changes what ver ### VCPKG_OSX_SYSROOT Set the name or path of the macOS platform SDK that will be used by CMake. See the CMake documentation for [CMAKE_OSX_SYSROOT](https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_SYSROOT.html) for more information. + +### VCPKG_OSX_ARCHITECTURES +Set the macOS / iOS target architecture which will be used by CMake. See the CMake documentation for [CMAKE_OSX_ARCHITECTURES](https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_ARCHITECTURES.html) for more information. + ## Per-port customization The CMake Macro `PORT` will be set when interpreting the triplet file and can be used to change settings (such as `VCPKG_LIBRARY_LINKAGE`) on a per-port basis. diff --git a/ports/abseil/CONTROL b/ports/abseil/CONTROL index 7e3f54a8bc038b..bcde132e82ecfc 100644 --- a/ports/abseil/CONTROL +++ b/ports/abseil/CONTROL @@ -1,10 +1,10 @@ Source: abseil -Version: 2020-03-03-1 +Version: 2020-03-03-2 Homepage: https://github.com/abseil/abseil-cpp Description: an open-source collection designed to augment the C++ standard library. Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from Google's own C++ code base, has been extensively tested and used in production, and is the same code we depend on in our daily coding lives. In some cases, Abseil provides pieces missing from the C++ standard; in others, Abseil provides alternatives to the standard for special needs we've found through usage in the Google code base. We denote those cases clearly within the library code we provide you. Abseil is not meant to be a competitor to the standard library; we've just found that many of these utilities serve a purpose within our code base, and we now want to provide those resources to the C++ community as a whole. -Feature: c++17 +Feature: cxx17 Description: Enable compiler C++17. diff --git a/ports/abseil/portfile.cmake b/ports/abseil/portfile.cmake index c569d766aa12ec..4c9196207691f6 100644 --- a/ports/abseil/portfile.cmake +++ b/ports/abseil/portfile.cmake @@ -12,7 +12,7 @@ vcpkg_from_github( ) set(CMAKE_CXX_STANDARD ) -if("c++17" IN_LIST FEATURES) +if("cxx17" IN_LIST FEATURES) set(CMAKE_CXX_STANDARD 17) endif() diff --git a/ports/angle/CMakeLists.txt b/ports/angle/CMakeLists.txt index e64b9aaa39e3f5..a9b8f07b9d42df 100644 --- a/ports/angle/CMakeLists.txt +++ b/ports/angle/CMakeLists.txt @@ -44,8 +44,8 @@ add_definitions( ) configure_file(commit.h include/id/commit.h COPYONLY) -include_directories(include src ${CMAKE_CURRENT_BINARY_DIR}/include) - +#include_directories(include src ${CMAKE_CURRENT_BINARY_DIR}/include) +include_directories("$" "$" "$" "$") ########## # angle::common if(WINDOWS_DESKTOP) @@ -71,14 +71,14 @@ file(GLOB ANGLE_COMMON_SOURCES "src/common/third_party/smhasher/src/*.h" "src/common/third_party/smhasher/src/*.cpp") list(FILTER ANGLE_COMMON_SOURCES EXCLUDE REGEX "_unittest|event_tracer|${ANGLE_COMMON_PLATFORM_FILTER}") -add_library(angle_common STATIC ${ANGLE_COMMON_SOURCES}) -target_include_directories(angle_common PUBLIC src/common/third_party/base) +add_library(angle_common OBJECT ${ANGLE_COMMON_SOURCES}) +target_include_directories(angle_common PUBLIC "$") add_library(angle::common ALIAS angle_common) ########## # angle::image_util file(GLOB ANGLE_IMAGE_UTIL_SOURCES "src/image_util/*.h" "src/image_util/*.inl" "src/image_util/*.cpp") -add_library(angle_image_util STATIC ${ANGLE_IMAGE_UTIL_SOURCES}) +add_library(angle_image_util OBJECT ${ANGLE_IMAGE_UTIL_SOURCES}) target_link_libraries(angle_image_util PRIVATE angle::common) add_library(angle::image_util ALIAS angle_image_util) @@ -96,7 +96,7 @@ file(GLOB TRANSLATOR_SOURCES "src/third_party/compiler/ArrayBoundsClamper.cpp" ) list(FILTER TRANSLATOR_SOURCES EXCLUDE REGEX "_unittest") -add_library(angle_translator STATIC ${TRANSLATOR_SOURCES}) +add_library(angle_translator OBJECT ${TRANSLATOR_SOURCES}) target_compile_definitions(angle_translator PUBLIC -DANGLE_ENABLE_ESSL -DANGLE_ENABLE_GLSL @@ -111,7 +111,7 @@ file(GLOB PREPROCESSOR_SOURCES "src/compiler/preprocessor/*.h" "src/compiler/preprocessor/*.cpp" ) -add_library(angle_preprocessor STATIC ${PREPROCESSOR_SOURCES}) +add_library(angle_preprocessor OBJECT ${PREPROCESSOR_SOURCES}) target_link_libraries(angle_preprocessor PRIVATE angle::common) add_library(angle::preprocessor ALIAS angle_preprocessor) @@ -151,7 +151,7 @@ if(WINDOWS_DESKTOP OR LINUX OR APPLE) ) list(FILTER LIBANGLE_GL_SOURCES EXCLUDE REGEX "_unittest") add_library(angle_renderer_opengl INTERFACE) - target_sources(angle_renderer_opengl INTERFACE ${LIBANGLE_GL_SOURCES}) + target_sources(angle_renderer_opengl INTERFACE "$") target_compile_definitions(angle_renderer_opengl INTERFACE -DANGLE_ENABLE_OPENGL) add_library(angle::renderer::opengl ALIAS angle_renderer_opengl) endif() @@ -171,7 +171,7 @@ if(WIN32) set(LIBANGLE_D3D_WINRT_SOURCES ${LIBANGLE_D3D_SOURCES}) list(FILTER LIBANGLE_D3D_WINRT_SOURCES INCLUDE REGEX "winrt") add_library(angle_renderer_winrt INTERFACE) - target_sources(angle_renderer_winrt INTERFACE ${LIBANGLE_D3D_WINRT_SOURCES}) + target_sources(angle_renderer_winrt INTERFACE "$") add_library(angle::renderer::winrt ALIAS angle_renderer_winrt) endif() @@ -181,7 +181,7 @@ if(WIN32) list(FILTER LIBANGLE_D3D_DESKTOP_SOURCES INCLUDE REGEX "d3d9|win32|converged") find_library(D3D9_LIB NAMES d3d9) add_library(angle_renderer_win32 INTERFACE) - target_sources(angle_renderer_win32 INTERFACE ${LIBANGLE_D3D_DESKTOP_SOURCES}) + target_sources(angle_renderer_win32 INTERFACE "$") target_compile_definitions(angle_renderer_win32 INTERFACE -DANGLE_ENABLE_D3D9) target_link_libraries(angle_renderer_win32 INTERFACE ${D3D9_LIB}) add_library(angle::renderer::win32 ALIAS angle_renderer_win32) @@ -192,7 +192,7 @@ if(WIN32) find_library(DXGUID_LIB NAMES dxguid) find_library(D3D11_LIB NAMES d3d11) add_library(angle_renderer_d3d INTERFACE) - target_sources(angle_renderer_d3d INTERFACE ${LIBANGLE_D3D_SOURCES}) + target_sources(angle_renderer_d3d INTERFACE "$") target_compile_definitions(angle_renderer_d3d INTERFACE -DANGLE_ENABLE_D3D11 "-DANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ \"d3dcompiler_47.dll\", \"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }" @@ -207,7 +207,7 @@ file(GLOB ANGLE_GPU_INFO_UTIL_SOURCES "src/gpu_info_util/SystemInfo_internal.h" "src/gpu_info_util/SystemInfo.cpp" ) -add_library(angle_gpu_info_util STATIC ${ANGLE_GPU_INFO_UTIL_SOURCES}) +add_library(angle_gpu_info_util OBJECT ${ANGLE_GPU_INFO_UTIL_SOURCES}) if(WIN32) target_sources(angle_gpu_info_util PRIVATE "src/gpu_info_util/SystemInfo_win.cpp") target_link_libraries(angle_gpu_info_util PRIVATE setupapi.lib dxgi.lib) @@ -281,6 +281,9 @@ else() endif() if(LINUX) + find_package(X11) + include_directories(${X11_INCLUDE_DIR}) + list(APPEND LIBANGLE_RENDERER_PLATFORM ${X11_LIBRARIES}) set(LIBANGLE_RENDERER_COMPILEDEF -DANGLE_USE_X11 ) @@ -297,14 +300,24 @@ target_link_libraries(libANGLE PRIVATE angle::preprocessor ${LIBANGLE_RENDERER_PLATFORM} ) -target_include_directories(libANGLE PRIVATE "src/third_party/khronos") +target_include_directories(libANGLE PRIVATE "$") target_compile_definitions(libANGLE PRIVATE -DANGLE_ENABLE_NULL PUBLIC -DLIBANGLE_IMPLEMENTATION - ${LIBANGLE_RENDERER_COMPILEDEF} + ${LIBANGLE_RENDERER_COMPILEDEF} + -DANGLE_EXPORT= + -DANGLE_UTIL_EXPORT= + -DEGLAPI= + -DGL_APICALL= + -DGL_API= ) add_library(angle::libANGLE ALIAS libANGLE) +if(BUILD_SHARED_LIBS) + target_compile_definitions(libANGLE + PRIVATE -DLIBANGLE_UTIL_IMPLEMENTATION + ) +endif() ########## # libGLESv2 @@ -344,12 +357,28 @@ target_link_libraries(libGLESv2 PRIVATE angle::common angle::libANGLE) target_compile_definitions(libGLESv2 PRIVATE -DLIBGLESV2_IMPLEMENTATION PUBLIC - -DGL_GLEXT_PROTOTYPES - -DGL_API= - -DGL_APICALL= - -DEGLAPI= - -DGL_API= + "-DGL_GLES_PROTOTYPES=1" + "-DGL_GLEXT_PROTOTYPES" + "-DEGL_EGL_PROTOTYPES=1" + "-DEGL_EGLEXT_PROTOTYPES" ) +if(BUILD_SHARED_LIBS) +else() + if(WIN32) + target_compile_definitions(libGLESv2 PRIVATE + "-DGL_API=" + "-DGL_APICALL=" + "-DEGLAPI=" + ) + else() + target_compile_definitions(libGLESv2 PRIVATE + "-DGL_API=__attribute__((visibility(\"default\")))" + "-DGL_APICALL=__attribute__((visibility(\"default\")))" + "-DEGLAPI=__attribute__((visibility(\"default\")))" + ) + endif() +endif() + target_include_directories(libGLESv2 PUBLIC "$") ########## @@ -361,20 +390,72 @@ add_library(libEGL "src/libEGL/resource.h" ) target_link_libraries(libEGL PRIVATE angle::common angle::libANGLE libGLESv2) -target_include_directories(libEGL PUBLIC "$") -target_include_directories(libEGL PUBLIC "$") +target_include_directories(libEGL PUBLIC "$" "$") +target_compile_definitions(libEGL + PRIVATE -DLIBGLESV2_IMPLEMENTATION + PUBLIC + "-DGL_GLES_PROTOTYPES=1" + "-DGL_GLEXT_PROTOTYPES" + "-DEGL_EGL_PROTOTYPES=1" + "-DEGL_EGLEXT_PROTOTYPES" +) +add_library(GL_VISIBILITY INTERFACE) +if(WIN32) + target_compile_definitions(GL_VISIBILITY INTERFACE + "-DGL_API=" + "-DGL_APICALL=") +else() + target_compile_definitions(GL_VISIBILITY INTERFACE + "-DGL_API=__attribute__((visibility(\"default\")))" + "-DGL_APICALL=__attribute__((visibility(\"default\")))") +endif() +target_link_libraries(libEGL PRIVATE GL_VISIBILITY) +target_link_libraries(libGLESv2 PRIVATE GL_VISIBILITY) + +if(WIN32) + target_compile_definitions(libEGL PRIVATE + "-DEGLAPI=" + ) +else() + target_compile_definitions(libEGL PRIVATE + "-DEGLAPI=__attribute__((visibility(\"default\")))" + ) +endif() +if(NOT BUILD_SHARED_LIBS) + add_definitions("-DANGLE_EXPORT=" "-DANGLE_UTIL_EXPORT=" "-DEGLAPI=" "-DGL_APICALL=" "-DGL_API=") +endif() SET_TARGET_PROPERTIES(libANGLE PROPERTIES PREFIX "") SET_TARGET_PROPERTIES(libGLESv2 PROPERTIES PREFIX "") SET_TARGET_PROPERTIES(libEGL PROPERTIES PREFIX "") -install(TARGETS libEGL libGLESv2 EXPORT ANGLEExport +install(TARGETS libEGL libGLESv2 libANGLE angle_common angle_image_util angle_gpu_info_util angle_translator angle_preprocessor GL_VISIBILITY EXPORT ANGLEExport RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) +if(WINDOWS_DESKTOP) + install(TARGETS angle_renderer_d3d angle_renderer_win32 angle_renderer_opengl EXPORT ANGLEExport + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) +elseif(WINDOWS_STORE) + install(TARGETS angle_renderer_d3d angle_renderer_winrt EXPORT ANGLEExport + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) +else() + install(TARGETS angle_renderer_opengl EXPORT ANGLEExport + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) +endif() + install(EXPORT ANGLEExport FILE unofficial-angle-config.cmake NAMESPACE unofficial::angle:: DESTINATION share/unofficial-angle) if(NOT DISABLE_INSTALL_HEADERS) diff --git a/ports/angle/CONTROL b/ports/angle/CONTROL index 0fb81989d13c49..4229c6f07e8db3 100644 --- a/ports/angle/CONTROL +++ b/ports/angle/CONTROL @@ -3,4 +3,4 @@ Version: 2019-12-31-2 Homepage: https://github.com/google/angle Description: A conformant OpenGL ES implementation for Windows, Mac and Linux. The goal of ANGLE is to allow users of multiple operating systems to seamlessly run WebGL and other OpenGL ES content by translating OpenGL ES API calls to one of the hardware-supported APIs available for that platform. ANGLE currently provides translation from OpenGL ES 2.0 and 3.0 to desktop OpenGL, OpenGL ES, Direct3D 9, and Direct3D 11. Support for translation from OpenGL ES to Vulkan is underway, and future plans include compute shader support (ES 3.1) and MacOS support. -Build-Depends: egl-registry +Build-Depends: egl-registry, opengl-registry diff --git a/ports/angle/portfile.cmake b/ports/angle/portfile.cmake index 9a28591ad8650f..08d70f608f0abe 100644 --- a/ports/angle/portfile.cmake +++ b/ports/angle/portfile.cmake @@ -1,5 +1,3 @@ -vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) - if (VCPKG_TARGET_IS_LINUX) message(WARNING "Building with a gcc version less than 6.1 is not supported.") message(WARNING "${PORT} currently requires the following libraries from the system package manager:\n libx11-dev\n libmesa-dev\n libxi-dev\n libxext-dev\n\nThese can be installed on Ubuntu systems via apt-get install libx11-dev libmesa-dev libxi-dev libxext-dev.") @@ -22,6 +20,7 @@ vcpkg_from_github( REPO google/angle REF 1fdf6ca5141d8e349e875eab6e51d93d929a7f0e SHA512 2553307f3d10b5c32166b9ed610b4b15310dccba00c644cd35026de86d87ea2e221c2e528f33b02f01c1ded2f08150e429de1fa300b73d655f8944f6f5047a82 + # On update check headers against opengl-registry PATCHES 001-fix-uwp.patch 002-fix-builder-error.patch @@ -45,3 +44,32 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-angle TARGET_PATH share/u vcpkg_copy_pdbs() file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +# File conflict with opengl-registry! Make sure headers are similar on Update! +# angle defines some additional entrypoints. +# opengl-registry probably needs an upstream update to account for those +# Due to that all angle headers get moved to include/angle. +# If you want to use those instead of the onces provided by opengl-registry make sure +# VCPKG_INSTALLED_DIR/include/angle is before VCPKG_INSTALLED_DIR/include +file(GLOB_RECURSE angle_includes "${CURRENT_PACKAGES_DIR}/include") +file(COPY ${angle_includes} DESTINATION "${CURRENT_PACKAGES_DIR}/include/angle") + +set(_double_files + include/GLES/egl.h + include/GLES/gl.h + include/GLES/glext.h + include/GLES/glplatform.h + include/GLES2/gl2.h + include/GLES2/gl2ext.h + include/GLES2/gl2platform.h + include/GLES3/gl3.h + include/GLES3/gl31.h + include/GLES3/gl32.h + include/GLES3/gl3platform.h) +foreach(_file ${_double_files}) + if(EXISTS "${CURRENT_PACKAGES_DIR}/${_file}") + file(REMOVE "${CURRENT_PACKAGES_DIR}/${_file}") + endif() +endforeach() + + diff --git a/ports/blend2d/CONTROL b/ports/blend2d/CONTROL index a0a1f6cc76c550..999ab5061c36fd 100644 --- a/ports/blend2d/CONTROL +++ b/ports/blend2d/CONTROL @@ -1,7 +1,8 @@ Source: blend2d -Version: beta_2019-12-27 +Version: beta_2020-03-29 Description: Beta 2D Vector Graphics Powered by a JIT Compiler Default-Features: jit, logging +Supports: !(arm|uwp) Feature: jit Description: Default feature. Enables jit pipeline compilation. Not supported for ARM and UWP. diff --git a/ports/blend2d/portfile.cmake b/ports/blend2d/portfile.cmake index aadc1e95b3cbfb..ddf330a4180379 100644 --- a/ports/blend2d/portfile.cmake +++ b/ports/blend2d/portfile.cmake @@ -1,10 +1,10 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO blend2d/blend2d - REF bddae39a210aa48c839901584eec647c8ae1b967 - SHA512 4d80571f5ec8f05753497af396046a75059002a1b7593cee80724a8b3c2495e566e88935bcc02c7380480a20b84ce44c228b1d6ca9c06e24af6564c2e40bc143 + REF 95ab468e39e964f240b847bce0bcb585a260da4c + SHA512 b90cc290673f51560e5085b8db47c5424d092fcd767ad4633b6d37e762d0f1d62fd683b9003269697086ad4aa78672a5682f68c3fd4a478c03f6d5710df66e2f HEAD_REF master ) @@ -21,8 +21,8 @@ if(NOT BLEND2D_BUILD_NO_JIT) vcpkg_from_github( OUT_SOURCE_PATH ASMJIT_SOURCE_PATH REPO asmjit/asmjit - REF baa79895c81b47a9d39abec904204dc0d9e0e6bb - SHA512 ec79736d22795de0135598e6649089df5f1594100ff6b6595ed2b83707808ba76d69cf807ecf5e4b9f17ebf7c00e4c7155105e600d56932cb209b77ee9b4fd96 + REF 1491d5f2ea0b6b398a63f250e7456a032866320f + SHA512 1aba49a5b44737d9393cc6576ef79330a2282139a1d3c279851d79e76949cc4bc6b7160c584910e17199f7610fcd29d56362baffce367a84b5432f528782359c HEAD_REF master ) diff --git a/ports/boringssl/0001-vcpkg.patch b/ports/boringssl/0001-vcpkg.patch new file mode 100644 index 00000000000000..88547d8c3ce459 --- /dev/null +++ b/ports/boringssl/0001-vcpkg.patch @@ -0,0 +1,32 @@ +diff --git i/CMakeLists.txt w/CMakeLists.txt +index 75bf9981b..15589a760 100644 +--- i/CMakeLists.txt ++++ w/CMakeLists.txt +@@ -564,7 +564,7 @@ endif() + + # Add minimal googletest targets. The provided one has many side-effects, and + # googletest has a very straightforward build. +-add_library(boringssl_gtest third_party/googletest/src/gtest-all.cc) ++add_library(boringssl_gtest STATIC third_party/googletest/src/gtest-all.cc) + target_include_directories(boringssl_gtest PRIVATE third_party/googletest) + + include_directories(third_party/googletest/include) +@@ -621,3 +621,18 @@ add_custom_target( + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + DEPENDS all_tests bssl_shim handshaker + ${MAYBE_USES_TERMINAL}) ++ ++install(TARGETS crypto ssl ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) ++ ++option(INSTALL_HEADERS "Install headers" ON) ++if(INSTALL_HEADERS) ++ install(DIRECTORY include/ DESTINATION include) ++endif() ++ ++option(INSTALL_TOOLS "Install bssl executable" OFF) ++if(INSTALL_TOOLS) ++ install(TARGETS bssl DESTINATION tools/boringssl) ++endif() diff --git a/ports/boringssl/CONTROL b/ports/boringssl/CONTROL new file mode 100644 index 00000000000000..fb8d41ce7d532c --- /dev/null +++ b/ports/boringssl/CONTROL @@ -0,0 +1,8 @@ +Source: boringssl +Version: 2020-04-07 +Homepage: https://boringssl.googlesource.com/boringssl +Description: BoringSSl is a fork of OpenSSL developed by Google +Supports: !uwp + +Feature: tools +Description: Build bssl executable diff --git a/ports/boringssl/portfile.cmake b/ports/boringssl/portfile.cmake new file mode 100644 index 00000000000000..a4b5acbc49ea81 --- /dev/null +++ b/ports/boringssl/portfile.cmake @@ -0,0 +1,51 @@ +vcpkg_fail_port_install(ON_TARGET "UWP") + +if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h") + message(WARNING "Can't build BoringSSL if OpenSSL is installed. Please remove OpenSSL, and try to install BoringSSL again if you need it. Build will continue since BoringSSL is a drop-in replacement for OpenSSL") + set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + return() +endif() + +vcpkg_find_acquire_program(PERL) +get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) +vcpkg_add_to_path(${PERL_EXE_PATH}) + +vcpkg_find_acquire_program(NASM) +get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) +vcpkg_add_to_path(${NASM_EXE_PATH}) + +vcpkg_find_acquire_program(GO) +get_filename_component(GO_EXE_PATH ${GO} DIRECTORY) +vcpkg_add_to_path(${GO_EXE_PATH}) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + tools INSTALL_TOOLS +) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO google/boringssl + REF 5902657734e2a796a514731e0fd0e80081ae43dc + SHA512 89458748ccf7e00e2e12a1026e7c41099298dfb6d0daaf885f52b98c84e833a4407e997dd3a5b92d56ede495ef431325a4b228c2d81598bde082141339b16684 + HEAD_REF master + PATCHES + 0001-vcpkg.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + ${FEATURE_OPTIONS} + OPTIONS_DEBUG + -DINSTALL_HEADERS=OFF + -DINSTALL_TOOLS=OFF +) + +vcpkg_install_cmake() + +if(IS_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/boringssl) + vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/boringssl") +endif() + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/cub/CONTROL b/ports/cub/CONTROL index 7c62c25a2dbfd1..eb708a84a8fb46 100644 --- a/ports/cub/CONTROL +++ b/ports/cub/CONTROL @@ -1,4 +1,4 @@ Source: cub -Version: 1.8.0 +Version: 1.8.0-1 Description: CUB is a flexible library of cooperative threadblock primitives and other utilities for CUDA kernel programming Build-Depends: cuda diff --git a/ports/egl-registry/CONTROL b/ports/egl-registry/CONTROL index 64b4745a4490dd..dad0d9d20c11eb 100644 --- a/ports/egl-registry/CONTROL +++ b/ports/egl-registry/CONTROL @@ -1,3 +1,3 @@ Source: egl-registry -Version: 2019-08-08 +Version: 2020-02-03 Description: the EGL API and Extension Registry diff --git a/ports/egl-registry/portfile.cmake b/ports/egl-registry/portfile.cmake index 9c7265d6b9f6d4..68f6a2ee8f2e7d 100644 --- a/ports/egl-registry/portfile.cmake +++ b/ports/egl-registry/portfile.cmake @@ -3,8 +3,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO KhronosGroup/EGL-Registry - REF 598f20e3b7b7eec3e8d8a83e64b9592a21c55bb6 - SHA512 360aa2399fec12ad23c5e4bce7e9287a9b1b1d98ba6c326dde2b1bc1c32735bc6933ca8e5c626ba421cda5aac216bc7c268e064cf0dd67605a23151e29ba1f36 + REF aa9b63f3ab18aee92c95786a2478156430f809e4 + SHA512 5ee7143c2cb46defbe1b2ecb0fabfb52fac2d9529b98c638dd4c04a312a62e7f7b3aee27d9749c92174ab967d533136b5881ce37ae9f2bee6685f52ffa8c8db6 HEAD_REF master ) diff --git a/ports/freerdp/CONTROL b/ports/freerdp/CONTROL index 56e9b310a79f20..86dd627a0273b9 100644 --- a/ports/freerdp/CONTROL +++ b/ports/freerdp/CONTROL @@ -1,5 +1,5 @@ Source: freerdp -Version: 2.0.0-rc4-6 +Version: 2.0.0-rc4-7 Homepage: https://github.com/FreeRDP/FreeRDP Description: A free implementation of the Remote Desktop Protocol (RDP) Build-Depends: openssl, glib (!windows) diff --git a/ports/freerdp/fix-include-path.patch b/ports/freerdp/fix-include-path.patch new file mode 100644 index 00000000000000..e9efc3bd34dbec --- /dev/null +++ b/ports/freerdp/fix-include-path.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 019926901..91973c888 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -103,7 +103,7 @@ else() + endif() + message("FREERDP_VERSION=${FREERDP_VERSION_FULL}") + +-set(FREERDP_INCLUDE_DIR "include/freerdp${FREERDP_VERSION_MAJOR}/") ++set(FREERDP_INCLUDE_DIR "include/freerdp/") + + # Compatibility options + if(DEFINED STATIC_CHANNELS) +diff --git a/winpr/CMakeLists.txt b/winpr/CMakeLists.txt +index 2da25a426..b06f718e9 100644 +--- a/winpr/CMakeLists.txt ++++ b/winpr/CMakeLists.txt +@@ -193,7 +193,7 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.10") + + SetFreeRDPCMakeInstallDir(WINPR_CMAKE_INSTALL_DIR "WinPR${WINPR_VERSION_MAJOR}") + +- set(WINPR_INCLUDE_DIR "include/winpr${WINPR_VERSION_MAJOR}") ++ set(WINPR_INCLUDE_DIR "include/winpr") + + configure_package_config_file(WinPRConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/WinPRConfig.cmake + INSTALL_DESTINATION ${WINPR_CMAKE_INSTALL_DIR} diff --git a/ports/freerdp/portfile.cmake b/ports/freerdp/portfile.cmake index b424441bac0543..0d15187c957c7f 100644 --- a/ports/freerdp/portfile.cmake +++ b/ports/freerdp/portfile.cmake @@ -9,6 +9,7 @@ vcpkg_from_github( fix-linux-build.patch openssl_threads.patch fix-include-install-path.patch + fix-include-path.patch ) if (NOT VCPKG_TARGET_IS_WINDOWS) @@ -60,7 +61,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") else() file(GLOB_RECURSE FREERDP_TOOLS "${CURRENT_PACKAGES_DIR}/bin/*") foreach(FREERDP_TOOL ${FREERDP_TOOLS}) - file(COPY ${FREERDP_TOOL} DESTINATION ${CURRENT_PACKAGES_DIR}/tools) + file(COPY ${FREERDP_TOOL} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(REMOVE ${FREERDP_TOOL}) endforeach() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) @@ -93,6 +94,22 @@ vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/WinPR/WinPRTargets-release.cm "lib/winpr-tools2${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" "bin/winpr-tools2${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" ) +vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/FreeRDP/FreeRDPTargets-debug.cmake + "debug/lib/freerdp2${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" + "debug/bin/freerdp2${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" +) +vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/FreeRDP/FreeRDPTargets-release.cmake + "lib/freerdp2${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" + "bin/freerdp2${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" +) +vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/FreeRDP-Client/FreeRDP-ClientTargets-debug.cmake + "debug/lib/freerdp-client2${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" + "debug/bin/freerdp-client2${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" +) +vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/FreeRDP-Client/FreeRDP-ClientTargets-release.cmake + "lib/freerdp-client2${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" + "bin/freerdp-client2${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}" +) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share diff --git a/ports/fribidi/CONTROL b/ports/fribidi/CONTROL index 771c4716efbb3f..6db23d6f996668 100644 --- a/ports/fribidi/CONTROL +++ b/ports/fribidi/CONTROL @@ -1,4 +1,4 @@ Source: fribidi -Version: 2019-02-04-2 +Version: 2019-02-04-3 Description: GNU FriBidi is an implementation of the Unicode Bidirectional Algorithm (bidi) Build-Depends: tool-meson diff --git a/ports/fribidi/portfile.cmake b/ports/fribidi/portfile.cmake index 843964500fe19a..79edb65c40f5a2 100644 --- a/ports/fribidi/portfile.cmake +++ b/ports/fribidi/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO fribidi/fribidi @@ -32,4 +30,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) endif() # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/fribidi RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/function2/CONTROL b/ports/function2/CONTROL index 9604e808457aa8..e230af308232bf 100644 --- a/ports/function2/CONTROL +++ b/ports/function2/CONTROL @@ -1,4 +1,4 @@ Source: function2 -Version: 4.0.0 +Version: 4.1.0 Homepage: https://github.com/Naios/function2 Description: Improved drop-in replacement to std::function diff --git a/ports/function2/portfile.cmake b/ports/function2/portfile.cmake index b57c722f8ed778..54d313ad1e29da 100644 --- a/ports/function2/portfile.cmake +++ b/ports/function2/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Naios/function2 - REF d2acdb6c3c7612a6133cd03464ef941161258f4e - SHA512 298f39db3c4e7a599e41fef71d1f953f3c5e20bc9f4af378c67bd47c10b126efd7be80be4ad919370a1151c8c5bc111ccd9054757a1aaf1ccf3f87ca958a7e3a + REF 3a0746bf5f601dfed05330aefcb6854354fce07d # 4.1.0 + SHA512 48dd8fb1ce47df0835c03edf78ae427beebfeeaaabf6b993eb02843f72cce796ba5d1042f505990f29debd42bc834e531335484d45ca33e841657e9ff9e5034f HEAD_REF master PATCHES disable-testing.patch diff --git a/ports/glad/CONTROL b/ports/glad/CONTROL index dc556e13d55255..a0d234f36587cd 100644 --- a/ports/glad/CONTROL +++ b/ports/glad/CONTROL @@ -1,5 +1,5 @@ Source: glad -Version: 0.1.33 +Version: 0.1.33-1 Description: Multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs. Build-Depends: egl-registry, opengl-registry Homepage: https://github.com/Dav1dde/glad diff --git a/ports/glad/encoding.patch b/ports/glad/encoding.patch new file mode 100644 index 00000000000000..0497cc79ae2153 --- /dev/null +++ b/ports/glad/encoding.patch @@ -0,0 +1,13 @@ +diff --git a/glad/__main__.py b/glad/__main__.py +index e7c0544a5..1e10dcc60 100644 +--- a/glad/__main__.py ++++ b/glad/__main__.py +@@ -32,7 +32,7 @@ def main(): + if reproducible: + logger.info('reproducible build, using packaged specification: \'%s.xml\'', value) + try: +- return spec_cls.from_file(glad.files.open_local(value + '.xml')) ++ return spec_cls.from_file(glad.files.open_local(value + '.xml', encoding='utf-8-sig')) + except IOError: + raise ValueError('unable to open reproducible copy of {}.xml, ' + 'try dropping --reproducible'.format(value)) diff --git a/ports/glad/portfile.cmake b/ports/glad/portfile.cmake index 9f08fe660043e8..1c14ca77fbfd0c 100644 --- a/ports/glad/portfile.cmake +++ b/ports/glad/portfile.cmake @@ -6,6 +6,7 @@ vcpkg_from_github( REF de6c39e3040c987323b8ed078c36442f4fb681b3 SHA512 a24523186d59de5c0895791c639c62573eaacf1d3843d3bf81eba848b4a33a9a8d17f9b6f791202dac77692bf147e25b3650989731d5ddb7a22e7d023b66885e HEAD_REF master + PATCHES encoding.patch ) vcpkg_find_acquire_program(PYTHON3) diff --git a/ports/google-cloud-cpp-common/CONTROL b/ports/google-cloud-cpp-common/CONTROL index f3df2b43d0af7b..6408941b2e43fe 100644 --- a/ports/google-cloud-cpp-common/CONTROL +++ b/ports/google-cloud-cpp-common/CONTROL @@ -1,5 +1,5 @@ Source: google-cloud-cpp-common -Version: 0.21.0 +Version: 0.25.0 Build-Depends: grpc, googleapis Description: Base C++ Libraries for Google Cloud Platform APIs Homepage: https://github.com/googleapis/google-cloud-cpp-common diff --git a/ports/google-cloud-cpp-common/portfile.cmake b/ports/google-cloud-cpp-common/portfile.cmake index 731e298e824ee3..e4ba4fa7261604 100644 --- a/ports/google-cloud-cpp-common/portfile.cmake +++ b/ports/google-cloud-cpp-common/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO googleapis/google-cloud-cpp-common - REF v0.21.0 - SHA512 a339c6f57ac539f1c45f2fb92311e5d48e29a4406a1e0cfda2f1dc18e8c6db345588ad0bebd2c23531e572982d4429ee73b4f0c3df1ba8028d4100d9b12ecaa1 + REF v0.25.0 + SHA512 074294e8b824d7f2b9d6d4051f4fbb28ca83166aad98ff000348abb238488b1c957726d901dae041bf50aa23ab368da5cf1d23ad42454f9ad07153976c0a29fe HEAD_REF master) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/google-cloud-cpp-spanner/CONTROL b/ports/google-cloud-cpp-spanner/CONTROL index 952e68aeaa6914..82d7ea0a63858d 100644 --- a/ports/google-cloud-cpp-spanner/CONTROL +++ b/ports/google-cloud-cpp-spanner/CONTROL @@ -1,5 +1,5 @@ Source: google-cloud-cpp-spanner -Version: 0.9.0 +Version: 1.1.0 Build-Depends: grpc, googleapis, google-cloud-cpp-common Description: C++ Client Library for Google Cloud Spanner. Homepage: https://github.com/googleapis/google-cloud-cpp-spanner diff --git a/ports/google-cloud-cpp-spanner/portfile.cmake b/ports/google-cloud-cpp-spanner/portfile.cmake index 8cb9aca40ea2d5..ffbae18dfc7490 100644 --- a/ports/google-cloud-cpp-spanner/portfile.cmake +++ b/ports/google-cloud-cpp-spanner/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO googleapis/google-cloud-cpp-spanner - REF v0.9.0 - SHA512 2a53489c266d85ef9f03d747c088edd4401db1d01ba6c79862c9ccedaee39993941772e59ed5d697b61d05438e0c89c512e50def59fd0ef4fb0359c6bdff7324 + REF v1.1.0 + SHA512 00141418a01ff55cf2228e3f59a49e49bc35e28da958a7817964976196bb6019e5f04e2d9ceacc758d649c8cc91d35df14aec23f9e8fa4044cfaa67115dc6e69 HEAD_REF master ) diff --git a/ports/google-cloud-cpp/CONTROL b/ports/google-cloud-cpp/CONTROL index 2075c8942c330b..ba320d8f2e6858 100644 --- a/ports/google-cloud-cpp/CONTROL +++ b/ports/google-cloud-cpp/CONTROL @@ -1,5 +1,5 @@ Source: google-cloud-cpp -Version: 0.20.0 +Version: 0.21.0 Build-Depends: grpc, curl[ssl], crc32c, googleapis, google-cloud-cpp-common Description: C++ Client Libraries for Google Cloud Platform APIs. Homepage: https://github.com/googleapis/google-cloud-cpp diff --git a/ports/google-cloud-cpp/portfile.cmake b/ports/google-cloud-cpp/portfile.cmake index addfaf1960182e..0bb7ef74237c34 100644 --- a/ports/google-cloud-cpp/portfile.cmake +++ b/ports/google-cloud-cpp/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO googleapis/google-cloud-cpp - REF v0.20.0 - SHA512 6e760f56186ee4bf2fca0e8e4e031e8a508a1e820a470513912e8e0bbcd7855cc1d7834f855a7d5b040492241d6cae1e27117d1de46fb3167c962d700c905be2 + REF v0.21.0 + SHA512 744c7a14c31966df1f1383ad5804428807babf53079ed96514367f145eb38b4b90be3e0f9c6f16deb9269c754fd5a44e898e5afb77f6f749ba968605d79b8397 HEAD_REF master PATCHES 0001-fix-x86-build.patch diff --git a/ports/googleapis/CONTROL b/ports/googleapis/CONTROL index 4be6ae9a2eb44a..12617fc36d9a3f 100644 --- a/ports/googleapis/CONTROL +++ b/ports/googleapis/CONTROL @@ -1,5 +1,5 @@ Source: googleapis -Version: 0.6.0 +Version: 0.7.0 Build-Depends: grpc, protobuf Description: C++ Proto Libraries for Google APIs. Homepage: https://github.com/googleapis/cpp-cmakefiles diff --git a/ports/googleapis/portfile.cmake b/ports/googleapis/portfile.cmake index 1ed5c32114db52..55eab05b98cdde 100644 --- a/ports/googleapis/portfile.cmake +++ b/ports/googleapis/portfile.cmake @@ -5,8 +5,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO googleapis/cpp-cmakefiles - REF v0.6.0 - SHA512 93f3b061ad9e20b31d597f48b476c1fdef09e822e556e9253318f0d387b2d6c143920658844690c7ea710be7b157e7a1473e1e2f0fdd3bf0e3e6fcb6b69a9e9d + REF v0.7.0 + SHA512 45a9c8934c82a3e8c5c91e24c9879cbe9d928f5276b1e20d1fa51fde6a7e6711212ac7d298b4f07942e3538e2b99e8101906f509697c9aad26b8fba09c292a13 HEAD_REF master ) diff --git a/ports/hunspell/CMakeLists.txt b/ports/hunspell/CMakeLists.txt index 7794d36cfbc2e6..810c894f7706c3 100644 --- a/ports/hunspell/CMakeLists.txt +++ b/ports/hunspell/CMakeLists.txt @@ -98,7 +98,7 @@ set(TESTPARSER_SRCS src/parsers/odfparser.cxx ) -if(NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND CMAKE_BUILD_TYPE STREQUAL "Release") +if(NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND CMAKE_BUILD_TYPE STREQUAL "Release" AND BUILD_TOOLS) add_executable(testparser ${TESTPARSER_SRCS}) target_link_libraries(testparser libhunspell) diff --git a/ports/hunspell/CONTROL b/ports/hunspell/CONTROL index d907a55362af52..967cc32c5c5f99 100644 --- a/ports/hunspell/CONTROL +++ b/ports/hunspell/CONTROL @@ -1,4 +1,7 @@ Source: hunspell -Version: 1.7.0 +Version: 1.7.0-1 Homepage: https://github.com/hunspell/hunspell Description: The most popular spellchecking library. + +Feature: tools +Description: Build hunspell tools diff --git a/ports/hunspell/portfile.cmake b/ports/hunspell/portfile.cmake index 67a4ff09edb7af..a1acdfb974e634 100644 --- a/ports/hunspell/portfile.cmake +++ b/ports/hunspell/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO hunspell/hunspell @@ -12,9 +10,18 @@ vcpkg_from_github( file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h.in DESTINATION ${SOURCE_PATH}) +if ("tools" IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_WINDOWS) + message(FATAL_ERROR "Feature tools is only supported on Windows platforms.") +endif() + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + tools BUILD_TOOLS +) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + OPTIONS ${FEATURE_OPTIONS} ) vcpkg_install_cmake() @@ -24,11 +31,6 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/hunspell) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/hunspell/COPYING ${CURRENT_PACKAGES_DIR}/share/hunspell/copyright) - -file(COPY ${SOURCE_PATH}/COPYING.LESSER DESTINATION ${CURRENT_PACKAGES_DIR}/share/hunspell) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/hunspell/COPYING.LESSER ${CURRENT_PACKAGES_DIR}/share/hunspell/copyright-lgpl) - -file(COPY ${SOURCE_PATH}/COPYING.MPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/hunspell) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/hunspell/COPYING.MPL ${CURRENT_PACKAGES_DIR}/share/hunspell/copyright-mpl) +file(INSTALL ${SOURCE_PATH}/COPYING.LESSER DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright-lgpl) +file(INSTALL ${SOURCE_PATH}/COPYING.MPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright-mpl) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/ixwebsocket/CONTROL b/ports/ixwebsocket/CONTROL index db9c2adc98beab..4acae5c3f0dcc6 100644 --- a/ports/ixwebsocket/CONTROL +++ b/ports/ixwebsocket/CONTROL @@ -1,5 +1,5 @@ Source: ixwebsocket -Version: 8.0.5 +Version: 9.1.9 Build-Depends: zlib Homepage: https://github.com/machinezone/IXWebSocket Description: Lightweight WebSocket Client and Server + HTTP Client and Server diff --git a/ports/ixwebsocket/portfile.cmake b/ports/ixwebsocket/portfile.cmake index de082aecebb1ed..68e523a055bea2 100644 --- a/ports/ixwebsocket/portfile.cmake +++ b/ports/ixwebsocket/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO machinezone/IXWebSocket - REF v8.0.5 - SHA512 9dcc20d9a0629b92c62a68a8bd7c8206f18dbd9e93289b0b687ec13c478ce9ad1f3563b38c399c8277b0d3812cc78ca725786ba1dedbc3445b9bdb9b689e8add + REF v9.1.9 + SHA512 f1fd731b5f6a9ce6d6d10bee22a5d9d9baaa8ea0564d6c4cd7eb91dcb88a45c49b2c7fdb75f8640a3589c1b30cee33ef5df8dcbb55920d013394d1e33ddd3c8e ) vcpkg_configure_cmake( diff --git a/ports/jsoncons/CONTROL b/ports/jsoncons/CONTROL index 8d545e9e750c86..320e9a4d7836be 100644 --- a/ports/jsoncons/CONTROL +++ b/ports/jsoncons/CONTROL @@ -1,4 +1,4 @@ Source: jsoncons -Version: 0.149.0 +Version: 0.150.0 Description: A C++, header-only library for constructing JSON and JSON-like text and binary data formats, with JSON Pointer, JSON Patch, JSONPath, CSV, MessagePack, CBOR, BSON, UBJSON Homepage: https://github.com/danielaparker/jsoncons diff --git a/ports/jsoncons/portfile.cmake b/ports/jsoncons/portfile.cmake index 95a8c6fea7a640..14f25e01da4620 100644 --- a/ports/jsoncons/portfile.cmake +++ b/ports/jsoncons/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO danielaparker/jsoncons - REF ecc3ee882b0eb4f000709037a26ef4a25e313f29 # v0.149.0 - SHA512 385a1a5221afbdc050238e844a8ecd85be164a7d13fd0d4209a99ac00df6953732d9354e05efaa58001f95193dc86165cd12a0b3ef206a582a3dc9a28495b49d + REF 36c0fa7895da3adef6eab8aec1e9c2f5720fc110 # v0.150.0 + SHA512 ef1379c40c31f3974a707edd133c1fcff544535f91680caee1f8616f04b1bb56bfdd2aedb46e89b73b34572296511557158d66ea1002a0499d68cacd23143d29 HEAD_REF master ) diff --git a/ports/libepoxy/CONTROL b/ports/libepoxy/CONTROL index f19def9433fe4e..2ff219a8fd2848 100644 --- a/ports/libepoxy/CONTROL +++ b/ports/libepoxy/CONTROL @@ -1,5 +1,5 @@ Source: libepoxy -Version: 1.5.3-2 +Version: 1.5.3-3 Homepage: https://github.com/anholt/libepoxy Description: Epoxy is a library for handling OpenGL function pointer management for you Build-Depends: tool-meson diff --git a/ports/libepoxy/portfile.cmake b/ports/libepoxy/portfile.cmake index 50f3fa55fdc484..e578dd659b9674 100644 --- a/ports/libepoxy/portfile.cmake +++ b/ports/libepoxy/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) vcpkg_from_github( @@ -72,5 +70,5 @@ endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/pkgconfig) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share/pkgconfig) -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libepoxy) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libepoxy/COPYING ${CURRENT_PACKAGES_DIR}/share/libepoxy/copyright) +file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) diff --git a/ports/libffi/CMakeLists.txt b/ports/libffi/CMakeLists.txt index cbaa70b055972f..b8b70db5da7c1e 100644 --- a/ports/libffi/CMakeLists.txt +++ b/ports/libffi/CMakeLists.txt @@ -21,13 +21,13 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "ARM") set(TARGET ARM) elseif(CMAKE_SYSTEM_NAME MATCHES "BSD" AND CMAKE_SIZEOF_VOID_P EQUAL 4) set(TARGET X86_FREEBSD) -elseif(CMAKE_SYSTEM_NAME MATCHES "Windows" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM") +elseif(CMAKE_SYSTEM_NAME MATCHES "Windows" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") set(TARGET ARM_WIN32) -elseif(CMAKE_SYSTEM_NAME MATCHES "Windows" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") +elseif(CMAKE_SYSTEM_NAME MATCHES "Windows" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") set(TARGET ARM_WIN64) -elseif(CMAKE_SYSTEM_NAME MATCHES "Windows" AND CMAKE_SIZEOF_VOID_P EQUAL 4) +elseif(CMAKE_SYSTEM_NAME MATCHES "Windows" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(TARGET X86_WIN32) -elseif(CMAKE_SYSTEM_NAME MATCHES "Windows" AND CMAKE_SIZEOF_VOID_P EQUAL 8) +elseif(CMAKE_SYSTEM_NAME MATCHES "Windows" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") set(TARGET X86_WIN64) elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 4) set(TARGET X86_DARWIN) diff --git a/ports/libffi/CONTROL b/ports/libffi/CONTROL index 50b50a7c9d6749..70e108a73c2b25 100644 --- a/ports/libffi/CONTROL +++ b/ports/libffi/CONTROL @@ -1,5 +1,4 @@ Source: libffi -Version: 3.3 +Version: 3.3-1 Homepage: https://github.com/libffi/libffi -Description: Portable, high level programming interface to various calling conventions -Supports: !arm \ No newline at end of file +Description: Portable, high level programming interface to various calling conventions \ No newline at end of file diff --git a/ports/libffi/portfile.cmake b/ports/libffi/portfile.cmake index b6549022c33b80..7209ce8d609216 100644 --- a/ports/libffi/portfile.cmake +++ b/ports/libffi/portfile.cmake @@ -23,13 +23,13 @@ vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets() if (VCPKG_LIBRARY_LINKAGE STREQUAL static) -file(READ ${CURRENT_PACKAGES_DIR}/include/ffi.h FFI_H) -string(REPLACE " *know* they are going to link with the static library. */" -" *know* they are going to link with the static library. */ + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/ffi.h + " *know* they are going to link with the static library. */" + " *know* they are going to link with the static library. */ #define FFI_BUILDING -" FFI_H "${FFI_H}") -file(WRITE ${CURRENT_PACKAGES_DIR}/include/ffi.h "${FFI_H}") +" + ) endif() -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/libpng/CONTROL b/ports/libpng/CONTROL index d03709b0080d53..173c3a0d39c652 100644 --- a/ports/libpng/CONTROL +++ b/ports/libpng/CONTROL @@ -1,5 +1,5 @@ Source: libpng -Version: 1.6.37-6 +Version: 1.6.37-7 Build-Depends: zlib Homepage: https://github.com/glennrp/libpng Description: libpng is a library implementing an interface for reading and writing PNG (Portable Network Graphics) format files. diff --git a/ports/libpng/portfile.cmake b/ports/libpng/portfile.cmake index e9a2004554799f..cc3ee459cb62f8 100644 --- a/ports/libpng/portfile.cmake +++ b/ports/libpng/portfile.cmake @@ -47,11 +47,17 @@ else() set(PNG_SHARED_LIBS OFF) endif() +set(LIBPNG_HARDWARE_OPTIMIZATIONS_OPTION ) +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL iOS) + set(LIBPNG_HARDWARE_OPTIMIZATIONS_OPTION "-DPNG_HARDWARE_OPTIMIZATIONS=OFF") +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS ${LIBPNG_APNG_OPTION} + ${LIBPNG_HARDWARE_OPTIMIZATIONS_OPTION} -DPNG_STATIC=${PNG_STATIC_LIBS} -DPNG_SHARED=${PNG_SHARED_LIBS} -DPNG_TESTS=OFF diff --git a/ports/libwebsockets/CONTROL b/ports/libwebsockets/CONTROL index 77536b9f8474be..6cb5eda15e2bbe 100644 --- a/ports/libwebsockets/CONTROL +++ b/ports/libwebsockets/CONTROL @@ -1,5 +1,6 @@ Source: libwebsockets -Version: 3.2.2-1 +Version: 4.0.1 Build-Depends: zlib, openssl, libuv Homepage: https://github.com/warmcat/libwebsockets Description: Libwebsockets is a lightweight pure C library built to use minimal CPU and memory resources, and provide fast throughput in both directions as client or server. +Supports: !(arm|uwp) \ No newline at end of file diff --git a/ports/libwebsockets/portfile.cmake b/ports/libwebsockets/portfile.cmake index a05ce4b168ece4..1b3df24d670834 100644 --- a/ports/libwebsockets/portfile.cmake +++ b/ports/libwebsockets/portfile.cmake @@ -1,8 +1,10 @@ +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp") + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO warmcat/libwebsockets - REF v3.2.2 - SHA512 be6cd57ae1d15de059c277ce56e9ccc87f7918811b40a427c96978397f2b1d446e1b5ed6ae62a6aa82c6d775871d6a15885d283d74d7887e98205ab61d206fc0 + REF 6eb39388f43f6e2a27f0efcbf8cb2391e38824e9 # v4.0.1 + SHA512 2317ab66cd642280dc5cc7c47b8efa562731cc5b4a4eda83f34b6a7b60f02df6444a818c36e84f5cf118c79d6d62a9aa2e486d18f434199abd9812e7b88941e4 HEAD_REF master PATCHES CMakeLists.patch @@ -134,10 +136,10 @@ vcpkg_configure_cmake( OPTIONS -DLWS_WITH_STATIC=${LWS_WITH_STATIC} -DLWS_WITH_SHARED=${LWS_WITH_SHARED} - -DLWS_USE_BUNDLED_ZLIB=OFF + -DLWS_WITH_BUNDLED_ZLIB=OFF -DLWS_WITHOUT_TESTAPPS=ON -DLWS_IPV6=ON - -DLWS_HTTP2=ON + -DLWS_WITH_HTTP2=ON -DLWS_WITH_HTTP_STREAM_COMPRESSION=ON # Since zlib is already a dependency -DLWS_WITH_LIBUV=ON # OPTIONS_RELEASE -DOPTIMIZE=1 @@ -164,10 +166,9 @@ file(WRITE ${CURRENT_PACKAGES_DIR}/share/libwebsockets/LibwebsocketsTargets-debu file(READ ${CURRENT_PACKAGES_DIR}/share/libwebsockets/LibwebsocketsTargets-release.cmake LIBWEBSOCKETSTARGETSRELEASE_CMAKE) string(REPLACE "websockets_static.lib" "websockets.lib" LIBWEBSOCKETSTARGETSRELEASE_CMAKE "${LIBWEBSOCKETSTARGETSRELEASE_CMAKE}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/libwebsockets/LibwebsocketsTargets-release.cmake "${LIBWEBSOCKETSTARGETSRELEASE_CMAKE}") -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libwebsockets) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/libwebsockets/LICENSE ${CURRENT_PACKAGES_DIR}/share/libwebsockets/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "windows" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + if (VCPKG_TARGET_IS_WINDOWS) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/websockets_static.lib ${CURRENT_PACKAGES_DIR}/debug/lib/websockets.lib) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/websockets_static.lib ${CURRENT_PACKAGES_DIR}/lib/websockets.lib) endif() diff --git a/ports/mpfr/CONTROL b/ports/mpfr/CONTROL index 7d2ec764322dbb..050de1d058887d 100644 --- a/ports/mpfr/CONTROL +++ b/ports/mpfr/CONTROL @@ -1,5 +1,5 @@ Source: mpfr -Version: 4.0.2-1 +Version: 4.0.2-2 Homepage: https://www.mpfr.org Description: The MPFR library is a C library for multiple-precision floating-point computations with correct rounding Build-Depends: mpir diff --git a/ports/mpfr/portfile.cmake b/ports/mpfr/portfile.cmake index 5837976dd7a969..2e202a578780fe 100644 --- a/ports/mpfr/portfile.cmake +++ b/ports/mpfr/portfile.cmake @@ -1,7 +1,5 @@ -include(vcpkg_common_functions) - vcpkg_download_distfile(ARCHIVE - URLS "http://www.mpfr.org/mpfr-4.0.2/mpfr-4.0.2.tar.xz" + URLS "http://www.mpfr.org/mpfr-4.0.2/mpfr-4.0.2.tar.xz" "https://ftp.gnu.org/gnu/mpfr/mpfr-4.0.2.tar.xz" FILENAME "mpfr-4.0.2.tar.xz" SHA512 d583555d08863bf36c89b289ae26bae353d9a31f08ee3894520992d2c26e5683c4c9c193d7ad139632f71c0a476d85ea76182702a98bf08dde7b6f65a54f8b88 ) @@ -24,5 +22,4 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpfr) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/mpfr/COPYING ${CURRENT_PACKAGES_DIR}/share/mpfr/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/nana/CONTROL b/ports/nana/CONTROL index a3d5736c32e965..5510511405de15 100644 --- a/ports/nana/CONTROL +++ b/ports/nana/CONTROL @@ -1,5 +1,5 @@ Source: nana -Version: 1.7.2 +Version: 1.7.2-1 Homepage: https://github.com/cnjinhao/nana Description: Cross-platform library for GUI programming in modern C++ style. Build-Depends: libpng, libjpeg-turbo, freetype (!uwp&&!windows), fontconfig (!uwp&&!windows) diff --git a/ports/nana/portfile.cmake b/ports/nana/portfile.cmake index af85e02d9de5fe..d038242e1ae1dd 100644 --- a/ports/nana/portfile.cmake +++ b/ports/nana/portfile.cmake @@ -1,9 +1,7 @@ -include(vcpkg_common_functions) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(WARNING "You will need to install Xorg dependencies to use nana:\napt install libx11-dev libxft-dev\n") +if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_TARGET_IS_UWP) + message(WARNING "You will need to install Xorg dependencies to use nana:\napt install libx11-dev libxft-dev libxcursor-dev\n") endif() vcpkg_from_github( @@ -34,5 +32,4 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-nana TARGET_PATH share/un vcpkg_copy_pdbs() -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/nana) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/nana/LICENSE ${CURRENT_PACKAGES_DIR}/share/nana/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/opengl-registry/CONTROL b/ports/opengl-registry/CONTROL index 3ff6c6e698bb3c..940158beda9d18 100644 --- a/ports/opengl-registry/CONTROL +++ b/ports/opengl-registry/CONTROL @@ -1,4 +1,4 @@ Source: opengl-registry -Version: 2019-08-22 +Version: 2020-02-03 Build-Depends: egl-registry Description: the API and Extension registries for the OpenGL family APIs diff --git a/ports/opengl-registry/portfile.cmake b/ports/opengl-registry/portfile.cmake index 406ca1c3f3600d..a9e3be246ec78d 100644 --- a/ports/opengl-registry/portfile.cmake +++ b/ports/opengl-registry/portfile.cmake @@ -1,14 +1,17 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO KhronosGroup/OpenGL-Registry - REF 3c9ab309994c2baeb5572aa0befd5f405166a275 - SHA512 f53018fe6dfb926dd6c1ce64ffde19b650a9071a1f6fa0c7a1596237e4ff84c3ff0092fb80811c4fea9b533c4b8607ed51f328d683d8f4aac18f0616f58b56a4 + REF 2223f5bebde4aa6b170fb32cdaaf580703fddb67 + SHA512 4e9b570f242942bd45a6601a6b0fcf1dc265c6ba03acaf782a639e7399842dd7350c2d4876236df80a070b2bd9ce7cee88cf2d85f2c50cfba7878d1f9379bbe9 HEAD_REF master ) file(COPY ${SOURCE_PATH}/api/GL DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${SOURCE_PATH}/api/GLES DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${SOURCE_PATH}/api/GLES2 DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${SOURCE_PATH}/api/GLES3 DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${SOURCE_PATH}/api/GLSC DESTINATION ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${SOURCE_PATH}/api/GLSC2 DESTINATION ${CURRENT_PACKAGES_DIR}/include) file(COPY ${SOURCE_PATH}/xml/gl.xml ${SOURCE_PATH}/xml/glx.xml diff --git a/ports/openvr/CONTROL b/ports/openvr/CONTROL index 545e0f341e1869..ada8687b5f8b82 100644 --- a/ports/openvr/CONTROL +++ b/ports/openvr/CONTROL @@ -1,4 +1,5 @@ Source: openvr -Version: 1.9.16 +Version: 1.10.30 Homepage: https://github.com/ValveSoftware/openvr Description: an API and runtime that allows access to VR hardware from multiple vendors without requiring that applications have specific knowledge of the hardware they are targeting. +Supports: !(arm|uwp|osx|android) \ No newline at end of file diff --git a/ports/openvr/portfile.cmake b/ports/openvr/portfile.cmake index e021d8eb212f35..0fb02dde1e2270 100644 --- a/ports/openvr/portfile.cmake +++ b/ports/openvr/portfile.cmake @@ -1,47 +1,41 @@ -include(vcpkg_common_functions) +vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp" "osx") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ValveSoftware/openvr - REF 39205f6b281a6131d1373d0217c1ab9ed19735ea # v1.9.16 - SHA512 f609a25aaae42e23d8c1b89e9f7d7f5e0e18e52cd3b3125044fdfa348c0f0e8b1e9c9d884a8014bb5dbc07c4d2635a9852d229ba95568b6c33f86b6afb27140f + REF 26fa19eb86ab3c589af2bdbc77449d61a8ff799b # v1.10.30 + SHA512 821e113c6a847a244cd138869b5c8192c67054e6b8d39c0764d4e88f7a839146e9d9ec1f189cd5566f8954ad07ee0c86cbf8d353806c9bceb0f0a45def1a0ca2 HEAD_REF master ) set(VCPKG_LIBRARY_LINKAGE dynamic) -if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(ARCH_PATH "win64") -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(ARCH_PATH "win32") +if(VCPKG_TARGET_IS_WINDOWS) + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(ARCH_PATH "win64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(ARCH_PATH "win32") + else() + message(FATAL_ERROR "Package only supports x64 and x86 Windows.") + endif() +elseif(VCPKG_TARGET_IS_LINUX) + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + set(ARCH_PATH "linux64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(ARCH_PATH "linux32") + else() + message(FATAL_ERROR "Package only supports x64 and x86 Linux.") + endif() else() - message(FATAL_ERROR "Package only supports x64 and x86 windows.") + message(FATAL_ERROR "Package only supports Windows and Linux.") endif() -if(VCPKG_CMAKE_SYSTEM_NAME) - message(FATAL_ERROR "Package only supports windows desktop.") -endif() +file(COPY ${SOURCE_PATH}/lib/${ARCH_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/lib) +file(COPY ${SOURCE_PATH}/lib/${ARCH_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(MAKE_DIRECTORY - ${CURRENT_PACKAGES_DIR}/lib - ${CURRENT_PACKAGES_DIR}/bin - ${CURRENT_PACKAGES_DIR}/debug/lib - ${CURRENT_PACKAGES_DIR}/debug/bin -) -file(COPY ${SOURCE_PATH}/lib/${ARCH_PATH}/openvr_api.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) -file(COPY ${SOURCE_PATH}/lib/${ARCH_PATH}/openvr_api.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -file(COPY - ${SOURCE_PATH}/bin/${ARCH_PATH}/openvr_api.dll - ${SOURCE_PATH}/bin/${ARCH_PATH}/openvr_api.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/bin -) -file(COPY - ${SOURCE_PATH}/bin/${ARCH_PATH}/openvr_api.dll - ${SOURCE_PATH}/bin/${ARCH_PATH}/openvr_api.pdb - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin -) -file(COPY ${SOURCE_PATH}/headers DESTINATION ${CURRENT_PACKAGES_DIR}) -file(RENAME ${CURRENT_PACKAGES_DIR}/headers ${CURRENT_PACKAGES_DIR}/include) +file(COPY ${SOURCE_PATH}/bin/${ARCH_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +file(COPY ${SOURCE_PATH}/bin/${ARCH_PATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + +file(INSTALL ${SOURCE_PATH}/headers DESTINATION ${CURRENT_PACKAGES_DIR} RENAME include) -file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openvr) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/openvr/LICENSE ${CURRENT_PACKAGES_DIR}/share/openvr/copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/opus/CONTROL b/ports/opus/CONTROL index c7b8d246f5ce2c..f4ed522c38d90d 100644 --- a/ports/opus/CONTROL +++ b/ports/opus/CONTROL @@ -1,4 +1,7 @@ Source: opus -Version: 1.3.1 +Version: 1.3.1-2 Homepage: https://github.com/xiph/opus Description: Totally open, royalty-free, highly versatile audio codec + +Feature: avx +Description: Builds the library with avx instruction set diff --git a/ports/opus/portfile.cmake b/ports/opus/portfile.cmake index bf23718df81d3d..a770da51f67f02 100644 --- a/ports/opus/portfile.cmake +++ b/ports/opus/portfile.cmake @@ -1,5 +1,3 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -12,7 +10,14 @@ vcpkg_from_github( HEAD_REF master) -vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + avx AVX_SUPPORTED +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS ${FEATURE_OPTIONS} + PREFER_NINJA) vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Opus) vcpkg_copy_pdbs() diff --git a/ports/osg-qt/CONTROL b/ports/osg-qt/CONTROL index acc5db392e9e8e..5d9506f19caa65 100644 --- a/ports/osg-qt/CONTROL +++ b/ports/osg-qt/CONTROL @@ -1,4 +1,4 @@ Source: osg-qt -Version: Qt4 -Description: osgQt - Qt project for making use of OpenSceneGraph(OSG) +Version: Qt4-1 +Description: osgQt - Qt project for making use of OpenSceneGraph(OSG) Build-Depends: osg, protobuf, qt5-base \ No newline at end of file diff --git a/ports/osg-qt/portfile.cmake b/ports/osg-qt/portfile.cmake index f78dbf37fc9b56..b97405db432194 100644 --- a/ports/osg-qt/portfile.cmake +++ b/ports/osg-qt/portfile.cmake @@ -1,4 +1,3 @@ -include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -6,10 +5,14 @@ vcpkg_from_github( REF Qt4 SHA512 426a4ba88f680978d24817248b99c68cafa4517144e6e3d2480612870c4a224bb955539cacb438274d4ee1c93c36d94f8437d142070b2ecde2b81517bf357e71 HEAD_REF master - PATCHES + PATCHES OsgMacroUtils.patch ) +if(VCPKG_TARGET_IS_OSX) + string(APPEND VCPKG_CXX_FLAGS " -stdlib=libc++") + string(APPEND VCPKG_C_FLAGS "") # both must be set +endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -22,5 +25,5 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle License -file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/osg-qt) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/osg-qt/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/osg-qt/copyright) \ No newline at end of file +file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) \ No newline at end of file diff --git a/ports/pango/CONTROL b/ports/pango/CONTROL index 98c09ee3fb2396..72b2aaa1070830 100644 --- a/ports/pango/CONTROL +++ b/ports/pango/CONTROL @@ -2,4 +2,4 @@ Source: pango Version: 1.40.11-6 Homepage: https://ftp.gnome.org/pub/GNOME/sources/pango/ Description: Text and font handling library. -Build-Depends: glib, gettext, cairo, fontconfig, freetype, harfbuzz[glib] (!(windows&static)) +Build-Depends: glib, gettext, cairo, fontconfig, freetype, harfbuzz[glib] (!(windows&static)&!osx) diff --git a/ports/pcre2/CONTROL b/ports/pcre2/CONTROL index be71b866edda0e..044bb81d36c138 100644 --- a/ports/pcre2/CONTROL +++ b/ports/pcre2/CONTROL @@ -1,4 +1,4 @@ Source: pcre2 -Version: 10.30-6 +Version: 10.30-7 Homepage: https://pcre.org/ Description: PCRE2 is a re-working of the original Perl Compatible Regular Expressions library diff --git a/ports/pcre2/portfile.cmake b/ports/pcre2/portfile.cmake index 199f72a5955069..9057ede478e4bd 100644 --- a/ports/pcre2/portfile.cmake +++ b/ports/pcre2/portfile.cmake @@ -14,7 +14,7 @@ vcpkg_extract_source_archive_ex( fix-uwp.patch ) -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Emscripten") +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "iOS") set(JIT OFF) else() set(JIT ON) diff --git a/ports/qt5-base/CONTROL b/ports/qt5-base/CONTROL index c3159094a21d18..9109ea40cf48bb 100644 --- a/ports/qt5-base/CONTROL +++ b/ports/qt5-base/CONTROL @@ -1,5 +1,5 @@ Source: qt5-base -Version: 5.12.5-11 +Version: 5.12.5-13 Homepage: https://www.qt.io/ Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components. Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl, angle (!windows), egl-registry, icu (!uwp), fontconfig (!windows) diff --git a/ports/qt5-base/cmake/qt_build_submodule.cmake b/ports/qt5-base/cmake/qt_build_submodule.cmake index 78249f58ac07cf..18925adc1fcdad 100644 --- a/ports/qt5-base/cmake/qt_build_submodule.cmake +++ b/ports/qt5-base/cmake/qt_build_submodule.cmake @@ -78,6 +78,25 @@ function(qt_build_submodule SOURCE_PATH) endforeach() if(EXISTS "${CURRENT_PACKAGES_DIR}/tools/qt5/bin") file(COPY "${CURRENT_PACKAGES_DIR}/tools/qt5/bin" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}") + + set(CURRENT_INSTALLED_DIR_BACKUP "${CURRENT_INSTALLED_DIR}") + set(CURRENT_INSTALLED_DIR "./../../.." ) # Making the qt.conf relative and not absolute + configure_file(${CURRENT_INSTALLED_DIR_BACKUP}/tools/qt5/qt_release.conf ${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/qt.conf) # This makes the tools at least useable for release + set(CURRENT_INSTALLED_DIR "${CURRENT_INSTALLED_DIR_BACKUP}") + vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin") + if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + file(GLOB_RECURSE DLL_DEPS_AVAIL "${CURRENT_INSTALLED_DIR}/tools/qt5/bin/*.dll") + string(REPLACE "${CURRENT_INSTALLED_DIR}/tools/qt5/bin/" "" DLL_DEPS_AVAIL "${DLL_DEPS_AVAIL}") + file(GLOB_RECURSE DLL_DEPS_NEEDED "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/*.dll") + string(REPLACE "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/" "" DLL_DEPS_NEEDED "${DLL_DEPS_NEEDED}") + if(DLL_DEPS_AVAIL AND DLL_DEPS_NEEDED) + list(REMOVE_ITEM DLL_DEPS_NEEDED ${DLL_DEPS_AVAIL}) + endif() + foreach(dll_dep ${DLL_DEPS_NEEDED}) + string(REGEX REPLACE "[^/]+$" "" dll_subpath "${dll_dep}") + file(COPY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/${dll_dep}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/qt5/bin/${dll_subpath}") + endforeach() + endif() endif() endfunction() \ No newline at end of file diff --git a/ports/qt5-base/cmake/qt_fix_cmake.cmake b/ports/qt5-base/cmake/qt_fix_cmake.cmake index f435566c659e05..1b6522716e2da6 100644 --- a/ports/qt5-base/cmake/qt_fix_cmake.cmake +++ b/ports/qt5-base/cmake/qt_fix_cmake.cmake @@ -1,25 +1,14 @@ function(qt_fix_cmake PACKAGE_DIR_TO_FIX PORT_TO_FIX) - set(BACKUP_PATH "$ENV{PATH}") - #Find Python and add it to the path - vcpkg_find_acquire_program(PYTHON2) - get_filename_component(PYTHON2_EXE_PATH ${PYTHON2} DIRECTORY) - vcpkg_add_to_path("${PYTHON2_EXE_PATH}") - #Fix the cmake files if they exist - if(EXISTS ${PACKAGE_DIR_TO_FIX}/lib/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON2} ${CURRENT_INSTALLED_DIR}/share/qt5/fixcmake.py ${PORT_TO_FIX} - WORKING_DIRECTORY ${PACKAGE_DIR_TO_FIX}/lib/cmake - LOGNAME fix-cmake - ) - endif() - if(EXISTS ${PACKAGE_DIR_TO_FIX}/share/cmake) - vcpkg_execute_required_process( - COMMAND ${PYTHON2} ${CURRENT_INSTALLED_DIR}/share/qt5/fixcmake.py ${PORT_TO_FIX} - WORKING_DIRECTORY ${PACKAGE_DIR_TO_FIX}/share/cmake - LOGNAME fix-cmake - ) - endif() + file(GLOB_RECURSE cmakefiles ${PACKAGE_DIR_TO_FIX}/share/cmake/*.cmake ${PACKAGE_DIR_TO_FIX}/lib/cmake/*.cmake) + foreach(cmakefile ${cmakefiles}) + file(READ "${cmakefile}" _contents) + if(_contents MATCHES "_install_prefix}/tools/qt5/bin/([a-z0-9]+)") # there are only about 3 to 5 cmake files which require the fix in ports: qt5-tools qt5-xmlpattern at5-activeqt qt5-quick + string(REGEX REPLACE "_install_prefix}/tools/qt5/bin/([a-z0-9]+)" "_install_prefix}/tools/${PORT_TO_FIX}/bin/\\1" _contents "${_contents}") + file(WRITE "${cmakefile}" "${_contents}") + endif() + endforeach() + #Install cmake files if(EXISTS ${PACKAGE_DIR_TO_FIX}/lib/cmake) file(MAKE_DIRECTORY ${PACKAGE_DIR_TO_FIX}/share) @@ -29,5 +18,4 @@ function(qt_fix_cmake PACKAGE_DIR_TO_FIX PORT_TO_FIX) if(EXISTS ${PACKAGE_DIR_TO_FIX}/debug/lib/cmake) file(REMOVE_RECURSE ${PACKAGE_DIR_TO_FIX}/debug/lib/cmake) endif() - set(ENV{PATH} "${BACKUP_PATH}") endfunction() \ No newline at end of file diff --git a/ports/qt5-base/cmake/qt_fix_prl.cmake b/ports/qt5-base/cmake/qt_fix_prl.cmake index 214f7cdb464127..7035534d8854a9 100644 --- a/ports/qt5-base/cmake/qt_fix_prl.cmake +++ b/ports/qt5-base/cmake/qt_fix_prl.cmake @@ -1,10 +1,13 @@ function(qt_fix_prl PACKAGE_DIR PRL_FILES) file(TO_CMAKE_PATH "${PACKAGE_DIR}/lib" CMAKE_LIB_PATH) file(TO_CMAKE_PATH "${PACKAGE_DIR}/include" CMAKE_INCLUDE_PATH) + file(TO_CMAKE_PATH "${CURRENT_INSTALLED_DIR}" CMAKE_INSTALLED_PREFIX) foreach(PRL_FILE IN LISTS PRL_FILES) file(READ "${PRL_FILE}" _contents) string(REPLACE "${CMAKE_LIB_PATH}" "\$\$[QT_INSTALL_LIBS]" _contents "${_contents}") string(REPLACE "${CMAKE_INCLUDE_PATH}" "\$\$[QT_INSTALL_HEADERS]" _contents "${_contents}") - file(WRITE "${PRL_FILE}" "${_contents}") + string(REPLACE "${CMAKE_INSTALLED_PREFIX}" "\$\$[QT_INSTALL_PREFIX]" _contents "${_contents}") + #Note: This only works without an extra if case since QT_INSTALL_PREFIX is the same for debug and release + file(WRITE "${PRL_FILE}" "${_contents}") endforeach() endfunction() \ No newline at end of file diff --git a/ports/qt5-base/fixcmake.py b/ports/qt5-base/fixcmake.py deleted file mode 100644 index 6f677327c1ca4d..00000000000000 --- a/ports/qt5-base/fixcmake.py +++ /dev/null @@ -1,88 +0,0 @@ -import os -import re -import sys -from glob import glob - -port="qt5" -if len(sys.argv) > 1: - port=sys.argv[1] - -files = [y for x in os.walk('.') for y in glob(os.path.join(x[0], '*.cmake'))] -tooldir="/tools/"+port+"/bin/" - -for f in files: - openedfile = open(f, "r") - builder = "" - dllpatterndebug = re.compile("_install_prefix}/bin/Qt5.*d+(.dll|.so)") - libpatterndebug = re.compile("_install_prefix}/lib/Qt5.*d+(.lib|.a)") - exepattern = re.compile("_install_prefix}/bin/[a-z]+(.exe|)") - toolexepattern = re.compile("_install_prefix}/tools/qt5/bin/[a-z]+(.exe|)") - tooldllpattern = re.compile("_install_prefix}/tools/qt5/bin/Qt5.*d+(.dll|.so)") - populatepluginpattern = re.compile("_populate_[^_]+_plugin_properties\([^ ]+ RELEASE") - populatetargetpattern = re.compile("_populate_[^_]+_target_properties\(RELEASE ") - for line in openedfile: - if "_install_prefix}/tools/qt5/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line.replace("/tools/qt5/bin", "/bin/") - builder += " else()" #This requires a release and debug build since Qt will check that the file exists! - #It would be better to use an elseif here with a EXISTS check but that requires a more complicated regex to build the complete filepath since each module uses its own _(qtmodule)_install_prefix - #so single configuration builds of Qt are currently not supported. Thus => - #TODO: Make single configuration builds of Qt work correctly! - builder += "\n " + line.replace("/tools/qt5/debug/bin", "/debug/bin/") - builder += " endif()\n" - elif "_install_prefix}/bin/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line - builder += " else()" #This requires a release and debug build! - builder += "\n " + line.replace("/bin/", "/debug/bin/") - builder += " endif()\n" - elif "_install_prefix}/lib/${LIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line - builder += " else()" #This requires a release and debug build! - builder += "\n " + line.replace("/lib/", "/debug/lib/") - builder += " endif()\n" - elif "_install_prefix}/lib/${IMPLIB_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line - builder += " else()" #This requires a release and debug build! - builder += "\n " + line.replace("/lib/", "/debug/lib/") - builder += " endif()\n" - elif "_install_prefix}/plugins/${PLUGIN_LOCATION}" in line: - builder += " if (${Configuration} STREQUAL \"RELEASE\")" - builder += "\n " + line - builder += " else()" #This requires a release and debug build! - builder += "\n " + line.replace("/plugins/", "/debug/plugins/") - builder += " endif()\n" - elif "_install_prefix}/lib/qtmaind.lib" in line: - # qtmaind.lib has been moved to manual-link: - builder += line.replace("/lib/", "/debug/lib/manual-link/") - elif "_install_prefix}/lib/qtmain.lib" in line: - # qtmain(d).lib has been moved to manual-link: - builder += line.replace("/lib/", "/lib/manual-link/") - builder += " set(imported_location_debug \"${_qt5Core_install_prefix}/debug/lib/manual-link/qtmaind.lib\")\n" - builder += "\n" - builder += " set_target_properties(Qt5::WinMain PROPERTIES\n" - builder += " IMPORTED_LOCATION_DEBUG ${imported_location_debug}\n" - builder += " )\n" - elif populatepluginpattern.search(line) != None: - builder += line - builder += line.replace("RELEASE", "DEBUG").replace(".dll", "d.dll").replace(".lib", "d.lib") - elif populatetargetpattern.search(line) != None: - builder += line - builder += line.replace("RELEASE", "DEBUG").replace(".dll", "d.dll").replace(".lib", "d.lib") - elif dllpatterndebug.search(line) != None: - builder += line.replace("/bin/", "/debug/bin/") - elif libpatterndebug.search(line) != None: - builder += line.replace("/lib/", "/debug/lib/") - elif tooldllpattern.search(line) != None: - builder += line.replace("/tools/qt5/bin", "/debug/bin/") - elif exepattern.search(line) != None: - builder += line.replace("/bin/", tooldir) - elif toolexepattern.search(line) != None: - builder += line.replace("/tools/qt5/bin/",tooldir) - else: - builder += line - new_file = open(f, "w") - new_file.write(builder) - new_file.close() diff --git a/ports/qt5-base/patches/Qt5BasicConfig.patch b/ports/qt5-base/patches/Qt5BasicConfig.patch new file mode 100644 index 00000000000000..d113fb6695bee1 --- /dev/null +++ b/ports/qt5-base/patches/Qt5BasicConfig.patch @@ -0,0 +1,78 @@ +diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +index c72989288..a88234dca 100644 +--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in ++++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +@@ -53,7 +53,11 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI + set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) + + !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) +- set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") ++ if(\"${Configuration}\" STREQUAL \"DEBUG\") ++ set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") ++ else() ++ set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") ++ endif() + !!ELSE + set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\") + !!ENDIF +@@ -69,8 +73,12 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI + ) + + !!IF !isEmpty(CMAKE_WINDOWS_BUILD) + !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) +- set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") ++ if(\"${Configuration}\" STREQUAL \"DEBUG\") ++ set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") ++ else() ++ set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") ++ endif() + !!ELSE + set(imported_implib \"IMPORTED_IMPLIB_${Configuration}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") + !!ENDIF +@@ -270,9 +278,8 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) + !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD + + !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD) +-!!IF isEmpty(CMAKE_DEBUG_TYPE) + !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) + !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) +- if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) ++ if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) + !!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE + if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) +@@ -281,20 +288,19 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) + !!ELSE // CMAKE_STATIC_WINDOWS_BUILD + if (EXISTS + !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) +- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" ++ \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" + !!ELSE + \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" + !!ENDIF + AND EXISTS + !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) +- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) ++ \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) + !!ELSE + \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) + !!ENDIF + _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) + !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD + endif() +-!!ENDIF // CMAKE_DEBUG_TYPE + !!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD + + !!ENDIF // CMAKE_RELEASE_TYPE +@@ -347,7 +353,12 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) + set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) + + !!IF isEmpty(CMAKE_PLUGIN_DIR_IS_ABSOLUTE) ++ if(\"${Configuration}\" STREQUAL \"DEBUG\") ++ set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\") ++ else() + set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\") ++ endif() ++ + !!ELSE + set(imported_location \"$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\") + !!ENDIF diff --git a/ports/qt5-base/patches/Qt5GuiConfigExtras.patch b/ports/qt5-base/patches/Qt5GuiConfigExtras.patch new file mode 100644 index 00000000000000..0029f2aa5d6fc2 --- /dev/null +++ b/ports/qt5-base/patches/Qt5GuiConfigExtras.patch @@ -0,0 +1,13 @@ +diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in +index 84dbbfebd..accb86e3f 100644 +--- a/src/gui/Qt5GuiConfigExtras.cmake.in ++++ b/src/gui/Qt5GuiConfigExtras.cmake.in +@@ -148,6 +153,8 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) + !!ENDIF + unset(Qt5Gui_${_cmake_lib_name}_LIBRARY CACHE) + ++ find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG ${_lib}d ${_lib} NAMES_PER_DIR ++ PATHS \"${_qt5Gui_install_prefix}/debug/lib\" NO_DEFAULT_PATH) + find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG ${_lib}d + PATHS \"${LibDir}\" + !!IF !mac diff --git a/ports/qt5-base/patches/Qt5PluginTarget.patch b/ports/qt5-base/patches/Qt5PluginTarget.patch new file mode 100644 index 00000000000000..0ae0a03c0aa76a --- /dev/null +++ b/ports/qt5-base/patches/Qt5PluginTarget.patch @@ -0,0 +1,22 @@ +diff --git a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in +index 5baf0fdb1..185abfffd 100644 +--- a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in ++++ b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in +@@ -1,11 +1,11 @@ + + add_library(Qt5::$$CMAKE_PLUGIN_NAME MODULE IMPORTED) + +-!!IF !isEmpty(CMAKE_RELEASE_TYPE) +-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\") +-!!ENDIF +-!!IF !isEmpty(CMAKE_DEBUG_TYPE) +-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\") +-!!ENDIF ++if(EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}$${CMAKE_PLUGIN_LOCATION_RELEASE}\") ++ _populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\") ++endif() ++if(EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_PLUGIN_DIR}$${CMAKE_PLUGIN_LOCATION_DEBUG}\") ++ _populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\") ++endif() + + list(APPEND Qt5$${CMAKE_MODULE_NAME}_PLUGINS Qt5::$$CMAKE_PLUGIN_NAME) diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index 7a1f35ef8513e6..8cb27084a6a3f4 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -42,6 +42,10 @@ qt_download_submodule( OUT_SOURCE_PATH SOURCE_PATH #patches/static_opengl.patch #Use this patch if you really want to statically link angle on windows (e.g. using -opengl es2 and -static). #Be carefull since it requires definining _GDI32_ for all dependent projects due to redefinition errors in the #the windows supplied gl.h header and the angle gl.h otherwise. + #CMake fixes + patches/Qt5BasicConfig.patch + patches/Qt5PluginTarget.patch + patches/Qt5GuiConfigExtras.patch # Patches the library search behavior for EGL since angle is not build with Qt ) # Remove vendored dependencies to ensure they are not picked up by the build @@ -61,7 +65,6 @@ set(ENV{_CL_} "/utf-8") set(CORE_OPTIONS -confirm-license -opensource - #-no-fontconfig #-simulator_and_device #-ltcg #-combined-angle-lib @@ -235,14 +238,14 @@ elseif(VCPKG_TARGET_IS_OSX) "SQLITE_LIBS=${SQLITE_RELEASE} -ldl -lpthread" "HARFBUZZ_LIBS=${HARFBUZZ_RELEASE} -framework ApplicationServices" "OPENSSL_LIBS=${SSL_RELEASE} ${EAY_RELEASE} -ldl -lpthread" - "FONTCONFIG_LIBS=${FONTCONFIG_RELEASE} ${FREETYPE_RELEASE} ${EXPAT_RELEASE}" + "FONTCONFIG_LIBS=${FONTCONFIG_RELEASE} ${FREETYPE_RELEASE} ${EXPAT_RELEASE} -liconv" ) list(APPEND DEBUG_OPTIONS "PSQL_LIBS=${PSQL_DEBUG} ${SSL_DEBUG} ${EAY_DEBUG} -ldl -lpthread" "SQLITE_LIBS=${SQLITE_DEBUG} -ldl -lpthread" "HARFBUZZ_LIBS=${HARFBUZZ_DEBUG} -framework ApplicationServices" "OPENSSL_LIBS=${SSL_DEBUG} ${EAY_DEBUG} -ldl -lpthread" - "FONTCONFIG_LIBS=${FONTCONFIG_DEBUG} ${FREETYPE_DEBUG} ${EXPAT_DEBUG}" + "FONTCONFIG_LIBS=${FONTCONFIG_DEBUG} ${FREETYPE_DEBUG} ${EXPAT_DEBUG} -liconv" ) endif() @@ -286,7 +289,7 @@ else() file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) # TODO: check if important debug information for cmake is lost - #This needs a new VCPKG policy. + #This needs a new VCPKG policy or a static angle build (ANGLE needs to be fixed in VCPKG!) if(VCPKG_TARGET_IS_WINDOWS AND ${VCPKG_LIBRARY_LINKAGE} MATCHES "static") # Move angle dll libraries message(STATUS "Moving ANGLE dlls from /bin to /tools/qt5-angle/bin. In static builds dlls are not allowed in /bin") if(EXISTS "${CURRENT_PACKAGES_DIR}/bin") @@ -299,12 +302,28 @@ else() endif() endif() - #TODO: Replace python script with cmake script - vcpkg_execute_required_process( - COMMAND ${PYTHON3} ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py - WORKING_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/cmake - LOGNAME fix-cmake - ) + ## Fix location of qtmain(d).lib. Has been moved into manual-link. Add debug version + if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_BUILD_TYPE) + set(cmakefile "${CURRENT_PACKAGES_DIR}/share/cmake/Qt5Core/Qt5CoreConfigExtras.cmake") + file(READ "${cmakefile}" _contents) + string(REPLACE "set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)" "set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG)" _contents "${_contents}") + string(REPLACE + [[set(imported_location "${_qt5Core_install_prefix}/lib/qtmain.lib")]] + [[set(imported_location_release "${_qt5Core_install_prefix}/lib/manual-link/qtmain.lib") + set(imported_location_debug "${_qt5Core_install_prefix}/debug/lib/manual-link/qtmaind.lib")]] + _contents "${_contents}") + string(REPLACE +[[ set_target_properties(Qt5::WinMain PROPERTIES + IMPORTED_LOCATION_RELEASE ${imported_location} + )]] +[[ set_target_properties(Qt5::WinMain PROPERTIES + IMPORTED_LOCATION_RELEASE ${imported_location_release} + IMPORTED_LOCATION_DEBUG ${imported_location_debug} + )]] + _contents "${_contents}") + file(WRITE "${cmakefile}" "${_contents}") + endif() + file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5core) if(EXISTS ${CURRENT_PACKAGES_DIR}/tools/qt5/bin) file(COPY ${CURRENT_PACKAGES_DIR}/tools/qt5/bin DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}) @@ -315,12 +334,15 @@ else() if(EXISTS ${CURRENT_PACKAGES_DIR}/tools/qt5/bin/qt.conf) file(REMOVE "${CURRENT_PACKAGES_DIR}/tools/qt5/bin/qt.conf") endif() - + set(CURRENT_INSTALLED_DIR_BACKUP "${CURRENT_INSTALLED_DIR}") + set(CURRENT_INSTALLED_DIR "./../../.." ) # Making the qt.conf relative and not absolute + configure_file(${CURRENT_PACKAGES_DIR}/tools/qt5/qt_release.conf ${CURRENT_PACKAGES_DIR}/tools/qt5/bin/qt.conf) # This makes the tools at least useable for release + set(CURRENT_INSTALLED_DIR "${CURRENT_INSTALLED_DIR_BACKUP}") + qt_install_copyright(${SOURCE_PATH}) endif() #install scripts for other qt ports file(COPY - ${CMAKE_CURRENT_LIST_DIR}/fixcmake.py ${CMAKE_CURRENT_LIST_DIR}/cmake/qt_port_hashes.cmake ${CMAKE_CURRENT_LIST_DIR}/cmake/qt_port_functions.cmake ${CMAKE_CURRENT_LIST_DIR}/cmake/qt_fix_makefile_install.cmake @@ -334,6 +356,14 @@ file(COPY ${CURRENT_PACKAGES_DIR}/share/qt5 ) +# Fix Qt5GuiConfigExtras EGL path +if(VCPKG_TARGET_IS_LINUX) + set(_file "${CURRENT_PACKAGES_DIR}/share/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake") + file(READ "${_file}" _contents) + string(REGEX REPLACE "_qt5gui_find_extra_libs\\\(EGL[^\\\n]+" "_qt5gui_find_extra_libs(EGL \"EGL\" \"\" \"\${_qt5Gui_install_prefix}/include\")\n" _contents "${_contents}") + file(WRITE "${_file}" "${_contents}") +endif() + if(QT_BUILD_LATEST) file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake/qt_port_hashes_latest.cmake diff --git a/ports/qt5-base/vcpkg-cmake-wrapper.cmake b/ports/qt5-base/vcpkg-cmake-wrapper.cmake index 1f048e3272a1ba..3e22f087c111bf 100644 --- a/ports/qt5-base/vcpkg-cmake-wrapper.cmake +++ b/ports/qt5-base/vcpkg-cmake-wrapper.cmake @@ -3,7 +3,7 @@ _find_package(${ARGS}) function(add_qt_library _target) foreach(_lib IN LISTS ARGN) #The fact that we are within this file means we are using the VCPKG toolchain. Has such we only need to search in VCPKG paths! - find_library(${_lib}_LIBRARY_DEBUG NAMES ${_lib}d ${_lib} NAMES_PER_DIR PATH_SUFFIXES lib plugins/platforms PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH) + find_library(${_lib}_LIBRARY_DEBUG NAMES ${_lib}_debug ${_lib}d ${_lib} NAMES_PER_DIR PATH_SUFFIXES lib plugins/platforms PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH) find_library(${_lib}_LIBRARY_RELEASE NAMES ${_lib} NAMES_PER_DIR PATH_SUFFIXES lib plugins/platforms PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) if(${_lib}_LIBRARY_RELEASE) list(APPEND interface_lib \$<\$>:${${_lib}_LIBRARY_RELEASE}>) diff --git a/ports/qt5-imageformats/CONTROL b/ports/qt5-imageformats/CONTROL index 24108f974215b8..20ee53538f67e6 100644 --- a/ports/qt5-imageformats/CONTROL +++ b/ports/qt5-imageformats/CONTROL @@ -1,4 +1,4 @@ Source: qt5-imageformats -Version: 5.12.5-2 +Version: 5.12.5-3 Description: Qt5 Image Formats Module - Plugins for additional image formats: TIFF, MNG, TGA, WBMP Build-Depends: qt5-base, tiff, libwebp, jasper diff --git a/ports/qt5-imageformats/portfile.cmake b/ports/qt5-imageformats/portfile.cmake index f7ce7466e4c4a9..dbea7fd9e45c1e 100644 --- a/ports/qt5-imageformats/portfile.cmake +++ b/ports/qt5-imageformats/portfile.cmake @@ -14,8 +14,10 @@ find_library(TIFF_DEBUG NAMES tiffd PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" N find_library(JASPER_RELEASE NAMES jasper PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(JASPER_DEBUG NAMES jasperd jasper libjasperd libjasper PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) -find_library(FREEGLUT_RELEASE NAMES freeglut glut PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) -find_library(FREEGLUT_DEBUG NAMES freeglutd freeglut glutd glut PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) +if(NOT VCPKG_TARGET_IS_OSX) + find_library(FREEGLUT_RELEASE NAMES freeglut glut PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) + find_library(FREEGLUT_DEBUG NAMES freeglutd freeglut glutd glut PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) +endif() find_library(WEBP_RELEASE NAMES webp PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH) find_library(WEBP_DEBUG NAMES webpd webp PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH) diff --git a/ports/reproc/CONTROL b/ports/reproc/CONTROL index b2ba2675ab47fd..36dee1083043b9 100644 --- a/ports/reproc/CONTROL +++ b/ports/reproc/CONTROL @@ -1,4 +1,4 @@ Source: reproc -Version: 11.0.1 +Version: 12.0.0 Description: Cross-platform (C99/C++11) process library Homepage: https://github.com/DaanDeMeyer/reproc diff --git a/ports/reproc/portfile.cmake b/ports/reproc/portfile.cmake index 92609cff8dc813..09989d8fa93dd7 100644 --- a/ports/reproc/portfile.cmake +++ b/ports/reproc/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO DaanDeMeyer/reproc - REF 62dd002f8bd85e369d5a02e3adb49f5b894d344d # v11.0.1 - SHA512 d6d8cb53ab38c0f4c9a9add1068ef09f96674f8f64a6d1fc65cfc5790063570f6da2b8b80988785d5daa3640cde27949ab474bbc6f2cf7587f79c017ed43c621 + REF 8a46b552d28b15ef584f9a6153c2c866754f7b94 # v12.0.0 + SHA512 df5b9b2024a2f8e0ed3ac3d0f8df4b251601a91c037b0a81825fd7a0b034ed2e3fbd1d107fa307b00b828b15ac74fccd85df58686a7ab74de82640a889c680b2 HEAD_REF master ) @@ -10,7 +10,7 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DREPROCXX=ON + -DREPROC++=ON -DREPROC_INSTALL_PKGCONFIG=OFF -DREPROC_INSTALL_CMAKECONFIGDIR=share ) @@ -19,7 +19,7 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -foreach(TARGET reproc reprocxx) +foreach(TARGET reproc reproc++) vcpkg_fixup_cmake_targets( CONFIG_PATH share/${TARGET} TARGET_PATH share/${TARGET} diff --git a/ports/sciter/CONTROL b/ports/sciter/CONTROL index a760561e9b54c2..073bebce2dfa90 100644 --- a/ports/sciter/CONTROL +++ b/ports/sciter/CONTROL @@ -1,5 +1,5 @@ -Source: sciter -Version: 4.4.0.7 -Homepage: https://github.com/c-smile/sciter-sdk -Description: Sciter is an embeddable HTML/CSS/scripting engine. -Supports: !uwp \ No newline at end of file +Source: sciter +Version: 4.4.1.5 +Homepage: https://github.com/c-smile/sciter-sdk +Description: Sciter is an embeddable HTML/CSS/scripting engine. +Supports: !uwp diff --git a/ports/sciter/portfile.cmake b/ports/sciter/portfile.cmake index f148d41485741d..c70468ea7cd0d7 100644 --- a/ports/sciter/portfile.cmake +++ b/ports/sciter/portfile.cmake @@ -9,8 +9,8 @@ endif() # header-only library set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled) -set(SCITER_REVISION 507dce1bed69d6ef7a0d5c7628cb7eb8680e0438) -set(SCITER_SHA 24ccc7d09247ea84a5a3e3c479dc6eb99b4115a89fec8e766874f706addee163b327f5380632b554b02074423f97097f993f8d361d8948800f6477de2b4ab5b5) +set(SCITER_REVISION e0f293ebfb59b9fbef058626bcaeafc38dad5fb8) +set(SCITER_SHA 30b163c478db0c749464de1f18ce249f90018490c737c3d740cebeab0963f5f76d04b907d6cd93952953a7a0ee139fc1ecfa28f6100ada210a6a9ff0e4ff12d5) if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64) set(SCITER_ARCH x64) @@ -73,6 +73,12 @@ elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Darwin) file(INSTALL ${SCITER_BIN}/sciter.app DESTINATION ${SCITER_TOOLS}) file(INSTALL ${SCITER_BIN}/sciter-osx-64.dylib DESTINATION ${SCITER_TOOLS}) + # not sure whether there is a better way to do this, because + # `file(INSTALL sciter.app FILE_PERMISSIONS EXECUTE)` + # would mark everything as executable which is no go. + execute_process(COMMAND sh -c "chmod +x sciter.app/Contents/MacOS/sciter" WORKING_DIRECTORY ${SCITER_TOOLS}) + execute_process(COMMAND sh -c "chmod +x inspector.app/Contents/MacOS/inspector" WORKING_DIRECTORY ${SCITER_TOOLS}) + file(INSTALL ${SCITER_BIN}/sciter-osx-64.dylib DESTINATION ${CURRENT_PACKAGES_DIR}/bin) file(INSTALL ${SCITER_BIN}/sciter-osx-64.dylib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) diff --git a/ports/skyr-url/CONTROL b/ports/skyr-url/CONTROL new file mode 100644 index 00000000000000..bf05d73ca806a3 --- /dev/null +++ b/ports/skyr-url/CONTROL @@ -0,0 +1,5 @@ +Source: skyr-url +Version: 1.4.3 +Build-Depends: tl-expected +Homepage: https://github.com/cpp-netlib/url +Description: A C++ library that implements the WhatWG URL specification diff --git a/ports/skyr-url/portfile.cmake b/ports/skyr-url/portfile.cmake new file mode 100644 index 00000000000000..c6df3658a90151 --- /dev/null +++ b/ports/skyr-url/portfile.cmake @@ -0,0 +1,27 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO cpp-netlib/url + REF v1.4.5 + SHA512 39501217e331a904daf928a5874f81808a9665a9e8debe39c15a3fb7607ab293a5a1b335062cc7ac8f4fe239d4233a2c5ed0e9b45dbec7edcc267eb3d25509d3 + HEAD_REF master +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DSkyr_BUILD_TESTS=OFF + -DSkyr_BUILD_DOCS=OFF + -DSkyr_BUILD_EXAMPLES=OFF + -DSkyr_WARNINGS_AS_ERRORS=OFF +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/skyr-url RENAME copyright) diff --git a/ports/vulkan-hpp/CONTROL b/ports/vulkan-hpp/CONTROL index 95b59f3f818480..2449918e3ee59b 100644 --- a/ports/vulkan-hpp/CONTROL +++ b/ports/vulkan-hpp/CONTROL @@ -1,4 +1,4 @@ Source: vulkan-hpp -Version: 2019-05-11 +Version: 2019-05-11-1 Description: Header only C++ bindings for the Vulkan C API Build-Depends: vulkan diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index bf8de7897b371e..722ffe5c25d794 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -199,11 +199,10 @@ fetchTool() selectCXX() { - __output=$1 - if [ "x$CXX" = "x" ]; then - CXX=g++ - if which g++-9 >/dev/null 2>&1; then + if which g++ >/dev/null 2>&1; then + CXX=g++ + elif which g++-9 >/dev/null 2>&1; then CXX=g++-9 elif which g++-8 >/dev/null 2>&1; then CXX=g++-8 @@ -212,24 +211,8 @@ selectCXX() elif which g++-6 >/dev/null 2>&1; then CXX=g++-6 fi + # If we can't find g++, allow CMake to do the look-up fi - - gccversion="$("$CXX" -v 2>&1)" - gccversion="$(extractStringBetweenDelimiters "$gccversion" "gcc version " ".")" - if [ "$gccversion" -lt "6" ]; then - echo "CXX ($CXX) is too old; please install a newer compiler such as g++-7." - echo "On Ubuntu try the following:" - echo " sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y" - echo " sudo apt-get update -y" - echo " sudo apt-get install g++-7 -y" - echo "On CentOS try the following:" - echo " sudo yum install centos-release-scl" - echo " sudo yum install devtoolset-7" - echo " scl enable devtoolset-7 bash" - return 1 - fi - - eval $__output="'$CXX'" } # Preparation @@ -246,19 +229,20 @@ if [ "$os" = "osx" ]; then if [ "$vcpkgAllowAppleClang" = "true" ] ; then CXX=clang++ else - selectCXX CXX || exit 1 + selectCXX fi else - selectCXX CXX || exit 1 + selectCXX fi # Do the build -buildDir="$vcpkgRootDir/toolsrc/build.rel" +srcDir="$vcpkgRootDir/toolsrc" +buildDir="$srcDir/build.rel" rm -rf "$buildDir" mkdir -p "$buildDir" -(cd "$buildDir" && CXX=$CXX "$cmakeExe" .. -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=OFF" "-DVCPKG_DEVELOPMENT_WARNINGS=Off" "-DDEFINE_DISABLE_METRICS=$vcpkgDisableMetrics" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1 -(cd "$buildDir" && "$cmakeExe" --build .) || exit 1 +("$cmakeExe" -B "$buildDir" -S "$srcDir" -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=OFF" "-DVCPKG_DEVELOPMENT_WARNINGS=OFF" "-DVCPKG_WARNINGS_AS_ERRORS=OFF" "-DVCPKG_DISABLE_METRICS=$vcpkgDisableMetrics" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1 +("$cmakeExe" --build "$buildDir") || exit 1 rm -rf "$vcpkgRootDir/vcpkg" cp "$buildDir/vcpkg" "$vcpkgRootDir/" diff --git a/scripts/build_info.cmake b/scripts/build_info.cmake new file mode 100644 index 00000000000000..45d81513f4e533 --- /dev/null +++ b/scripts/build_info.cmake @@ -0,0 +1,34 @@ +set(BUILD_INFO_FILE_PATH ${CURRENT_PACKAGES_DIR}/BUILD_INFO) +file(WRITE ${BUILD_INFO_FILE_PATH} "CRTLinkage: ${VCPKG_CRT_LINKAGE}\n") +file(APPEND ${BUILD_INFO_FILE_PATH} "LibraryLinkage: ${VCPKG_LIBRARY_LINKAGE}\n") + +if (DEFINED VCPKG_POLICY_DLLS_WITHOUT_LIBS) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyDLLsWithoutLIBs: ${VCPKG_POLICY_DLLS_WITHOUT_LIBS}\n") +endif() +if (DEFINED VCPKG_POLICY_DLLS_WITHOUT_EXPORTS) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyDLLsWithoutExports: ${VCPKG_POLICY_DLLS_WITHOUT_EXPORTS}\n") +endif() +if (DEFINED VCPKG_POLICY_EMPTY_PACKAGE) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyEmptyPackage: ${VCPKG_POLICY_EMPTY_PACKAGE}\n") +endif() +if (DEFINED VCPKG_POLICY_ONLY_RELEASE_CRT) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyOnlyReleaseCRT: ${VCPKG_POLICY_ONLY_RELEASE_CRT}\n") +endif() +if (DEFINED VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyAllowObsoleteMsvcrt: ${VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT}\n") +endif() +if (DEFINED VCPKG_POLICY_EMPTY_INCLUDE_FOLDER) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyEmptyIncludeFolder: ${VCPKG_POLICY_EMPTY_INCLUDE_FOLDER}\n") +endif() +if (DEFINED VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyAllowRestrictedHeaders: ${VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS}\n") +endif() +if (DEFINED VCPKG_POLICY_SKIP_DUMPBIN_CHECKS) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicySkipDumpbinChecks: ${VCPKG_POLICY_SKIP_DUMPBIN_CHECKS}\n") +endif() +if (DEFINED VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicySkipArchitectureCheck: ${VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK}\n") +endif() +if (DEFINED VCPKG_HEAD_VERSION) + file(APPEND ${BUILD_INFO_FILE_PATH} "Version: ${VCPKG_HEAD_VERSION}\n") +endif() \ No newline at end of file diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 1eebc3b8db5e83..963546e9832662 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -76,6 +76,37 @@ else() set(_VCPKG_TARGET_TRIPLET_ARCH arm64) elseif(_VCPKG_CL MATCHES "bin/cl.exe$" OR _VCPKG_CL MATCHES "x86/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin" AND DEFINED CMAKE_SYSTEM_NAME AND NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") + list(LENGTH CMAKE_OSX_ARCHITECTURES arch_count) + if(arch_count EQUAL 0) + message(WARNING "Unable to determine target architecture. " + "Consider providing a value for the CMAKE_OSX_ARCHITECTURES cache variable. " + "Continuing without vcpkg.") + set(VCPKG_TOOLCHAIN ON) + return() + else() + if(arch_count GREATER 1) + message(WARNING "Detected more than one target architecture. Using the first one.") + endif() + list(GET CMAKE_OSX_ARCHITECTURES 0 target_arch) + if(target_arch STREQUAL arm64) + set(_VCPKG_TARGET_TRIPLET_ARCH arm64) + elseif(target_arch STREQUAL arm64s) + set(_VCPKG_TARGET_TRIPLET_ARCH arm64s) + elseif(target_arch STREQUAL armv7s) + set(_VCPKG_TARGET_TRIPLET_ARCH armv7s) + elseif(target_arch STREQUAL armv7) + set(_VCPKG_TARGET_TRIPLET_ARCH arm) + elseif(target_arch STREQUAL x86_64) + set(_VCPKG_TARGET_TRIPLET_ARCH x64) + elseif(target_arch STREQUAL i386) + set(_VCPKG_TARGET_TRIPLET_ARCH x86) + else() + message(WARNING "Unable to determine target architecture, continuing without vcpkg.") + set(VCPKG_TOOLCHAIN ON) + return() + endif() + endif() elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") set(_VCPKG_TARGET_TRIPLET_ARCH x64) else() @@ -96,6 +127,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HO set(_VCPKG_TARGET_TRIPLET_PLAT linux) elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")) set(_VCPKG_TARGET_TRIPLET_PLAT osx) +elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS") + set(_VCPKG_TARGET_TRIPLET_PLAT ios) elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")) set(_VCPKG_TARGET_TRIPLET_PLAT windows) elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")) @@ -146,6 +179,8 @@ else() #Release build: Put Release paths before Debug paths. Debug Paths are req ) endif() +set(VCPKG_CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH}) + file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) set(_PROGRAMFILESX86 "PROGRAMFILES(x86)") file(TO_CMAKE_PATH "$ENV{${_PROGRAMFILESX86}}" _programfiles_x86) @@ -235,7 +270,15 @@ if(NOT DEFINED VCPKG_OVERRIDE_FIND_PACKAGE_NAME) set(VCPKG_OVERRIDE_FIND_PACKAGE_NAME find_package) endif() macro(${VCPKG_OVERRIDE_FIND_PACKAGE_NAME} name) + # Workaround to set the ROOT_PATH until upstream CMake stops overriding + # the ROOT_PATH at apple OS initialization phase. + # See https://gitlab.kitware.com/cmake/cmake/merge_requests/3273 + if(CMAKE_SYSTEM_NAME STREQUAL iOS) + set(BACKUP_CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH}) + list(APPEND CMAKE_FIND_ROOT_PATH ${VCPKG_CMAKE_FIND_ROOT_PATH}) + endif() string(TOLOWER "${name}" _vcpkg_lowercase_name) + if(EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/${_vcpkg_lowercase_name}/vcpkg-cmake-wrapper.cmake") set(ARGS "${ARGV}") include(${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/${_vcpkg_lowercase_name}/vcpkg-cmake-wrapper.cmake) @@ -285,6 +328,9 @@ macro(${VCPKG_OVERRIDE_FIND_PACKAGE_NAME} name) else() _find_package(${ARGV}) endif() + if(CMAKE_SYSTEM_NAME STREQUAL iOS) + set(CMAKE_FIND_ROOT_PATH "${BACKUP_CMAKE_FIND_ROOT_PATH}") + endif() endmacro() set(VCPKG_TOOLCHAIN ON) @@ -301,13 +347,15 @@ if(NOT _CMAKE_IN_TRY_COMPILE) file(TO_CMAKE_PATH "${_VCPKG_ROOT_DIR}" _root_dir) file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/vcpkg.config.cmake" "set(VCPKG_TARGET_TRIPLET \"${VCPKG_TARGET_TRIPLET}\" CACHE STRING \"\")\n" + "set(VCPKG_TARGET_ARCHITECTURE \"${VCPKG_TARGET_ARCHITECTURE}\" CACHE STRING \"\")\n" "set(VCPKG_APPLOCAL_DEPS \"${VCPKG_APPLOCAL_DEPS}\" CACHE STRING \"\")\n" "set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE \"${_chainload_file}\" CACHE STRING \"\")\n" "set(_VCPKG_ROOT_DIR \"${_root_dir}\" CACHE STRING \"\")\n" ) else() - list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES + list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES VCPKG_TARGET_TRIPLET + VCPKG_TARGET_ARCHITECTURE VCPKG_APPLOCAL_DEPS VCPKG_CHAINLOAD_TOOLCHAIN_FILE _VCPKG_ROOT_DIR diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 3fa5958d70b1a4..44a951e9fc2a53 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -63,14 +63,6 @@ ampl-mp:arm-uwp=fail ampl-mp:x64-uwp=fail angelscript:arm64-windows=fail angelscript:arm-uwp=fail - -# Conflicts with qt5-base and ms-angle -angle:arm64-windows = skip -angle:arm-uwp = skip -angle:x64-uwp = skip -angle:x64-windows = skip -angle:x64-windows-static = skip -angle:x86-windows = skip antlr4:arm64-windows=fail antlr4:arm-uwp=fail antlr4:x64-uwp=fail @@ -312,7 +304,6 @@ cudnn:arm-uwp=fail cudnn:x64-uwp=fail cudnn:x64-windows-static=fail cudnn:x86-windows=fail -cutelyst2:x64-osx=fail date:arm64-windows=fail dbow2:x64-osx=fail dcmtk:arm64-windows=fail @@ -606,8 +597,6 @@ hidapi:x64-uwp=fail hiredis:arm-uwp=fail hiredis:x64-uwp=fail hpx:x64-windows-static=fail -hunspell:x64-linux=fail -hunspell:x64-osx=fail hwloc:arm64-windows=fail hwloc:arm-uwp=fail hwloc:x64-linux=fail @@ -669,7 +658,6 @@ jemalloc:x64-uwp=fail jemalloc:x64-windows-static=fail jinja2cpplight:arm-uwp=fail jinja2cpplight:x64-uwp=fail -kd-soap:x64-osx=fail keystone:arm64-windows=fail keystone:arm-uwp=fail keystone:x64-uwp=fail @@ -751,7 +739,6 @@ libfabric:x64-linux=fail libfabric:x64-osx=fail libfabric:x64-uwp=fail libfabric:x64-windows=ignore -libffi:arm-uwp=fail libfreenect2:arm64-windows=fail libgd:x64-linux=ignore libgit2:arm64-windows=fail @@ -896,6 +883,14 @@ librdkafka:arm-uwp=fail librdkafka:x64-uwp=fail # Conflicts with openssl +boringssl:arm64-windows = skip +boringssl:arm-uwp = skip +boringssl:x64-linux = skip +boringssl:x64-osx = skip +boringssl:x64-uwp = skip +boringssl:x64-windows = skip +boringssl:x64-windows-static = skip +boringssl:x86-windows = skip libressl:arm64-windows = skip libressl:arm-uwp = skip libressl:x64-linux = skip @@ -1135,11 +1130,11 @@ mpir:arm64-windows=fail mpir:arm-uwp=fail mpir:x64-uwp=fail -#Conflicts with angle and qt-5base +#Conflicts with angle ms-angle:arm64-windows = skip ms-angle:arm-uwp = skip -ms-angle:x64-linux = fail -ms-angle:x64-osx = fail +ms-angle:x64-linux = skip +ms-angle:x64-osx = skip ms-angle:x64-uwp = skip ms-angle:x64-windows = skip ms-angle:x64-windows-static = skip @@ -1314,7 +1309,6 @@ openvdb:x64-windows-static=fail openvpn3:x64-osx=fail openvr:arm64-windows=fail openvr:arm-uwp=fail -openvr:x64-linux=fail openvr:x64-osx=fail openvr:x64-uwp=fail openxr-loader:arm64-windows=fail @@ -1340,6 +1334,8 @@ osgearth:x64-osx=fail osgearth:x64-linux=fail osgearth:x64-windows-static=fail osg-qt:x64-windows-static=fail +# Missing Fontconfig linkage in vcpkg_cmake_wrapper. Will be fixed by #9860 with the removal of the wrapper. +osg-qt:x64-osx=fail osg-qt:x64-linux=ignore otl:x64-windows=ignore otl:x64-windows-static=ignore @@ -1462,7 +1458,6 @@ python3:x64-uwp=fail qca:x64-linux=fail qca:x64-osx=fail qca:x64-windows-static=fail -qcustomplot:x64-osx=fail qhull:arm-uwp=ignore qhull:x64-windows-static=ignore qhull:x64-uwp=ignore @@ -1470,7 +1465,6 @@ qpid-proton:arm-uwp=fail qpid-proton:x64-uwp=fail qpid-proton:x64-windows-static=fail qscintilla:x64-linux=fail -qscintilla:x64-osx=fail qt5-activeqt:x64-linux=fail qt5-activeqt:x64-osx=fail qt5-macextras:x64-linux=fail @@ -1537,7 +1531,6 @@ redis-plus-plus:arm64-windows=fail replxx:arm-uwp=fail replxx:x64-uwp=fail replxx:arm64-windows=fail -replxx:x86-windows=fail reproc:arm-uwp=fail reproc:x64-uwp=fail restbed:arm-uwp=fail diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 9766bd26747d09..ab65a5683bc1ca 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -202,6 +202,8 @@ function(vcpkg_configure_cmake) set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/android.cmake") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/osx.cmake") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "iOS") + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/ios.cmake") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/freebsd.cmake") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW") @@ -243,7 +245,7 @@ function(vcpkg_configure_cmake) endif() # Sets configuration variables for macOS builds - foreach(config_var INSTALL_NAME_DIR OSX_DEPLOYMENT_TARGET OSX_SYSROOT) + foreach(config_var INSTALL_NAME_DIR OSX_DEPLOYMENT_TARGET OSX_SYSROOT OSX_ARCHITECTURES) if(DEFINED VCPKG_${config_var}) list(APPEND _csc_OPTIONS "-DCMAKE_${config_var}=${VCPKG_${config_var}}") endif() diff --git a/scripts/cmake/vcpkg_configure_meson.cmake b/scripts/cmake/vcpkg_configure_meson.cmake index bbff5e9f6af0e9..2af64999e25d53 100644 --- a/scripts/cmake/vcpkg_configure_meson.cmake +++ b/scripts/cmake/vcpkg_configure_meson.cmake @@ -38,83 +38,218 @@ function(vcpkg_configure_meson) file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - - # use the same compiler options as in vcpkg_configure_cmake - if(NOT VCPKG_TARGET_IS_WINDOWS) - message(FATAL_ERROR "vcpkg_configure_meson() currently only supports windows targets.") - endif() - set(MESON_COMMON_CFLAGS "${MESON_COMMON_CFLAGS} /DWIN32 /D_WINDOWS /W3 /utf-8") - set(MESON_COMMON_CXXFLAGS "${MESON_COMMON_CXXFLAGS} /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc") - - if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL "dynamic") - set(MESON_DEBUG_CFLAGS "${MESON_DEBUG_CFLAGS} /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1") - set(MESON_DEBUG_CXXFLAGS "${MESON_DEBUG_CXXFLAGS} /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1") - - set(MESON_RELEASE_CFLAGS "${MESON_RELEASE_CFLAGS} /MD /O2 /Gy /DNDEBUG /Z7") - set(MESON_RELEASE_CXXFLAGS "${MESON_RELEASE_CXXFLAGS} /MD /O2 /Gy /DNDEBUG /Z7") - elseif(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL "static") - set(MESON_DEBUG_CFLAGS "${MESON_DEBUG_CFLAGS} /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1") - set(MESON_DEBUG_CXXFLAGS "${MESON_DEBUG_CXXFLAGS} /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1") - - set(MESON_RELEASE_CFLAGS "${MESON_RELEASE_CFLAGS} /MT /O2 /Gy /DNDEBUG /Z7") - set(MESON_RELEASE_CXXFLAGS "${MESON_RELEASE_CXXFLAGS} /MT /O2 /Gy /DNDEBUG /Z7") + + #Extract compiler flags + if(NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + set(MESON_CMAKE_FLAG_SUFFIX "_INIT") + if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake") + set(MESON_CMAKE_FLAG_SUFFIX "") + elseif(VCPKG_TARGET_IS_LINUX) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/linux.cmake") + elseif(VCPKG_TARGET_IS_ANDROID) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/android.cmake") + elseif(VCPKG_TARGET_IS_OSX) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/osx.cmake") + elseif(VVCPKG_TARGET_IS_FREEBSD) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/freebsd.cmake") + elseif(VCPKG_TARGET_IS_MINGW) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake") + endif() endif() + + include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") - set(MESON_COMMON_LDFLAGS "${MESON_COMMON_LDFLAGS} /DEBUG") - set(MESON_RELEASE_LDFLAGS "${MESON_RELEASE_LDFLAGS} /INCREMENTAL:NO /OPT:REF /OPT:ICF") + string(APPEND MESON_COMMON_CFLAGS " ${CMAKE_C_FLAGS${MESON_CMAKE_FLAG_SUFFIX}}") + string(APPEND MESON_COMMON_CXXFLAGS " ${CMAKE_CXX_FLAGS${MESON_CMAKE_FLAG_SUFFIX}}") + + string(APPEND MESON_DEBUG_CFLAGS " ${CMAKE_C_FLAGS_DEBUG${MESON_CMAKE_FLAG_SUFFIX}}") + string(APPEND MESON_DEBUG_CXXFLAGS " ${CMAKE_CXX_FLAGS_DEBUG${MESON_CMAKE_FLAG_SUFFIX}}") + + string(APPEND MESON_RELEASE_CFLAGS " ${CMAKE_C_FLAGS_RELEASE${MESON_CMAKE_FLAG_SUFFIX}}") + string(APPEND MESON_RELEASE_CXXFLAGS " ${CMAKE_CXX_FLAGS_RELEASE${MESON_CMAKE_FLAG_SUFFIX}}") + + string(APPEND MESON_COMMON_LDFLAGS " ${CMAKE_SHARED_LINKER_FLAGS${MESON_CMAKE_FLAG_SUFFIX}}") + string(APPEND MESON_DEBUG_LDFLAGS " ${CMAKE_SHARED_LINKER_FLAGS_DEBUG${MESON_CMAKE_FLAG_SUFFIX}}") + string(APPEND MESON_RELEASE_LDFLAGS " ${CMAKE_SHARED_LINKER_FLAGS_RELEASE${MESON_CMAKE_FLAG_SUFFIX}}") # select meson cmd-line options - list(APPEND _vcm_OPTIONS -Dcmake_prefix_path=${CURRENT_INSTALLED_DIR}) + if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND _vcm_OPTIONS "-Dcmake_prefix_path=['${CURRENT_INSTALLED_DIR}','${CURRENT_INSTALLED_DIR}/share']") + else() + list(APPEND _vcm_OPTIONS "-Dcmake_prefix_path=['${CURRENT_INSTALLED_DIR}']") + endif() list(APPEND _vcm_OPTIONS --buildtype plain --backend ninja --wrap-mode nodownload) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") list(APPEND _vcm_OPTIONS --default-library shared) else() list(APPEND _vcm_OPTIONS --default-library static) endif() + list(APPEND _vcm_OPTIONS --libdir lib) # else meson install into an architecture describing folder list(APPEND _vcm_OPTIONS_DEBUG --prefix ${CURRENT_PACKAGES_DIR}/debug --includedir ../include) list(APPEND _vcm_OPTIONS_RELEASE --prefix ${CURRENT_PACKAGES_DIR}) vcpkg_find_acquire_program(MESON) + + get_filename_component(CMAKE_PATH ${CMAKE_COMMAND} DIRECTORY) + vcpkg_add_to_path("${CMAKE_PATH}") # Make CMake invokeable for Meson + vcpkg_find_acquire_program(NINJA) get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) - if(CMAKE_HOST_WIN32) - set(_PATHSEP ";") + vcpkg_add_to_path("${NINJA_PATH}") + + if(NOT ENV{PKG_CONFIG}) + find_program(PKGCONFIG pkg-config) + if(NOT PKGCONFIG AND CMAKE_HOST_WIN32) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES pkg-config) + vcpkg_add_to_path("${MSYS_ROOT}/usr/bin") + endif() + find_program(PKGCONFIG pkg-config REQUIRED) else() - set(_PATHSEP ":") + debug_message(STATUS "PKG_CONFIG found in ENV! Using $ENV{PKG_CONFIG}") + set(PKGCONFIG $ENV{PKG_CONFIG}) + endif() + set(PKGCONFIG_SHARE_DIR "${CURRENT_INSTALLED_DIR}/share/pkgconfig/") + if(WIN32) + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" PKGCONFIG_SHARE_DIR "${PKGCONFIG_SHARE_DIR}") endif() - set(ENV{PATH} "$ENV{PATH}${_PATHSEP}${NINJA_PATH}") + # configure debug + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + + #setting up PKGCONFIG + if(NOT PKGCONFIG MATCHES "--define-variable=prefix") + set(PKGCONFIG_PREFIX "${CURRENT_INSTALLED_DIR}/debug") + # if(WIN32) + # string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" PKGCONFIG_PREFIX "${PKGCONFIG_PREFIX}") + # endif() + set(ENV{PKG_CONFIG} "${PKGCONFIG} --define-variable=prefix=${PKGCONFIG_PREFIX}") + endif() + set(PKGCONFIG_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig/") + if(WIN32) + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" PKGCONFIG_INSTALLED_DIR "${PKGCONFIG_INSTALLED_DIR}") + endif() + if(ENV{PKG_CONFIG_PATH}) + set(BACKUP_ENV_PKG_CONFIG_PATH_DEBUG $ENV{PKG_CONFIG_PATH}) + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}: ${PKGCONFIG_SHARE_DIR}: $ENV{PKG_CONFIG_PATH}") + else() + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}: ${PKGCONFIG_SHARE_DIR}") + endif() + + set(CFLAGS "-Dc_args=[${MESON_COMMON_CFLAGS} ${MESON_DEBUG_CFLAGS}]") + string(REGEX REPLACE " +(/|-)" "','\\1" CFLAGS ${CFLAGS}) # Seperate compiler arguments with comma and enclose in ' + string(REGEX REPLACE " *\\\]" "']" CFLAGS ${CFLAGS}) # Add trailing ' at end + string(REGEX REPLACE "\\\['," "[" CFLAGS ${CFLAGS}) # Remove prepended ', introduced in #1 + string(REGEX REPLACE "\\\['\\\]" "[]" CFLAGS ${CFLAGS}) # Remove trailing ' introduced in #2 if no elements + + set(CXXFLAGS "-Dcpp_args=[${MESON_COMMON_CXXFLAGS} ${MESON_DEBUG_CXXFLAGS}]") + string(REGEX REPLACE " +(/|-)" "','\\1" CXXFLAGS ${CXXFLAGS}) + string(REGEX REPLACE " *\\\]" "']" CXXFLAGS ${CXXFLAGS}) + string(REGEX REPLACE "\\\['," "[" CXXFLAGS ${CXXFLAGS}) + string(REGEX REPLACE "\\\['\\\]" "[]" CXXFLAGS ${CXXFLAGS}) + set(LDFLAGS "[${MESON_COMMON_LDFLAGS} ${MESON_DEBUG_LDFLAGS}]") + string(REGEX REPLACE " +(/|-)" "','\\1" LDFLAGS ${LDFLAGS}) + string(REGEX REPLACE " *\\\]" "']" LDFLAGS ${LDFLAGS}) + string(REGEX REPLACE "\\\['," "[" LDFLAGS ${LDFLAGS}) + string(REGEX REPLACE "\\\['\\\]" "[]" LDFLAGS ${LDFLAGS}) + set(CLDFLAGS "-Dc_link_args=${LDFLAGS}") + set(CXXLDFLAGS "-Dcpp_link_args=${LDFLAGS}") + vcpkg_execute_required_process( + COMMAND ${MESON} ${_vcm_OPTIONS} ${_vcm_OPTIONS_DEBUG} ${_vcm_SOURCE_PATH} ${CFLAGS} ${CXXFLAGS} ${CLDFLAGS} ${CXXLDFLAGS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + + #Copy meson log files into buildtree for CI + if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/meson-logs/meson-log.txt") + file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/meson-logs/meson-log.txt" DESTINATION "${CURRENT_BUILDTREES_DIR}") + file(RENAME "${CURRENT_BUILDTREES_DIR}/meson-log.txt" "${CURRENT_BUILDTREES_DIR}/meson-log-dbg.txt") + endif() + if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/meson-logs/install-log.txt") + file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/meson-logs/install-log.txt" DESTINATION "${CURRENT_BUILDTREES_DIR}") + file(RENAME "${CURRENT_BUILDTREES_DIR}/install-log.txt" "${CURRENT_BUILDTREES_DIR}/install-log-dbg.txt") + endif() + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + + #Restore PKG_CONFIG_PATH + if(BACKUP_ENV_PKG_CONFIG_PATH_DEBUG) + set(ENV{PKG_CONFIG_PATH} "${BACKUP_ENV_PKG_CONFIG_PATH_DEBUG}") + unset(BACKUP_ENV_PKG_CONFIG_PATH_DEBUG) + else() + unset(ENV{PKG_CONFIG_PATH}) + endif() + endif() + # configure release if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - set(ENV{CFLAGS} "${MESON_COMMON_CFLAGS} ${MESON_RELEASE_CFLAGS}") - set(ENV{CXXFLAGS} "${MESON_COMMON_CXXFLAGS} ${MESON_RELEASE_CXXFLAGS}") - set(ENV{LDFLAGS} "${MESON_COMMON_LDFLAGS} ${MESON_RELEASE_LDFLAGS}") - set(ENV{CPPFLAGS} "${MESON_COMMON_CPPFLAGS} ${MESON_RELEASE_CPPFLAGS}") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + #setting up PKGCONFIG + if(NOT PKGCONFIG MATCHES "--define-variable=prefix") + set(PKGCONFIG_PREFIX "${CURRENT_INSTALLED_DIR}") + # if(WIN32) + # string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" PKGCONFIG_PREFIX "${PKGCONFIG_PREFIX}") + # endif() + set(ENV{PKG_CONFIG} "${PKGCONFIG} --define-variable=prefix=${PKGCONFIG_PREFIX}") + endif() + set(PKGCONFIG_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}/lib/pkgconfig/") + if(WIN32) + string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" PKGCONFIG_INSTALLED_DIR "${PKGCONFIG_INSTALLED_DIR}") + endif() + if(ENV{PKG_CONFIG_PATH}) + set(BACKUP_ENV_PKG_CONFIG_PATH_RELEASE $ENV{PKG_CONFIG_PATH}) + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}: ${PKGCONFIG_SHARE_DIR}: $ENV{PKG_CONFIG_PATH}") + else() + set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}: ${PKGCONFIG_SHARE_DIR}") + endif() + + # Normalize flags for meson (i.e. " /string /with /flags " -> ['/string', '/with', '/flags']) + set(CFLAGS "-Dc_args=[${MESON_COMMON_CFLAGS} ${MESON_RELEASE_CFLAGS}]") + string(REGEX REPLACE " +(/|-)" "','\\1" CFLAGS ${CFLAGS}) # Seperate compiler arguments with comma and enclose in ' + string(REGEX REPLACE " *\\\]" "']" CFLAGS ${CFLAGS}) # Add trailing ' at end + string(REGEX REPLACE "\\\['," "[" CFLAGS ${CFLAGS}) # Remove prepended ', introduced in #1 + string(REGEX REPLACE "\\\['\\\]" "[]" CFLAGS ${CFLAGS}) # Remove trailing ' introduced in #2 if no elements + set(CXXFLAGS "-Dcpp_args=[${MESON_COMMON_CXXFLAGS} ${MESON_RELEASE_CXXFLAGS}]") + string(REGEX REPLACE " +(/|-)" "','\\1" CXXFLAGS ${CXXFLAGS}) + string(REGEX REPLACE " *\\\]" "']" CXXFLAGS ${CXXFLAGS}) + string(REGEX REPLACE "\\\['," "[" CXXFLAGS ${CXXFLAGS}) + string(REGEX REPLACE "\\\['\\\]" "[]" CXXFLAGS ${CXXFLAGS}) + set(LDFLAGS "[${MESON_COMMON_LDFLAGS} ${MESON_RELEASE_LDFLAGS}]") + string(REGEX REPLACE " +(/|-)" "','\\1" LDFLAGS ${LDFLAGS}) + string(REGEX REPLACE " *\\\]" "']" LDFLAGS ${LDFLAGS}) + string(REGEX REPLACE "\\\['," "[" LDFLAGS ${LDFLAGS}) + string(REGEX REPLACE "\\\['\\\]" "[]" LDFLAGS ${LDFLAGS}) + set(CLDFLAGS "-Dc_link_args=${LDFLAGS}") + set(CXXLDFLAGS "-Dcpp_link_args=${LDFLAGS}") + vcpkg_execute_required_process( - COMMAND ${MESON} ${_vcm_OPTIONS} ${_vcm_OPTIONS_RELEASE} ${_vcm_SOURCE_PATH} + COMMAND ${MESON} ${_vcm_OPTIONS} ${_vcm_OPTIONS_RELEASE} ${_vcm_SOURCE_PATH} ${CFLAGS} ${CXXFLAGS} ${CLDFLAGS} ${CXXLDFLAGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME config-${TARGET_TRIPLET}-rel ) + #Copy meson log files into buildtree for CI + if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/meson-logs/meson-log.txt") + file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/meson-logs/meson-log.txt" DESTINATION "${CURRENT_BUILDTREES_DIR}") + file(RENAME "${CURRENT_BUILDTREES_DIR}/meson-log.txt" "${CURRENT_BUILDTREES_DIR}/meson-log-rel.txt") + endif() + if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/meson-logs/install-log.txt") + file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/meson-logs/install-log.txt" DESTINATION "${CURRENT_BUILDTREES_DIR}") + file(RENAME "${CURRENT_BUILDTREES_DIR}/install-log.txt" "${CURRENT_BUILDTREES_DIR}/install-log-rel.txt") + endif() message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - # configure debug - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - set(ENV{CFLAGS} "${MESON_COMMON_CFLAGS} ${MESON_DEBUG_CFLAGS}") - set(ENV{CXXFLAGS} "${MESON_COMMON_CXXFLAGS} ${MESON_DEBUG_CXXFLAGS}") - set(ENV{LDFLAGS} "${MESON_COMMON_LDFLAGS} ${MESON_DEBUG_LDFLAGS}") - set(ENV{CPPFLAGS} "${MESON_COMMON_CPPFLAGS} ${MESON_DEBUG_CPPFLAGS}") - vcpkg_execute_required_process( - COMMAND ${MESON} ${_vcm_OPTIONS} ${_vcm_OPTIONS_DEBUG} ${_vcm_SOURCE_PATH} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME config-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + + #Restore PKG_CONFIG_PATH + if(BACKUP_ENV_PKG_CONFIG_PATH_RELEASE) + set(ENV{PKG_CONFIG_PATH} "${BACKUP_ENV_PKG_CONFIG_PATH_RELEASE}") + unset(BACKUP_ENV_PKG_CONFIG_PATH_RELEASE) + else() + unset(ENV{PKG_CONFIG_PATH}) + endif() + endif() endfunction() diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index ed5e010e03ae34..c7fbe0f8479999 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -187,7 +187,7 @@ function(vcpkg_find_acquire_program VAR) set(BREW_PACKAGE_NAME "ninja") set(APT_PACKAGE_NAME "ninja-build") set(URL "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip") - set(ARCHIVE "ninja-1.8.2-win.zip") + set(ARCHIVE "ninja-win-1.8.2.zip") set(HASH 9b9ce248240665fcd6404b989f3b3c27ed9682838225e6dc9b67b551774f251e4ff8a207504f941e7c811e7a8be1945e7bcb94472a335ef15e23a0200a32e6d5) elseif(VAR MATCHES "NUGET") set(PROGNAME nuget) @@ -323,8 +323,8 @@ function(vcpkg_find_acquire_program VAR) find_program(${VAR} ${PROGNAME} PATHS ${PATHS}) else() vcpkg_find_acquire_program(${REQUIRED_INTERPRETER}) - find_file(SCRIPT ${SCRIPTNAME} PATHS ${PATHS}) - set(${VAR} ${${REQUIRED_INTERPRETER}} ${SCRIPT}) + find_file(SCRIPT_${VAR} ${SCRIPTNAME} PATHS ${PATHS}) + set(${VAR} ${${REQUIRED_INTERPRETER}} ${SCRIPT_${VAR}}) endif() endmacro() diff --git a/scripts/ports.cmake b/scripts/ports.cmake index 9681427d76e23a..fcec5ad2fbeaf7 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -88,38 +88,7 @@ if(CMD MATCHES "^BUILD$") include(${SCRIPTS}/cmake/vcpkg_common_definitions.cmake) include(${SCRIPTS}/cmake/vcpkg_common_functions.cmake) include(${CURRENT_PORT_DIR}/portfile.cmake) - - set(BUILD_INFO_FILE_PATH ${CURRENT_PACKAGES_DIR}/BUILD_INFO) - file(WRITE ${BUILD_INFO_FILE_PATH} "CRTLinkage: ${VCPKG_CRT_LINKAGE}\n") - file(APPEND ${BUILD_INFO_FILE_PATH} "LibraryLinkage: ${VCPKG_LIBRARY_LINKAGE}\n") - - if (DEFINED VCPKG_POLICY_DLLS_WITHOUT_LIBS) - file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyDLLsWithoutLIBs: ${VCPKG_POLICY_DLLS_WITHOUT_LIBS}\n") - endif() - if (DEFINED VCPKG_POLICY_DLLS_WITHOUT_EXPORTS) - file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyDLLsWithoutExports: ${VCPKG_POLICY_DLLS_WITHOUT_EXPORTS}\n") - endif() - if (DEFINED VCPKG_POLICY_EMPTY_PACKAGE) - file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyEmptyPackage: ${VCPKG_POLICY_EMPTY_PACKAGE}\n") - endif() - if (DEFINED VCPKG_POLICY_ONLY_RELEASE_CRT) - file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyOnlyReleaseCRT: ${VCPKG_POLICY_ONLY_RELEASE_CRT}\n") - endif() - if (DEFINED VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT) - file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyAllowObsoleteMsvcrt: ${VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT}\n") - endif() - if (DEFINED VCPKG_POLICY_EMPTY_INCLUDE_FOLDER) - file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyEmptyIncludeFolder: ${VCPKG_POLICY_EMPTY_INCLUDE_FOLDER}\n") - endif() - if (DEFINED VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS) - file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyAllowRestrictedHeaders: ${VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS}\n") - endif() - if (DEFINED VCPKG_POLICY_SKIP_DUMPBIN_CHECKS) - file(APPEND ${BUILD_INFO_FILE_PATH} "PolicySkipDumpbinChecks: ${VCPKG_POLICY_SKIP_DUMPBIN_CHECKS}\n") - endif() - if (DEFINED VCPKG_HEAD_VERSION) - file(APPEND ${BUILD_INFO_FILE_PATH} "Version: ${VCPKG_HEAD_VERSION}\n") - endif() + include(${SCRIPTS}/build_info.cmake) elseif(CMD MATCHES "^CREATE$") file(TO_NATIVE_PATH ${VCPKG_ROOT_DIR} NATIVE_VCPKG_ROOT_DIR) file(TO_NATIVE_PATH ${DOWNLOADS} NATIVE_DOWNLOADS) diff --git a/scripts/toolchains/ios.cmake b/scripts/toolchains/ios.cmake new file mode 100644 index 00000000000000..5497117a302a7e --- /dev/null +++ b/scripts/toolchains/ios.cmake @@ -0,0 +1,54 @@ +if(NOT _VCPKG_IOS_TOOLCHAIN) + set(_VCPKG_IOS_TOOLCHAIN 1) + + # Set the CMAKE_SYSTEM_NAME for try_compile calls. + set(CMAKE_SYSTEM_NAME iOS CACHE STRING "") + + macro(_vcpkg_setup_ios_arch arch) + unset(_vcpkg_ios_system_processor) + unset(_vcpkg_ios_sysroot) + unset(_vcpkg_ios_target_architecture) + + if ("${arch}" STREQUAL "arm64") + set(_vcpkg_ios_system_processor "aarch64") + set(_vcpkg_ios_target_architecture "arm64") + elseif("${arch}" STREQUAL "arm") + set(_vcpkg_ios_system_processor "arm") + set(_vcpkg_ios_target_architecture "armv7") + elseif("${arch}" STREQUAL "x64") + set(_vcpkg_ios_sysroot "iphonesimulator") + set(_vcpkg_ios_target_architecture "x86_64") + elseif("${arch}" STREQUAL "x86") + set(_vcpkg_ios_sysroot "iphonesimulator") + set(_vcpkg_ios_target_architecture "i386") + else() + message(FATAL_ERROR + "Unknown VCPKG_TARGET_ARCHITECTURE value provided for triplet ${VCPKG_TARGET_TRIPLET}: ${arch}") + endif() + endmacro() + + _vcpkg_setup_ios_arch("${VCPKG_TARGET_ARCHITECTURE}") + if(_vcpkg_ios_system_processor AND NOT CMAKE_SYSTEM_PROCESSOR) + set(CMAKE_SYSTEM_PROCESSOR ${_vcpkg_ios_system_processor}) + endif() + + # If VCPKG_OSX_ARCHITECTURES or VCPKG_OSX_SYSROOT is set in the triplet, they will take priority, + # so the following will be no-ops. + set(CMAKE_OSX_ARCHITECTURES "${_vcpkg_ios_target_architecture}" CACHE STRING "Build architectures for iOS") + if(_vcpkg_ios_sysroot) + set(CMAKE_OSX_SYSROOT ${_vcpkg_ios_sysroot} CACHE STRING "iOS sysroot") + endif() + + get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) + if(NOT _CMAKE_IN_TRY_COMPILE) + string(APPEND CMAKE_C_FLAGS_INIT " -fPIC ${VCPKG_C_FLAGS} ") + string(APPEND CMAKE_CXX_FLAGS_INIT " -fPIC ${VCPKG_CXX_FLAGS} ") + string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " ${VCPKG_C_FLAGS_DEBUG} ") + string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " ${VCPKG_CXX_FLAGS_DEBUG} ") + string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " ${VCPKG_C_FLAGS_RELEASE} ") + string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " ${VCPKG_CXX_FLAGS_RELEASE} ") + + string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ") + string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ") + endif() +endif() diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 01073fdbb2ac81..5ac380279a4a62 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -60,10 +60,10 @@ f477842d0cebefcd6bf9c6d536ab8ea20ec5b0aa967ee963ab6a101aeff9df8742ca600d35f39e2e7158d76d8231f1ed2bef6104dce84d2bf8d6b07d17d706a1 - 4.6.2 + 4.8.1 nuget.exe - https://dist.nuget.org/win-x86-commandline/v4.6.2/nuget.exe - 60daea7bec2de23089f7ad73985dd788ac154171d6326c2c456726849b8f97dfc38cbdd9b9bf8d96aced009ccaaed317905b65c108e149cfbbbcdfb95f8f0519 + https://dist.nuget.org/win-x86-commandline/v4.8.1/nuget.exe + 42cb744338af8decc033a75bce5b4c4df28e102bafc45f9a8ba86d7bc010f5b43ebacae80d7b28c4f85ac900eefc2a349620ae65f27f6ca1c21c53b63b92924b 3.1.81 @@ -81,9 +81,9 @@ 18.01.0 - aria2-1.33.1-win-32bit-build1\aria2c.exe - https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip - 2456176ba3d506a07cf0cc4f61f080e1ff8cb4106426d66f354c5bb67a9a8720b5ddb26904275e61b1f623c932355f7dcde4cd17556cc895f11293c23c3a9bf3 + aria2-1.34.0-win-32bit-build1\aria2c.exe + https://github.com/aria2/aria2/releases/download/release-1.34.0/aria2-1.34.0-win-32bit-build1.zip + 2a5480d503ac6e8203040c7e516a3395028520da05d0ebf3a2d56d5d24ba5d17630e8f318dd4e3cc2094cc4668b90108fb58e8b986b1ffebd429995058063c27 aria2-1.33.1-win-32bit-build1.zip diff --git a/toolsrc/CMakeLists.txt b/toolsrc/CMakeLists.txt index 4fb1890e27ae82..226985366500e7 100644 --- a/toolsrc/CMakeLists.txt +++ b/toolsrc/CMakeLists.txt @@ -1,81 +1,42 @@ cmake_minimum_required(VERSION 3.14) -project(vcpkg C CXX) +project(vcpkg CXX) +include(cmake/utilities.cmake) -OPTION(DEFINE_DISABLE_METRICS "Option for disabling metrics" OFF) -OPTION(VCPKG_ALLOW_APPLE_CLANG "Option for allowing apple clang" OFF) -OPTION(VCPKG_DEVELOPMENT_WARNINGS "Option for turning on all warnings, and making them errors" ON) -OPTION(BUILD_TESTING "Option for enabling testing" ON) -OPTION(VCPKG_BUILD_BENCHMARKING "Option for enabling benchmarking" OFF) +# =============== +# === Options === +# =============== -# for backwards compatibility with existing code -if (WERROR) - set(VCPKG_DEVELOPMENT_WARNINGS On) -endif() +include(CMakeDependentOption) +option(BUILD_TESTING "Option for enabling testing" ON) +option(VCPKG_DISABLE_METRICS "Option for disabling metrics" OFF) +option(VCPKG_ALLOW_APPLE_CLANG "Option for allowing apple clang, even versions that we don't know will work" OFF) +option(VCPKG_DEVELOPMENT_WARNINGS "Option for turning on all warnings" ON) +option(VCPKG_WARNINGS_AS_ERRORS "Set warnings to be errors" ${VCPKG_DEVELOPMENT_WARNINGS}) -if (DEFINE_DISABLE_METRICS) - set(DISABLE_METRICS_VALUE "1") -else() - set(DISABLE_METRICS_VALUE "0") -endif() +CMAKE_DEPENDENT_OPTION(VCPKG_BUILD_BENCHMARKING "Option for enabling benchmarking" OFF + "BUILD_TESTING" OFF) -if(CMAKE_COMPILER_IS_GNUXX OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") - set(GCC 1) -elseif(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") - if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "11.0.0") - set(CLANG 1) - # Disable linking with libc++fs because this features are added in libc++ library - set(NO_LIBCXXFS 1) - elseif(NOT VCPKG_ALLOW_APPLE_CLANG) - message(FATAL_ERROR -"Building the vcpkg tool requires support for the C++ Filesystem TS. -Apple clang versions 10.01 and below do not have support for it. -Please install gcc6 or newer from homebrew (brew install gcc@6). -If you would like to try anyway, pass --allowAppleClang to bootstrap.sh.") - else() - set(CLANG 1) - endif() -elseif(CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang") - set(CLANG 1) - if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.0.0") - set(NO_LIBCXXFS 1) - add_compile_definitions(_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM=1) - endif() -elseif(NOT MSVC) - message(FATAL_ERROR "Unknown compiler: ${CMAKE_CXX_COMPILER_ID}") +if(WERROR) + message(DEPRECATION "-DWERROR is no longer a supported flag. It doesn't do anything.") +endif() +if(DEFINE_DISABLE_METRICS) + message(DEPRECATION "DEFINE_DISABLE_METRICS is now called VCPKG_DISABLE_METRICS.") + set(VCPKG_DISABLE_METRICS ${DEFINE_DISABLE_METRICS} CACHE BOOL "Option for disabling metrics" FORCE) endif() -set(THREADS_PREFER_PTHREAD_FLAG ON) -find_package(Threads REQUIRED) - -add_definitions(-DDISABLE_METRICS=${DISABLE_METRICS_VALUE}) -include_directories(include) -link_libraries(Threads::Threads) +vcpkg_detect_compiler() +vcpkg_detect_standard_library() +vcpkg_detect_std_filesystem() -if(CLANG AND NOT MSVC) - include(CheckCXXSourceCompiles) - check_cxx_source_compiles("#include - int main() { return __GLIBCXX__; }" USES_LIBSTDCXX) - check_cxx_source_compiles("#include - int main() { return _LIBCPP_VERSION; }" USES_LIBCXX) - if ( NOT USES_LIBSTDCXX AND NOT USES_LIBCXX ) - message(FATAL_ERROR "Can't find which C++ runtime is in use") - endif() -endif() +# ====================== +# === Compiler Flags === +# ====================== -if(GCC OR (CLANG AND USES_LIBSTDCXX)) - include(CheckCXXSourceCompiles) - set(CMAKE_REQUIRED_LIBRARIES stdc++fs) - check_cxx_source_compiles("#include - int main() { return 0; }" LINKS_TO_STDCXX_FS) - unset(CMAKE_REQUIRED_LIBRARIES) - if (LINKS_TO_STDCXX_FS) - link_libraries(stdc++fs) - endif() -elseif(CLANG AND NOT MSVC AND NOT NO_LIBCXXFS) - link_libraries(c++fs) -endif() +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD 17) if(MSVC) # either MSVC, or clang-cl @@ -83,89 +44,108 @@ if(MSVC) if (MSVC_VERSION GREATER 1900) # Visual Studio 2017 or later - add_compile_options(-std:c++17 -permissive-) - else() - # Visual Studio 2015 - add_compile_options(-std:c++latest) + add_compile_options(-permissive-) endif() if(VCPKG_DEVELOPMENT_WARNINGS) - string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - add_compile_options(-W4 -WX) + string(REGEX REPLACE "[-/]W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - if (CLANG) + add_compile_options(-W4) + if(VCPKG_COMPILER STREQUAL "clang") add_compile_options(-Wmissing-prototypes -Wno-missing-field-initializers) endif() endif() -elseif(GCC OR CLANG) - add_compile_options(-std=c++1z) + if(VCPKG_WARNINGS_AS_ERRORS) + add_compile_options(-WX) + endif() +else() if(VCPKG_DEVELOPMENT_WARNINGS) - add_compile_options(-Wall -Wextra -Wpedantic -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-redundant-move -Werror) + add_compile_options(-Wall -Wextra -Wpedantic -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-redundant-move) # GCC and clang have different names for the same warning - if (GCC) + if(VCPKG_COMPILER STREQUAL "gcc") add_compile_options(-Wmissing-declarations) - elseif(CLANG) + elseif(VCPKG_COMPILER STREQUAL "clang") add_compile_options(-Wmissing-prototypes) endif() endif() + + if(VCPKG_WARNINGS_AS_ERRORS) + add_compile_options(-Werror) + endif() +endif() + +# ======================== +# === System Libraries === +# ======================== + +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) +link_libraries(Threads::Threads) + +add_compile_definitions(VCPKG_USE_STD_FILESYSTEM=$) +if(VCPKG_REQUIRE_LINK_CXXFS) + if(VCPKG_STANDARD_LIBRARY STREQUAL "libstdc++") + link_libraries(stdc++fs) + elseif(VCPKG_STANDARD_LIBRARY STREQUAL "libc++") + link_libraries(c++fs) + endif() +endif() + +if (MINGW) + add_compile_definitions( + UNICODE + _WIN32_WINNT=0x0601 + WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY=4 + __fastfail=exit) + link_libraries(winhttp bcrypt version ole32 uuid) endif() -file(GLOB_RECURSE VCPKGLIB_SOURCES CONFIGURE_DEPENDS src/vcpkg/*.cpp) +# =============== +# === Targets === +# =============== + +add_compile_definitions(VCPKG_DISABLE_METRICS=$) +include_directories(include) +file(GLOB_RECURSE VCPKGLIB_SOURCES CONFIGURE_DEPENDS src/vcpkg/*.cpp) add_library(vcpkglib OBJECT ${VCPKGLIB_SOURCES}) + add_executable(vcpkg src/vcpkg.cpp $) if (BUILD_TESTING) file(GLOB_RECURSE VCPKGTEST_SOURCES CONFIGURE_DEPENDS src/vcpkg-test/*.cpp) enable_testing() - add_executable(vcpkg-test - ${VCPKGTEST_SOURCES} - $) - + add_executable(vcpkg-test ${VCPKGTEST_SOURCES} $) add_test(NAME default COMMAND vcpkg-test) if (VCPKG_BUILD_BENCHMARKING) target_compile_options(vcpkg-test PRIVATE -DCATCH_CONFIG_ENABLE_BENCHMARKING) endif() +endif() - find_program(CLANG_FORMAT clang-format) - if (CLANG_FORMAT) - file(GLOB_RECURSE VCPKG_FORMAT_SOURCES CONFIGURE_DEPENDS src/*.cpp include/pch.h include/vcpkg/*.h include/vcpkg-test/*.h) - add_custom_target(format COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKG_FORMAT_SOURCES}) - endif() +find_program(CLANG_FORMAT clang-format) +if(CLANG_FORMAT) + file(GLOB_RECURSE VCPKG_FORMAT_SOURCES CONFIGURE_DEPENDS src/*.cpp include/pch.h include/vcpkg/*.h include/vcpkg-test/*.h) + add_custom_target(format COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKG_FORMAT_SOURCES}) endif() +# =========== +# === PCH === +# =========== + if(MSVC) - get_target_property(_srcs vcpkglib SOURCES) + get_target_property(_srcs vcpkglib SOURCES) - if(NOT CMAKE_GENERATOR MATCHES "Visual Studio .*") - set_property(SOURCE src/pch.cpp APPEND PROPERTY OBJECT_OUTPUTS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") - set_property(SOURCE ${_srcs} APPEND PROPERTY OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") - endif() + if(NOT CMAKE_GENERATOR MATCHES "Visual Studio .*") + set_property(SOURCE src/pch.cpp APPEND PROPERTY OBJECT_OUTPUTS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") + set_property(SOURCE ${_srcs} APPEND PROPERTY OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") + endif() - set_source_files_properties(src/pch.cpp PROPERTIES COMPILE_FLAGS "/Ycpch.h") - target_sources(vcpkglib PRIVATE src/pch.cpp) - target_compile_options(vcpkglib PRIVATE /Yupch.h /FIpch.h /Zm200) + set_source_files_properties(src/pch.cpp PROPERTIES COMPILE_FLAGS "/Ycpch.h") + target_sources(vcpkglib PRIVATE src/pch.cpp) + target_compile_options(vcpkglib PRIVATE /Yupch.h /FIpch.h /Zm200) endif() -if (MINGW) - include(CheckCXXSourceCompiles) - check_cxx_source_compiles("#include - int main() { return 0; }" USES_EXPERIMENTAL_FS) - - if (NOT USES_EXPERIMENTAL_FS) - add_compile_definitions(USE_STD_FILESYSTEM) - endif() - - add_compile_definitions( - UNICODE - _WIN32_WINNT=0x0601 - WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY=4 - __fastfail=exit) - foreach(tgt vcpkg vcpkg-test) - target_link_libraries(${tgt} PRIVATE winhttp bcrypt version ole32 uuid) - endforeach() -endif() diff --git a/toolsrc/cmake/utilities.cmake b/toolsrc/cmake/utilities.cmake new file mode 100644 index 00000000000000..8f088cea42bd09 --- /dev/null +++ b/toolsrc/cmake/utilities.cmake @@ -0,0 +1,164 @@ +# Outputs to Cache: VCPKG_COMPILER +function(vcpkg_detect_compiler) + if(NOT DEFINED CACHE{VCPKG_COMPILER}) + if(CMAKE_COMPILER_IS_GNUXX OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0) + message(FATAL_ERROR + "The g++ version picked up is too old; please install a newer compiler such as g++-7. + On Ubuntu try the following: + sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y + sudo apt-get update -y + sudo apt-get install g++-7 -y + On CentOS try the following: + sudo yum install centos-release-scl + sudo yum install devtoolset-7 + scl enable devtoolset-7 bash") + endif() + + set(COMPILER "gcc") + elseif(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.0.0" AND NOT VCPKG_ALLOW_APPLE_CLANG) + message(FATAL_ERROR + "Building the vcpkg tool requires support for the C++ Filesystem TS. + Apple clang versions 10.01 and below do not have support for it. + Please install gcc6 or newer from homebrew (brew install gcc). + If you would like to try anyway, pass --allowAppleClang to bootstrap.sh.") + endif() + set(COMPILER "clang") + elseif(CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang") + set(COMPILER "clang") + elseif(MSVC) + set(COMPILER "msvc") + else() + message(FATAL_ERROR "Unknown compiler: ${CMAKE_CXX_COMPILER_ID}") + endif() + + set(VCPKG_COMPILER ${COMPILER} + CACHE STRING + "The compiler in use; one of gcc, clang, msvc") + endif() +endfunction() + +# Outputs to Cache: VCPKG_STANDARD_LIBRARY +function(vcpkg_detect_standard_library) + if(NOT DEFINED CACHE{VCPKG_STANDARD_LIBRARY}) + include(CheckCXXSourceCompiles) + + message(STATUS "Detecting the C++ standard library") + + # note: since is the smallest header, generally it's used to get the standard library version + set(CMAKE_REQUIRED_QUIET ON) + check_cxx_source_compiles( + "#include + #if !defined(__GLIBCXX__) + #error not libstdc++ + #endif + int main() {}" + _VCPKG_STANDARD_LIBRARY_LIBSTDCXX) + check_cxx_source_compiles( + "#include + #if !defined(_LIBCPP_VERSION) + #error not libc++ + #endif + int main() {}" + _VCPKG_STANDARD_LIBRARY_LIBCXX) + check_cxx_source_compiles( + "#include + #if !defined(_MSVC_STL_VERSION) + #error not MSVC stl + #endif + int main() {}" + _VCPKG_STANDARD_LIBRARY_MSVC_STL) + if(_VCPKG_STANDARD_LIBRARY_LIBSTDCXX) + set(STANDARD_LIBRARY "libstdc++") + elseif(_VCPKG_STANDARD_LIBRARY_LIBCXX) + set(STANDARD_LIBRARY "libc++") + elseif(_VCPKG_STANDARD_LIBRARY_MSVC_STL) + set(STANDARD_LIBRARY "msvc-stl") + else() + message(FATAL_ERROR "Can't find which C++ runtime is in use") + endif() + + set(VCPKG_STANDARD_LIBRARY ${STANDARD_LIBRARY} + CACHE STRING + "The C++ standard library in use; one of libstdc++, libc++, msvc-stl") + + message(STATUS "Detecting the C++ standard library - ${VCPKG_STANDARD_LIBRARY}") + endif() +endfunction() + +# Outputs to Cache: VCPKG_USE_STD_FILESYSTEM, VCPKG_REQUIRE_LINK_CXXFS +function(vcpkg_detect_std_filesystem) + vcpkg_detect_standard_library() + + if(NOT DEFINED CACHE{VCPKG_USE_STD_FILESYSTEM}) + include(CheckCXXSourceCompiles) + + message(STATUS "Detecting how to use the C++ filesystem library") + + set(CMAKE_REQUIRED_QUIET ON) + if(VCPKG_STANDARD_LIBRARY STREQUAL "libstdc++") + check_cxx_source_compiles( + "#include + #if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 9 + #error libstdc++ after version 9 does not require -lstdc++fs + #endif + int main() {}" + _VCPKG_REQUIRE_LINK_CXXFS) + + check_cxx_source_compiles( + "#include + #if !defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE < 8 + #error libstdc++ before version 8 doesn't support + #endif + int main() {}" + _VCPKG_USE_STD_FILESYSTEM) + elseif(VCPKG_STANDARD_LIBRARY STREQUAL "libc++") + if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") + # AppleClang never requires (or allows) -lc++fs, even with libc++ version 8.0.0 + set(_VCPKG_REQUIRE_LINK_CXXFS OFF) + else() + check_cxx_source_compiles( + "#include + #if _LIBCPP_VERSION >= 9000 + #error libc++ after version 9 does not require -lc++fs + #endif + int main() {}" + _VCPKG_REQUIRE_LINK_CXXFS) + endif() + + # We don't support versions of libc++ < 7.0.0, and libc++ 7.0.0 has + set(_VCPKG_USE_STD_FILESYSTEM ON) + elseif(VCPKG_STANDARD_LIBRARY STREQUAL "msvc-stl") + check_cxx_source_compiles( + "#include + #if !defined(_MSVC_STL_UPDATE) || _MSVC_STL_UPDATE < 201803 + #error MSVC STL before 15.7 doesn't support + #endif + int main() {}" + _VCPKG_USE_STD_FILESYSTEM) + + set(_VCPKG_REQUIRE_LINK_CXXFS OFF) + endif() + + set(VCPKG_USE_STD_FILESYSTEM ${_VCPKG_USE_STD_FILESYSTEM} + CACHE BOOL + "Whether to use , as opposed to " + FORCE) + set(VCPKG_REQUIRE_LINK_CXXFS ${_VCPKG_REQUIRE_LINK_CXXFS} + CACHE BOOL + "Whether it's required to pass -l[std]c++fs in order to use " + FORCE) + + if(VCPKG_USE_STD_FILESYSTEM) + set(msg "") + else() + set(msg "") + endif() + if(VCPKG_REQUIRE_LINK_CXXFS) + set(msg "${msg} with -l[std]c++fs") + endif() + + message(STATUS "Detecting how to use the C++ filesystem library - ${msg}") + endif() +endfunction() diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h index a6a442f0ae7aa2..bdc13aedf5e41b 100644 --- a/toolsrc/include/pch.h +++ b/toolsrc/include/pch.h @@ -31,7 +31,7 @@ #include #define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING #include -#if USE_STD_FILESYSTEM +#if VCPKG_USE_STD_FILESYSTEM #include #else #include @@ -54,7 +54,12 @@ #else #include #endif + #include +// glibc defines major and minor in sys/types.h, and should not +#undef major +#undef minor + #include #include #include diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h index 3b92feabebeba9..0bad428c01de1b 100644 --- a/toolsrc/include/vcpkg/base/files.h +++ b/toolsrc/include/vcpkg/base/files.h @@ -3,7 +3,7 @@ #include #include -#if USE_STD_FILESYSTEM +#if VCPKG_USE_STD_FILESYSTEM #include #else #define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING @@ -12,7 +12,7 @@ namespace fs { -#if USE_STD_FILESYSTEM +#if VCPKG_USE_STD_FILESYSTEM namespace stdfs = std::filesystem; #else namespace stdfs = std::experimental::filesystem; diff --git a/toolsrc/include/vcpkg/base/uint128.h b/toolsrc/include/vcpkg/base/uint128.h new file mode 100644 index 00000000000000..6b7816760f2cd2 --- /dev/null +++ b/toolsrc/include/vcpkg/base/uint128.h @@ -0,0 +1,26 @@ +#pragma once + +#include + +namespace vcpkg { + +struct UInt128 { + UInt128() = default; + UInt128(uint64_t value) : bottom(value), top(0) {} + + UInt128& operator<<=(int by) noexcept; + UInt128& operator>>=(int by) noexcept; + UInt128& operator+=(uint64_t lhs) noexcept; + + uint64_t bottom_64_bits() const noexcept { + return bottom; + } + uint64_t top_64_bits() const noexcept { + return top; + } +private: + uint64_t bottom; + uint64_t top; +}; + +} diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index 892fb2370736ef..d8e87f131695d2 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -222,6 +222,7 @@ namespace vcpkg::Build ALLOW_OBSOLETE_MSVCRT, ALLOW_RESTRICTED_HEADERS, SKIP_DUMPBIN_CHECKS, + SKIP_ARCHITECTURE_CHECK, // Must be last COUNT, }; @@ -235,6 +236,7 @@ namespace vcpkg::Build BuildPolicy::ALLOW_OBSOLETE_MSVCRT, BuildPolicy::ALLOW_RESTRICTED_HEADERS, BuildPolicy::SKIP_DUMPBIN_CHECKS, + BuildPolicy::SKIP_ARCHITECTURE_CHECK }; const std::string& to_string(BuildPolicy policy); diff --git a/toolsrc/include/vcpkg/export.prefab.h b/toolsrc/include/vcpkg/export.prefab.h new file mode 100644 index 00000000000000..56a5ba371935b0 --- /dev/null +++ b/toolsrc/include/vcpkg/export.prefab.h @@ -0,0 +1,82 @@ +#pragma once + +#include +#include +#include + + +#include + +namespace vcpkg::Export::Prefab +{ + constexpr int kFragmentSize = 3; + + struct Options + { + Optional maybe_group_id; + Optional maybe_artifact_id; + Optional maybe_version; + Optional maybe_min_sdk; + Optional maybe_target_sdk; + bool enable_maven; + bool enable_debug; + }; + struct NdkVersion + { + NdkVersion(int _major, int _minor, int _patch) : m_major{_major}, + m_minor{_minor}, + m_patch{_patch}{ + } + int major() { return this->m_major; } + int minor() { return this->m_minor; } + int patch() { return this->m_patch; } + std::string to_string(); + void to_string(std::string& out); + + private: + int m_major; + int m_minor; + int m_patch; + }; + + struct ABIMetadata + { + std::string abi; + int api; + int ndk; + std::string stl; + std::string to_string(); + }; + + struct PlatformModuleMetadata + { + std::vector export_libraries; + std::string library_name; + std::string to_json(); + }; + + struct ModuleMetadata + { + std::vector export_libraries; + std::string library_name; + PlatformModuleMetadata android; + std::string to_json(); + }; + + struct PackageMetadata + { + std::string name; + int schema; + std::vector dependencies; + std::string version; + std::string to_json(); + }; + + + + void do_export(const std::vector& export_plan, + const VcpkgPaths& paths, + const Options& prefab_options, const Triplet& triplet); + Optional find_ndk_version(const std::string &content); + Optional to_version(const std::string &version); +} diff --git a/toolsrc/include/vcpkg/triplet.h b/toolsrc/include/vcpkg/triplet.h index d836dd2302e456..92ea10175c5f69 100644 --- a/toolsrc/include/vcpkg/triplet.h +++ b/toolsrc/include/vcpkg/triplet.h @@ -23,6 +23,11 @@ namespace vcpkg static const Triplet X64_UWP; static const Triplet ARM_UWP; static const Triplet ARM64_UWP; + + static const Triplet ARM_ANDROID; + static const Triplet ARM64_ANDROID; + static const Triplet X86_ANDROID; + static const Triplet X64_ANDROID; const std::string& canonical_name() const; const std::string& to_string() const; diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h index 63d19af2ce865e..31d8374f1e6d93 100644 --- a/toolsrc/include/vcpkg/vcpkgpaths.h +++ b/toolsrc/include/vcpkg/vcpkgpaths.h @@ -14,6 +14,8 @@ namespace vcpkg namespace Tools { static const std::string SEVEN_ZIP = "7zip"; + static const std::string SEVEN_ZIP_ALT = "7z"; + static const std::string MAVEN = "mvn"; static const std::string CMAKE = "cmake"; static const std::string GIT = "git"; static const std::string NINJA = "ninja"; diff --git a/toolsrc/src/vcpkg-test/files.cpp b/toolsrc/src/vcpkg-test/files.cpp index d8bc5ba74eb126..cbe1e81c3c39eb 100644 --- a/toolsrc/src/vcpkg-test/files.cpp +++ b/toolsrc/src/vcpkg-test/files.cpp @@ -65,8 +65,6 @@ namespace Width width = Width{5}, CurrentDepth current_depth = CurrentDepth{0}) { - std::random_device rd; - // we want ~70% of our "files" to be directories, and then a third // each of the remaining ~30% to be regular files, directory symlinks, // and regular symlinks @@ -132,7 +130,7 @@ namespace CHECK_EC_ON_FILE(base_link, ec); vcpkg::Test::create_symlink(base_link, base, ec); } - else // type == directory_symlink_tag + else // file_type == directory_symlink_tag { // directory symlink auto parent = base; diff --git a/toolsrc/src/vcpkg-test/paragraph.cpp b/toolsrc/src/vcpkg-test/paragraph.cpp index ba929ac56bb961..678064f1cccc1e 100644 --- a/toolsrc/src/vcpkg-test/paragraph.cpp +++ b/toolsrc/src/vcpkg-test/paragraph.cpp @@ -8,6 +8,8 @@ namespace Strings = vcpkg::Strings; using vcpkg::Parse::Paragraph; +namespace { + auto test_parse_control_file(const std::vector>& v) { std::vector pghs; @@ -29,6 +31,8 @@ auto test_make_binary_paragraph(const std::unordered_map -#include #include #include #include @@ -8,6 +7,14 @@ #include #include +#if defined(_WIN32) +#define _NOMINMAX +#define WIN32_LEAN_AND_MEAN +#include +#else +#include +#endif + using vcpkg::Optional; using vcpkg::StringView; using vcpkg::ZStringView; @@ -39,16 +46,17 @@ namespace check_exit(VCPKG_LINE_INFO, exit_code != 0); #else // ^^^ defined(_WIN32) / !defined(_WIN32) vvv std::string tmp; - tmp.reserve(varname.size() + value.size() + 1); tmp.append(varname.data(), varname.size()); tmp.push_back('='); - if (value) + if (auto v = value.get()) { - const auto& unpacked = value.value_or_exit(VCPKG_LINE_INFO); - tmp.append(unpacked); + tmp.append(*v); } - const int exit_code = putenv(tmp.c_str()); + // putenv expects the string to never go out of scope + char* env_string = new char[tmp.size() + 1]; // overflow checked by tmp's null allocation + memcpy(env_string, tmp.data(), tmp.size()); + const int exit_code = putenv(env_string); check_exit(VCPKG_LINE_INFO, exit_code == 0); #endif // defined(_WIN32) } diff --git a/toolsrc/src/vcpkg-test/uint128.cpp b/toolsrc/src/vcpkg-test/uint128.cpp new file mode 100644 index 00000000000000..57d0169afc1e6a --- /dev/null +++ b/toolsrc/src/vcpkg-test/uint128.cpp @@ -0,0 +1,64 @@ +#include + +#include + +TEST_CASE ("uint128 constructor and assign", "[uint128]") { + vcpkg::UInt128 x = 120; + REQUIRE(x.bottom_64_bits() == 120); + REQUIRE(x.top_64_bits() == 0); + + x = 3201; + REQUIRE(x.bottom_64_bits() == 3201); + REQUIRE(x.top_64_bits() == 0); + + x = 0xFFFF'FFFF'FFFF'FFFF; + REQUIRE(x.bottom_64_bits() == 0xFFFF'FFFF'FFFF'FFFF); + REQUIRE(x.top_64_bits() == 0); +} + +TEST_CASE ("uint128 add-assign", "[uint128]") { + vcpkg::UInt128 x = 0xFFFF'FFFF'FFFF'FFFF; + x += 1; + REQUIRE(x.bottom_64_bits() == 0); + REQUIRE(x.top_64_bits() == 1); +} + +TEST_CASE ("uint128 shl-assign", "[uint128]") { + vcpkg::UInt128 x = 0xFFFF'FFFF'FFFF'FFFF; + x <<= 32; + REQUIRE(x.bottom_64_bits() == 0xFFFF'FFFF'0000'0000); + REQUIRE(x.top_64_bits() == 0x0000'0000'FFFF'FFFF); + + x <<= 60; + REQUIRE(x.bottom_64_bits() == 0); + REQUIRE(x.top_64_bits() == 0xFFFF'FFFF'F000'0000); + + x = 1; + x <<= 96; + REQUIRE(x.bottom_64_bits() == 0); + REQUIRE(x.top_64_bits() == (uint64_t(1) << 32)); +} + +TEST_CASE ("uint128 shr-assign", "[uint128]") { + vcpkg::UInt128 x = 0xFFFF'FFFF'FFFF'FFFF; + x <<= 64; + REQUIRE(x.bottom_64_bits() == 0x0000'0000'0000'0000); + REQUIRE(x.top_64_bits() == 0xFFFF'FFFF'FFFF'FFFF); + + x >>= 32; + REQUIRE(x.bottom_64_bits() == 0xFFFF'FFFF'0000'0000); + REQUIRE(x.top_64_bits() == 0x0000'0000'FFFF'FFFF); + + x >>= 60; + REQUIRE(x.bottom_64_bits() == 0x0000'000F'FFFF'FFFF); + REQUIRE(x.top_64_bits() == 0x0000'0000'0000'0000); + + x = 0x8000'0000'0000'0000; + x <<= 64; + REQUIRE(x.bottom_64_bits() == 0); + REQUIRE(x.top_64_bits() == 0x8000'0000'0000'0000); + + x >>= 96; + REQUIRE(x.bottom_64_bits() == (uint64_t(1) << 31)); + REQUIRE(x.top_64_bits() == 0); +} diff --git a/toolsrc/src/vcpkg-test/util.cpp b/toolsrc/src/vcpkg-test/util.cpp index d754baec1fc8fd..c615f6bb2b9760 100644 --- a/toolsrc/src/vcpkg-test/util.cpp +++ b/toolsrc/src/vcpkg-test/util.cpp @@ -114,21 +114,21 @@ namespace vcpkg::Test #elif !defined(_WIN32) // FILESYSTEM_SYMLINK == FILESYSTEM_SYMLINK_STD return AllowSymlinks::Yes; #else - HKEY key; - bool allow_symlinks = true; - - const auto status = RegOpenKeyExW( - HKEY_LOCAL_MACHINE, LR"(SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock)", 0, 0, &key); - - if (status == ERROR_FILE_NOT_FOUND) - { - allow_symlinks = false; + constexpr static const wchar_t regkey[] = + LR"(SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock)"; + constexpr static const wchar_t regkey_member[] = LR"(AllowDevelopmentWithoutDevLicense)"; + + DWORD data; + DWORD dataSize = sizeof(data); + const auto status = RegGetValueW( + HKEY_LOCAL_MACHINE, regkey, regkey_member, RRF_RT_DWORD, nullptr, &data, &dataSize); + + if (status == ERROR_SUCCESS && data == 1) { + return AllowSymlinks::Yes; + } else { std::clog << "Symlinks are not allowed on this system\n"; + return AllowSymlinks::No; } - - if (status == ERROR_SUCCESS) RegCloseKey(key); - - return allow_symlinks ? AllowSymlinks::Yes : AllowSymlinks::No; #endif } const static AllowSymlinks CAN_CREATE_SYMLINKS = internal_can_create_symlinks(); diff --git a/toolsrc/src/vcpkg/base/hash.cpp b/toolsrc/src/vcpkg/base/hash.cpp index b70897a2b8b716..45ce43cdd29bc1 100644 --- a/toolsrc/src/vcpkg/base/hash.cpp +++ b/toolsrc/src/vcpkg/base/hash.cpp @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -50,82 +51,14 @@ namespace vcpkg::Hash } } - namespace - { - struct UInt128 - { - std::uint64_t top; - std::uint64_t bottom; - - UInt128() = default; - UInt128(std::uint64_t value) : top(0), bottom(value) {} - - UInt128& operator<<=(int by) noexcept - { - if (by == 0) - { - return *this; - } - - if (by < 64) - { - top <<= by; - const auto shift_up = bottom >> (64 - by); - top |= shift_up; - bottom <<= by; - } - else - { - top = bottom; - top <<= (by - 64); - } - - return *this; - } - - UInt128& operator>>=(int by) noexcept - { - if (by == 0) - { - return *this; - } - - if (by < 64) - { - bottom >>= by; - const auto shift_down = top << (64 - by); - bottom |= shift_down; - top >>= by; - } - else - { - bottom = top; - bottom >>= (by - 64); - } - - return *this; - } - - UInt128& operator+=(std::size_t lhs) noexcept - { - // bottom + lhs > uint64::max - if (bottom > std::numeric_limits::max() - lhs) - { - top += 1; - } - bottom += lhs; - return *this; - } - }; - + template + auto top_bits(UIntTy x) -> std::enable_if_t::value, uchar> { + return static_cast(x >> ((sizeof(x) - 1) * 8)); + } + template + auto top_bits(UIntTy x) -> decltype(top_bits(x.top_64_bits())) { + return top_bits(x.top_64_bits()); } - template - void top_bits(T) = delete; - - static constexpr uchar top_bits(uchar x) noexcept { return x; } - [[maybe_unused]] static constexpr uchar top_bits(std::uint32_t x) noexcept { return (x >> 24) & 0xFF; } - [[maybe_unused]] static constexpr uchar top_bits(std::uint64_t x) noexcept { return (x >> 56) & 0xFF; } - [[maybe_unused]] static constexpr uchar top_bits(UInt128 x) noexcept { return top_bits(x.top); } // treats UIntTy as big endian for the purpose of this mapping template diff --git a/toolsrc/src/vcpkg/base/system.process.cpp b/toolsrc/src/vcpkg/base/system.process.cpp index 5f34ace2a7f526..2bb61455e8d198 100644 --- a/toolsrc/src/vcpkg/base/system.process.cpp +++ b/toolsrc/src/vcpkg/base/system.process.cpp @@ -532,6 +532,7 @@ namespace vcpkg Debug::print( "cmd_execute() returned ", exit_code, " after ", static_cast(timer.microseconds()), " us\n"); #else + (void)env; Debug::print("system(", cmd_line, ")\n"); fflush(nullptr); int exit_code = system(cmd_line.c_str()); @@ -587,6 +588,7 @@ namespace vcpkg }(); g_ctrl_c_state.transition_from_spawn_process(); #else + (void)env; const auto actual_cmd_line = Strings::format(R"###(%s 2>&1)###", cmd_line); Debug::print("popen(", actual_cmd_line, ")\n"); diff --git a/toolsrc/src/vcpkg/base/uint128.cpp b/toolsrc/src/vcpkg/base/uint128.cpp new file mode 100644 index 00000000000000..e0256075e09451 --- /dev/null +++ b/toolsrc/src/vcpkg/base/uint128.cpp @@ -0,0 +1,55 @@ +#include + +#include + +namespace vcpkg { + +UInt128& UInt128::operator<<=(int by) noexcept { + if (by == 0) { + return *this; + } + + if (by < 64) { + top <<= by; + const auto shift_up = bottom >> (64 - by); + top |= shift_up; + bottom <<= by; + } else { + top = bottom; + top <<= (by - 64); + bottom = 0; + } + + return *this; +} + +UInt128& UInt128::operator>>=(int by) noexcept { + if (by == 0) { + return *this; + } + + if (by < 64) { + bottom >>= by; + const auto shift_down = top << (64 - by); + bottom |= shift_down; + top >>= by; + } else { + bottom = top; + bottom >>= (by - 64); + top = 0; + } + + return *this; +} + +UInt128& UInt128::operator+=(uint64_t rhs) noexcept { + // bottom + lhs > uint64::max + if (bottom > std::numeric_limits::max() - rhs) + { + top += 1; + } + bottom += rhs; + return *this; +} + +} diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index c1e91adf95e12e..fe17c490af4b8c 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -160,6 +160,7 @@ namespace vcpkg::Build static const std::string NAME_ALLOW_OBSOLETE_MSVCRT = "PolicyAllowObsoleteMsvcrt"; static const std::string NAME_ALLOW_RESTRICTED_HEADERS = "PolicyAllowRestrictedHeaders"; static const std::string NAME_SKIP_DUMPBIN_CHECKS = "PolicySkipDumpbinChecks"; + static const std::string NAME_SKIP_ARCHITECTURE_CHECK = "PolicySkipArchitectureCheck"; const std::string& to_string(BuildPolicy policy) { @@ -173,6 +174,7 @@ namespace vcpkg::Build case BuildPolicy::ALLOW_OBSOLETE_MSVCRT: return NAME_ALLOW_OBSOLETE_MSVCRT; case BuildPolicy::ALLOW_RESTRICTED_HEADERS: return NAME_ALLOW_RESTRICTED_HEADERS; case BuildPolicy::SKIP_DUMPBIN_CHECKS: return NAME_SKIP_DUMPBIN_CHECKS; + case BuildPolicy::SKIP_ARCHITECTURE_CHECK: return NAME_SKIP_ARCHITECTURE_CHECK; default: Checks::unreachable(VCPKG_LINE_INFO); } } @@ -189,6 +191,7 @@ namespace vcpkg::Build case BuildPolicy::ALLOW_OBSOLETE_MSVCRT: return "VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT"; case BuildPolicy::ALLOW_RESTRICTED_HEADERS: return "VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS"; case BuildPolicy::SKIP_DUMPBIN_CHECKS: return "VCPKG_POLICY_SKIP_DUMPBIN_CHECKS"; + case BuildPolicy::SKIP_ARCHITECTURE_CHECK: return "VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK"; default: Checks::unreachable(VCPKG_LINE_INFO); } } @@ -252,6 +255,7 @@ namespace vcpkg::Build })); } +#if defined(_WIN32) static const std::unordered_map& make_env_passthrough(const PreBuildInfo& pre_build_info) { static Cache, std::unordered_map> envs; @@ -271,6 +275,7 @@ namespace vcpkg::Build return env; }); } +#endif std::string make_build_env_cmd(const PreBuildInfo& pre_build_info, const Toolset& toolset) { @@ -821,7 +826,6 @@ namespace vcpkg::Build auto binary_caching_enabled = binaries_provider && action.build_options.binary_caching == BinaryCaching::YES; auto& fs = paths.get_filesystem(); - Triplet triplet = action.spec.triplet(); auto& spec = action.spec; const std::string& name = action.source_control_file_location.value_or_exit(VCPKG_LINE_INFO) .source_control_file->core_paragraph->name; @@ -831,7 +835,7 @@ namespace vcpkg::Build { for (const FeatureSpec& fspec : kv.second) { - if (!(status_db.is_installed(fspec) || spec.name() == name)) + if (!(status_db.is_installed(fspec) || fspec.name() == name)) { missing_fspecs.emplace_back(fspec); } @@ -1053,7 +1057,7 @@ namespace vcpkg::Build public_abi_override = variable_value.empty() ? nullopt : Optional{variable_value}; break; case VcpkgTripletVar::LOAD_VCVARS_ENV: - if (variable_value.empty()) + if (variable_value.empty()) { load_vcvars_env = true; if(external_toolchain_file) diff --git a/toolsrc/src/vcpkg/export.cpp b/toolsrc/src/vcpkg/export.cpp index a9dd3bba29de24..b41d88dc176fd1 100644 --- a/toolsrc/src/vcpkg/export.cpp +++ b/toolsrc/src/vcpkg/export.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -263,6 +264,7 @@ namespace vcpkg::Export bool zip = false; bool seven_zip = false; bool chocolatey = false; + bool prefab = false; bool all_installed = false; Optional maybe_output; @@ -271,6 +273,7 @@ namespace vcpkg::Export Optional maybe_nuget_version; IFW::Options ifw_options; + Prefab::Options prefab_options; Chocolatey::Options chocolatey_options; std::vector specs; }; @@ -294,7 +297,19 @@ namespace vcpkg::Export static constexpr StringLiteral OPTION_CHOCOLATEY_VERSION_SUFFIX = "--x-version-suffix"; static constexpr StringLiteral OPTION_ALL_INSTALLED = "--x-all-installed"; - static constexpr std::array EXPORT_SWITCHES = {{ + static constexpr StringLiteral OPTION_PREFAB = "--prefab"; + static constexpr StringLiteral OPTION_PREFAB_GROUP_ID = "--prefab-group-id"; + static constexpr StringLiteral OPTION_PREFAB_ARTIFACT_ID = "--prefab-artifact-id"; + static constexpr StringLiteral OPTION_PREFAB_VERSION = "--prefab-version"; + static constexpr StringLiteral OPTION_PREFAB_SDK_MIN_VERSION = "--prefab-min-sdk"; + static constexpr StringLiteral OPTION_PREFAB_SDK_TARGET_VERSION = "--prefab-target-sdk"; + static constexpr StringLiteral OPTION_PREFAB_ENABLE_MAVEN = "--prefab-maven"; + static constexpr StringLiteral OPTION_PREFAB_ENABLE_DEBUG = "--prefab-debug"; + + + + + static constexpr std::array EXPORT_SWITCHES = {{ {OPTION_DRY_RUN, "Do not actually export"}, {OPTION_RAW, "Export to an uncompressed directory"}, {OPTION_NUGET, "Export a NuGet package"}, @@ -302,10 +317,13 @@ namespace vcpkg::Export {OPTION_ZIP, "Export to a zip file"}, {OPTION_SEVEN_ZIP, "Export to a 7zip (.7z) file"}, {OPTION_CHOCOLATEY, "Export a Chocolatey package (experimental feature)"}, + {OPTION_PREFAB, "Export to Prefab format"}, + {OPTION_PREFAB_ENABLE_MAVEN, "Enable maven"}, + {OPTION_PREFAB_ENABLE_DEBUG, "Enable prefab debug"}, {OPTION_ALL_INSTALLED, "Export all installed packages"}, }}; - static constexpr std::array EXPORT_SETTINGS = {{ + static constexpr std::array EXPORT_SETTINGS = {{ {OPTION_OUTPUT, "Specify the output name (used to construct filename)"}, {OPTION_NUGET_ID, "Specify the id for the exported NuGet package (overrides --output)"}, {OPTION_NUGET_VERSION, "Specify the version for the exported NuGet package"}, @@ -318,6 +336,11 @@ namespace vcpkg::Export "Specify the maintainer for the exported Chocolatey package (experimental feature)"}, {OPTION_CHOCOLATEY_VERSION_SUFFIX, "Specify the version suffix to add for the exported Chocolatey package (experimental feature)"}, + {OPTION_PREFAB_GROUP_ID, "GroupId uniquely identifies your project according maven specifications"}, + {OPTION_PREFAB_ARTIFACT_ID, "Artifact Id is the name of the project according maven specifications"}, + {OPTION_PREFAB_VERSION, "Version is the name of the project according maven specifications"}, + {OPTION_PREFAB_SDK_MIN_VERSION, "Android minimum supported sdk version"}, + {OPTION_PREFAB_SDK_TARGET_VERSION, "Android target sdk version"}, }}; const CommandStructure COMMAND_STRUCTURE = { @@ -343,8 +366,11 @@ namespace vcpkg::Export ret.zip = options.switches.find(OPTION_ZIP) != options.switches.cend(); ret.seven_zip = options.switches.find(OPTION_SEVEN_ZIP) != options.switches.cend(); ret.chocolatey = options.switches.find(OPTION_CHOCOLATEY) != options.switches.cend(); - ret.all_installed = options.switches.find(OPTION_ALL_INSTALLED) != options.switches.end(); + ret.prefab = options.switches.find(OPTION_PREFAB) != options.switches.cend(); + ret.prefab_options.enable_maven = options.switches.find(OPTION_PREFAB_ENABLE_MAVEN) != options.switches.cend(); + ret.prefab_options.enable_debug = options.switches.find(OPTION_PREFAB_ENABLE_DEBUG) != options.switches.cend(); ret.maybe_output = maybe_lookup(options.settings, OPTION_OUTPUT); + ret.all_installed = options.switches.find(OPTION_ALL_INSTALLED) != options.switches.end(); if (ret.all_installed) { @@ -363,10 +389,10 @@ namespace vcpkg::Export }); } - if (!ret.raw && !ret.nuget && !ret.ifw && !ret.zip && !ret.seven_zip && !ret.dry_run && !ret.chocolatey) + if (!ret.raw && !ret.nuget && !ret.ifw && !ret.zip && !ret.seven_zip && !ret.dry_run && !ret.chocolatey && !ret.prefab) { System::print2(System::Color::error, - "Must provide at least one export type: --raw --nuget --ifw --zip --7zip --chocolatey\n"); + "Must provide at least one export type: --raw --nuget --ifw --zip --7zip --chocolatey --prefab\n"); System::print2(COMMAND_STRUCTURE.example_text); Checks::exit_fail(VCPKG_LINE_INFO); } @@ -418,6 +444,16 @@ namespace vcpkg::Export {OPTION_IFW_INSTALLER_FILE_PATH, ret.ifw_options.maybe_installer_file_path}, }); + options_implies(OPTION_PREFAB, + ret.prefab, + { + {OPTION_PREFAB_ARTIFACT_ID, ret.prefab_options.maybe_artifact_id}, + {OPTION_PREFAB_GROUP_ID, ret.prefab_options.maybe_group_id}, + {OPTION_PREFAB_SDK_MIN_VERSION, ret.prefab_options.maybe_min_sdk}, + {OPTION_PREFAB_SDK_TARGET_VERSION, ret.prefab_options.maybe_target_sdk}, + {OPTION_PREFAB_VERSION, ret.prefab_options.maybe_version}, + }); + options_implies(OPTION_CHOCOLATEY, ret.chocolatey, { @@ -605,6 +641,10 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console Chocolatey::do_export(export_plan, paths, opts.chocolatey_options); } + if(opts.prefab){ + Prefab::do_export(export_plan, paths, opts.prefab_options, default_triplet); + } + Checks::exit_success(VCPKG_LINE_INFO); } } diff --git a/toolsrc/src/vcpkg/export.prefab.cpp b/toolsrc/src/vcpkg/export.prefab.cpp new file mode 100644 index 00000000000000..9a3f240fa678d0 --- /dev/null +++ b/toolsrc/src/vcpkg/export.prefab.cpp @@ -0,0 +1,695 @@ +#include "pch.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace vcpkg::Export::Prefab +{ + using Dependencies::ExportPlanAction; + using Dependencies::ExportPlanType; + using Install::InstallDir; + using System::CPUArchitecture; + + + + static std::vector find_modules(const VcpkgPaths& system, const fs::path& root, const std::string& ext) + { + std::vector paths; + Files::Filesystem& utils = system.get_filesystem(); + std::error_code error_code; + if (!utils.exists(root, error_code) || !utils.is_directory(root)) return paths; + + fs::stdfs::recursive_directory_iterator it(root); + fs::stdfs::recursive_directory_iterator endit; + + while (it != endit) + { + if (utils.is_regular_file(*it) && it->path().extension() == ext) + { + paths.push_back(it->path().filename()); + } + ++it; + } + return paths; + } + + std::string NdkVersion::to_string() + { + std::string ret; + this->to_string(ret); + return ret; + } + void NdkVersion::to_string(std::string& out) + { + out.append("NdkVersion{major=") + .append(std::to_string(major())) + .append(",minor=") + .append(std::to_string(minor())) + .append(",patch=") + .append(std::to_string(patch())) + .append("}"); + } + + static std::string jsonify(const std::vector& dependencies) + { + std::vector deps; + for (const auto& dep : dependencies) + { + deps.push_back("\"" + dep + "\""); + } + return Strings::join(",", deps); + } + + static std::string null_if_empty(const std::string& str) + { + std::string copy = str; + if (copy.size() == 0) + { + copy = "null"; + } + else + { + copy = "\"" + copy + "\""; + } + return copy; + } + + static std::string null_if_empty_array(const std::string& str) + { + std::string copy = str; + if (copy.size() == 0) + { + copy = "null"; + } + else + { + copy = "[" + copy + "]"; + } + return copy; + } + + std::string ABIMetadata::to_string() + { + std::string TEMPLATE = R"({ + "abi":"@ABI@", + "api":@API@, + "ndk":@NDK@, + "stl":"@STL@" +})"; + std::string json = Strings::replace_all(std::move(TEMPLATE), "@ABI@", abi); + json = Strings::replace_all(std::move(json), "@API@", std::to_string(api)); + json = Strings::replace_all(std::move(json), "@NDK@", std::to_string(ndk)); + json = Strings::replace_all(std::move(json), "@STL@", stl); + return json; + } + + std::string PlatformModuleMetadata::to_json() + { + std::string TEMPLATE = R"({ + "export_libraries": @LIBRARIES@, + "library_name": @LIBRARY_NAME@ +})"; + + std::string json = Strings::replace_all(std::move(TEMPLATE), "@LIBRARY_NAME@", null_if_empty(library_name)); + json = Strings::replace_all(std::move(json), "@LIBRARIES@", null_if_empty_array(jsonify(export_libraries))); + return json; + } + + std::string ModuleMetadata::to_json() + { + std::string TEMPLATE = R"({ + "export_libraries": [@LIBRARIES@], + "library_name":@LIBRARY_NAME@, + "android": @ANDROID_METADATA@ +})"; + + std::string json = Strings::replace_all(std::move(TEMPLATE), "@LIBRARY_NAME@", null_if_empty(library_name)); + json = Strings::replace_all(std::move(json), "@LIBRARIES@", jsonify(export_libraries)); + json = Strings::replace_all(std::move(json), "@ANDROID_METADATA@", android.to_json()); + return json; + } + + std::string PackageMetadata::to_json() + { + std::string deps = jsonify(dependencies); + + std::string TEMPLATE = R"({ + "name":"@PACKAGE_NAME@", + "schema_version": @PACKAGE_SCHEMA@, + "dependencies":[@PACKAGE_DEPS@], + "version":"@PACKAGE_VERSION@" +})"; + std::string json = Strings::replace_all(std::move(TEMPLATE), "@PACKAGE_NAME@", name); + json = Strings::replace_all(std::move(json), "@PACKAGE_SCHEMA@", std::to_string(schema)); + json = Strings::replace_all(std::move(json), "@PACKAGE_DEPS@", deps); + json = Strings::replace_all(std::move(json), "@PACKAGE_VERSION@", version); + return json; + } + + Optional find_ndk_version(const std::string& content) + { + std::smatch pkg_match; + std::regex pkg_regex(R"(Pkg\.Revision\s*=\s*(\d+)(\.\d+)(\.\d+)\s*)"); + + if (std::regex_search(content, pkg_match, pkg_regex)) + { + for (const auto& p : pkg_match) + { + std::string delimiter = "="; + std::string s = p.str(); + auto it = s.find(delimiter); + if (it != std::string::npos) + { + std::string token = (s.substr(s.find(delimiter) + 1, s.size())); + return Strings::trim(std::move(token)); + } + } + } + return {}; + } + + Optional to_version(const std::string& version) + { + if (version.size() > 100) return {}; + size_t last = 0; + size_t next = 0; + std::vector fragments(0); + + while ((next = version.find(".", last)) != std::string::npos) + { + fragments.push_back(std::stoi(version.substr(last, next - last))); + last = next + 1; + } + fragments.push_back(std::stoi(version.substr(last))); + if (fragments.size() == kFragmentSize) + { + return NdkVersion(fragments[0], fragments[1], fragments[2]); + } + return {}; + } + + static void compress_directory(const VcpkgPaths& paths, const fs::path& source, const fs::path& destination) + { + auto& fs = paths.get_filesystem(); + + std::error_code ec; + + fs.remove(destination, ec); + Checks::check_exit( + VCPKG_LINE_INFO, !fs.exists(destination), "Could not remove file: %s", destination.u8string()); +#if defined(_WIN32) + auto&& seven_zip_exe = paths.get_tool_exe(Tools::SEVEN_ZIP); + + System::cmd_execute_and_capture_output( + Strings::format( + R"("%s" a "%s" "%s\*")", seven_zip_exe.u8string(), destination.u8string(), source.u8string()), + System::get_clean_environment()); +#else + System::cmd_execute_clean( + Strings::format(R"(cd '%s' && zip --quiet -r '%s' *)", source.u8string(), destination.u8string())); +#endif + } + + static void maven_install(const fs::path& aar, const fs::path& pom, const Options& prefab_options) + { + if(prefab_options.enable_debug){ + System::print2("\n[DEBUG] Installing POM and AAR file to ~/.m2\n\n"); + } + const char* cmd_line_format = prefab_options.enable_debug ? R"("%s" "install:install-file" "-Dfile=%s" "-DpomFile=%s")" + : R"("%s" "-q" "install:install-file" "-Dfile=%s" "-DpomFile=%s")"; + + const auto cmd_line = Strings::format(cmd_line_format, + Tools::MAVEN, + aar.u8string(), + pom.u8string()); + const int exit_code = System::cmd_execute_clean(cmd_line); + Checks::check_exit(VCPKG_LINE_INFO, exit_code == 0, "Error: %s installing maven file", aar.generic_u8string()); + } + + static Build::PreBuildInfo build_info_from_triplet(const VcpkgPaths& paths, + const std::unique_ptr& provider, + const Triplet& triplet) + { + provider->load_generic_triplet_vars(triplet); + const Build::PreBuildInfo pre_build_info( + paths, triplet, provider->get_generic_triplet_vars(triplet).value_or_exit(VCPKG_LINE_INFO)); + return pre_build_info; + } + + static bool is_supported(const Build::PreBuildInfo& info) + { + return Strings::case_insensitive_ascii_equals(info.cmake_system_name, "android"); + } + + void do_export(const std::vector& export_plan, + const VcpkgPaths& paths, + const Options& prefab_options, + const Triplet& default_triplet) + { + auto provider = CMakeVars::make_triplet_cmake_var_provider(paths); + + auto build_info = build_info_from_triplet(paths, provider, default_triplet); + Checks::check_exit(VCPKG_LINE_INFO, is_supported(build_info), "Currenty supported on android triplets"); + + std::vector available_triplets = paths.get_available_triplets(); + + std::unordered_map required_archs = { + {CPUArchitecture::ARM, "armeabi-v7a"}, + {CPUArchitecture::ARM64, "arm64-v8a"}, + {CPUArchitecture::X86, "x86"}, + {CPUArchitecture::X64, "x86_64"}}; + + std::unordered_map cpu_architecture_api_map = {{CPUArchitecture::ARM64, 21}, + {CPUArchitecture::ARM, 16}, + {CPUArchitecture::X64, 21}, + {CPUArchitecture::X86, 16}}; + + + std::vector triplets; + std::unordered_map triplet_abi_map; + std::unordered_map triplet_api_map; + + for (auto& triplet_file : available_triplets){ + if (triplet_file.name.size() > 0){ + Triplet triplet = Triplet::from_canonical_name(std::move(triplet_file.name)); + auto triplet_build_info = build_info_from_triplet(paths, provider, triplet); + if (is_supported(triplet_build_info)){ + auto cpu_architecture = System::to_cpu_architecture(triplet_build_info.target_architecture).value_or_exit(VCPKG_LINE_INFO); + auto required_arch = required_archs.find(cpu_architecture); + if (required_arch != required_archs.end()){ + triplets.push_back(triplet); + triplet_abi_map[triplet] = required_archs[cpu_architecture]; + triplet_api_map[triplet] = cpu_architecture_api_map[cpu_architecture]; + required_archs.erase(required_arch); + } + } + } + } + + + Checks::check_exit( + VCPKG_LINE_INFO, required_archs.empty(), "Export requires the following architectures arm64-v8a, armeabi-v7a, x86_64, x86 to be present"); + + Optional android_ndk_home = System::get_environment_variable("ANDROID_NDK_HOME"); + + Checks::check_exit( + VCPKG_LINE_INFO, android_ndk_home.has_value(), "Error: ANDROID_NDK_HOME environment missing"); + + Files::Filesystem& utils = paths.get_filesystem(); + + const fs::path ndk_location = android_ndk_home.value_or_exit(VCPKG_LINE_INFO); + + Checks::check_exit(VCPKG_LINE_INFO, + utils.exists(ndk_location), + "Error: ANDROID_NDK_HOME Directory does not exists %s", + ndk_location.generic_u8string()); + const fs::path source_properties_location = ndk_location / "source.properties"; + + Checks::check_exit(VCPKG_LINE_INFO, + utils.exists(ndk_location), + "Error: source.properties missing in ANDROID_NDK_HOME directory %s", + source_properties_location.generic_u8string()); + + std::string content = utils.read_contents(source_properties_location, VCPKG_LINE_INFO); + + Optional version_opt = find_ndk_version(content); + + Checks::check_exit(VCPKG_LINE_INFO, + version_opt.has_value(), + "Error: NDK version missing %s", + source_properties_location.generic_u8string()); + + NdkVersion version = to_version(version_opt.value_or_exit(VCPKG_LINE_INFO)).value_or_exit(VCPKG_LINE_INFO); + + const fs::path vcpkg_root_path = paths.root; + const fs::path raw_exported_dir_path = vcpkg_root_path / "prefab"; + + utils.remove_all(raw_exported_dir_path, VCPKG_LINE_INFO); + + /* + prefab + └── + ├── aar + │   ├── AndroidManifest.xml + │   ├── META-INF + │   │   └── LICENCE + │   └── prefab + │   ├── modules + │   │   └── + │   │   ├── include + │   │   ├── libs + │   │   │   ├── android.arm64-v8a + │   │   │   │   ├── abi.json + │   │   │   │   └── lib.so + │   │   │   ├── android.armeabi-v7a + │   │   │   │   ├── abi.json + │   │   │   │   └── lib.so + │   │   │   ├── android.x86 + │   │   │   │   ├── abi.json + │   │   │   │   └── lib.so + │   │   │   └── android.x86_64 + │   │   │   ├── abi.json + │   │   │   └── lib.so + │   │   └── module.json + │   └── prefab.json + ├── -.aar + └── pom.xml + */ + + std::unordered_map version_map; + + std::error_code error_code; + + std::unordered_map> empty_package_dependencies; + + // + + for (const auto& action : export_plan) + { + + const std::string name = action.spec.name(); + auto dependencies = action.dependencies(default_triplet); + + const auto action_build_info = Build::read_build_info(utils, paths.build_info_file_path(action.spec)); + const bool is_empty_package = action_build_info.policies.is_enabled(Build::BuildPolicy::EMPTY_PACKAGE); + + + if(is_empty_package){ + empty_package_dependencies[name] = std::set(); + for(auto dependency : dependencies){ + if(empty_package_dependencies.find(dependency.name()) != empty_package_dependencies.end()){ + auto& child_deps = empty_package_dependencies[name]; + auto& parent_deps = empty_package_dependencies[dependency.name()]; + for(auto parent_dep: parent_deps){ + child_deps.insert(parent_dep); + } + } + else { + empty_package_dependencies[name].insert(dependency); + } + } + continue; + } + + const fs::path per_package_dir_path = raw_exported_dir_path / name; + + const auto& binary_paragraph = action.core_paragraph().value_or_exit(VCPKG_LINE_INFO); + const std::string norm_version = binary_paragraph.version; + + version_map[name] = norm_version; + + System::print2("\nExporting package ", name, "...\n"); + + fs::path package_directory = per_package_dir_path / "aar"; + fs::path prefab_directory = package_directory / "prefab"; + fs::path modules_directory = prefab_directory / "modules"; + + utils.create_directories(modules_directory, error_code); + + std::string artifact_id = prefab_options.maybe_artifact_id.value_or(name); + std::string group_id = prefab_options.maybe_group_id.value_or("com.vcpkg.ndk.support"); + std::string sdk_min_version = prefab_options.maybe_min_sdk.value_or("16"); + std::string sdk_target_version = prefab_options.maybe_target_sdk.value_or("29"); + + std::string MANIFEST_TEMPLATE = + R"( + +)"; + std::string manifest = Strings::replace_all(std::move(MANIFEST_TEMPLATE), "@GROUP_ID@", group_id); + manifest = Strings::replace_all(std::move(manifest), "@ARTIFACT_ID@", artifact_id); + manifest = Strings::replace_all(std::move(manifest), "@MIN_SDK_VERSION@", sdk_min_version); + manifest = Strings::replace_all(std::move(manifest), "@SDK_TARGET_VERSION@", sdk_target_version); + + fs::path manifest_path = package_directory / "AndroidManifest.xml"; + fs::path prefab_path = prefab_directory / "prefab.json"; + + fs::path meta_dir = package_directory / "META-INF"; + + utils.create_directories(meta_dir, error_code); + + const fs::path share_root = + vcpkg_root_path / "packages" / Strings::format("%s_%s", name, action.spec.triplet()); + + utils.copy_file(share_root / "share" / name / "copyright", + meta_dir / "LICENSE", + fs::copy_options::overwrite_existing, + error_code); + + PackageMetadata pm; + pm.name = artifact_id; + pm.schema = 1; + pm.version = norm_version; + + std::set dependencies_minus_empty_packages; + + for(auto dependency: dependencies){ + if(empty_package_dependencies.find(dependency.name()) != empty_package_dependencies.end()){ + for(auto& empty_package_dep: empty_package_dependencies[dependency.name()]){ + dependencies_minus_empty_packages.insert(empty_package_dep); + } + } + else { + dependencies_minus_empty_packages.insert(dependency); + } + } + + std::vector pom_dependencies; + + if (dependencies_minus_empty_packages.size() > 0) + { + pom_dependencies.push_back("\n"); + } + + for (const auto& it : dependencies_minus_empty_packages) + { + std::string maven_pom = R"( + @GROUP_ID@ + @ARTIFACT_ID@ + @VERSION@ + aar + runtime + )"; + std::string pom = Strings::replace_all(std::move(maven_pom), "@GROUP_ID@", group_id); + pom = Strings::replace_all(std::move(pom), "@ARTIFACT_ID@", it.name()); + pom = Strings::replace_all(std::move(pom), "@VERSION@", version_map[it.name()]); + pom_dependencies.push_back(pom); + pm.dependencies.push_back(it.name()); + } + + if (dependencies_minus_empty_packages.size() > 0) + { + pom_dependencies.push_back("\n"); + } + + if(prefab_options.enable_debug){ + System::print2(Strings::format( + "[DEBUG]\n\tWriting manifest\n\tTo %s\n\tWriting prefab meta data\n\tTo %s\n\n", + manifest_path.generic_u8string(), prefab_path.generic_u8string())); + } + + utils.write_contents(manifest_path, manifest, VCPKG_LINE_INFO); + utils.write_contents(prefab_path, pm.to_json(), VCPKG_LINE_INFO); + + if(prefab_options.enable_debug){ + std::vector triplet_names; + for(auto triplet: triplets){ + triplet_names.push_back(triplet.canonical_name()); + } + System::print2(Strings::format("[DEBUG] Found %d triplets\n\t%s\n\n", triplets.size(), + Strings::join("\n\t", triplet_names))); + } + + for (const auto& triplet : triplets) + { + const fs::path listfile = vcpkg_root_path / "installed" / "vcpkg" / "info" / + (Strings::format("%s_%s_%s", name, norm_version, triplet) + ".list"); + const fs::path installed_dir = vcpkg_root_path / "packages" / Strings::format("%s_%s", name, triplet); + Checks::check_exit(VCPKG_LINE_INFO, + utils.exists(listfile), + "Error: Packages not installed %s:%s %s", + name, + triplet, + listfile.generic_u8string()); + + fs::path libs = installed_dir / "lib"; + + std::vector modules; + + std::vector modules_shared = find_modules(paths, libs, ".so"); + + for (const auto& module : modules_shared) + { + modules.push_back(module); + } + + std::vector modules_static = find_modules(paths, libs, ".a"); + for (const auto& module : modules_static) + { + modules.push_back(module); + } + + // header only libs + if (modules.empty()) + { + fs::path module_dir = modules_directory / name; + fs::path module_libs_dir = module_dir / "libs"; + utils.create_directories(module_libs_dir, error_code); + fs::path installed_headers_dir = installed_dir / "include"; + fs::path exported_headers_dir = module_dir / "include"; + + ModuleMetadata meta; + fs::path module_meta_path = module_dir / "module.json"; + utils.write_contents(module_meta_path, meta.to_json(), VCPKG_LINE_INFO); + + utils.copy(installed_headers_dir, exported_headers_dir, fs::copy_options::recursive); + break; + } + else + { + for (const auto& module : modules) + { + std::string module_name = module.stem().generic_u8string(); + std::string extension = module.extension().generic_u8string(); + + ABIMetadata ab; + ab.abi = triplet_abi_map[triplet]; + ab.api = triplet_api_map[triplet]; + + ab.stl = Strings::contains(extension, "a") ?"c++_static": "c++_shared"; + ab.ndk = version.major(); + + if(prefab_options.enable_debug){ + System::print2(Strings::format("[DEBUG] Found module %s:%s\n", module_name, ab.abi)); + } + + module_name = Strings::trim(std::move(module_name)); + + if (Strings::starts_with(module_name, "lib")) + { + module_name = module_name.substr(3); + } + fs::path module_dir = (modules_directory / module_name); + fs::path module_libs_dir = + module_dir / "libs" / Strings::format("android.%s", ab.abi); + utils.create_directories(module_libs_dir, error_code); + + fs::path abi_path = module_libs_dir / "abi.json"; + + if(prefab_options.enable_debug){ + System::print2(Strings::format("\tWriting abi metadata\n\tTo %s\n", + abi_path.generic_u8string())); + } + utils.write_contents(abi_path, ab.to_string(), VCPKG_LINE_INFO); + + fs::path installed_module_path = libs / module.filename(); + fs::path exported_module_path = module_libs_dir / module.filename(); + + utils.copy_file(installed_module_path, + exported_module_path, + fs::copy_options::overwrite_existing, + error_code); + if(prefab_options.enable_debug){ + System::print2(Strings::format("\tCopying libs\n\tFrom %s\n\tTo %s\n", + installed_module_path.generic_u8string(), exported_module_path.generic_u8string())); + } + fs::path installed_headers_dir = installed_dir / "include"; + fs::path exported_headers_dir = module_libs_dir / "include"; + + + if(prefab_options.enable_debug){ + System::print2(Strings::format("\tCopying headers\n\tFrom %s\n\tTo %s\n", + installed_headers_dir.generic_u8string(), exported_headers_dir.generic_u8string())); + } + + utils.copy(installed_headers_dir, exported_headers_dir, fs::copy_options::recursive); + + ModuleMetadata meta; + + fs::path module_meta_path = module_dir / "module.json"; + + if(prefab_options.enable_debug){ + System::print2(Strings::format("\tWriting module metadata\n\tTo %s\n\n", + module_meta_path.generic_u8string())); + } + + utils.write_contents(module_meta_path, meta.to_json(), VCPKG_LINE_INFO); + } + } + } + + fs::path exported_archive_path = per_package_dir_path / Strings::format("%s-%s.aar", name, norm_version); + fs::path pom_path = per_package_dir_path / "pom.xml"; + + if(prefab_options.enable_debug){ + System::print2(Strings::format("[DEBUG] Exporting AAR And POM\n\tAAR Path %s\n\tPOM Path %s\n", + exported_archive_path.generic_u8string(), pom_path.generic_u8string())); + } + + compress_directory(paths, package_directory, exported_archive_path); + + std::string POM = R"( + + 4.0.0 + + + @GROUP_ID@ + @ARTIFACT_ID@ + @VERSION@ + aar + The Vcpkg AAR for @ARTIFACT_ID@ + https://github.com/microsoft/vcpkg.git + @DEPENDENCIES@ +)"; + + std::string pom = Strings::replace_all(std::move(POM), "@GROUP_ID@", group_id); + pom = Strings::replace_all(std::move(pom), "@ARTIFACT_ID@", artifact_id); + pom = Strings::replace_all(std::move(pom), "@DEPENDENCIES@", Strings::join("\n", pom_dependencies)); + pom = Strings::replace_all(std::move(pom), "@VERSION@", norm_version); + + utils.write_contents(pom_path, pom, VCPKG_LINE_INFO); + + if (prefab_options.enable_maven) + { + + maven_install(exported_archive_path, pom_path, prefab_options); + if(prefab_options.enable_debug){ + System::print2( + Strings::format("\n\n[DEBUG] Configuration properties in Android Studio\nIn app/build.gradle\n\n\t%s:%s:%s\n\n", + group_id, artifact_id, norm_version)); + + System::print2(R"(And cmake flags + + externalNativeBuild { + cmake { + arguments '-DANDROID_STL=c++_shared' + cppFlags "-std=c++17" + } + } + +)"); + + System::print2(R"(In gradle.properties + + android.enablePrefab=true + android.enableParallelJsonGen=false + android.prefabVersion=${prefab.version} + +)");} + } + System::print2(System::Color::success, + Strings::format("Successfuly exported %s. Checkout %s \n", + name, + raw_exported_dir_path.generic_u8string())); + } + } +} diff --git a/toolsrc/src/vcpkg/install.cpp b/toolsrc/src/vcpkg/install.cpp index 5084ac918b0e6a..1b9b7db34d6aa7 100644 --- a/toolsrc/src/vcpkg/install.cpp +++ b/toolsrc/src/vcpkg/install.cpp @@ -297,7 +297,7 @@ namespace vcpkg::Install using Build::BuildResult; using Build::ExtendedBuildResult; - ExtendedBuildResult perform_install_plan_action(const VcpkgPaths& paths, + static ExtendedBuildResult perform_install_plan_action(const VcpkgPaths& paths, InstallPlanAction& action, StatusParagraphs& status_db, IBinaryProvider* binaries_provider) diff --git a/toolsrc/src/vcpkg/metrics.cpp b/toolsrc/src/vcpkg/metrics.cpp index 308ee0d510d99f..06478d3f40e01d 100644 --- a/toolsrc/src/vcpkg/metrics.cpp +++ b/toolsrc/src/vcpkg/metrics.cpp @@ -240,7 +240,7 @@ namespace vcpkg::Metrics static MetricMessage g_metricmessage; static bool g_should_send_metrics = -#if defined(NDEBUG) && (DISABLE_METRICS == 0) +#if defined(NDEBUG) && (VCPKG_DISABLE_METRICS == 0) true #else false @@ -248,7 +248,7 @@ namespace vcpkg::Metrics ; static bool g_should_print_metrics = false; - bool get_compiled_metrics_enabled() { return DISABLE_METRICS == 0; } + bool get_compiled_metrics_enabled() { return VCPKG_DISABLE_METRICS == 0; } std::string get_MAC_user() { diff --git a/toolsrc/src/vcpkg/postbuildlint.cpp b/toolsrc/src/vcpkg/postbuildlint.cpp index 663d2e3c9caa8c..c6d5f04beb03b5 100644 --- a/toolsrc/src/vcpkg/postbuildlint.cpp +++ b/toolsrc/src/vcpkg/postbuildlint.cpp @@ -738,7 +738,7 @@ namespace vcpkg::PostBuildLint System::printf(System::Color::warning, "Expected %s crt linkage, but the following libs had invalid crt linkage:\n\n", expected_build_type.to_string()); - for (const BuildTypeAndFile btf : libs_with_invalid_crt) + for (const BuildTypeAndFile& btf : libs_with_invalid_crt) { System::printf(" %s: %s\n", btf.file.generic_string(), btf.build_type.to_string()); } @@ -786,7 +786,7 @@ namespace vcpkg::PostBuildLint if (!dlls_with_outdated_crt.empty()) { System::print2(System::Color::warning, "Detected outdated dynamic CRT in the following files:\n\n"); - for (const OutdatedDynamicCrtAndFile btf : dlls_with_outdated_crt) + for (const OutdatedDynamicCrtAndFile& btf : dlls_with_outdated_crt) { System::print2(" ", btf.file.u8string(), ": ", btf.outdated_crt.name, "\n"); } @@ -871,11 +871,11 @@ namespace vcpkg::PostBuildLint if (!pre_build_info.build_type) error_count += check_matching_debug_and_release_binaries(debug_libs, release_libs); + if (!build_info.policies.is_enabled(BuildPolicy::SKIP_ARCHITECTURE_CHECK)) { std::vector libs; libs.insert(libs.cend(), debug_libs.cbegin(), debug_libs.cend()); libs.insert(libs.cend(), release_libs.cbegin(), release_libs.cend()); - error_count += check_lib_architecture(pre_build_info.target_architecture, libs); } diff --git a/toolsrc/src/vcpkg/triplet.cpp b/toolsrc/src/vcpkg/triplet.cpp index 8026baa8a8208f..47b82498964e71 100644 --- a/toolsrc/src/vcpkg/triplet.cpp +++ b/toolsrc/src/vcpkg/triplet.cpp @@ -39,6 +39,12 @@ namespace vcpkg const Triplet Triplet::ARM_UWP = from_canonical_name("arm-uwp"); const Triplet Triplet::ARM64_UWP = from_canonical_name("arm64-uwp"); + // + const Triplet Triplet::ARM_ANDROID = from_canonical_name("arm-android"); + const Triplet Triplet::ARM64_ANDROID = from_canonical_name("arm64-android"); + const Triplet Triplet::X86_ANDROID = from_canonical_name("x86-android"); + const Triplet Triplet::X64_ANDROID = from_canonical_name("x64-android"); + Triplet Triplet::from_canonical_name(std::string&& triplet_as_string) { std::string s(Strings::ascii_to_lowercase(std::move(triplet_as_string))); @@ -55,19 +61,19 @@ namespace vcpkg Optional Triplet::guess_architecture() const noexcept { using System::CPUArchitecture; - if (*this == X86_WINDOWS || *this == X86_UWP) + if (*this == X86_WINDOWS || *this == X86_UWP || *this == X86_ANDROID) { return CPUArchitecture::X86; } - else if (*this == X64_WINDOWS || *this == X64_UWP) + else if (*this == X64_WINDOWS || *this == X64_UWP || *this ==X64_ANDROID) { return CPUArchitecture::X64; } - else if (*this == ARM_WINDOWS || *this == ARM_UWP) + else if (*this == ARM_WINDOWS || *this == ARM_UWP || *this == ARM_ANDROID) { return CPUArchitecture::ARM; } - else if (*this == ARM64_WINDOWS || *this == ARM64_UWP) + else if (*this == ARM64_WINDOWS || *this == ARM64_UWP || *this == ARM64_ANDROID) { return CPUArchitecture::ARM64; } diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index fc6d37de7b2932..ed80a210e88c89 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -74,11 +74,11 @@ - Level3 + Level4 Disabled true ..\include - DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) + VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true Use @@ -92,7 +92,7 @@ Disabled true ..\include - DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) + VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true Use @@ -108,7 +108,7 @@ true true ..\include - DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) + VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true Use @@ -127,7 +127,7 @@ true true ..\include - DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) + VCPKG_DISABLE_METRICS=$(DISABLE_METRICS);VCPKG_VERSION=$(VCPKG_VERSION);_MBCS;NDEBUG;%(PreprocessorDefinitions) /std:c++latest %(AdditionalOptions) true Use @@ -179,6 +179,7 @@ + @@ -258,6 +259,7 @@ + @@ -288,4 +290,4 @@ - \ No newline at end of file + diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index 14ec1e105dadb6..9e2e8c08ac122e 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -71,7 +71,7 @@ - Level3 + Level4 Disabled true ..\include diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj index 24bb7b29b0c77f..07e10e1a431b56 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -109,7 +109,7 @@ - Level3 + Level4 Disabled ..\include;$(VCInstallDir)UnitTest\include;$(VsInstallRoot)\VC\Auxiliary\VS\UnitTest\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;%(PreprocessorDefinitions) @@ -186,4 +186,4 @@ - \ No newline at end of file + diff --git a/triplets/community/arm-ios.cmake b/triplets/community/arm-ios.cmake new file mode 100644 index 00000000000000..7fee3751d8e967 --- /dev/null +++ b/triplets/community/arm-ios.cmake @@ -0,0 +1,4 @@ +set(VCPKG_TARGET_ARCHITECTURE arm) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_CMAKE_SYSTEM_NAME iOS) diff --git a/triplets/community/arm64-ios.cmake b/triplets/community/arm64-ios.cmake new file mode 100644 index 00000000000000..c632e93819e3ef --- /dev/null +++ b/triplets/community/arm64-ios.cmake @@ -0,0 +1,4 @@ +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_CMAKE_SYSTEM_NAME iOS) diff --git a/triplets/community/x64-ios.cmake b/triplets/community/x64-ios.cmake new file mode 100644 index 00000000000000..0c93d6c684c6a5 --- /dev/null +++ b/triplets/community/x64-ios.cmake @@ -0,0 +1,4 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_CMAKE_SYSTEM_NAME iOS) diff --git a/triplets/community/x86-ios.cmake b/triplets/community/x86-ios.cmake new file mode 100644 index 00000000000000..143b373b932220 --- /dev/null +++ b/triplets/community/x86-ios.cmake @@ -0,0 +1,4 @@ +set(VCPKG_TARGET_ARCHITECTURE x86) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_CMAKE_SYSTEM_NAME iOS)