aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/keystone
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/keystone')
-rw-r--r--vcpkg/ports/keystone/0001-fix-gcc15.patch12
-rw-r--r--vcpkg/ports/keystone/0002-fix-cmake4.patch39
-rw-r--r--vcpkg/ports/keystone/portfile.cmake54
-rw-r--r--vcpkg/ports/keystone/vcpkg.json15
4 files changed, 120 insertions, 0 deletions
diff --git a/vcpkg/ports/keystone/0001-fix-gcc15.patch b/vcpkg/ports/keystone/0001-fix-gcc15.patch
new file mode 100644
index 0000000..5e0105f
--- /dev/null
+++ b/vcpkg/ports/keystone/0001-fix-gcc15.patch
@@ -0,0 +1,12 @@
+diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h
+index 3346de93..a2adf853 100644
+--- a/llvm/include/llvm/ADT/STLExtras.h
++++ b/llvm/include/llvm/ADT/STLExtras.h
+@@ -21,6 +21,7 @@
+ #include <algorithm> // for std::all_of
+ #include <cassert>
+ #include <cstddef> // for std::size_t
++#include <cstdint>
+ #include <cstdlib> // for qsort
+ #include <functional>
+ #include <iterator>
diff --git a/vcpkg/ports/keystone/0002-fix-cmake4.patch b/vcpkg/ports/keystone/0002-fix-cmake4.patch
new file mode 100644
index 0000000..8e66e48
--- /dev/null
+++ b/vcpkg/ports/keystone/0002-fix-cmake4.patch
@@ -0,0 +1,39 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ # Keystone Assembler Engine (www.keystone-engine.org)
+ # By Nguyen Anh Quynh, 2016
+
+-cmake_minimum_required(VERSION 2.8.7)
++cmake_minimum_required(VERSION 3.5)
+ project(keystone)
+
+ set(KEYSTONE_VERSION_MAJOR 0)
+@@ -24,7 +24,7 @@ if (POLICY CMP0051)
+ # stripped everywhere that access the SOURCES property, so we just
+ # defer to the OLD behavior of not including generator expressions
+ # in the output for now.
+- cmake_policy(SET CMP0051 OLD)
++ # cmake_policy(SET CMP0051 OLD)
+ endif()
+
+ if (POLICY CMP0063)
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ # See docs/CMake.html for instructions about how to build LLVM with CMake.
+
+-cmake_minimum_required(VERSION 2.8.7)
++cmake_minimum_required(VERSION 3.5)
+
+ set(LLVM_INSTALL_TOOLCHAIN_ONLY ON)
+
+@@ -19,7 +19,7 @@ if (POLICY CMP0051)
+ # stripped everywhere that access the SOURCES property, so we just
+ # defer to the OLD behavior of not including generator expressions
+ # in the output for now.
+- cmake_policy(SET CMP0051 OLD)
++ # cmake_policy(SET CMP0051 OLD)
+ endif()
+
+ if(CMAKE_VERSION VERSION_LESS 3.1.20141117)
diff --git a/vcpkg/ports/keystone/portfile.cmake b/vcpkg/ports/keystone/portfile.cmake
new file mode 100644
index 0000000..e650110
--- /dev/null
+++ b/vcpkg/ports/keystone/portfile.cmake
@@ -0,0 +1,54 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO keystone-engine/keystone
+ REF dc7932ef2b2c4a793836caec6ecab485005139d6 # 0.9.2
+ SHA512 ebcdb1cca6dfdf76e0ad2a42a667044806e5c083c07357908298c6ef23d15960f887efa05c1cb3dee90ebdcd5af819bcf8af0fa1aa068aa9a0c6703dee29514e
+ HEAD_REF master
+ PATCHES
+ 0001-fix-gcc15.patch
+ 0002-fix-cmake4.patch
+)
+
+vcpkg_find_acquire_program(PYTHON3)
+vcpkg_find_acquire_program(PKGCONFIG)
+
+string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" KEYSTONE_BUILD_STATIC_RUNTIME)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DKEYSTONE_BUILD_STATIC_RUNTIME=${KEYSTONE_BUILD_STATIC_RUNTIME}
+ "-DPYTHON_EXECUTABLE=${PYTHON3}"
+ "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
+
+ # Add support for only a subset of architectures
+ #-DLLVM_TARGETS_TO_BUILD="AArch64;X86"
+)
+
+vcpkg_cmake_install()
+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
+ 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(REMOVE ${DLLS})
+endif()
+
+vcpkg_fixup_pkgconfig()
+
+vcpkg_install_copyright(
+ COMMENT [[
+Keystone is distributed under dual Version 2 of the GNU General Public License (GPLv2) and commercial license.
+For commercial usage in production environments, contact the authors of Keystone to buy a royalty-free license keystone.engine@gmail.com
+]]
+ FILE_LIST "${SOURCE_PATH}/COPYING"
+)
diff --git a/vcpkg/ports/keystone/vcpkg.json b/vcpkg/ports/keystone/vcpkg.json
new file mode 100644
index 0000000..618b9c6
--- /dev/null
+++ b/vcpkg/ports/keystone/vcpkg.json
@@ -0,0 +1,15 @@
+{
+ "name": "keystone",
+ "version-semver": "0.9.2",
+ "port-version": 4,
+ "description": "A Lightweight multi-platform, multi-architecture assembler framework.",
+ "homepage": "https://github.com/keystone-engine/keystone",
+ "license": null,
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ }
+ ]
+}