diff options
Diffstat (limited to 'vcpkg/ports/triton')
| -rw-r--r-- | vcpkg/ports/triton/fix_bin_path.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/triton/portfile.cmake | 51 | ||||
| -rw-r--r-- | vcpkg/ports/triton/vcpkg.json | 46 |
3 files changed, 110 insertions, 0 deletions
diff --git a/vcpkg/ports/triton/fix_bin_path.patch b/vcpkg/ports/triton/fix_bin_path.patch new file mode 100644 index 0000000..13b02bd --- /dev/null +++ b/vcpkg/ports/triton/fix_bin_path.patch @@ -0,0 +1,13 @@ +diff --git a/src/libtriton/CMakeLists.txt b/src/libtriton/CMakeLists.txt
+index 3c3ef6b..1adb110 100644
+--- a/src/libtriton/CMakeLists.txt
++++ b/src/libtriton/CMakeLists.txt
+@@ -318,7 +318,7 @@ install(
+ EXPORT tritonTargets
+ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/triton"
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ )
diff --git a/vcpkg/ports/triton/portfile.cmake b/vcpkg/ports/triton/portfile.cmake new file mode 100644 index 0000000..4435919 --- /dev/null +++ b/vcpkg/ports/triton/portfile.cmake @@ -0,0 +1,51 @@ +vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO JonathanSalwan/Triton
+ REF e312eafcdf507d9aebd0f8a7daf2eb4c28a19d30
+ SHA512 eb184859fe3023f188f7828335924da36c45dea90dc1ece7d8cf770dc7951022d4e51647cdd520e9bc91a8e01cab4a8801808e469900bdbbc3806624c132ad8d
+ HEAD_REF master
+ PATCHES
+ fix_bin_path.patch
+)
+
+string(COMPARE NOTEQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" DYNAMICLIB)
+string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATICCRT)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ "python" PYTHON_BINDINGS
+ "boost" BOOST_INTERFACE
+)
+
+set(ADDITIONAL_OPTIONS "")
+if(PYTHON_BINDINGS)
+ vcpkg_get_vcpkg_installed_python(PYTHON3)
+ list(APPEND ADDITIONAL_OPTIONS
+ "-DPYTHON_EXECUTABLE=${PYTHON3}"
+ )
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DZ3_INTERFACE=ON
+ -DBUILD_SHARED_LIBS=${DYNAMICLIB}
+ -DMSVC_STATIC=${STATICCRT}
+ -DBUILD_EXAMPLES=OFF
+ -DENABLE_TEST=OFF
+ ${ADDITIONAL_OPTIONS}
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_fixup_pkgconfig()
+
+# Move cmake configs
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
+
+# Remove duplicate files
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
+
+# Handle copyright
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
diff --git a/vcpkg/ports/triton/vcpkg.json b/vcpkg/ports/triton/vcpkg.json new file mode 100644 index 0000000..2bba551 --- /dev/null +++ b/vcpkg/ports/triton/vcpkg.json @@ -0,0 +1,46 @@ +{ + "name": "triton", + "version-date": "2025-02-15", + "description": "Triton is a Dynamic Binary Analysis (DBA) framework. It provides internal components like a Dynamic Symbolic Execution (DSE) engine, a dynamic taint engine, AST representations of the x86, x86-64, ARM32 and AArch64 Instructions Set Architecture (ISA), SMT simplification passes, an SMT solver interface and, the last but not least, Python bindings.", + "homepage": "https://github.com/JonathanSalwan/Triton", + "license": "Apache-2.0", + "supports": "!arm", + "dependencies": [ + { + "name": "capstone", + "default-features": false, + "features": [ + "arm", + "arm64", + "x86" + ] + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "z3" + ], + "features": { + "boost": { + "description": "Use Boost as multiprecision library", + "dependencies": [ + "boost-multiprecision", + "boost-numeric-conversion" + ] + }, + "python": { + "description": "Build Triton with Python bindings", + "dependencies": [ + { + "name": "python3", + "default-features": false + } + ] + } + } +} |