aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/capstone
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/capstone
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/capstone')
-rw-r--r--vcpkg/ports/capstone/001-silence-windows-crt-secure-warnings.patch15
-rw-r--r--vcpkg/ports/capstone/002-force-exportname-capstone.patch22
-rw-r--r--vcpkg/ports/capstone/portfile.cmake62
-rw-r--r--vcpkg/ports/capstone/vcpkg.json73
4 files changed, 172 insertions, 0 deletions
diff --git a/vcpkg/ports/capstone/001-silence-windows-crt-secure-warnings.patch b/vcpkg/ports/capstone/001-silence-windows-crt-secure-warnings.patch
new file mode 100644
index 0000000..a2e99e9
--- /dev/null
+++ b/vcpkg/ports/capstone/001-silence-windows-crt-secure-warnings.patch
@@ -0,0 +1,15 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f5f4448..5e5cc7e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -87,6 +87,10 @@ if(CAPSTONE_BUILD_STATIC_RUNTIME)
+ set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
+ endif()
+
++if(WIN32)
++ add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
++endif()
++
+ ## sources
+ set(SOURCES_ENGINE
+ cs.c
diff --git a/vcpkg/ports/capstone/002-force-exportname-capstone.patch b/vcpkg/ports/capstone/002-force-exportname-capstone.patch
new file mode 100644
index 0000000..50735f5
--- /dev/null
+++ b/vcpkg/ports/capstone/002-force-exportname-capstone.patch
@@ -0,0 +1,22 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4797bc57..929eee49 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -658,7 +658,7 @@ target_include_directories(capstone PUBLIC
+ if(BUILD_STATIC_LIBS)
+ add_library(capstone_static STATIC $<TARGET_OBJECTS:capstone>)
+ # Use normal capstone name. Otherwise we get libcapstone_static.a
+- set_target_properties(capstone_static PROPERTIES OUTPUT_NAME "capstone")
++ set_target_properties(capstone_static PROPERTIES OUTPUT_NAME "capstone" EXPORT_NAME "capstone")
+ target_include_directories(capstone_static PUBLIC
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
+ )
+@@ -668,7 +668,7 @@ if(BUILD_SHARED_LIBS)
+ set_property(TARGET capstone PROPERTY POSITION_INDEPENDENT_CODE 1)
+ add_library(capstone_shared SHARED $<TARGET_OBJECTS:capstone>)
+ # Use normal capstone name. Otherwise we get libcapstone_shared.so
+- set_target_properties(capstone_shared PROPERTIES OUTPUT_NAME "capstone")
++ set_target_properties(capstone_shared PROPERTIES OUTPUT_NAME "capstone" EXPORT_NAME "capstone")
+ set_target_properties(capstone_shared PROPERTIES
+ VERSION ${PROJECT_VERSION}
+ SOVERSION ${PROJECT_VERSION_MAJOR}
diff --git a/vcpkg/ports/capstone/portfile.cmake b/vcpkg/ports/capstone/portfile.cmake
new file mode 100644
index 0000000..bfeb9de
--- /dev/null
+++ b/vcpkg/ports/capstone/portfile.cmake
@@ -0,0 +1,62 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO "capstone-engine/capstone"
+ REF "${VERSION}"
+ SHA512 d4ed08a2ab4ed8ede51a163e98542129d6441889cf6936ac9e3f8027fb2dfcbb04a7aacba14c2a007e788790bb3939c173b47db3d95f5dd9eafce2f30ff493e1
+ HEAD_REF next
+ PATCHES
+ 001-silence-windows-crt-secure-warnings.patch
+ 002-force-exportname-capstone.patch
+)
+
+string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_CRT)
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" CAPSTONE_STATIC)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ "arm" CAPSTONE_ARM_SUPPORT
+ "arm64" CAPSTONE_ARM64_SUPPORT
+ "evm" CAPSTONE_EVM_SUPPORT
+ "m680x" CAPSTONE_M680X_SUPPORT
+ "m68k" CAPSTONE_M68K_SUPPORT
+ "mips" CAPSTONE_MIPS_SUPPORT
+ "ppc" CAPSTONE_PPC_SUPPORT
+ "sparc" CAPSTONE_SPARC_SUPPORT
+ "sysz" CAPSTONE_SYSZ_SUPPORT
+ "tms320c64x" CAPSTONE_TMS320C64X_SUPPORT
+ "x86" CAPSTONE_X86_SUPPORT
+ "xcore" CAPSTONE_XCORE_SUPPORT
+ "mos65xx" CAPSTONE_MOS65XX_SUPPORT
+ "tricore" CAPSTONE_TRICORE_SUPPORT
+ "wasm" CAPSTONE_WASM_SUPPORT
+ "bpf" CAPSTONE_BPF_SUPPORT
+ "riscv" CAPSTONE_RISCV_SUPPORT
+ "diet" CAPSTONE_BUILD_DIET
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DCAPSTONE_ARCHITECTURE_DEFAULT=OFF
+ -DCAPSTONE_BUILD_TESTS=OFF
+ -DCAPSTONE_BUILD_CSTOOL=OFF
+ -DCAPSTONE_BUILD_STATIC_RUNTIME=${STATIC_CRT}
+ -DBUILD_STATIC_RUNTIME=${STATIC_CRT}
+ -DBUILD_STATIC_LIBS=${CAPSTONE_STATIC}
+ ${FEATURE_OPTIONS}
+ MAYBE_UNUSED_VARIABLES
+ CAPSTONE_BUILD_STATIC_RUNTIME
+ BUILD_STATIC_RUNTIME
+ BUILD_STATIC_LIBS
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(
+ FILE_LIST "${SOURCE_PATH}/LICENSE.TXT"
+)
diff --git a/vcpkg/ports/capstone/vcpkg.json b/vcpkg/ports/capstone/vcpkg.json
new file mode 100644
index 0000000..a91bb2a
--- /dev/null
+++ b/vcpkg/ports/capstone/vcpkg.json
@@ -0,0 +1,73 @@
+{
+ "name": "capstone",
+ "version": "5.0.6",
+ "description": "Multi-architecture disassembly framework",
+ "homepage": "https://github.com/capstone-engine/capstone",
+ "license": "BSD-3-Clause",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "arm": {
+ "description": "Capstone disassembly support for ARM"
+ },
+ "arm64": {
+ "description": "Capstone disassembly support for ARM64"
+ },
+ "bpf": {
+ "description": "Capstone disassembly support for BPF"
+ },
+ "diet": {
+ "description": "Build Capstone in diet mode (reduced features for smaller size)"
+ },
+ "evm": {
+ "description": "Capstone disassembly support for EVM"
+ },
+ "m680x": {
+ "description": "Capstone disassembly support for M680X"
+ },
+ "m68k": {
+ "description": "Capstone disassembly support for M68k"
+ },
+ "mips": {
+ "description": "Capstone disassembly support for MIPS"
+ },
+ "mos65xx": {
+ "description": "Capstone disassembly support for MOS65XX"
+ },
+ "ppc": {
+ "description": "Capstone disassembly support for PowerPC"
+ },
+ "riscv": {
+ "description": "Capstone disassembly support for RISC-V"
+ },
+ "sparc": {
+ "description": "Capstone disassembly support for SPARC"
+ },
+ "sysz": {
+ "description": "Capstone disassembly support for SysZ"
+ },
+ "tms320c64x": {
+ "description": "Capstone disassembly support for TMS320C64X"
+ },
+ "tricore": {
+ "description": "Capstone disassembly support for TriCore"
+ },
+ "wasm": {
+ "description": "Capstone disassembly support for WebAssembly"
+ },
+ "x86": {
+ "description": "Capstone disassembly support for x86"
+ },
+ "xcore": {
+ "description": "Capstone disassembly support for XCore"
+ }
+ }
+}