diff options
Diffstat (limited to 'vcpkg/ports/libdisasm')
| -rw-r--r-- | vcpkg/ports/libdisasm/CMakeLists.txt | 52 | ||||
| -rw-r--r-- | vcpkg/ports/libdisasm/portfile.cmake | 23 | ||||
| -rw-r--r-- | vcpkg/ports/libdisasm/sizeofvoid.patch | 27 | ||||
| -rw-r--r-- | vcpkg/ports/libdisasm/vcpkg.json | 14 |
4 files changed, 116 insertions, 0 deletions
diff --git a/vcpkg/ports/libdisasm/CMakeLists.txt b/vcpkg/ports/libdisasm/CMakeLists.txt new file mode 100644 index 0000000..4c029bd --- /dev/null +++ b/vcpkg/ports/libdisasm/CMakeLists.txt @@ -0,0 +1,52 @@ +cmake_minimum_required(VERSION 3.9) +project(libdisasm C) + +set(CMAKE_DEBUG_POSTFIX d) + +set(SRCS + libdisasm/ia32_implicit.c + libdisasm/ia32_implicit.h + libdisasm/ia32_insn.c + libdisasm/ia32_insn.h + libdisasm/ia32_invariant.c + libdisasm/ia32_invariant.h + libdisasm/ia32_modrm.c + libdisasm/ia32_modrm.h + libdisasm/ia32_opcode_tables.c + libdisasm/ia32_opcode_tables.h + libdisasm/ia32_operand.c + libdisasm/ia32_operand.h + libdisasm/ia32_reg.c + libdisasm/ia32_reg.h + libdisasm/ia32_settings.c + libdisasm/ia32_settings.h + libdisasm/libdis.h + libdisasm/qword.h + libdisasm/x86_disasm.c + libdisasm/x86_format.c + libdisasm/x86_imm.c + libdisasm/x86_imm.h + libdisasm/x86_insn.c + libdisasm/x86_misc.c + libdisasm/x86_operand_list.c + libdisasm/x86_operand_list.h +) + +include_directories(libdisasm) + +add_library(libdisasm ${SRCS}) + +if (MSVC) + target_compile_definitions(libdisasm PRIVATE _CRT_SECURE_NO_WARNINGS) +endif() + +install( + TARGETS libdisasm + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) + +if(NOT DISABLE_INSTALL_HEADERS) + install(FILES libdisasm/libdis.h DESTINATION include) +endif() diff --git a/vcpkg/ports/libdisasm/portfile.cmake b/vcpkg/ports/libdisasm/portfile.cmake new file mode 100644 index 0000000..cb681d8 --- /dev/null +++ b/vcpkg/ports/libdisasm/portfile.cmake @@ -0,0 +1,23 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO bastard/libdisasm + REF 0.23 + FILENAME "libdisasm-0.23.tar.gz" + SHA512 29eecfbfd8168188242278a1a38f0c90770d0581a52d4600ae6343829dd0d6607b98329f12a3d7409d43dd56dca6a7d1eb25d58a001c2bfd3eb8474c0e7879e7 + PATCHES sizeofvoid.patch +) + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS_DEBUG + -DDISABLE_INSTALL_HEADERS=ON +) + +vcpkg_cmake_install() + +# Handle copyright +file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/vcpkg/ports/libdisasm/sizeofvoid.patch b/vcpkg/ports/libdisasm/sizeofvoid.patch new file mode 100644 index 0000000..1e4e008 --- /dev/null +++ b/vcpkg/ports/libdisasm/sizeofvoid.patch @@ -0,0 +1,27 @@ +--- a/libdisasm/x86_disasm.c ++++ b/libdisasm/x86_disasm.c +@@ -35,7 +35,7 @@ unsigned int x86_disasm( unsigned char *buf, unsigned int buf_len, + + if ( offset >= buf_len ) { + /* another caller screwup ;) */ +- x86_report_error(report_disasm_bounds, (void*)(long)buf_rva+offset); ++ x86_report_error(report_disasm_bounds, (void*)(long)(buf_rva+offset)); + return 0; + } + +@@ -53,13 +53,13 @@ unsigned int x86_disasm( unsigned char *buf, unsigned int buf_len, + + /* check and see if we had an invalid instruction */ + if (! size ) { +- x86_report_error(report_invalid_insn, (void*)(long)buf_rva+offset ); ++ x86_report_error(report_invalid_insn, (void*)(long)(buf_rva+offset)); + return 0; + } + + /* check if we overran the end of the buffer */ + if ( size > len ) { +- x86_report_error( report_insn_bounds, (void*)(long)buf_rva + offset ); ++ x86_report_error( report_insn_bounds, (void*)(long)(buf_rva + offset)); + MAKE_INVALID( insn, bytes ); + return 0; + } diff --git a/vcpkg/ports/libdisasm/vcpkg.json b/vcpkg/ports/libdisasm/vcpkg.json new file mode 100644 index 0000000..d5a6f41 --- /dev/null +++ b/vcpkg/ports/libdisasm/vcpkg.json @@ -0,0 +1,14 @@ +{ + "name": "libdisasm", + "version": "0.23", + "port-version": 11, + "description": "x86 Disassembler Library.", + "homepage": "https://sourceforge.net/projects/bastard", + "license": "ClArtistic", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + } + ] +} |