diff --git a/ports/zydis/portfile.cmake b/ports/zydis/portfile.cmake index fe635961ceb5af..a07d6d8729d682 100644 --- a/ports/zydis/portfile.cmake +++ b/ports/zydis/portfile.cmake @@ -1,19 +1,13 @@ -vcpkg_download_distfile( - OSX_INTEL_ALIGNMENT_FIX - URLS https://github.com/zyantific/zydis/commit/a605f54580c26d2164530fab323057834569d169.patch?full_index=1 - SHA512 15fad10e4880ab2ee494babc0451b96604a6cc00c09c6740c6b97b83718e01d8e117614bf8f9ec8a6777e9baa1336c7f540709b21dcdc9b53f912bd117f1d3c0 - FILENAME zydis-intel-alignment-fix-a605f54580c26d2164530fab323057834569d169.patch -) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO zyantific/zydis REF "v${VERSION}" - SHA512 334284bccfb6ce61cc530fd479d6278db3e4df1fb52b311acd7d21558843c9bf14e74a199cd937041d434260b65c506c07ae1a37243d2240eb9443ae5e56e000 + SHA512 e07add4d43768ded02a238911fde6e74d2391abf8df282f774fca1a8c3fca3e97b03e90e0f3c7c0f3c75485fb29c0be4071d5e5b2e23dd5b8b1a864e3b713fbc HEAD_REF master PATCHES zycore.patch - "${OSX_INTEL_ALIGNMENT_FIX}" + ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ZYDIS_BUILD_SHARED_LIB) @@ -21,8 +15,11 @@ string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ZYDIS_BUILD_SHARED_LIB vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS + -DZYAN_SYSTEM_ZYCORE=ON -DZYDIS_BUILD_SHARED_LIB=${ZYDIS_BUILD_SHARED_LIB} + -DZYDIS_BUILD_DOXYGEN=OFF -DZYDIS_BUILD_EXAMPLES=OFF + -DZYDIS_BUILD_TESTS=OFF OPTIONS_DEBUG -DZYDIS_BUILD_TOOLS=OFF ) @@ -34,7 +31,6 @@ vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/zydis) vcpkg_copy_tools(TOOL_NAMES ZydisDisasm ZydisInfo AUTO_CLEAN) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/Zydis/Defines.h" "defined(ZYDIS_STATIC_BUILD)" "1") endif() diff --git a/ports/zydis/vcpkg.json b/ports/zydis/vcpkg.json index c9459b1d9a1936..6cc61cfb156ca3 100644 --- a/ports/zydis/vcpkg.json +++ b/ports/zydis/vcpkg.json @@ -1,7 +1,6 @@ { "name": "zydis", - "version-semver": "4.0.0", - "port-version": 2, + "version-semver": "4.1.0", "description": "Fast and lightweight x86/x86-64 disassembler library.", "homepage": "https://zydis.re", "license": "MIT", diff --git a/ports/zydis/zycore.patch b/ports/zydis/zycore.patch index 5e62c7f29c4513..503daa2a898c11 100644 --- a/ports/zydis/zycore.patch +++ b/ports/zydis/zycore.patch @@ -1,66 +1,14 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5e812fb..64c6e97 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -78,8 +78,7 @@ if (ZYAN_SYSTEM_ZYCORE) - find_package(Zycore) - else () - # Try to initialize the Zycore submodule using Git -- if (NOT EXISTS "${ZYAN_ZYCORE_PATH}/CMakeLists.txt" AND -- "${ZYAN_ZYCORE_PATH}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}/dependencies/zycore") -+ if (0) - find_package(Git QUIET) - if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") - execute_process( -@@ -89,7 +88,7 @@ else () - endif() - endif () - -- if (NOT EXISTS "${ZYAN_ZYCORE_PATH}/CMakeLists.txt") -+ if (0) - message( - FATAL_ERROR - "Can't find zycore submodule. Please make sure to clone the repo recursively.\n" -@@ -101,7 +100,7 @@ else () - ) - endif () - -- add_subdirectory(${ZYAN_ZYCORE_PATH} "zycore" EXCLUDE_FROM_ALL) -+ find_package(zycore CONFIG REQUIRED) - endif () - - # =============================================================================================== # -@@ -115,7 +114,7 @@ else () - target_compile_definitions("Zydis" PUBLIC "ZYDIS_STATIC_BUILD") - endif () - --target_link_libraries("Zydis" PUBLIC "Zycore") -+target_link_libraries("Zydis" PUBLIC Zycore::Zycore) - target_include_directories("Zydis" - PUBLIC - $ -@@ -383,14 +382,16 @@ if (ZYDIS_BUILD_TOOLS AND NOT ZYAN_NO_LIBC) - target_compile_definitions("ZydisFuzzReEncoding" PRIVATE "ZYDIS_LIBFUZZER") - endif () - -- add_executable("ZydisTestEncoderAbsolute" -- "tools/ZydisTestEncoderAbsolute.c") -- target_link_libraries("ZydisTestEncoderAbsolute" "Zydis") -- set_target_properties("ZydisTestEncoderAbsolute" PROPERTIES FOLDER "Tools") -- target_compile_definitions("ZydisTestEncoderAbsolute" PRIVATE "_CRT_SECURE_NO_WARNINGS") -- zyan_set_common_flags("ZydisTestEncoderAbsolute") -- zyan_maybe_enable_wpo("ZydisTestEncoderAbsolute") -- _maybe_set_emscripten_cfg("ZydisTestEncoderAbsolute") -+ if (NOT ZYDIS_BUILD_SHARED_LIB) -+ add_executable("ZydisTestEncoderAbsolute" -+ "tools/ZydisTestEncoderAbsolute.c") -+ target_link_libraries("ZydisTestEncoderAbsolute" "Zydis") -+ set_target_properties("ZydisTestEncoderAbsolute" PROPERTIES FOLDER "Tools") -+ target_compile_definitions("ZydisTestEncoderAbsolute" PRIVATE "_CRT_SECURE_NO_WARNINGS") -+ zyan_set_common_flags("ZydisTestEncoderAbsolute") -+ zyan_maybe_enable_wpo("ZydisTestEncoderAbsolute") -+ _maybe_set_emscripten_cfg("ZydisTestEncoderAbsolute") -+ endif () - endif () - - add_executable("ZydisInfo" "tools/ZydisInfo.c") +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 62d5de6..ee500c7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -138,7 +138,8 @@ function (locate_zycore) + ) + endfunction () + +-locate_zycore() ++find_package(zycore CONFIG REQUIRED) ++add_library(Zycore ALIAS Zycore::Zycore) + + # =============================================================================================== # + # Library configuration # diff --git a/versions/baseline.json b/versions/baseline.json index 7fc61e78ad5797..359f6752a1508f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -9733,8 +9733,8 @@ "port-version": 0 }, "zydis": { - "baseline": "4.0.0", - "port-version": 2 + "baseline": "4.1.0", + "port-version": 0 }, "zyre": { "baseline": "2019-07-07", diff --git a/versions/z-/zydis.json b/versions/z-/zydis.json index 60a5fe1bf0560e..073e577b29f3e1 100644 --- a/versions/z-/zydis.json +++ b/versions/z-/zydis.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "a08c5c766c41651280cb783e5dd0a8a5764f9700", + "version-semver": "4.1.0", + "port-version": 0 + }, { "git-tree": "4057692f573c3990f5767e5e2952fc54a76cb1c9", "version-semver": "4.0.0",