-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[triton] Add new port #17224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[triton] Add new port #17224
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Source: triton | ||
| Version: dev-v0.9 | ||
| Homepage: https://github.com/JonathanSalwan/Triton | ||
| 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. | ||
| Build-Depends: z3, capstone, boost-multiprecision, boost-numeric-conversion, boost-math | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you use vcpkg.json instead of CONTROL? Please see the reference https://github.com/microsoft/vcpkg/blob/master/docs/maintainers/pr-review-checklist.md |
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,67 @@ | ||||||
|
|
||||||
| set(VERSION dev-v0.9) | ||||||
| vcpkg_download_distfile(ARCHIVE | ||||||
| URLS "https://api.github.com/repos/JonathanSalwan/Triton/tarball/${VERSION}" | ||||||
| FILENAME "triton-${VERSION}.tar.gz" | ||||||
| SHA512 7d33f2654cae4868fbbcb3a3ec709c8f5f2e692c6d989cd2c9c95886b9623731d399ae23c7b4189be239c388c07b89bdd415bbf215bffed629ce50d8785079b4 | ||||||
| ) | ||||||
|
|
||||||
| vcpkg_extract_source_archive_ex( | ||||||
| OUT_SOURCE_PATH SOURCE_PATH | ||||||
| ARCHIVE ${ARCHIVE} | ||||||
| REF ${VERSION} | ||||||
| ) | ||||||
|
|
||||||
| set(STATICLIB OFF) | ||||||
| if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") | ||||||
| set(STATICLIB ON) | ||||||
| endif() | ||||||
|
|
||||||
| # Capstone path should be adapted in Windows | ||||||
| if(VCPKG_TARGET_IS_WINDOWS) | ||||||
| if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") | ||||||
| set(CAPSTONE_LIBRARY ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/capstone${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}) | ||||||
| else() | ||||||
| set(CAPSTONE_LIBRARY ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/capstone_dll${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}) | ||||||
| endif() | ||||||
|
|
||||||
| set(CAPSTONE_INCLUDE_DIR ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include/capstone) | ||||||
| else() | ||||||
| set(CAPSTONE_INCLUDE_DIR ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include) | ||||||
| set(CAPSTONE_LIBRARY ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/libcapstone${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}) | ||||||
| endif() | ||||||
|
|
||||||
| # Z3 | ||||||
| set(Z3_LIBRARY ${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib/libz3${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}) | ||||||
|
|
||||||
|
|
||||||
| vcpkg_configure_cmake( | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We also prefer to use the new functions in a new port. Since the current functions have deprecated. Please see Other functions like vcpkg_install_cmake() also needs to be updated. If we use new functions, |
||||||
| SOURCE_PATH ${SOURCE_PATH} | ||||||
| PREFER_NINJA | ||||||
| OPTIONS | ||||||
| -DZ3_INTERFACE=${Z3_INTERFACE} | ||||||
| -DPYTHON_BINDINGS=${PYTHON_BINDINGS} | ||||||
| -DPYTHON36=${PYTHON36} | ||||||
| -DSTATICLIB=${STATICLIB} | ||||||
| -DZ3_LIBRARY=${Z3_LIBRARY} | ||||||
| -DCAPSTONE_LIBRARY=${CAPSTONE_LIBRARY} | ||||||
| -DCAPSTONE_INCLUDE_DIR=${CAPSTONE_INCLUDE_DIR} | ||||||
| -DPYTHON_INCLUDE_DIR="${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include" | ||||||
| -DPYTHON_LIBRARY=${PYTHON_LIBRARY} | ||||||
| ) | ||||||
|
|
||||||
| vcpkg_install_cmake() | ||||||
| vcpkg_copy_pdbs() | ||||||
|
|
||||||
| configure_file("${CURRENT_BUILDTREES_DIR}/src/dev-v0.9-fd0ccd4864.clean/LICENSE.txt" "${CURRENT_PACKAGES_DIR}/share/triton/copyright" COPYONLY) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) | ||||||
|
|
||||||
| if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/triton.dll) | ||||||
| file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) | ||||||
| file(RENAME ${CURRENT_PACKAGES_DIR}/lib/triton.dll ${CURRENT_PACKAGES_DIR}/bin/triton.dll) | ||||||
| endif() | ||||||
| if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/triton.dll) | ||||||
| file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) | ||||||
| file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/triton.dll ${CURRENT_PACKAGES_DIR}/debug/bin/triton.dll) | ||||||
| endif() | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the version uses a unstable one. I noticed that there are also released versions. Why do you not use the latest release here?
Also, please follow the new policy to rename this field in vcpkg.json.
https://github.com/microsoft/vcpkg/blob/master/docs/users/versioning.md
https://github.com/microsoft/vcpkg/blob/master/docs/users/versioning.reference.md