From 016ac4266d72491f7afe858a9cc0d2dad04a1f03 Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Tue, 10 Aug 2021 22:45:14 -0700 Subject: [PATCH 1/7] [keystone] Fix static build with dynamic CRT on Windows --- ports/keystone/CONTROL | 3 --- ports/keystone/portfile.cmake | 39 +++++++++++++++-------------------- ports/keystone/vcpkg.json | 13 ++++++++++++ scripts/ci.baseline.txt | 3 --- 4 files changed, 30 insertions(+), 28 deletions(-) delete mode 100644 ports/keystone/CONTROL create mode 100644 ports/keystone/vcpkg.json diff --git a/ports/keystone/CONTROL b/ports/keystone/CONTROL deleted file mode 100644 index cc2c01c2f928a8..00000000000000 --- a/ports/keystone/CONTROL +++ /dev/null @@ -1,3 +0,0 @@ -Source: keystone -Version: 0.9.2 -Description: Lightweight multi-platform, multi-architecture assembler framework diff --git a/ports/keystone/portfile.cmake b/ports/keystone/portfile.cmake index f75cfeeea220e3..2b27387c1d23cc 100644 --- a/ports/keystone/portfile.cmake +++ b/ports/keystone/portfile.cmake @@ -1,3 +1,5 @@ +vcpkg_fail_port_install(ON_TARGET "uwp") + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO keystone-engine/keystone @@ -8,43 +10,36 @@ vcpkg_from_github( vcpkg_find_acquire_program(PYTHON2) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" KEYSTONE_BUILD_STATIC) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" KEYSTONE_BUILD_SHARED) +string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" KEYSTONE_BUILD_STATIC_RUNTIME) -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" OPTIONS - -DKEYSTONE_BUILD_STATIC=${KEYSTONE_BUILD_STATIC} - -DKEYSTONE_BUILD_SHARED=${KEYSTONE_BUILD_SHARED} + -DKEYSTONE_BUILD_STATIC_RUNTIME=${KEYSTONE_BUILD_STATIC_RUNTIME} -DPYTHON_EXECUTABLE=${PYTHON2} # Add support for only a subset of architectures #-DLLVM_TARGETS_TO_BUILD="AArch64;X86" ) -vcpkg_install_cmake() +vcpkg_cmake_install() vcpkg_copy_pdbs() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(GLOB EXES ${CURRENT_PACKAGES_DIR}/bin/*.exe ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) -if(EXES) - file(REMOVE ${EXES}) -endif() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + vcpkg_copy_tools(TOOL_NAMES kstool AUTO_CLEAN) else() # Move DLLs - file(GLOB DLLS ${CURRENT_PACKAGES_DIR}/lib/*.dll) - file(COPY ${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") + file(COPY "${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin") file(REMOVE ${DLLS}) - file(GLOB DLLS ${CURRENT_PACKAGES_DIR}/debug/lib/*.dll) - file(COPY ${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(GLOB "DLLS ${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") + file(COPY "${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin") file(REMOVE ${DLLS}) endif() +vcpkg_fixup_pkgconfig() + # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING - DESTINATION ${CURRENT_PACKAGES_DIR}/share/keystone - RENAME copyright -) +file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) \ No newline at end of file diff --git a/ports/keystone/vcpkg.json b/ports/keystone/vcpkg.json new file mode 100644 index 00000000000000..1d4aa2265f47b2 --- /dev/null +++ b/ports/keystone/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "keystone", + "version-semver": "0.9.2", + "description": "A Lightweight multi-platform, multi-architecture assembler framework.", + "homepage": "https://github.com/keystone-engine/keystone", + "supports": "!uwp", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + } + ] +} diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 7f53972bc521e1..a1e9fabebb2245 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -497,8 +497,6 @@ jemalloc:x64-uwp=fail jemalloc:x64-windows-static=fail jinja2cpplight:arm-uwp=fail jinja2cpplight:x64-uwp=fail -keystone:arm-uwp=fail -keystone:x64-uwp=fail kfr:arm64-windows=fail kfr:arm-uwp=fail kfr:x64-linux=fail @@ -1723,7 +1721,6 @@ clockutils:x64-windows-static-md=fail fastcgi:x64-windows-static-md=fail gmp:x64-windows-static-md=fail ijg-libjpeg:x64-windows-static-md=fail -keystone:x64-windows-static-md=fail libcerf:x64-windows-static-md=fail libgo:x64-windows-static-md=fail libmicrohttpd:x64-windows-static-md=fail From e981dec3b65ad7f0db1cbff61750383603c86b2d Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Tue, 10 Aug 2021 22:49:58 -0700 Subject: [PATCH 2/7] Add port-version --- ports/keystone/vcpkg.json | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/keystone/vcpkg.json b/ports/keystone/vcpkg.json index 1d4aa2265f47b2..62827d58e690d2 100644 --- a/ports/keystone/vcpkg.json +++ b/ports/keystone/vcpkg.json @@ -1,6 +1,7 @@ { "name": "keystone", "version-semver": "0.9.2", + "port-version": 1, "description": "A Lightweight multi-platform, multi-architecture assembler framework.", "homepage": "https://github.com/keystone-engine/keystone", "supports": "!uwp", From 5a9b6614c754337ae16d2cf21d98bb6c5b77fae0 Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Tue, 10 Aug 2021 22:50:34 -0700 Subject: [PATCH 3/7] Update version files --- versions/baseline.json | 2 +- versions/k-/keystone.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index ecae6d2b7358e8..b445c674272327 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2870,7 +2870,7 @@ }, "keystone": { "baseline": "0.9.2", - "port-version": 0 + "port-version": 1 }, "kf5archive": { "baseline": "5.84.0", diff --git a/versions/k-/keystone.json b/versions/k-/keystone.json index c8918172178fed..79d7b70adb61a7 100644 --- a/versions/k-/keystone.json +++ b/versions/k-/keystone.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "775c69e6c08d1f2b1bdd867f0fee8c7548279fb3", + "version-semver": "0.9.2", + "port-version": 1 + }, { "git-tree": "779d3f65bc01be0cfb50208ec50673612154023f", "version-string": "0.9.2", From 1e4ce6662e84ea6c9f1c8a2195979dd74a75672e Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Tue, 10 Aug 2021 22:58:27 -0700 Subject: [PATCH 4/7] Add double quotes for the path --- ports/keystone/portfile.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/keystone/portfile.cmake b/ports/keystone/portfile.cmake index 2b27387c1d23cc..e359b5710af50f 100644 --- a/ports/keystone/portfile.cmake +++ b/ports/keystone/portfile.cmake @@ -32,10 +32,10 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") else() # Move DLLs file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") - file(COPY "${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin") + file(COPY ${DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/bin") file(REMOVE ${DLLS}) - file(GLOB "DLLS ${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") - file(COPY "${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin") + file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") + file(COPY ${DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") file(REMOVE ${DLLS}) endif() From 1e6440c1bd3cf7efef13fd0e5b4d105bf62b7798 Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Tue, 10 Aug 2021 22:59:45 -0700 Subject: [PATCH 5/7] Update versions/k-/keystone.json --- versions/k-/keystone.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/k-/keystone.json b/versions/k-/keystone.json index 79d7b70adb61a7..e571bc32f2edc7 100644 --- a/versions/k-/keystone.json +++ b/versions/k-/keystone.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "775c69e6c08d1f2b1bdd867f0fee8c7548279fb3", + "git-tree": "b44b0717c7ac7badb9565ed07b7d12a0b67c2a8a", "version-semver": "0.9.2", "port-version": 1 }, From 7ba741fb5376ce893f46299eed7617ee6c0620d6 Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Wed, 11 Aug 2021 01:41:15 -0700 Subject: [PATCH 6/7] Add comments for kstool --- ports/keystone/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/keystone/portfile.cmake b/ports/keystone/portfile.cmake index e359b5710af50f..6a6e25690e9f06 100644 --- a/ports/keystone/portfile.cmake +++ b/ports/keystone/portfile.cmake @@ -28,6 +28,7 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + #For windows, do not build kstool if building DLL https://github.com/keystone-engine/keystone/blob/master/CMakeLists.txt#L74 vcpkg_copy_tools(TOOL_NAMES kstool AUTO_CLEAN) else() # Move DLLs From f1f7a30870529ae7f12aedcd1ec368a862708698 Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Wed, 11 Aug 2021 01:42:13 -0700 Subject: [PATCH 7/7] Update versions/k-/keystone.json --- versions/k-/keystone.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/k-/keystone.json b/versions/k-/keystone.json index e571bc32f2edc7..7f8c71f6fbf6e0 100644 --- a/versions/k-/keystone.json +++ b/versions/k-/keystone.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "b44b0717c7ac7badb9565ed07b7d12a0b67c2a8a", + "git-tree": "34865a7cf3fbcf4f104e8b136862aa8acc1a7ca7", "version-semver": "0.9.2", "port-version": 1 },