Skip to content

Commit

Permalink
[zydis] Update version to v4.1.0 (#39037)
Browse files Browse the repository at this point in the history
Fix #38691

- [x] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [x] SHA512s are updated for each updated download.
- [ ] ~~The "supports" clause reflects platforms that may be fixed by
this new version.~~
- [ ] ~~Any fixed [CI
baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt)
entries are removed from that file.~~
- [x] Any patches that are no longer applied are deleted from the port's
directory.
- [x] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [x] Only one version is added to each modified port's versions file.
  • Loading branch information
FrankXie05 authored Jun 4, 2024
1 parent c986993 commit c4451fd
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 79 deletions.
14 changes: 5 additions & 9 deletions ports/zydis/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
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)

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
)
Expand All @@ -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()

Expand Down
3 changes: 1 addition & 2 deletions ports/zydis/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
80 changes: 14 additions & 66 deletions ports/zydis/zycore.patch
Original file line number Diff line number Diff line change
@@ -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
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
@@ -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 #
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions versions/z-/zydis.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "a08c5c766c41651280cb783e5dd0a8a5764f9700",
"version-semver": "4.1.0",
"port-version": 0
},
{
"git-tree": "4057692f573c3990f5767e5e2952fc54a76cb1c9",
"version-semver": "4.0.0",
Expand Down

0 comments on commit c4451fd

Please sign in to comment.