From ffb96495118e74bd5ea7454178f03564a1bd2713 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Wed, 20 Oct 2021 15:55:00 +0800 Subject: [PATCH 01/81] [mbedtls] update to 3.0.0 --- ports/mbedtls/enable-pthread.patch | 167 +++++++++++------------------ ports/mbedtls/portfile.cmake | 25 +++-- ports/mbedtls/vcpkg.json | 13 ++- 3 files changed, 88 insertions(+), 117 deletions(-) diff --git a/ports/mbedtls/enable-pthread.patch b/ports/mbedtls/enable-pthread.patch index 6353103769c327..e92b74cb809d0c 100755 --- a/ports/mbedtls/enable-pthread.patch +++ b/ports/mbedtls/enable-pthread.patch @@ -1,102 +1,65 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8833246..f68ab02 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -28,6 +28,7 @@ set(MBEDTLS_DIR ${CMAKE_CURRENT_SOURCE_DIR}) - - option(USE_PKCS11_HELPER_LIBRARY "Build mbed TLS with the pkcs11-helper library." OFF) - option(ENABLE_ZLIB_SUPPORT "Build mbed TLS with zlib library." OFF) -+option(ENABLE_PTHREAD "Build mbed TLS with pthread" OFF) - - option(ENABLE_PROGRAMS "Build mbed TLS programs." ON) - -@@ -231,6 +232,8 @@ else() - set(LIB_INSTALL_DIR lib) - endif() - -+include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/) -+ - if(ENABLE_ZLIB_SUPPORT) - find_package(ZLIB) - -@@ -239,6 +242,17 @@ if(ENABLE_ZLIB_SUPPORT) - endif(ZLIB_FOUND) - endif(ENABLE_ZLIB_SUPPORT) - -+if(ENABLE_PTHREAD) -+ if(WIN32) -+ find_package(pthreads_windows REQUIRED) -+ include_directories(${PThreads4W_INCLUDE_DIR}) -+ else() -+ set(CMAKE_THREAD_PREFER_PTHREAD ON) -+ find_package(Threads REQUIRED) -+ endif() -+ set(LINK_WITH_PTHREAD ON) -+endif() -+ - add_subdirectory(include) - - add_subdirectory(3rdparty) -diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt -index 62c0f62..7923202 100644 ---- a/include/CMakeLists.txt -+++ b/include/CMakeLists.txt -@@ -1,10 +1,14 @@ - option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON) - -+configure_file(mbedtls/config_threading.h.in mbedtls/config_threading.h) -+ - if(INSTALL_MBEDTLS_HEADERS) - - file(GLOB headers "mbedtls/*.h") - file(GLOB psa_headers "psa/*.h") -- -+ -+ set(headers ${headers} ${CMAKE_CURRENT_BINARY_DIR}/mbedtls/config_threading.h) -+ - install(FILES ${headers} - DESTINATION include/mbedtls - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) -diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h -index 1e6e052..51c20da 100644 ---- a/include/mbedtls/config.h -+++ b/include/mbedtls/config.h -@@ -24,6 +24,8 @@ - * limitations under the License. - */ - -+#include "mbedtls/config_threading.h" -+ - #ifndef MBEDTLS_CONFIG_H - #define MBEDTLS_CONFIG_H - -diff --git a/include/mbedtls/config_threading.h.in b/include/mbedtls/config_threading.h.in -new file mode 100644 -index 0000000..9d5d42e ---- /dev/null -+++ b/include/mbedtls/config_threading.h.in -@@ -0,0 +1,6 @@ -+#cmakedefine ENABLE_PTHREAD -+ -+#ifdef ENABLE_PTHREAD -+#define MBEDTLS_THREADING_C -+#define MBEDTLS_THREADING_PTHREAD -+#endif -\ No newline at end of file -diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt -index 33e2cfc..4b99331 100644 ---- a/library/CMakeLists.txt -+++ b/library/CMakeLists.txt -@@ -137,7 +137,11 @@ if(ENABLE_ZLIB_SUPPORT) - endif(ENABLE_ZLIB_SUPPORT) - - if(LINK_WITH_PTHREAD) -- set(libs ${libs} pthread) -+ if(WIN32) -+ set(libs ${libs} ${PThreads4W_LIBRARY}) -+ else() -+ set(libs ${libs} pthread) -+ endif() - endif() - - if(LINK_WITH_TRUSTED_STORAGE) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cf74af5..fbfdf4c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,6 +43,7 @@ endif() + set(MBEDTLS_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + + option(ENABLE_PROGRAMS "Build mbed TLS programs." ON) ++option(ENABLE_PTHREAD "Build mbed TLS with pthread" OFF) + + option(UNSAFE_BUILD "Allow unsafe builds. These builds ARE NOT SECURE." OFF) + option(MBEDTLS_FATAL_WARNINGS "Compiler warnings treated as errors" ON) +@@ -222,6 +223,19 @@ else() + set(LIB_INSTALL_DIR lib) + endif() + ++include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/) ++ ++if(ENABLE_PTHREAD) ++ if(WIN32) ++ find_package(pthreads_windows REQUIRED) ++ include_directories(${PThreads4W_INCLUDE_DIR}) ++ else() ++ set(CMAKE_THREAD_PREFER_PTHREAD ON) ++ find_package(Threads REQUIRED) ++ endif() ++ set(LINK_WITH_PTHREAD ON) ++endif() ++ + add_subdirectory(include) + + add_subdirectory(3rdparty) +diff --git a/include/mbedtls/mbedtls_config.h b/include/mbedtls/mbedtls_config.h +index a60db7e..bb2cad5 100644 +--- a/include/mbedtls/mbedtls_config.h ++++ b/include/mbedtls/mbedtls_config.h +@@ -24,6 +24,11 @@ + * limitations under the License. + */ + ++#ifdef ENABLE_PTHREAD ++#define MBEDTLS_THREADING_C ++#define MBEDTLS_THREADING_PTHREAD ++#endif ++ + /** + * This is an optional version symbol that enables comatibility handling of + * config files. +diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt +index 1cd5589..aa06678 100644 +--- a/library/CMakeLists.txt ++++ b/library/CMakeLists.txt +@@ -130,7 +130,11 @@ if(HAIKU) + endif(HAIKU) + + if(LINK_WITH_PTHREAD) +- set(libs ${libs} pthread) ++ if(WIN32) ++ set(libs ${libs} ${PThreads4W_LIBRARY}) ++ else() ++ set(libs ${libs} pthread) ++ endif() + endif() + + if(LINK_WITH_TRUSTED_STORAGE) diff --git a/ports/mbedtls/portfile.cmake b/ports/mbedtls/portfile.cmake index 3bd961fbce827f..669280d1febbad 100644 --- a/ports/mbedtls/portfile.cmake +++ b/ports/mbedtls/portfile.cmake @@ -5,8 +5,8 @@ set(VCPKG_LIBRARY_LINKAGE static) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ARMmbed/mbedtls - REF 523f0554b6cdc7ace5d360885c3f5bbcc73ec0e8 # mbedtls-2.24.0 - SHA512 1ce78f34e8d87c2ce0454e0a08f4c6e5b3129d4b24cfa44162af21c2e8b5dc7feabf849e4fa547ce3781b5ce11aaf675cfed47412bae40091fbdd87bbcdbee07 + REF 8df2f8e7b9c7bb9390ac74bb7bace27edca81a2b # mbedtls-3.0.0 + SHA512 7cc1412664a8e8d35b8d0c578cd2d0fc2b4aee82e1f9583aaf167e4adf893b5fd0c8fd686db11900c13418789e99ee03fc91ea37ac3ef922c28d51f54fa196ad HEAD_REF master PATCHES enable-pthread.patch @@ -15,12 +15,11 @@ vcpkg_from_github( vcpkg_check_features( OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES - pthreads ENABLE_PTHREAD + pthreads ENABLE_PTHREAD ) -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" OPTIONS ${FEATURE_OPTIONS} -DENABLE_TESTING=OFF @@ -28,14 +27,14 @@ vcpkg_configure_cmake( -DMBEDTLS_FATAL_WARNINGS=FALSE ) -vcpkg_install_cmake() +vcpkg_cmake_install() +vcpkg_copy_pdbs() +vcpkg_cmake_config_fixup(CONFIG_PATH "CMake") -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) if (VCPKG_TARGET_IS_WINDOWS AND pthreads IN_LIST FEATURES) - file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -endif () - -vcpkg_copy_pdbs() \ No newline at end of file + file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +endif () \ No newline at end of file diff --git a/ports/mbedtls/vcpkg.json b/ports/mbedtls/vcpkg.json index ec036a05f62094..236ae20347840f 100644 --- a/ports/mbedtls/vcpkg.json +++ b/ports/mbedtls/vcpkg.json @@ -1,10 +1,19 @@ { "name": "mbedtls", - "version-string": "2.24.0", - "port-version": 3, + "version": "3.0.0", "description": "An open source, portable, easy to use, readable and flexible SSL library", "homepage": "https://github.com/ARMmbed/mbedtls", "supports": "!uwp", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], "features": { "pthreads": { "description": "Multi-threading support", From ecc5dc912551e3ce37fec3b0c076de50f858b22d Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Wed, 20 Oct 2021 15:56:30 +0800 Subject: [PATCH 02/81] update version --- ports/mbedtls/vcpkg.json | 2 +- versions/baseline.json | 4 ++-- versions/m-/mbedtls.json | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ports/mbedtls/vcpkg.json b/ports/mbedtls/vcpkg.json index 236ae20347840f..796319105b222b 100644 --- a/ports/mbedtls/vcpkg.json +++ b/ports/mbedtls/vcpkg.json @@ -12,7 +12,7 @@ { "name": "vcpkg-cmake-config", "host": true - } + } ], "features": { "pthreads": { diff --git a/versions/baseline.json b/versions/baseline.json index f334952134f54d..38478a39ed8208 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4217,8 +4217,8 @@ "port-version": 1 }, "mbedtls": { - "baseline": "2.24.0", - "port-version": 3 + "baseline": "3.0.0", + "port-version": 0 }, "mcpp": { "baseline": "2.7.2.14", diff --git a/versions/m-/mbedtls.json b/versions/m-/mbedtls.json index d9fdc8f6b618c2..9232e5977ccf80 100644 --- a/versions/m-/mbedtls.json +++ b/versions/m-/mbedtls.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0579930c1af250dd8b65891b533397cf5ca0c067", + "version": "3.0.0", + "port-version": 0 + }, { "git-tree": "a68475211755b3999de8cb2ec1d2fdfe9bb8ab10", "version-string": "2.24.0", From d4b5d576458e7a7ccfb3a9dcc4eeac3553e6979b Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Thu, 21 Oct 2021 17:40:42 +0800 Subject: [PATCH 03/81] update version --- versions/m-/mbedtls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/m-/mbedtls.json b/versions/m-/mbedtls.json index 9232e5977ccf80..fca7356f72a524 100644 --- a/versions/m-/mbedtls.json +++ b/versions/m-/mbedtls.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "0579930c1af250dd8b65891b533397cf5ca0c067", + "git-tree": "1253d35afb1cda738ecfaefd4d36dc3e692c7041", "version": "3.0.0", "port-version": 0 }, From 351ec9997fbbd5a08747efc9608ed8fd07694a7e Mon Sep 17 00:00:00 2001 From: BehroozAbbassi Date: Fri, 5 Nov 2021 14:47:18 -0700 Subject: [PATCH 04/81] [lief] Add new port for lief-project/LIEF --- ports/lief/portfile.cmake | 97 +++++++++++++++++++++++++++++++++++++++ ports/lief/vcpkg.json | 96 ++++++++++++++++++++++++++++++++++++++ versions/l-/lief.json | 9 ++++ 3 files changed, 202 insertions(+) create mode 100644 ports/lief/portfile.cmake create mode 100644 ports/lief/vcpkg.json create mode 100644 versions/l-/lief.json diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake new file mode 100644 index 00000000000000..85470fe9b0c5ce --- /dev/null +++ b/ports/lief/portfile.cmake @@ -0,0 +1,97 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO lief-project/LIEF + REF 551ede538abeca63a158bd7c42b6b6337c92a26e # v0.11.5 + SHA512 2f98e6e63dd79300f43c39eb4c032dbe72402140cc12061c38d8df3b0f40166f22f8e41f37112255b019f2478c164e89e384b6826dd7b6cc0b9cdb6de407c564 + HEAD_REF master +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS +FEATURES + "tests" LIEF_TESTS # Enable tests + "doc" LIEF_DOC # Enable documentation + "python-api" LIEF_PYTHON_API # Enable Python API + "install-python" LIEF_INSTALL_PYTHON # Install Python bindings + "c-api" LIEF_C_API # C API + "examples" LIEF_EXAMPLES # Build LIEF C++ examples + "force32" LIEF_FORCE32 # Force build LIEF 32 bits version + "coverage" LIEF_COVERAGE # Perform code coverage + "use-ccache" LIEF_USE_CCACHE # Use ccache to speed up compilation + "extra-warnings" LIEF_EXTRA_WARNINGS # Enable extra warning from the compiler + "logging" LIEF_LOGGING # Enable logging + "logging-debug" LIEF_LOGGING_DEBUG # Enable debug logging + "enable-json" LIEF_ENABLE_JSON # Enable JSON-related APIs + "shared-lib" LIEF_SHARED_LIB # Enable shared lib + + # "disable_frozen" LIEF_DISABLE_FROZEN # Disable Frozen even if it is supported + + "elf" LIEF_ELF # Build LIEF with ELF module + "pe" LIEF_PE # Build LIEF with PE module + "macho" LIEF_MACHO # Build LIEF with MachO module + + "oat" LIEF_OAT # Build LIEF with OAT module + "dex" LIEF_DEX # Build LIEF with DEX module + "vdex" LIEF_VDEX # Build LIEF with VDEX module + "art" LIEF_ART # Build LIEF with ART module + + # Sanitizer + "asan" LIEF_ASAN # Enable Address sanitizer + "lsan" LIEF_LSAN # Enable Leak sanitizer + "tsan" LIEF_TSAN # Enable Thread sanitizer + "usan" LIEF_USAN # Enable undefined sanitizer + + # Fuzzer + "fuzzing" LIEF_FUZZING # Fuzz LIEF + + # Profiling + "profiling" LIEF_PROFILING # Enable performance profiling + +INVERTED_FEATURES + "disable-frozen" LIEF_DISABLE_FROZEN # Disable Frozen even if it is supported +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA # Disable this option if project cannot be built with Ninja + + OPTIONS + # -DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT_DIR}\\scripts\\buildsystems\\vcpkg.cmake" + ${FEATURE_OPTIONS} + OPTIONS_DEBUG + # -DCMAKE_DEBUG_POSTFIX=d + # -DLIEF_USE_CRT_DEBUG=MTd + -DLIEF_USE_CRT_DEBUG=MDd + + OPTIONS_RELEASE + # -DLIEF_USE_CRT_RELEASE=MT + -DLIEF_USE_CRT_RELEASE=MD +) + +vcpkg_install_cmake() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + if(VCPKG_TARGET_IS_WINDOWS) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/LIEF.dll") + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin") + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/LIEF.dll" "${CURRENT_PACKAGES_DIR}/debug/bin/LIEF.dll") + endif() + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/LIEF.dll") + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin") + file(RENAME "${CURRENT_PACKAGES_DIR}/lib/LIEF.dll" "${CURRENT_PACKAGES_DIR}/bin/LIEF.dll") + endif() + endif() + endif() +endif() + +vcpkg_copy_pdbs() + +# # Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/LIEF RENAME copyright) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + +message(STATUS "[LIEF DEBUG] Installing done") \ No newline at end of file diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json new file mode 100644 index 00000000000000..c8f9e8992303b8 --- /dev/null +++ b/ports/lief/vcpkg.json @@ -0,0 +1,96 @@ +{ + "name": "lief", + "version-string": "0.11.5", + "description": "LIEF - Library to Instrument Executable Formats", + "homepage": "https://lief.quarkslab.com", + "default-features": [ + "pe", + "shared-lib" + ], + "features": { + "art": { + "description": "Build LIEF with ART module" + }, + "asan": { + "description": "Enable Address sanitizer" + }, + "c-api": { + "description": "C API" + }, + "coverage": { + "description": "Perform code coverage" + }, + "dex": { + "description": "Build LIEF with DEX module" + }, + "disable-frozen": { + "description": "Disable Frozen even if it is supported" + }, + "doc": { + "description": "Enable documentation" + }, + "elf": { + "description": "Build LIEF with ELF module" + }, + "enable-json": { + "description": "Enable JSON-related APIs" + }, + "examples": { + "description": "Build LIEF C++ examples" + }, + "extra-warnings": { + "description": "Enable extra warning from the compiler" + }, + "force32": { + "description": "Force build LIEF 32 bits version" + }, + "fuzzing": { + "description": "Fuzz LIEF" + }, + "install-python": { + "description": "Install Python bindings" + }, + "logging": { + "description": "Enable logging" + }, + "logging-debug": { + "description": "Enable debug logging" + }, + "lsan": { + "description": "Enable Leak sanitizer" + }, + "macho": { + "description": "Build LIEF with MachO module" + }, + "oat": { + "description": "Build LIEF with OAT module" + }, + "pe": { + "description": "Build LIEF with PE module" + }, + "profiling": { + "description": "Enable performance profiling" + }, + "python-api": { + "description": "Enable Python API" + }, + "shared-lib": { + "description": "Enable shared lib" + }, + "tests": { + "description": "Enable tests" + }, + "tsan": { + "description": "Enable Thread sanitizer" + }, + "usan": { + "description": "Enable undefined sanitizer" + }, + "use-ccache": { + "description": "Use ccache to speed up compilation" + }, + "vdex": { + "description": "Build LIEF with VDEX module" + } + } +} diff --git a/versions/l-/lief.json b/versions/l-/lief.json new file mode 100644 index 00000000000000..1caaf09dbf5808 --- /dev/null +++ b/versions/l-/lief.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "0aa4bf20d35df6ae77d402e17754be595685eead", + "version-string": "0.11.5", + "port-version": 0 + } + ] +} From ff0d91df8618027398c0eb692e5670df544acab5 Mon Sep 17 00:00:00 2001 From: BehroozAbbassi Date: Fri, 5 Nov 2021 14:47:46 -0700 Subject: [PATCH 05/81] [lief] Add new port for lief-project/LIEF --- versions/baseline.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/versions/baseline.json b/versions/baseline.json index 1030927d9d63cf..b6e4989f2ae798 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4064,6 +4064,10 @@ "baseline": "2020-05-19", "port-version": 2 }, + "lief": { + "baseline": "0.11.5", + "port-version": 0 + }, "lilv": { "baseline": "0.24.10", "port-version": 0 From 52c7b782385731e94e4eaf57c2a8f4d78839d5d7 Mon Sep 17 00:00:00 2001 From: BehroozAbbassi Date: Sat, 20 Nov 2021 10:02:52 -0800 Subject: [PATCH 06/81] Update ports/lief/portfile.cmake Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> --- ports/lief/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 85470fe9b0c5ce..d0f9da7514aeaf 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -67,7 +67,7 @@ vcpkg_configure_cmake( -DLIEF_USE_CRT_RELEASE=MD ) -vcpkg_install_cmake() +vcpkg_cmake_install() if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) if(VCPKG_TARGET_IS_WINDOWS) From 735dd5bd4a6d475eca4fbc4a17055710132addbe Mon Sep 17 00:00:00 2001 From: BehroozAbbassi Date: Sat, 20 Nov 2021 10:03:58 -0800 Subject: [PATCH 07/81] Update ports/lief/portfile.cmake Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> --- ports/lief/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index d0f9da7514aeaf..a6ca9b25fd24c6 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -89,7 +89,7 @@ endif() vcpkg_copy_pdbs() # # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/LIEF RENAME copyright) +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/LIEF" RENAME copyright) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) From 6b428c39dac7a264aa4c2ffc1f47e00bc672c24d Mon Sep 17 00:00:00 2001 From: BehroozAbbassi Date: Sat, 20 Nov 2021 10:04:22 -0800 Subject: [PATCH 08/81] Update ports/lief/portfile.cmake Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> --- ports/lief/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index a6ca9b25fd24c6..8c2539b6f0e5ec 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -91,7 +91,7 @@ vcpkg_copy_pdbs() # # Handle copyright file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/LIEF" RENAME copyright) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) message(STATUS "[LIEF DEBUG] Installing done") \ No newline at end of file From dca0802b3b7c362385a05202faca3365240ce0b2 Mon Sep 17 00:00:00 2001 From: BehroozAbbassi Date: Sat, 20 Nov 2021 10:05:12 -0800 Subject: [PATCH 09/81] Update ports/lief/portfile.cmake Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> --- ports/lief/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 8c2539b6f0e5ec..d9004cbae2b72f 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -92,6 +92,6 @@ vcpkg_copy_pdbs() file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/LIEF" RENAME copyright) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") message(STATUS "[LIEF DEBUG] Installing done") \ No newline at end of file From 2960f30aab3971dbfef35016a81370aef1f053a6 Mon Sep 17 00:00:00 2001 From: BehroozAbbassi Date: Sat, 20 Nov 2021 10:05:25 -0800 Subject: [PATCH 10/81] Update ports/lief/vcpkg.json Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> --- ports/lief/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index c8f9e8992303b8..a92e1bc58ab004 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -1,6 +1,6 @@ { "name": "lief", - "version-string": "0.11.5", + "version": "0.11.5", "description": "LIEF - Library to Instrument Executable Formats", "homepage": "https://lief.quarkslab.com", "default-features": [ From 6de3b347496291946a3486b44bbfc1a859ad7fb6 Mon Sep 17 00:00:00 2001 From: BehroozAbbassi Date: Sat, 20 Nov 2021 10:05:47 -0800 Subject: [PATCH 11/81] Update ports/lief/vcpkg.json Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> --- ports/lief/vcpkg.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index a92e1bc58ab004..9343725033630e 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -3,6 +3,16 @@ "version": "0.11.5", "description": "LIEF - Library to Instrument Executable Formats", "homepage": "https://lief.quarkslab.com", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], "default-features": [ "pe", "shared-lib" From 66e3201f170115c0f835f470a61b88344a3a965a Mon Sep 17 00:00:00 2001 From: BehroozAbbassi Date: Sat, 20 Nov 2021 10:37:08 -0800 Subject: [PATCH 12/81] Update portfile.cmake --- ports/lief/portfile.cmake | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index d9004cbae2b72f..efe74357b4920e 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -50,7 +50,17 @@ INVERTED_FEATURES "disable-frozen" LIEF_DISABLE_FROZEN # Disable Frozen even if it is supported ) -vcpkg_configure_cmake( +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" LIEF_SHARED_LIB) + +if (LIEF_SHARED_LIB) + set(LIEF_CRT_DEBUG MDd) + set(LIEF_CRT_RELEASE MD) +else() + set(LIEF_CRT_DEBUG MTd) + set(LIEF_CRT_RELEASE MT) +endif() + +vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA # Disable this option if project cannot be built with Ninja @@ -58,13 +68,10 @@ vcpkg_configure_cmake( # -DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT_DIR}\\scripts\\buildsystems\\vcpkg.cmake" ${FEATURE_OPTIONS} OPTIONS_DEBUG - # -DCMAKE_DEBUG_POSTFIX=d - # -DLIEF_USE_CRT_DEBUG=MTd - -DLIEF_USE_CRT_DEBUG=MDd + -DLIEF_USE_CRT_DEBUG=${LIEF_CRT_DEBUG} OPTIONS_RELEASE - # -DLIEF_USE_CRT_RELEASE=MT - -DLIEF_USE_CRT_RELEASE=MD + -DLIEF_USE_CRT_RELEASE=${LIEF_CRT_RELEASE} ) vcpkg_cmake_install() From a51156a9f5c5bbf99dbb4dd00993e4dad089692c Mon Sep 17 00:00:00 2001 From: BehroozAbbassi Date: Sat, 20 Nov 2021 11:07:22 -0800 Subject: [PATCH 13/81] Update CI baseline --- versions/l-/lief.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versions/l-/lief.json b/versions/l-/lief.json index 1caaf09dbf5808..4a4d2640621339 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "0aa4bf20d35df6ae77d402e17754be595685eead", - "version-string": "0.11.5", + "git-tree": "dd5f8edc575f08ba78998380c7e31e06da8e3023", + "version": "0.11.5", "port-version": 0 } ] From f5d9218a039e59aae9d8cddfe12288446069aa61 Mon Sep 17 00:00:00 2001 From: BehroozAbbassi Date: Sat, 20 Nov 2021 11:31:22 -0800 Subject: [PATCH 14/81] Update portfile.cmake --- ports/lief/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index efe74357b4920e..e92b1ee164fcf6 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -1,3 +1,5 @@ +vcpkg_fail_port_install(ON_CRT_LINKAGE "dynamic" ON_LIBRARY_LINKAGE "static" ) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lief-project/LIEF From 44e4de68e96a31a99526cb1102c53f014765934b Mon Sep 17 00:00:00 2001 From: BehroozAbbassi Date: Sat, 20 Nov 2021 11:47:45 -0800 Subject: [PATCH 15/81] Update portfile.cmake --- ports/lief/portfile.cmake | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index e92b1ee164fcf6..0ca3319a82fbad 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -1,4 +1,10 @@ -vcpkg_fail_port_install(ON_CRT_LINKAGE "dynamic" ON_LIBRARY_LINKAGE "static" ) +vcpkg_fail_port_install(ON_TARGET "UWP") + +if ("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static" ) + if ("${VCPKG_CRT_LINKAGE}" STREQUAL "dynamic" ) + vcpkg_fail_port_install(MESSAGE "${PORT} doesn't support static-md" ALWAYS) + endif() +endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -54,12 +60,17 @@ INVERTED_FEATURES string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" LIEF_SHARED_LIB) -if (LIEF_SHARED_LIB) - set(LIEF_CRT_DEBUG MDd) - set(LIEF_CRT_RELEASE MD) +if(VCPKG_TARGET_IS_WINDOWS) + if (LIEF_SHARED_LIB) + set(LIEF_CRT_DEBUG MDd) + set(LIEF_CRT_RELEASE MD) + else() + set(LIEF_CRT_DEBUG MTd) + set(LIEF_CRT_RELEASE MT) + endif() else() - set(LIEF_CRT_DEBUG MTd) - set(LIEF_CRT_RELEASE MT) + set(LIEF_CRT_DEBUG "") + set(LIEF_CRT_RELEASE "") endif() vcpkg_cmake_configure( From ec0933d471308deb4c8643fec069eb05fb30636a Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Mon, 22 Nov 2021 17:12:55 +0800 Subject: [PATCH 16/81] update version --- versions/l-/lief.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/l-/lief.json b/versions/l-/lief.json index 4a4d2640621339..d35573687ae18c 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "dd5f8edc575f08ba78998380c7e31e06da8e3023", + "git-tree": "ae2b26b210826c46e6fafcec2b3c1f808a73d2dd", "version": "0.11.5", "port-version": 0 } From 71eb6f358622718080cd476255003afed1b0038d Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Thu, 6 Jan 2022 18:32:51 +0800 Subject: [PATCH 17/81] [mbedtls] update to 3.1.0 --- ports/mbedtls/enable-pthread.patch | 159 +++++++++++++++++------------ ports/mbedtls/portfile.cmake | 10 +- ports/mbedtls/vcpkg.json | 2 +- 3 files changed, 101 insertions(+), 70 deletions(-) diff --git a/ports/mbedtls/enable-pthread.patch b/ports/mbedtls/enable-pthread.patch index e92b74cb809d0c..c7fdbceb29cfc1 100755 --- a/ports/mbedtls/enable-pthread.patch +++ b/ports/mbedtls/enable-pthread.patch @@ -1,65 +1,94 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index cf74af5..fbfdf4c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -43,6 +43,7 @@ endif() - set(MBEDTLS_DIR ${CMAKE_CURRENT_SOURCE_DIR}) - - option(ENABLE_PROGRAMS "Build mbed TLS programs." ON) -+option(ENABLE_PTHREAD "Build mbed TLS with pthread" OFF) - - option(UNSAFE_BUILD "Allow unsafe builds. These builds ARE NOT SECURE." OFF) - option(MBEDTLS_FATAL_WARNINGS "Compiler warnings treated as errors" ON) -@@ -222,6 +223,19 @@ else() - set(LIB_INSTALL_DIR lib) - endif() - -+include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/) -+ -+if(ENABLE_PTHREAD) -+ if(WIN32) -+ find_package(pthreads_windows REQUIRED) -+ include_directories(${PThreads4W_INCLUDE_DIR}) -+ else() -+ set(CMAKE_THREAD_PREFER_PTHREAD ON) -+ find_package(Threads REQUIRED) -+ endif() -+ set(LINK_WITH_PTHREAD ON) -+endif() -+ - add_subdirectory(include) - - add_subdirectory(3rdparty) -diff --git a/include/mbedtls/mbedtls_config.h b/include/mbedtls/mbedtls_config.h -index a60db7e..bb2cad5 100644 ---- a/include/mbedtls/mbedtls_config.h -+++ b/include/mbedtls/mbedtls_config.h -@@ -24,6 +24,11 @@ - * limitations under the License. - */ - -+#ifdef ENABLE_PTHREAD -+#define MBEDTLS_THREADING_C -+#define MBEDTLS_THREADING_PTHREAD -+#endif -+ - /** - * This is an optional version symbol that enables comatibility handling of - * config files. -diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt -index 1cd5589..aa06678 100644 ---- a/library/CMakeLists.txt -+++ b/library/CMakeLists.txt -@@ -130,7 +130,11 @@ if(HAIKU) - endif(HAIKU) - - if(LINK_WITH_PTHREAD) -- set(libs ${libs} pthread) -+ if(WIN32) -+ set(libs ${libs} ${PThreads4W_LIBRARY}) -+ else() -+ set(libs ${libs} pthread) -+ endif() - endif() - - if(LINK_WITH_TRUSTED_STORAGE) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6debe35..64e0674 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -51,6 +51,7 @@ if(WIN32) + else() + option(GEN_FILES "Generate the auto-generated files as needed" ON) + endif() ++option(ENABLE_PTHREAD "Build mbed TLS with pthread" OFF) + + string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}") + string(REGEX MATCH "GNU" CMAKE_COMPILER_IS_GNU "${CMAKE_C_COMPILER_ID}") +@@ -243,12 +244,26 @@ else() + set(LIB_INSTALL_DIR lib) + endif() + ++include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/) ++ + add_subdirectory(include) + + add_subdirectory(3rdparty) + + add_subdirectory(library) + ++if(ENABLE_PTHREAD) ++ if(WIN32) ++ find_package(pthreads_windows REQUIRED) ++ include_directories(${PThreads4W_INCLUDE_DIR}) ++ else() ++ set(CMAKE_THREAD_PREFER_PTHREAD ON) ++ find_package(Threads REQUIRED) ++ endif() ++ set(LINK_WITH_PTHREAD ON) ++endif() ++ ++ + # + # The C files in tests/src directory contain test code shared among test suites + # and programs. This shared test code is compiled and linked to test suites and +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index e693bc1..7f5216a 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -1,9 +1,13 @@ + option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON) + ++configure_file(mbedtls/config_threading.h.in mbedtls/config_threading.h) ++ + if(INSTALL_MBEDTLS_HEADERS) + + file(GLOB headers "mbedtls/*.h") + file(GLOB psa_headers "psa/*.h") ++ ++ set(headers ${headers} ${CMAKE_CURRENT_BINARY_DIR}/mbedtls/config_threading.h) + + install(FILES ${headers} + DESTINATION include/mbedtls +diff --git a/include/mbedtls/mbedtls_config.h b/include/mbedtls/mbedtls_config.h +index 0558ee0..d2fd425 100644 +--- a/include/mbedtls/mbedtls_config.h ++++ b/include/mbedtls/mbedtls_config.h +@@ -24,6 +24,15 @@ + * limitations under the License. + */ + ++#include "mbedtls/config_threading.h" ++ ++#cmakedefine ENABLE_PTHREAD ++ ++#ifdef ENABLE_PTHREAD ++#define MBEDTLS_THREADING_C ++#define MBEDTLS_THREADING_PTHREAD ++#endif ++ + /** + * This is an optional version symbol that enables comatibility handling of + * config files. +diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt +index 07599f5..27e426d 100644 +--- a/library/CMakeLists.txt ++++ b/library/CMakeLists.txt +@@ -189,7 +189,11 @@ if(HAIKU) + endif(HAIKU) + + if(LINK_WITH_PTHREAD) +- set(libs ${libs} pthread) ++ if(WIN32) ++ set(libs ${libs} ${PThreads4W_LIBRARY}) ++ else() ++ set(libs ${libs} pthread) ++ endif() + endif() + + if(LINK_WITH_TRUSTED_STORAGE) diff --git a/ports/mbedtls/portfile.cmake b/ports/mbedtls/portfile.cmake index 669280d1febbad..5c1c84f41bccd3 100644 --- a/ports/mbedtls/portfile.cmake +++ b/ports/mbedtls/portfile.cmake @@ -5,8 +5,8 @@ set(VCPKG_LIBRARY_LINKAGE static) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ARMmbed/mbedtls - REF 8df2f8e7b9c7bb9390ac74bb7bace27edca81a2b # mbedtls-3.0.0 - SHA512 7cc1412664a8e8d35b8d0c578cd2d0fc2b4aee82e1f9583aaf167e4adf893b5fd0c8fd686db11900c13418789e99ee03fc91ea37ac3ef922c28d51f54fa196ad + REF d65aeb37349ad1a50e0f6c9b694d4b5290d60e49 #v3.1.0 + SHA512 a3fde5e6e206d0ab43282502fec45da14f1ccb24974db7a9348a18870d3c07b10fe72419ebf5130cec1b9e819ef804608b0f7b48670f619e328f5b798a8d9eb1 HEAD_REF master PATCHES enable-pthread.patch @@ -28,13 +28,15 @@ vcpkg_cmake_configure( ) vcpkg_cmake_install() -vcpkg_copy_pdbs() + vcpkg_cmake_config_fixup(CONFIG_PATH "CMake") +vcpkg_copy_pdbs() + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) if (VCPKG_TARGET_IS_WINDOWS AND pthreads IN_LIST FEATURES) file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") -endif () \ No newline at end of file +endif () diff --git a/ports/mbedtls/vcpkg.json b/ports/mbedtls/vcpkg.json index 796319105b222b..dafb11878f5fe8 100644 --- a/ports/mbedtls/vcpkg.json +++ b/ports/mbedtls/vcpkg.json @@ -1,6 +1,6 @@ { "name": "mbedtls", - "version": "3.0.0", + "version": "3.1.0", "description": "An open source, portable, easy to use, readable and flexible SSL library", "homepage": "https://github.com/ARMmbed/mbedtls", "supports": "!uwp", From 7992465bd913ab42885334060901fc5d644902f8 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Thu, 6 Jan 2022 18:34:00 +0800 Subject: [PATCH 18/81] update version --- versions/baseline.json | 2 +- versions/m-/mbedtls.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index 25649a3cfec470..4f01208723f521 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4325,7 +4325,7 @@ "port-version": 0 }, "mbedtls": { - "baseline": "3.0.0", + "baseline": "3.1.0", "port-version": 0 }, "mcpp": { diff --git a/versions/m-/mbedtls.json b/versions/m-/mbedtls.json index fca7356f72a524..cac44a8067633d 100644 --- a/versions/m-/mbedtls.json +++ b/versions/m-/mbedtls.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "1253d35afb1cda738ecfaefd4d36dc3e692c7041", - "version": "3.0.0", + "git-tree": "7dba8cab9ca893d1a474235ed289f8ca4815504c", + "version": "3.1.0", "port-version": 0 }, { From b9a9286c2224aa63b4c6f1bcbb13e9b1d44e04a5 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Thu, 6 Jan 2022 19:18:56 +0800 Subject: [PATCH 19/81] fix configure_file error --- ports/mbedtls/enable-pthread.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/mbedtls/enable-pthread.patch b/ports/mbedtls/enable-pthread.patch index c7fdbceb29cfc1..e1977964e3ae17 100755 --- a/ports/mbedtls/enable-pthread.patch +++ b/ports/mbedtls/enable-pthread.patch @@ -44,7 +44,7 @@ index e693bc1..7f5216a 100644 @@ -1,9 +1,13 @@ option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON) -+configure_file(mbedtls/config_threading.h.in mbedtls/config_threading.h) ++#configure_file(mbedtls/config_threading.h.in mbedtls/config_threading.h) + if(INSTALL_MBEDTLS_HEADERS) From 3eb3c2fd65fab66e0cd72981516c939bed4845c2 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Thu, 6 Jan 2022 19:19:20 +0800 Subject: [PATCH 20/81] update version --- versions/m-/mbedtls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/m-/mbedtls.json b/versions/m-/mbedtls.json index cac44a8067633d..c1a42b55e27f9f 100644 --- a/versions/m-/mbedtls.json +++ b/versions/m-/mbedtls.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "7dba8cab9ca893d1a474235ed289f8ca4815504c", + "git-tree": "3fabf75908c8662c34499dab6e07cca51ca65a97", "version": "3.1.0", "port-version": 0 }, From cff4f3b2817e051b4b0829ac5f850c929aa063a2 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Thu, 6 Jan 2022 19:56:12 +0800 Subject: [PATCH 21/81] fix configure_file error --- ports/mbedtls/enable-pthread.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/mbedtls/enable-pthread.patch b/ports/mbedtls/enable-pthread.patch index e1977964e3ae17..e60d8ccf426aaf 100755 --- a/ports/mbedtls/enable-pthread.patch +++ b/ports/mbedtls/enable-pthread.patch @@ -51,7 +51,7 @@ index e693bc1..7f5216a 100644 file(GLOB headers "mbedtls/*.h") file(GLOB psa_headers "psa/*.h") + -+ set(headers ${headers} ${CMAKE_CURRENT_BINARY_DIR}/mbedtls/config_threading.h) ++ #set(headers ${headers} ${CMAKE_CURRENT_BINARY_DIR}/mbedtls/config_threading.h) install(FILES ${headers} DESTINATION include/mbedtls From 6ebf844ee792b41dfdacc77a4502a284a3cfe396 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Thu, 6 Jan 2022 19:56:39 +0800 Subject: [PATCH 22/81] update version --- versions/m-/mbedtls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/m-/mbedtls.json b/versions/m-/mbedtls.json index c1a42b55e27f9f..8285c75ec42b7e 100644 --- a/versions/m-/mbedtls.json +++ b/versions/m-/mbedtls.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "3fabf75908c8662c34499dab6e07cca51ca65a97", + "git-tree": "39e7a2b8fdf00334393aba7615a4538638011dc9", "version": "3.1.0", "port-version": 0 }, From e28701cfb564c8a1b7983be5cf657534ef4f1525 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Thu, 6 Jan 2022 21:10:17 +0800 Subject: [PATCH 23/81] fix configure_file error --- ports/mbedtls/enable-pthread.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/mbedtls/enable-pthread.patch b/ports/mbedtls/enable-pthread.patch index e60d8ccf426aaf..e52aa2334b3a96 100755 --- a/ports/mbedtls/enable-pthread.patch +++ b/ports/mbedtls/enable-pthread.patch @@ -44,14 +44,14 @@ index e693bc1..7f5216a 100644 @@ -1,9 +1,13 @@ option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON) -+#configure_file(mbedtls/config_threading.h.in mbedtls/config_threading.h) ++ + if(INSTALL_MBEDTLS_HEADERS) file(GLOB headers "mbedtls/*.h") file(GLOB psa_headers "psa/*.h") + -+ #set(headers ${headers} ${CMAKE_CURRENT_BINARY_DIR}/mbedtls/config_threading.h) ++ install(FILES ${headers} DESTINATION include/mbedtls @@ -63,7 +63,7 @@ index 0558ee0..d2fd425 100644 * limitations under the License. */ -+#include "mbedtls/config_threading.h" ++ + +#cmakedefine ENABLE_PTHREAD + @@ -80,7 +80,7 @@ index 07599f5..27e426d 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -189,7 +189,11 @@ if(HAIKU) - endif(HAIKU) + endif(HAIKU) if(LINK_WITH_PTHREAD) - set(libs ${libs} pthread) From c056c4d009f22021ccc24c6cea7bf178646e33b3 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Thu, 6 Jan 2022 21:10:40 +0800 Subject: [PATCH 24/81] upadte version --- versions/m-/mbedtls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/m-/mbedtls.json b/versions/m-/mbedtls.json index 8285c75ec42b7e..22e3b325902589 100644 --- a/versions/m-/mbedtls.json +++ b/versions/m-/mbedtls.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "39e7a2b8fdf00334393aba7615a4538638011dc9", + "git-tree": "7b340b1479e15744592d010fae2298f94d6d3af5", "version": "3.1.0", "port-version": 0 }, From b1870eef4647cb653f7e5186fafeef17cce446ee Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Thu, 6 Jan 2022 21:38:39 +0800 Subject: [PATCH 25/81] fix configure_file error --- ports/mbedtls/enable-pthread.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/mbedtls/enable-pthread.patch b/ports/mbedtls/enable-pthread.patch index e52aa2334b3a96..088c2b1701c364 100755 --- a/ports/mbedtls/enable-pthread.patch +++ b/ports/mbedtls/enable-pthread.patch @@ -14,7 +14,7 @@ index 6debe35..64e0674 100644 set(LIB_INSTALL_DIR lib) endif() -+include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/) ++#include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/) + add_subdirectory(include) @@ -44,14 +44,14 @@ index e693bc1..7f5216a 100644 @@ -1,9 +1,13 @@ option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON) -+ ++#configure_file(mbedtls/config_threading.h.in mbedtls/config_threading.h) + if(INSTALL_MBEDTLS_HEADERS) file(GLOB headers "mbedtls/*.h") file(GLOB psa_headers "psa/*.h") + -+ ++ #set(headers ${headers} ${CMAKE_CURRENT_BINARY_DIR}/mbedtls/config_threading.h) install(FILES ${headers} DESTINATION include/mbedtls @@ -80,7 +80,7 @@ index 07599f5..27e426d 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -189,7 +189,11 @@ if(HAIKU) - endif(HAIKU) + endif(HAIKU) if(LINK_WITH_PTHREAD) - set(libs ${libs} pthread) From eddc93168758726312b8c516d69ffdc2a2325617 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Thu, 6 Jan 2022 21:38:57 +0800 Subject: [PATCH 26/81] update version --- versions/m-/mbedtls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/m-/mbedtls.json b/versions/m-/mbedtls.json index 22e3b325902589..f0e07a2c0333c2 100644 --- a/versions/m-/mbedtls.json +++ b/versions/m-/mbedtls.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "7b340b1479e15744592d010fae2298f94d6d3af5", + "git-tree": "d166fd001341f0db9228c7ebc0e1ce26b49c492c", "version": "3.1.0", "port-version": 0 }, From 213d49e2cc3ebce158d02194dfaf977981c4d384 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Thu, 6 Jan 2022 21:55:17 +0800 Subject: [PATCH 27/81] fix configure_file error --- ports/mbedtls/enable-pthread.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/mbedtls/enable-pthread.patch b/ports/mbedtls/enable-pthread.patch index 088c2b1701c364..ce97c797c0596b 100755 --- a/ports/mbedtls/enable-pthread.patch +++ b/ports/mbedtls/enable-pthread.patch @@ -65,7 +65,7 @@ index 0558ee0..d2fd425 100644 + + -+#cmakedefine ENABLE_PTHREAD ++ + +#ifdef ENABLE_PTHREAD +#define MBEDTLS_THREADING_C From 4ca64918fea6fcd4e917ce6a12a39edfda622bc1 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Thu, 6 Jan 2022 21:55:37 +0800 Subject: [PATCH 28/81] update version --- versions/m-/mbedtls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/m-/mbedtls.json b/versions/m-/mbedtls.json index f0e07a2c0333c2..b0288d0a8d12db 100644 --- a/versions/m-/mbedtls.json +++ b/versions/m-/mbedtls.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "d166fd001341f0db9228c7ebc0e1ce26b49c492c", + "git-tree": "cb24bc09987c40f55865d21693afc27649fbcb85", "version": "3.1.0", "port-version": 0 }, From 654dc769d1bd338677427c77db449f8686e8ff8d Mon Sep 17 00:00:00 2001 From: Behrooz Abbassi Date: Wed, 12 Jan 2022 07:03:46 -0800 Subject: [PATCH 29/81] Add MSVC specific variables to the LIEF_USE_CRT_RELEASE --- ports/lief/portfile.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 0ca3319a82fbad..0054cfff0f0e58 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -85,6 +85,11 @@ vcpkg_cmake_configure( OPTIONS_RELEASE -DLIEF_USE_CRT_RELEASE=${LIEF_CRT_RELEASE} + + MAYBE_UNUSED_VARIABLES + LIEF_SHARED_LIB + LIEF_USE_CRT_DEBUG + LIEF_USE_CRT_RELEASE ) vcpkg_cmake_install() From 00005e1c1fbe1ecbe8bf9c4060e1e0506d1981a1 Mon Sep 17 00:00:00 2001 From: Behrooz Abbassi Date: Wed, 12 Jan 2022 07:15:36 -0800 Subject: [PATCH 30/81] add lief:x64-windows-static-md=fail to the ci.baseline.txt --- scripts/ci.baseline.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index fff761d116fb29..bef5c5f2bd9d39 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -533,6 +533,7 @@ libcopp:arm-uwp=fail # Missing system libraries on linux to run/prepare autoconf libgpod:x64-linux=fail libgpod:x64-osx=fail +lief:x64-windows-static-md=fail cpuid:arm-uwp=fail cpuid:x64-uwp=fail cpuid:arm64-windows=fail From 6fdad13f70c91a77bee87e8456db6853be4334b2 Mon Sep 17 00:00:00 2001 From: Behrooz Abbassi Date: Wed, 12 Jan 2022 07:21:30 -0800 Subject: [PATCH 31/81] Update version database --- versions/l-/lief.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/l-/lief.json b/versions/l-/lief.json index d35573687ae18c..84ff7a49bf9731 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "ae2b26b210826c46e6fafcec2b3c1f808a73d2dd", + "git-tree": "35e3e6b66dcd76ad8a840418e9faca9d2538beca", "version": "0.11.5", "port-version": 0 } From 595baf89c52a9b63475a5a319b1fb3899a4dfc93 Mon Sep 17 00:00:00 2001 From: Behrooz Abbassi Date: Wed, 12 Jan 2022 07:26:40 -0800 Subject: [PATCH 32/81] update ci.baseline.txt --- scripts/ci.baseline.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index bef5c5f2bd9d39..804ee79ad42372 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -533,7 +533,14 @@ libcopp:arm-uwp=fail # Missing system libraries on linux to run/prepare autoconf libgpod:x64-linux=fail libgpod:x64-osx=fail + +# LIEF library lief:x64-windows-static-md=fail +lief:x64-linux=fail +lief:x64-uwp=fail +lief:arm-uwp=fail +lief:x64-osx=fail + cpuid:arm-uwp=fail cpuid:x64-uwp=fail cpuid:arm64-windows=fail From e621fe0c032844e92d3d32b2d35a5c4589072740 Mon Sep 17 00:00:00 2001 From: Behrooz Abbassi Date: Thu, 13 Jan 2022 09:22:55 -0800 Subject: [PATCH 33/81] Update scripts/ci.baseline.txt Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> --- scripts/ci.baseline.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 804ee79ad42372..dad2b497a71739 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -533,7 +533,6 @@ libcopp:arm-uwp=fail # Missing system libraries on linux to run/prepare autoconf libgpod:x64-linux=fail libgpod:x64-osx=fail - # LIEF library lief:x64-windows-static-md=fail lief:x64-linux=fail From 9625f725d15774e2c30472f801b7ad3dac304efe Mon Sep 17 00:00:00 2001 From: Behrooz Abbassi Date: Thu, 13 Jan 2022 09:23:05 -0800 Subject: [PATCH 34/81] Update scripts/ci.baseline.txt Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> --- scripts/ci.baseline.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index dad2b497a71739..1481bc91c58a80 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -539,7 +539,6 @@ lief:x64-linux=fail lief:x64-uwp=fail lief:arm-uwp=fail lief:x64-osx=fail - cpuid:arm-uwp=fail cpuid:x64-uwp=fail cpuid:arm64-windows=fail From ad44909f7d6427b997e8a231877bc7cb97dabf24 Mon Sep 17 00:00:00 2001 From: Behrooz Abbassi Date: Thu, 13 Jan 2022 10:21:54 -0800 Subject: [PATCH 35/81] Add supports platforms/triplets to the vcpkg.json --- ports/lief/portfile.cmake | 4 +++- ports/lief/vcpkg.json | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 0054cfff0f0e58..6403920928fbc2 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -1,4 +1,6 @@ -vcpkg_fail_port_install(ON_TARGET "UWP") + +vcpkg_fail_port_install(ON_TARGET "UWP" "linux" "osx" ON_ARCH "x64" "arm") + if ("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static" ) if ("${VCPKG_CRT_LINKAGE}" STREQUAL "dynamic" ) diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index 9343725033630e..958bd05a1b7f5d 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -3,6 +3,7 @@ "version": "0.11.5", "description": "LIEF - Library to Instrument Executable Formats", "homepage": "https://lief.quarkslab.com", + "supports": "((x86 | x64) & ((windows & static) | windows)) & !uwp", "dependencies": [ { "name": "vcpkg-cmake", From 294a989d38268bf3357a1319f862109fe1fa580d Mon Sep 17 00:00:00 2001 From: Behrooz Abbassi Date: Thu, 13 Jan 2022 10:27:07 -0800 Subject: [PATCH 36/81] Update version database --- versions/l-/lief.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/l-/lief.json b/versions/l-/lief.json index 84ff7a49bf9731..9892a59891f35e 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "35e3e6b66dcd76ad8a840418e9faca9d2538beca", + "git-tree": "29277fa9876e26113ca01513894cefaf8e2a3b59", "version": "0.11.5", "port-version": 0 } From cbc793419d82cce6540823e77d315ed98216e4ce Mon Sep 17 00:00:00 2001 From: Behrooz Abbassi Date: Thu, 13 Jan 2022 10:31:39 -0800 Subject: [PATCH 37/81] Update ci.baseline.txt --- ports/lief/portfile.cmake | 3 --- scripts/ci.baseline.txt | 4 ---- 2 files changed, 7 deletions(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 6403920928fbc2..561a2993b17773 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -1,7 +1,4 @@ -vcpkg_fail_port_install(ON_TARGET "UWP" "linux" "osx" ON_ARCH "x64" "arm") - - if ("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static" ) if ("${VCPKG_CRT_LINKAGE}" STREQUAL "dynamic" ) vcpkg_fail_port_install(MESSAGE "${PORT} doesn't support static-md" ALWAYS) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 1481bc91c58a80..fd53db47b8ea43 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -535,10 +535,6 @@ libgpod:x64-linux=fail libgpod:x64-osx=fail # LIEF library lief:x64-windows-static-md=fail -lief:x64-linux=fail -lief:x64-uwp=fail -lief:arm-uwp=fail -lief:x64-osx=fail cpuid:arm-uwp=fail cpuid:x64-uwp=fail cpuid:arm64-windows=fail From 7ffc538ba7292e51e940395696ac689f06d76629 Mon Sep 17 00:00:00 2001 From: Behrooz Abbassi Date: Thu, 13 Jan 2022 10:32:02 -0800 Subject: [PATCH 38/81] Update version database --- versions/l-/lief.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/l-/lief.json b/versions/l-/lief.json index 9892a59891f35e..7be54a35d91c83 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "29277fa9876e26113ca01513894cefaf8e2a3b59", + "git-tree": "6062e41da9a5a0b6bb1df1d2ab26adc2a5899d25", "version": "0.11.5", "port-version": 0 } From 71525da4bb3a282391217ae8012c730b6a4ad441 Mon Sep 17 00:00:00 2001 From: Behrooz Abbassi Date: Fri, 14 Jan 2022 06:28:19 -0800 Subject: [PATCH 39/81] Update ports/lief/portfile.cmake Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> --- ports/lief/portfile.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 561a2993b17773..9e5a043dec8814 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -73,8 +73,7 @@ else() endif() vcpkg_cmake_configure( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA # Disable this option if project cannot be built with Ninja + SOURCE_PATH "${SOURCE_PATH}" OPTIONS # -DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT_DIR}\\scripts\\buildsystems\\vcpkg.cmake" From cee387f0cb04a9d620bb985d3f0feda7d82c4ff4 Mon Sep 17 00:00:00 2001 From: Behrooz Abbassi Date: Fri, 14 Jan 2022 06:28:27 -0800 Subject: [PATCH 40/81] Update ports/lief/vcpkg.json Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> --- ports/lief/vcpkg.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index 958bd05a1b7f5d..1eee42a78fb773 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -8,10 +8,6 @@ { "name": "vcpkg-cmake", "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true } ], "default-features": [ From 2a4fb4e6df0b95976e7201d01881d56f98706f34 Mon Sep 17 00:00:00 2001 From: Behrooz Abbassi Date: Fri, 14 Jan 2022 06:39:51 -0800 Subject: [PATCH 41/81] Update version database --- versions/l-/lief.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/l-/lief.json b/versions/l-/lief.json index 7be54a35d91c83..3d850bb3e51a93 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "6062e41da9a5a0b6bb1df1d2ab26adc2a5899d25", + "git-tree": "caf1c9aaa488f2153ac9c63639cd915684df6dca", "version": "0.11.5", "port-version": 0 } From 12cd9aad218bdc0141769e648b81d7c01f7f2ecf Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Tue, 1 Feb 2022 10:04:20 -0500 Subject: [PATCH 42/81] Some fixes for LIEF and mbedtls --- ports/lief/portfile.cmake | 78 ++++++------------------------ ports/lief/vcpkg.json | 29 ++++++++--- ports/mbedtls/enable-pthread.patch | 70 ++++++++++++--------------- ports/mbedtls/portfile.cmake | 15 +++--- ports/mbedtls/vcpkg.json | 10 +++- 5 files changed, 85 insertions(+), 117 deletions(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 9e5a043dec8814..929589d41d42ef 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -1,20 +1,13 @@ - -if ("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static" ) - if ("${VCPKG_CRT_LINKAGE}" STREQUAL "dynamic" ) - vcpkg_fail_port_install(MESSAGE "${PORT} doesn't support static-md" ALWAYS) - endif() -endif() - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lief-project/LIEF - REF 551ede538abeca63a158bd7c42b6b6337c92a26e # v0.11.5 - SHA512 2f98e6e63dd79300f43c39eb4c032dbe72402140cc12061c38d8df3b0f40166f22f8e41f37112255b019f2478c164e89e384b6826dd7b6cc0b9cdb6de407c564 + REF 12c5bf4489a40ee0ca3f1debec4b476ac8c64c37 # master commit 1/31/22 + SHA512 b49a1502f24a493a120592834819153c84d014c687ed324d6cb0394974e50e892bea3f8c1844e7f5332ff32dd98d3b08d006d44b92c9c3a02fb2631239e666b7 HEAD_REF master ) -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS -FEATURES +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS +FEATURES "tests" LIEF_TESTS # Enable tests "doc" LIEF_DOC # Enable documentation "python-api" LIEF_PYTHON_API # Enable Python API @@ -24,18 +17,17 @@ FEATURES "force32" LIEF_FORCE32 # Force build LIEF 32 bits version "coverage" LIEF_COVERAGE # Perform code coverage "use-ccache" LIEF_USE_CCACHE # Use ccache to speed up compilation - "extra-warnings" LIEF_EXTRA_WARNINGS # Enable extra warning from the compiler + "extra-warnings" LIEF_EXTRA_WARNINGS # Enable extra warning from the compiler "logging" LIEF_LOGGING # Enable logging "logging-debug" LIEF_LOGGING_DEBUG # Enable debug logging "enable-json" LIEF_ENABLE_JSON # Enable JSON-related APIs - "shared-lib" LIEF_SHARED_LIB # Enable shared lib # "disable_frozen" LIEF_DISABLE_FROZEN # Disable Frozen even if it is supported "elf" LIEF_ELF # Build LIEF with ELF module "pe" LIEF_PE # Build LIEF with PE module "macho" LIEF_MACHO # Build LIEF with MachO module - + "oat" LIEF_OAT # Build LIEF with OAT module "dex" LIEF_DEX # Build LIEF with DEX module "vdex" LIEF_VDEX # Build LIEF with VDEX module @@ -49,7 +41,7 @@ FEATURES # Fuzzer "fuzzing" LIEF_FUZZING # Fuzz LIEF - + # Profiling "profiling" LIEF_PROFILING # Enable performance profiling @@ -57,64 +49,26 @@ INVERTED_FEATURES "disable-frozen" LIEF_DISABLE_FROZEN # Disable Frozen even if it is supported ) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" LIEF_SHARED_LIB) - -if(VCPKG_TARGET_IS_WINDOWS) - if (LIEF_SHARED_LIB) - set(LIEF_CRT_DEBUG MDd) - set(LIEF_CRT_RELEASE MD) - else() - set(LIEF_CRT_DEBUG MTd) - set(LIEF_CRT_RELEASE MT) - endif() -else() - set(LIEF_CRT_DEBUG "") - set(LIEF_CRT_RELEASE "") -endif() - vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" - OPTIONS - # -DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT_DIR}\\scripts\\buildsystems\\vcpkg.cmake" + OPTIONS ${FEATURE_OPTIONS} - OPTIONS_DEBUG - -DLIEF_USE_CRT_DEBUG=${LIEF_CRT_DEBUG} - - OPTIONS_RELEASE - -DLIEF_USE_CRT_RELEASE=${LIEF_CRT_RELEASE} - - MAYBE_UNUSED_VARIABLES - LIEF_SHARED_LIB - LIEF_USE_CRT_DEBUG - LIEF_USE_CRT_RELEASE + -DLIEF_OPT_MBEDTLS_EXTERNAL=ON + -DLIEF_OPT_UTFCPP_EXTERNAL=ON + -DLIEF_EXTERNAL_SPDLOG=ON + -DLIEF_OPT_NLOHMANN_JSON_EXTERNAL=ON + # TODO: + # -DLIEF_EXTERNAL_LEAF=ON + # -DLIEF_EXTERNAL_LEAF_DIR= ) vcpkg_cmake_install() -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - if(VCPKG_TARGET_IS_WINDOWS) - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/LIEF.dll") - file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin") - file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/LIEF.dll" "${CURRENT_PACKAGES_DIR}/debug/bin/LIEF.dll") - endif() - endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/LIEF.dll") - file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin") - file(RENAME "${CURRENT_PACKAGES_DIR}/lib/LIEF.dll" "${CURRENT_PACKAGES_DIR}/bin/LIEF.dll") - endif() - endif() - endif() -endif() - vcpkg_copy_pdbs() # # Handle copyright -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/LIEF" RENAME copyright) +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/lief" RENAME copyright) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") - -message(STATUS "[LIEF DEBUG] Installing done") \ No newline at end of file diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index 1eee42a78fb773..812dfa5555bec3 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -1,18 +1,31 @@ { "name": "lief", - "version": "0.11.5", + "version": "0.12.0", "description": "LIEF - Library to Instrument Executable Formats", "homepage": "https://lief.quarkslab.com", - "supports": "((x86 | x64) & ((windows & static) | windows)) & !uwp", + "supports": "!uwp", "dependencies": [ { "name": "vcpkg-cmake", "host": true - } + }, + "mbedtls", + "utfcpp", + "spdlog", + "frozen", + "boost-leaf" ], "default-features": [ + "art", + "c-api", + "dex", + "elf", + "enable-json", + "logging", + "macho", + "oat", "pe", - "shared-lib" + "vdex" ], "features": { "art": { @@ -40,7 +53,10 @@ "description": "Build LIEF with ELF module" }, "enable-json": { - "description": "Enable JSON-related APIs" + "description": "Enable JSON-related APIs", + "dependencies": [ + "nlohmann-json" + ] }, "examples": { "description": "Build LIEF C++ examples" @@ -81,9 +97,6 @@ "python-api": { "description": "Enable Python API" }, - "shared-lib": { - "description": "Enable shared lib" - }, "tests": { "description": "Enable tests" }, diff --git a/ports/mbedtls/enable-pthread.patch b/ports/mbedtls/enable-pthread.patch index 6353103769c327..fc19be726686d0 100755 --- a/ports/mbedtls/enable-pthread.patch +++ b/ports/mbedtls/enable-pthread.patch @@ -1,32 +1,26 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8833246..f68ab02 100644 +index 6debe35d1..9b59cebe6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -28,6 +28,7 @@ set(MBEDTLS_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +@@ -42,6 +42,8 @@ endif() + # Set the project root directory. + set(MBEDTLS_DIR ${CMAKE_CURRENT_SOURCE_DIR}) - option(USE_PKCS11_HELPER_LIBRARY "Build mbed TLS with the pkcs11-helper library." OFF) - option(ENABLE_ZLIB_SUPPORT "Build mbed TLS with zlib library." OFF) +option(ENABLE_PTHREAD "Build mbed TLS with pthread" OFF) - ++ option(ENABLE_PROGRAMS "Build mbed TLS programs." ON) -@@ -231,6 +232,8 @@ else() + option(UNSAFE_BUILD "Allow unsafe builds. These builds ARE NOT SECURE." OFF) +@@ -243,6 +245,19 @@ else() set(LIB_INSTALL_DIR lib) endif() -+include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/) ++include_directories("${CMAKE_CURRENT_BINARY_DIR}/include") + - if(ENABLE_ZLIB_SUPPORT) - find_package(ZLIB) - -@@ -239,6 +242,17 @@ if(ENABLE_ZLIB_SUPPORT) - endif(ZLIB_FOUND) - endif(ENABLE_ZLIB_SUPPORT) - +if(ENABLE_PTHREAD) + if(WIN32) + find_package(pthreads_windows REQUIRED) -+ include_directories(${PThreads4W_INCLUDE_DIR}) ++ include_directories("${PThreads4W_INCLUDE_DIR}") + else() + set(CMAKE_THREAD_PREFER_PTHREAD ON) + find_package(Threads REQUIRED) @@ -38,7 +32,7 @@ index 8833246..f68ab02 100644 add_subdirectory(3rdparty) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt -index 62c0f62..7923202 100644 +index e693bc17c..b7b778505 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -1,10 +1,14 @@ @@ -50,29 +44,15 @@ index 62c0f62..7923202 100644 file(GLOB headers "mbedtls/*.h") file(GLOB psa_headers "psa/*.h") -- -+ -+ set(headers ${headers} ${CMAKE_CURRENT_BINARY_DIR}/mbedtls/config_threading.h) -+ + ++ set(headers ${headers} "${CMAKE_CURRENT_BINARY_DIR}/mbedtls/config_threading.h") ++ install(FILES ${headers} DESTINATION include/mbedtls PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) -diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h -index 1e6e052..51c20da 100644 ---- a/include/mbedtls/config.h -+++ b/include/mbedtls/config.h -@@ -24,6 +24,8 @@ - * limitations under the License. - */ - -+#include "mbedtls/config_threading.h" -+ - #ifndef MBEDTLS_CONFIG_H - #define MBEDTLS_CONFIG_H - diff --git a/include/mbedtls/config_threading.h.in b/include/mbedtls/config_threading.h.in new file mode 100644 -index 0000000..9d5d42e +index 000000000..f6286ed9c --- /dev/null +++ b/include/mbedtls/config_threading.h.in @@ -0,0 +1,6 @@ @@ -82,18 +62,30 @@ index 0000000..9d5d42e +#define MBEDTLS_THREADING_C +#define MBEDTLS_THREADING_PTHREAD +#endif -\ No newline at end of file +diff --git a/include/mbedtls/mbedtls_config.h b/include/mbedtls/mbedtls_config.h +index 0558ee001..60a08868b 100644 +--- a/include/mbedtls/mbedtls_config.h ++++ b/include/mbedtls/mbedtls_config.h +@@ -24,6 +24,8 @@ + * limitations under the License. + */ + ++#include "mbedtls/config_threading.h" ++ + /** + * This is an optional version symbol that enables comatibility handling of + * config files. diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt -index 33e2cfc..4b99331 100644 +index 07599f5d1..3be3f640e 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt -@@ -137,7 +137,11 @@ if(ENABLE_ZLIB_SUPPORT) - endif(ENABLE_ZLIB_SUPPORT) +@@ -189,7 +189,11 @@ if(HAIKU) + endif(HAIKU) if(LINK_WITH_PTHREAD) - set(libs ${libs} pthread) + if(WIN32) -+ set(libs ${libs} ${PThreads4W_LIBRARY}) ++ set(libs ${libs} "${PThreads4W_LIBRARY}") + else() + set(libs ${libs} pthread) + endif() diff --git a/ports/mbedtls/portfile.cmake b/ports/mbedtls/portfile.cmake index 3bd961fbce827f..1329a317f85bf3 100644 --- a/ports/mbedtls/portfile.cmake +++ b/ports/mbedtls/portfile.cmake @@ -5,9 +5,9 @@ set(VCPKG_LIBRARY_LINKAGE static) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ARMmbed/mbedtls - REF 523f0554b6cdc7ace5d360885c3f5bbcc73ec0e8 # mbedtls-2.24.0 - SHA512 1ce78f34e8d87c2ce0454e0a08f4c6e5b3129d4b24cfa44162af21c2e8b5dc7feabf849e4fa547ce3781b5ce11aaf675cfed47412bae40091fbdd87bbcdbee07 - HEAD_REF master + REF d65aeb37349ad1a50e0f6c9b694d4b5290d60e49 # v3.1.0 + SHA512 a3fde5e6e206d0ab43282502fec45da14f1ccb24974db7a9348a18870d3c07b10fe72419ebf5130cec1b9e819ef804608b0f7b48670f619e328f5b798a8d9eb1 + HEAD_REF development PATCHES enable-pthread.patch ) @@ -18,7 +18,7 @@ vcpkg_check_features( pthreads ENABLE_PTHREAD ) -vcpkg_configure_cmake( +vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS @@ -28,9 +28,12 @@ vcpkg_configure_cmake( -DMBEDTLS_FATAL_WARNINGS=FALSE ) -vcpkg_install_cmake() +vcpkg_cmake_install() + +vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) @@ -38,4 +41,4 @@ if (VCPKG_TARGET_IS_WINDOWS AND pthreads IN_LIST FEATURES) file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) endif () -vcpkg_copy_pdbs() \ No newline at end of file +vcpkg_copy_pdbs() diff --git a/ports/mbedtls/vcpkg.json b/ports/mbedtls/vcpkg.json index ec036a05f62094..2fc10ca2794d2e 100644 --- a/ports/mbedtls/vcpkg.json +++ b/ports/mbedtls/vcpkg.json @@ -1,10 +1,16 @@ { "name": "mbedtls", - "version-string": "2.24.0", - "port-version": 3, + "version-string": "3.1.0", + "port-version": 0, "description": "An open source, portable, easy to use, readable and flexible SSL library", "homepage": "https://github.com/ARMmbed/mbedtls", "supports": "!uwp", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + } + ], "features": { "pthreads": { "description": "Multi-threading support", From f6209c042e42aa76d3c94742251b9405cc74dff6 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sat, 5 Feb 2022 14:22:20 -0500 Subject: [PATCH 43/81] Fix some Windows compilation errors This probably isn't the best fix... --- ports/lief/fix_windows_build.patch | 26 ++++++++++++++++++++++++++ ports/lief/portfile.cmake | 1 + 2 files changed, 27 insertions(+) create mode 100644 ports/lief/fix_windows_build.patch diff --git a/ports/lief/fix_windows_build.patch b/ports/lief/fix_windows_build.patch new file mode 100644 index 00000000000000..0f1cc0d38d69a5 --- /dev/null +++ b/ports/lief/fix_windows_build.patch @@ -0,0 +1,26 @@ +diff --git a/src/PE/Builder.cpp b/src/PE/Builder.cpp +index b793d74b..ab8dc90b 100644 +--- a/src/PE/Builder.cpp ++++ b/src/PE/Builder.cpp +@@ -27,6 +27,8 @@ + #include "LIEF/PE/Builder.hpp" + #include "LIEF/PE/ResourceData.hpp" + #include "LIEF/PE/utils.hpp" ++#define LIEF_PE_FORCE_UNDEF ++#include "LIEF/PE/undef.h" + #include "LIEF/PE/ImportEntry.hpp" + #include "LIEF/PE/Import.hpp" + #include "LIEF/PE/Section.hpp" +diff --git a/src/PE/utils.cpp b/src/PE/utils.cpp +index b9dd332c..445fdf18 100644 +--- a/src/PE/utils.cpp ++++ b/src/PE/utils.cpp +@@ -29,6 +29,8 @@ + #include "LIEF/exception.hpp" + + #include "LIEF/PE/utils.hpp" ++#define LIEF_PE_FORCE_UNDEF ++#include "LIEF/PE/undef.h" + #include "LIEF/PE/Structures.hpp" + #include "LIEF/PE/Binary.hpp" + #include "LIEF/PE/Import.hpp" diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 472d852b235ef0..844d4480815610 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -6,6 +6,7 @@ vcpkg_from_github( HEAD_REF master PATCHES support_distribution.patch + fix_windows_build.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS From 4f97fdb8237735784c1fefffd1ec7616f19537ab Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sat, 5 Feb 2022 14:23:25 -0500 Subject: [PATCH 44/81] Add version Will probably be overwritten later --- versions/baseline.json | 6 +++--- versions/l-/lief.json | 5 +++++ versions/m-/mbedtls.json | 5 +++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index 8933a0c62fde7d..bbb4915bc9eade 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4157,7 +4157,7 @@ "port-version": 3 }, "lief": { - "baseline": "0.11.5", + "baseline": "2022-02-02", "port-version": 0 }, "lilv": { @@ -4353,8 +4353,8 @@ "port-version": 0 }, "mbedtls": { - "baseline": "2.24.0", - "port-version": 4 + "baseline": "3.1.0", + "port-version": 0 }, "mcpp": { "baseline": "2.7.2.14", diff --git a/versions/l-/lief.json b/versions/l-/lief.json index 3d850bb3e51a93..571b5ffc68a735 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "571d94859a254dcdac0326c6a75c7ae58ce12a6e", + "version": "2022-02-02", + "port-version": 0 + }, { "git-tree": "caf1c9aaa488f2153ac9c63639cd915684df6dca", "version": "0.11.5", diff --git a/versions/m-/mbedtls.json b/versions/m-/mbedtls.json index f1e254f7f5c03f..f737d258f53d41 100644 --- a/versions/m-/mbedtls.json +++ b/versions/m-/mbedtls.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "cac757f522e2ea45e2acb5dddeea2ecce2458166", + "version-string": "3.1.0", + "port-version": 0 + }, { "git-tree": "676b36c2f6fc72a2fbbbe521ae46fdefe5db67ca", "version": "2.24.0", From b029fbe41010daa5e247737a25f18749c08ff2d0 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sun, 6 Feb 2022 14:39:34 -0500 Subject: [PATCH 45/81] Fix Windows linking --- ports/lief/portfile.cmake | 9 ++++- ports/lief/support_distribution.patch | 58 ++++++++++++++++++++++----- 2 files changed, 55 insertions(+), 12 deletions(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 844d4480815610..2a79d9e3b3a8ff 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -76,8 +76,13 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -# Remove all-caps directory. These files moved in vcpkg_fixup_cmake_targets -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/LIEF") +# Check if all-caps directory is empty (it won't be on case-insensitive filesystems). +# These files could have been moved during vcpkg_fixup_cmake_targets +file(GLOB dir_files "${CURRENT_PACKAGES_DIR}/share/LIEF/*") +list(LENGTH dir_files dir_files_len) +if(dir_files_len EQUAL 0) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/LIEF") +endif() # # Handle copyright file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/lief/support_distribution.patch b/ports/lief/support_distribution.patch index be43cf781a98dc..0ac994e898b91b 100644 --- a/ports/lief/support_distribution.patch +++ b/ports/lief/support_distribution.patch @@ -1,8 +1,29 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6ee2b0c5..d2ec0ae1 100644 +index 6ee2b0c5..b86e746e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -327,7 +327,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/LIEF.pc.in ${CMAKE_CURRENT_BINARY_DIR +@@ -11,11 +11,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_CROSSCOMPILING) + endif() + + +-if(WIN32 OR ${IS_WIN_CROSS_COMPILE}) +- include(ChooseMSVCCRT) +-endif() +-include(CheckCXXCompilerFlag) +-include(CheckCCompilerFlag) + include(ExternalProject) + include(CMakePackageConfigHelpers) + +@@ -201,8 +196,6 @@ if(WINDOWS AND BUILD_SHARED_LIBS) + endif() + + if(MSVC OR ${IS_WIN_CROSS_COMPILE}) +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") + endif() + + if(CMAKE_BUILD_TYPE MATCHES Debug AND WINDOWS) +@@ -327,7 +320,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/LIEF.pc.in ${CMAKE_CURRENT_BINARY_DIR @ONLY) target_include_directories(LIB_LIEF @@ -11,7 +32,7 @@ index 6ee2b0c5..d2ec0ae1 100644 PRIVATE "${LIEF_PRIVATE_INCLUDE_DIR}") if(LIEF_ENABLE_JSON) -@@ -370,7 +370,7 @@ if(LIEF_EXTERNAL_LEAF) +@@ -370,7 +363,7 @@ if(LIEF_EXTERNAL_LEAF) if(LIEF_EXTERNAL_LEAF_DIR) message(STATUS "External LEAF include dir: ${LIEF_EXTERNAL_LEAF_DIR}") target_include_directories(LIB_LIEF SYSTEM PUBLIC @@ -20,7 +41,7 @@ index 6ee2b0c5..d2ec0ae1 100644 endif() else() add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/leaf.hpp -@@ -532,7 +532,7 @@ if(LIEF_COVERAGE) +@@ -532,7 +525,7 @@ if(LIEF_COVERAGE) target_link_libraries(LIB_LIEF gcov) endif() @@ -29,7 +50,7 @@ index 6ee2b0c5..d2ec0ae1 100644 # Set a default build type if none was specified -@@ -579,10 +579,10 @@ endif() +@@ -579,10 +572,10 @@ endif() # Find Package Config # ====================== @@ -42,8 +63,25 @@ index 6ee2b0c5..d2ec0ae1 100644 write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfigVersion.cmake -@@ -645,10 +645,12 @@ else() - endif() +@@ -629,26 +622,15 @@ endif() + # Installation + # ====================== + +-if(UNIX) +- include(GNUInstallDirs) +-else() +- if(WIN32) +- set(CMAKE_INSTALL_LIBDIR "lib") +- set(CMAKE_INSTALL_DATADIR "share") +- set(CMAKE_INSTALL_INCLUDEDIR "include") +- set(CMAKE_INSTALL_BINDIR "bin") +- set(CMAKE_INSTALL_DATAROOTDIR "share") +- message(STATUS "Setting installation destination on Windows to: ${CMAKE_INSTALL_PREFIX}") +- else() +- message(FATAL_ERROR "System not UNIX nor WIN32 - not implemented yet") +- endif() +-endif() ++include(GNUInstallDirs) install( - TARGETS LIB_LIEF @@ -52,12 +90,12 @@ index 6ee2b0c5..d2ec0ae1 100644 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries) -+ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install( DIRECTORY ${LIEF_PUBLIC_INCLUDE_DIR} -@@ -657,11 +659,6 @@ install( +@@ -657,11 +639,6 @@ install( FILES_MATCHING REGEX "(.*).(hpp|h|def)$") @@ -69,7 +107,7 @@ index 6ee2b0c5..d2ec0ae1 100644 install( FILES ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfigVersion.cmake -@@ -673,7 +670,13 @@ install( +@@ -673,7 +650,13 @@ install( DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT libraries) From 97eb98ab477ca7e6bbb4e4ddce4e520af1dd66b5 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sun, 6 Feb 2022 16:54:04 -0500 Subject: [PATCH 46/81] Version update --- versions/l-/lief.json | 2 +- versions/m-/mbedtls.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/versions/l-/lief.json b/versions/l-/lief.json index 571b5ffc68a735..1c4f901c27599b 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "571d94859a254dcdac0326c6a75c7ae58ce12a6e", + "git-tree": "3318de8b06afa4566725cb12163691a91ba7577a", "version": "2022-02-02", "port-version": 0 }, diff --git a/versions/m-/mbedtls.json b/versions/m-/mbedtls.json index f737d258f53d41..296052ec83c522 100644 --- a/versions/m-/mbedtls.json +++ b/versions/m-/mbedtls.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "cac757f522e2ea45e2acb5dddeea2ecce2458166", - "version-string": "3.1.0", + "git-tree": "28498675cd2337c9085e81843b7c09be91c5bdd9", + "version": "3.1.0", "port-version": 0 }, { From 9c42a62a864d50cc2cb3ce4267f9fa639fc0156d Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sun, 6 Feb 2022 17:08:18 -0500 Subject: [PATCH 47/81] Remove mbedtls vcpkg-cmake-wrapper for pthreads The pthreads library seems to be propagated correctly on Windows... if someone knows about something I'm missing, I'd be happy to hear it --- ports/mbedtls/portfile.cmake | 4 ---- ports/mbedtls/vcpkg-cmake-wrapper.cmake | 29 ------------------------- 2 files changed, 33 deletions(-) delete mode 100644 ports/mbedtls/vcpkg-cmake-wrapper.cmake diff --git a/ports/mbedtls/portfile.cmake b/ports/mbedtls/portfile.cmake index 3ba3f2c48b48b2..968fb9fc72d26e 100644 --- a/ports/mbedtls/portfile.cmake +++ b/ports/mbedtls/portfile.cmake @@ -34,7 +34,3 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) - -if (VCPKG_TARGET_IS_WINDOWS AND pthreads IN_LIST FEATURES) - file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") -endif () diff --git a/ports/mbedtls/vcpkg-cmake-wrapper.cmake b/ports/mbedtls/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index 40a0bccb4dfbae..00000000000000 --- a/ports/mbedtls/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,29 +0,0 @@ -include(FindPackageHandleStandardArgs) - -find_path(MBEDTLS_INCLUDE_DIR mbedtls/ssl.h) - -find_library(MBEDTLS_CRYPTO_LIBRARY mbedcrypto) -find_package(pthreads_windows QUIET) -set(MBEDTLS_CRYPTO_LIBRARY ${MBEDTLS_CRYPTO_LIBRARY} ${PThreads4W_LIBRARY}) -find_library(MBEDTLS_X509_LIBRARY mbedx509) -find_library(MBEDTLS_TLS_LIBRARY mbedtls) -set(MBEDTLS_LIBRARIES ${MBEDTLS_CRYPTO_LIBRARY} ${MBEDTLS_X509_LIBRARY} ${MBEDTLS_TLS_LIBRARY}) - -if (MBEDTLS_INCLUDE_DIR AND EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h") - file( - STRINGS ${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h _MBEDTLS_VERLINE - REGEX "^#define[ \t]+MBEDTLS_VERSION_STRING[\t ].*" - ) - string(REGEX REPLACE ".*MBEDTLS_VERSION_STRING[\t ]+\"(.*)\"" "\\1" MBEDTLS_VERSION ${_MBEDTLS_VERLINE}) -endif() - -find_package_handle_standard_args( - mbedTLS - REQUIRED_VARS - MBEDTLS_INCLUDE_DIR - MBEDTLS_CRYPTO_LIBRARY - MBEDTLS_X509_LIBRARY - MBEDTLS_TLS_LIBRARY - PThreads4W_FOUND - VERSION_VAR MBEDTLS_VERSION -) From 2bbe52454f140129bbe2678c1bfe72c581b9a1e0 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sun, 6 Feb 2022 17:12:14 -0500 Subject: [PATCH 48/81] Update version --- versions/m-/mbedtls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/m-/mbedtls.json b/versions/m-/mbedtls.json index 296052ec83c522..c34b0e466418a2 100644 --- a/versions/m-/mbedtls.json +++ b/versions/m-/mbedtls.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "28498675cd2337c9085e81843b7c09be91c5bdd9", + "git-tree": "073b53c6eac24815192072e94d2b7bf84c878391", "version": "3.1.0", "port-version": 0 }, From d7ac27ef82505b9b3073dc29e35eddcaa9932f1c Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sun, 6 Feb 2022 19:10:52 -0500 Subject: [PATCH 49/81] LIEF fails on windows arm64 --- scripts/ci.baseline.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 815ef7290d9250..d457cb027beab5 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -661,6 +661,7 @@ libwandio:arm64-windows=fail libwandio:arm-uwp=fail licensepp:arm-uwp=fail licensepp:x64-uwp=fail +lief:arm64-windows=fail linenoise-ng:arm-uwp=fail linenoise-ng:x64-uwp=fail live555:arm-uwp=fail From 047453d4979410d6475b55b9d46548bb69f8a33a Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sun, 6 Feb 2022 19:29:59 -0500 Subject: [PATCH 50/81] Update to follow maintainer guidelines --- ports/lief/portfile.cmake | 2 +- ports/lief/vcpkg.json | 5 +++++ ports/mbedtls/vcpkg.json | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 2a79d9e3b3a8ff..4e840b7dde6956 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -69,7 +69,7 @@ vcpkg_cmake_configure( vcpkg_cmake_install() -vcpkg_fixup_cmake_targets(CONFIG_PATH share/LIEF/cmake) +vcpkg_cmake_config_fixup(CONFIG_PATH share/LIEF/cmake) vcpkg_copy_pdbs() diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index 1118945dd6cdc3..2b5836a2ec42e9 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -3,6 +3,7 @@ "version": "2022-02-02", "description": "LIEF - Library to Instrument Executable Formats", "homepage": "https://lief.quarkslab.com", + "license": "Apache-2.0", "supports": "!uwp", "dependencies": [ "boost-leaf", @@ -13,6 +14,10 @@ { "name": "vcpkg-cmake", "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true } ], "default-features": [ diff --git a/ports/mbedtls/vcpkg.json b/ports/mbedtls/vcpkg.json index dafb11878f5fe8..e193eea13e3253 100644 --- a/ports/mbedtls/vcpkg.json +++ b/ports/mbedtls/vcpkg.json @@ -3,6 +3,7 @@ "version": "3.1.0", "description": "An open source, portable, easy to use, readable and flexible SSL library", "homepage": "https://github.com/ARMmbed/mbedtls", + "license": "Apache-2.0", "supports": "!uwp", "dependencies": [ { From fb11b6f5690c2c5a9756951b4c81ca735ba865c7 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sun, 6 Feb 2022 19:30:21 -0500 Subject: [PATCH 51/81] Update versions --- versions/l-/lief.json | 2 +- versions/m-/mbedtls.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/versions/l-/lief.json b/versions/l-/lief.json index 1c4f901c27599b..e58396d8d315fa 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "3318de8b06afa4566725cb12163691a91ba7577a", + "git-tree": "6e1c443eaf3ca7fd95288f44551c38b8802712fb", "version": "2022-02-02", "port-version": 0 }, diff --git a/versions/m-/mbedtls.json b/versions/m-/mbedtls.json index c34b0e466418a2..35f75aa5d82f0f 100644 --- a/versions/m-/mbedtls.json +++ b/versions/m-/mbedtls.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "073b53c6eac24815192072e94d2b7bf84c878391", + "git-tree": "f96d53eaca85a20bcb9da745af33ab1b96406f54", "version": "3.1.0", "port-version": 0 }, From 9d0c38f16356133ea13c41e7c9b28e65df27ea47 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Wed, 9 Feb 2022 22:59:07 -0500 Subject: [PATCH 52/81] Update to latest commit on master --- ports/lief/portfile.cmake | 6 +- ports/lief/support_distribution.patch | 79 ++++++++++++++++++++++----- ports/lief/vcpkg.json | 2 +- 3 files changed, 69 insertions(+), 18 deletions(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 4e840b7dde6956..32ad9d2b924c13 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -1,12 +1,12 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lief-project/LIEF - REF b65e7cca03ec4cd91f1d7125e717d01635ea81ba # master commit 2/2/22 - SHA512 ab2511388d121652c4794632a4ffff852ce4e262e0f17a290a4e85f0ebbf2eb81d3ad0cfc35839d9d919b4228f72b4412241c2c3ae509181dbd8c1869633edc0 + REF 77328b0071c7254567d9e8383ea0f5f876f9da17 # master commit 2/8/22 + SHA512 a6ccb611f72205760e7fc66197bbf59f7afedb9ff309054230f0622c657883203a87bc14dc9ff1f797c403f49b99cc0bf755d84aef0eb0c6784502ec3a71c1d1 HEAD_REF master PATCHES support_distribution.patch - fix_windows_build.patch + # fix_windows_build.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/lief/support_distribution.patch b/ports/lief/support_distribution.patch index 0ac994e898b91b..bbfe0d30a11b69 100644 --- a/ports/lief/support_distribution.patch +++ b/ports/lief/support_distribution.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6ee2b0c5..b86e746e 100644 +index 1f73fb29..5a9fd079 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,11 +11,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_CROSSCOMPILING) @@ -23,7 +23,7 @@ index 6ee2b0c5..b86e746e 100644 endif() if(CMAKE_BUILD_TYPE MATCHES Debug AND WINDOWS) -@@ -327,7 +320,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/LIEF.pc.in ${CMAKE_CURRENT_BINARY_DIR +@@ -328,7 +321,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/LIEF.pc.in ${CMAKE_CURRENT_BINARY_DIR @ONLY) target_include_directories(LIB_LIEF @@ -32,7 +32,7 @@ index 6ee2b0c5..b86e746e 100644 PRIVATE "${LIEF_PRIVATE_INCLUDE_DIR}") if(LIEF_ENABLE_JSON) -@@ -370,7 +363,7 @@ if(LIEF_EXTERNAL_LEAF) +@@ -371,7 +364,7 @@ if(LIEF_EXTERNAL_LEAF) if(LIEF_EXTERNAL_LEAF_DIR) message(STATUS "External LEAF include dir: ${LIEF_EXTERNAL_LEAF_DIR}") target_include_directories(LIB_LIEF SYSTEM PUBLIC @@ -41,7 +41,7 @@ index 6ee2b0c5..b86e746e 100644 endif() else() add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/leaf.hpp -@@ -532,7 +525,7 @@ if(LIEF_COVERAGE) +@@ -533,7 +526,7 @@ if(LIEF_COVERAGE) target_link_libraries(LIB_LIEF gcov) endif() @@ -50,7 +50,7 @@ index 6ee2b0c5..b86e746e 100644 # Set a default build type if none was specified -@@ -579,10 +572,10 @@ endif() +@@ -580,10 +573,10 @@ endif() # Find Package Config # ====================== @@ -63,7 +63,7 @@ index 6ee2b0c5..b86e746e 100644 write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfigVersion.cmake -@@ -629,26 +622,15 @@ endif() +@@ -630,26 +623,15 @@ endif() # Installation # ====================== @@ -95,9 +95,9 @@ index 6ee2b0c5..b86e746e 100644 install( DIRECTORY ${LIEF_PUBLIC_INCLUDE_DIR} -@@ -657,11 +639,6 @@ install( +@@ -658,11 +640,6 @@ install( FILES_MATCHING - REGEX "(.*).(hpp|h|def)$") + REGEX "(.*).(hpp|h|def|inc)$") -install( - FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/FindLIEF.cmake @@ -107,7 +107,7 @@ index 6ee2b0c5..b86e746e 100644 install( FILES ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfigVersion.cmake -@@ -673,7 +650,13 @@ install( +@@ -674,7 +651,13 @@ install( DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT libraries) @@ -151,15 +151,66 @@ index 94ee5245..16454dfd 100644 +endif() +set_property(TARGET LIEF::LIEF APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${BOOST_LEAF_INCLUDE_PATH}") diff --git a/cmake/LIEFApi.cmake b/cmake/LIEFApi.cmake -index 772c8b75..f3bacb1f 100644 +index f06f846c..964b394d 100644 --- a/cmake/LIEFApi.cmake +++ b/cmake/LIEFApi.cmake -@@ -59,7 +59,7 @@ if(LIEF_C_API) - +@@ -18,7 +18,7 @@ endif() + # ----- + if(LIEF_C_API) target_include_directories(LIB_LIEF - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include" -- PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include") +- PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include") + PUBLIC "$") include("${CMAKE_CURRENT_SOURCE_DIR}/api/c/CMakeLists.txt") endif() +diff --git a/examples/cmake/find_package/CMakeLists.txt b/examples/cmake/find_package/CMakeLists.txt +index 1812d4b1..0add37d9 100644 +--- a/examples/cmake/find_package/CMakeLists.txt ++++ b/examples/cmake/find_package/CMakeLists.txt +@@ -2,43 +2,17 @@ cmake_minimum_required(VERSION 3.1) + + project(CMakeLIEF) + +-# Use LIEF with 'find_package()' +-# ============================== +- +-# Custom path to the LIEF install directory +-set(LIEF_DIR CACHE PATH ${CMAKE_INSTALL_PREFIX}) +- +-# Directory to 'FindLIEF.cmake' +-list(APPEND CMAKE_MODULE_PATH ${LIEF_DIR}/share/LIEF/cmake) +- +-# include 'FindLIEF.cmake' +-include(FindLIEF) +- + # Find LIEF +-find_package(LIEF REQUIRED COMPONENTS STATIC) # COMPONENTS: - Default: STATIC +- +-message(STATUS "LIEF include directory: ${LIEF_INCLUDE_DIRS}") +-message(STATUS "LIEF library: ${LIEF_LIBRARIES}") ++find_package(LIEF REQUIRED) + + # Add our executable + # ================== + add_executable(HelloLIEF main.cpp) + +-if(MSVC) +- set_property(TARGET HelloLIEF PROPERTY LINK_FLAGS /NODEFAULTLIB:MSVCRT) +-endif() +- +- +-# Setup the LIEF include directory +-target_include_directories(HelloLIEF +- PUBLIC +- ${LIEF_INCLUDE_DIRS} +-) +- +-# Enable C++11 ++# C++11 minimum + set_property(TARGET HelloLIEF + PROPERTY CXX_STANDARD 11 + PROPERTY CXX_STANDARD_REQUIRED ON) + + # Link the executable with LIEF +-target_link_libraries(HelloLIEF PUBLIC ${LIEF_LIBRARIES}) ++target_link_libraries(HelloLIEF PRIVATE LIEF::LIEF) diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index 2b5836a2ec42e9..3f01192e5c2302 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -1,6 +1,6 @@ { "name": "lief", - "version": "2022-02-02", + "version": "2022-02-08", "description": "LIEF - Library to Instrument Executable Formats", "homepage": "https://lief.quarkslab.com", "license": "Apache-2.0", From f9b3b0e729cccbf1826ac63b3b835eed6582adbd Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Wed, 9 Feb 2022 23:01:58 -0500 Subject: [PATCH 53/81] Update version --- versions/baseline.json | 2 +- versions/l-/lief.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index bbb4915bc9eade..1eaabac3db90bb 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4157,7 +4157,7 @@ "port-version": 3 }, "lief": { - "baseline": "2022-02-02", + "baseline": "2022-02-08", "port-version": 0 }, "lilv": { diff --git a/versions/l-/lief.json b/versions/l-/lief.json index e58396d8d315fa..dde407da455da0 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "6e1c443eaf3ca7fd95288f44551c38b8802712fb", - "version": "2022-02-02", + "git-tree": "cf4b79d47c269cb75262747d53741bb3d380650a", + "version": "2022-02-08", "port-version": 0 }, { From 5512a7e29ac2d8a80469ecd3489f8221737cb4e7 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Thu, 10 Feb 2022 09:12:24 -0500 Subject: [PATCH 54/81] Fixup patch to build on Windows --- ports/lief/fix_windows_build.patch | 6 +++--- ports/lief/portfile.cmake | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/lief/fix_windows_build.patch b/ports/lief/fix_windows_build.patch index 0f1cc0d38d69a5..424bbaf2ac68e4 100644 --- a/ports/lief/fix_windows_build.patch +++ b/ports/lief/fix_windows_build.patch @@ -1,5 +1,5 @@ diff --git a/src/PE/Builder.cpp b/src/PE/Builder.cpp -index b793d74b..ab8dc90b 100644 +index f6aa79de..b18fde8a 100644 --- a/src/PE/Builder.cpp +++ b/src/PE/Builder.cpp @@ -27,6 +27,8 @@ @@ -12,7 +12,7 @@ index b793d74b..ab8dc90b 100644 #include "LIEF/PE/Import.hpp" #include "LIEF/PE/Section.hpp" diff --git a/src/PE/utils.cpp b/src/PE/utils.cpp -index b9dd332c..445fdf18 100644 +index 3545fec3..5158ed8f 100644 --- a/src/PE/utils.cpp +++ b/src/PE/utils.cpp @@ -29,6 +29,8 @@ @@ -21,6 +21,6 @@ index b9dd332c..445fdf18 100644 #include "LIEF/PE/utils.hpp" +#define LIEF_PE_FORCE_UNDEF +#include "LIEF/PE/undef.h" - #include "LIEF/PE/Structures.hpp" #include "LIEF/PE/Binary.hpp" #include "LIEF/PE/Import.hpp" + #include "LIEF/PE/ImportEntry.hpp" diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 32ad9d2b924c13..bfe2eb018c1deb 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -6,7 +6,7 @@ vcpkg_from_github( HEAD_REF master PATCHES support_distribution.patch - # fix_windows_build.patch + fix_windows_build.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -77,7 +77,7 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") # Check if all-caps directory is empty (it won't be on case-insensitive filesystems). -# These files could have been moved during vcpkg_fixup_cmake_targets +# These files could have been moved during vcpkg_cmake_config_fixup file(GLOB dir_files "${CURRENT_PACKAGES_DIR}/share/LIEF/*") list(LENGTH dir_files dir_files_len) if(dir_files_len EQUAL 0) From ec80fe30dd6fd11d2ec4ec3ef7db022604617e8c Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Thu, 10 Feb 2022 09:12:49 -0500 Subject: [PATCH 55/81] Update version --- versions/l-/lief.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/l-/lief.json b/versions/l-/lief.json index dde407da455da0..f9b9b815659207 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "cf4b79d47c269cb75262747d53741bb3d380650a", + "git-tree": "22da5e9099b17744d18d178dc02d9d4a034134f8", "version": "2022-02-08", "port-version": 0 }, From af7369103593c969103b7214cfcb55fa50c9b712 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Thu, 10 Feb 2022 13:43:21 -0500 Subject: [PATCH 56/81] Update windows patch --- ports/lief/fix_windows_build.patch | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/ports/lief/fix_windows_build.patch b/ports/lief/fix_windows_build.patch index 424bbaf2ac68e4..31131874c4dd48 100644 --- a/ports/lief/fix_windows_build.patch +++ b/ports/lief/fix_windows_build.patch @@ -1,3 +1,40 @@ +diff --git a/include/LIEF/PE/enums.hpp b/include/LIEF/PE/enums.hpp +index 0175eb38..dec357de 100644 +--- a/include/LIEF/PE/enums.hpp ++++ b/include/LIEF/PE/enums.hpp +@@ -17,6 +17,7 @@ + #include + #include + #include "LIEF/enums.hpp" ++#define LIEF_PE_FORCE_UNDEF + #include "LIEF/PE/undef.h" + + namespace LIEF { +diff --git a/src/BinaryStream/VectorStream.cpp b/src/BinaryStream/VectorStream.cpp +index b029d950..c4348cca 100644 +--- a/src/BinaryStream/VectorStream.cpp ++++ b/src/BinaryStream/VectorStream.cpp +@@ -13,6 +13,7 @@ + * See the License for the specific language governing permissions and + * limitations under the License. + */ ++#include + #include + #include + #include +diff --git a/src/PE/Binary.cpp b/src/PE/Binary.cpp +index 76f5deb6..0cd58cbe 100644 +--- a/src/PE/Binary.cpp ++++ b/src/PE/Binary.cpp +@@ -34,6 +34,8 @@ + #include "LIEF/PE/Binary.hpp" + #include "LIEF/PE/Builder.hpp" + #include "LIEF/PE/utils.hpp" ++#define LIEF_PE_FORCE_UNDEF ++#include "LIEF/PE/undef.h" + #include "LIEF/PE/EnumToString.hpp" + #include "LIEF/PE/ResourceDirectory.hpp" + #include "LIEF/PE/ResourceData.hpp" diff --git a/src/PE/Builder.cpp b/src/PE/Builder.cpp index f6aa79de..b18fde8a 100644 --- a/src/PE/Builder.cpp From 5958dc3f8e31418592a3ab01ca8a764b21942b6c Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Thu, 10 Feb 2022 13:43:57 -0500 Subject: [PATCH 57/81] Update version --- versions/l-/lief.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/l-/lief.json b/versions/l-/lief.json index f9b9b815659207..e4fdfc6f18f033 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "22da5e9099b17744d18d178dc02d9d4a034134f8", + "git-tree": "86c36b0e07db12cdc04a56b7597abb5ea9f0321c", "version": "2022-02-08", "port-version": 0 }, From b728824bf10a34bf4d1092f620b51d0d3eacdc52 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sat, 12 Feb 2022 15:32:39 -0500 Subject: [PATCH 58/81] Update to latest master --- ports/lief/portfile.cmake | 4 ++-- ports/lief/vcpkg.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index bfe2eb018c1deb..a2fe6af8fbc9d1 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lief-project/LIEF - REF 77328b0071c7254567d9e8383ea0f5f876f9da17 # master commit 2/8/22 - SHA512 a6ccb611f72205760e7fc66197bbf59f7afedb9ff309054230f0622c657883203a87bc14dc9ff1f797c403f49b99cc0bf755d84aef0eb0c6784502ec3a71c1d1 + REF 05e3c6eb7cd0ca67c97208e34ac7b815ad0f318e # master commit 2022-02-12 + SHA512 95f126ab8c8aa93c2b78da338c96cbe91a54b03a9d11fbc555959d1b54f4965a9c975c8953f5c05bab6798c0a4a710b8dab85ed630fe2a26b55810ed477e7441 HEAD_REF master PATCHES support_distribution.patch diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index 3f01192e5c2302..253cd47c04ebf3 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -1,6 +1,6 @@ { "name": "lief", - "version": "2022-02-08", + "version": "2022-02-12", "description": "LIEF - Library to Instrument Executable Formats", "homepage": "https://lief.quarkslab.com", "license": "Apache-2.0", From 9fa05d1331483b43304cac8ffd5d5a740fb3dd49 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sat, 12 Feb 2022 15:33:25 -0500 Subject: [PATCH 59/81] Update version --- versions/baseline.json | 2 +- versions/l-/lief.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index 1eaabac3db90bb..77b9d11cc5e7e1 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4157,7 +4157,7 @@ "port-version": 3 }, "lief": { - "baseline": "2022-02-08", + "baseline": "2022-02-12", "port-version": 0 }, "lilv": { diff --git a/versions/l-/lief.json b/versions/l-/lief.json index e4fdfc6f18f033..96c86c746df5a9 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "86c36b0e07db12cdc04a56b7597abb5ea9f0321c", - "version": "2022-02-08", + "git-tree": "395e5838923ee3fc12ee08d455a148305b501e86", + "version": "2022-02-12", "port-version": 0 }, { From ab77d3b784793875d6f6a1fd83f5721446c1269a Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Mon, 14 Feb 2022 22:27:31 -0500 Subject: [PATCH 60/81] Update LIEF to latest master. Add tcb/span dependency --- ports/lief/fix_span_include.patch | 17 ++++++++ ports/lief/fix_windows_build.patch | 63 ------------------------------ ports/lief/portfile.cmake | 9 +++-- ports/lief/vcpkg.json | 3 +- ports/span/portfile.cmake | 20 ++++++++++ ports/span/vcpkg.json | 13 ++++++ 6 files changed, 57 insertions(+), 68 deletions(-) create mode 100644 ports/lief/fix_span_include.patch delete mode 100644 ports/lief/fix_windows_build.patch create mode 100644 ports/span/portfile.cmake create mode 100644 ports/span/vcpkg.json diff --git a/ports/lief/fix_span_include.patch b/ports/lief/fix_span_include.patch new file mode 100644 index 00000000000000..194d0454e401dd --- /dev/null +++ b/ports/lief/fix_span_include.patch @@ -0,0 +1,17 @@ +diff --git a/include/LIEF/third-party/span.hpp b/include/LIEF/third-party/span.hpp +index db355fc4..5f521fd3 100644 +--- a/include/LIEF/third-party/span.hpp ++++ b/include/LIEF/third-party/span.hpp +@@ -16,10 +16,10 @@ + #define LIEF_THIRD_PARTY_SPAN_H_ + #include "LIEF/config.h" + +-#ifndef LIEF_EXTERNAL_LEAF ++#ifndef LIEF_EXTERNAL_SPAN + #include + #else +-#include ++#include + #endif + + #endif diff --git a/ports/lief/fix_windows_build.patch b/ports/lief/fix_windows_build.patch deleted file mode 100644 index 31131874c4dd48..00000000000000 --- a/ports/lief/fix_windows_build.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff --git a/include/LIEF/PE/enums.hpp b/include/LIEF/PE/enums.hpp -index 0175eb38..dec357de 100644 ---- a/include/LIEF/PE/enums.hpp -+++ b/include/LIEF/PE/enums.hpp -@@ -17,6 +17,7 @@ - #include - #include - #include "LIEF/enums.hpp" -+#define LIEF_PE_FORCE_UNDEF - #include "LIEF/PE/undef.h" - - namespace LIEF { -diff --git a/src/BinaryStream/VectorStream.cpp b/src/BinaryStream/VectorStream.cpp -index b029d950..c4348cca 100644 ---- a/src/BinaryStream/VectorStream.cpp -+++ b/src/BinaryStream/VectorStream.cpp -@@ -13,6 +13,7 @@ - * See the License for the specific language governing permissions and - * limitations under the License. - */ -+#include - #include - #include - #include -diff --git a/src/PE/Binary.cpp b/src/PE/Binary.cpp -index 76f5deb6..0cd58cbe 100644 ---- a/src/PE/Binary.cpp -+++ b/src/PE/Binary.cpp -@@ -34,6 +34,8 @@ - #include "LIEF/PE/Binary.hpp" - #include "LIEF/PE/Builder.hpp" - #include "LIEF/PE/utils.hpp" -+#define LIEF_PE_FORCE_UNDEF -+#include "LIEF/PE/undef.h" - #include "LIEF/PE/EnumToString.hpp" - #include "LIEF/PE/ResourceDirectory.hpp" - #include "LIEF/PE/ResourceData.hpp" -diff --git a/src/PE/Builder.cpp b/src/PE/Builder.cpp -index f6aa79de..b18fde8a 100644 ---- a/src/PE/Builder.cpp -+++ b/src/PE/Builder.cpp -@@ -27,6 +27,8 @@ - #include "LIEF/PE/Builder.hpp" - #include "LIEF/PE/ResourceData.hpp" - #include "LIEF/PE/utils.hpp" -+#define LIEF_PE_FORCE_UNDEF -+#include "LIEF/PE/undef.h" - #include "LIEF/PE/ImportEntry.hpp" - #include "LIEF/PE/Import.hpp" - #include "LIEF/PE/Section.hpp" -diff --git a/src/PE/utils.cpp b/src/PE/utils.cpp -index 3545fec3..5158ed8f 100644 ---- a/src/PE/utils.cpp -+++ b/src/PE/utils.cpp -@@ -29,6 +29,8 @@ - #include "LIEF/exception.hpp" - - #include "LIEF/PE/utils.hpp" -+#define LIEF_PE_FORCE_UNDEF -+#include "LIEF/PE/undef.h" - #include "LIEF/PE/Binary.hpp" - #include "LIEF/PE/Import.hpp" - #include "LIEF/PE/ImportEntry.hpp" diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index a2fe6af8fbc9d1..c810a7d8653ed3 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -1,12 +1,12 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lief-project/LIEF - REF 05e3c6eb7cd0ca67c97208e34ac7b815ad0f318e # master commit 2022-02-12 - SHA512 95f126ab8c8aa93c2b78da338c96cbe91a54b03a9d11fbc555959d1b54f4965a9c975c8953f5c05bab6798c0a4a710b8dab85ed630fe2a26b55810ed477e7441 + REF 274d887e176aaa404a60cf6eea239f84f191349e # master commit 2022-02-14 + SHA512 5a5a57f4dc36eb4d74dfd4d7a66f4c5a7eb83b6b58202944ead9be86a576c141cd3c54b5b45f7182a4a7710349da16e16b67e7074523c18fedb98ecf8ba43fba HEAD_REF master PATCHES support_distribution.patch - fix_windows_build.patch + fix_span_include.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -65,6 +65,7 @@ vcpkg_cmake_configure( -DLIEF_OPT_FROZEN_EXTERNAL=ON -DLIEF_OPT_EXTERNAL_LEAF=ON "-DLIEF_EXTERNAL_LEAF_DIR=${CURRENT_INSTALLED_DIR}/include" + -DLIEF_OPT_EXTERNAL_SPAN=ON ) vcpkg_cmake_install() @@ -84,5 +85,5 @@ if(dir_files_len EQUAL 0) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/LIEF") endif() -# # Handle copyright +# Handle copyright file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index 253cd47c04ebf3..419285aa03649d 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -1,6 +1,6 @@ { "name": "lief", - "version": "2022-02-12", + "version": "2022-02-14", "description": "LIEF - Library to Instrument Executable Formats", "homepage": "https://lief.quarkslab.com", "license": "Apache-2.0", @@ -9,6 +9,7 @@ "boost-leaf", "frozen", "mbedtls", + "span", "spdlog", "utfcpp", { diff --git a/ports/span/portfile.cmake b/ports/span/portfile.cmake new file mode 100644 index 00000000000000..ea652e235e9e8f --- /dev/null +++ b/ports/span/portfile.cmake @@ -0,0 +1,20 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO tcbrindle/span + REF 427f6bd0bbf36ad46aec4d8bdd7760beeb10dd33 # master commit 2021-12-15 + SHA512 c775bd50bc68d98fcde5e99bb9b6594c8ac9ef15fa15efe89c253b4135df77d83e58743d3c7e90d3aff03429251497a7d56d1900f6e258416c0664a82326243c + HEAD_REF master +) + +# Just a single header +file( + INSTALL "${SOURCE_PATH}/include/tcb/span.hpp" + DESTINATION "${CURRENT_PACKAGES_DIR}/include/tcb" +) + +# Handle copyright +file( + INSTALL "${SOURCE_PATH}/LICENSE_1_0.txt" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/tcb" + RENAME copyright +) diff --git a/ports/span/vcpkg.json b/ports/span/vcpkg.json new file mode 100644 index 00000000000000..a52f3d37f2e95e --- /dev/null +++ b/ports/span/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "span", + "version-string": "2021-12-15", + "description": "Implementation of C++20's std::span for older compilers", + "homepage": "https://github.com/tcbrindle/span", + "license": "BSL-1.0", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + } + ] +} From 6d195b81907bf569ce8ff445b31a188562988e92 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Mon, 14 Feb 2022 22:30:33 -0500 Subject: [PATCH 61/81] Update versions --- versions/baseline.json | 6 +++++- versions/l-/lief.json | 4 ++-- versions/s-/span.json | 9 +++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 versions/s-/span.json diff --git a/versions/baseline.json b/versions/baseline.json index 77b9d11cc5e7e1..2854b8923e26d1 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4157,7 +4157,7 @@ "port-version": 3 }, "lief": { - "baseline": "2022-02-12", + "baseline": "2022-02-14", "port-version": 0 }, "lilv": { @@ -6532,6 +6532,10 @@ "baseline": "7.8.2", "port-version": 5 }, + "span": { + "baseline": "2021-12-15", + "port-version": 0 + }, "span-lite": { "baseline": "0.10.3", "port-version": 0 diff --git a/versions/l-/lief.json b/versions/l-/lief.json index 96c86c746df5a9..277b2cf125bf5b 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "395e5838923ee3fc12ee08d455a148305b501e86", - "version": "2022-02-12", + "git-tree": "b30321c98ca2256de6085106e44e3906be45c52a", + "version": "2022-02-14", "port-version": 0 }, { diff --git a/versions/s-/span.json b/versions/s-/span.json new file mode 100644 index 00000000000000..57b5d45eb8e51d --- /dev/null +++ b/versions/s-/span.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "fd7108ae4c8ebafe4e6ea0254a1e652361653908", + "version-string": "2021-12-15", + "port-version": 0 + } + ] +} From 8d8fa8e33cb848526040c1865db3fa4fb6480d7a Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Mon, 14 Feb 2022 22:44:00 -0500 Subject: [PATCH 62/81] Rename span to tcb-span - same as Conan --- ports/lief/vcpkg.json | 2 +- ports/{span => tcb-span}/portfile.cmake | 2 +- ports/{span => tcb-span}/vcpkg.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename ports/{span => tcb-span}/portfile.cmake (90%) rename ports/{span => tcb-span}/vcpkg.json (92%) diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index 419285aa03649d..3d2aa2f1ff78a6 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -9,7 +9,7 @@ "boost-leaf", "frozen", "mbedtls", - "span", + "tcb-span", "spdlog", "utfcpp", { diff --git a/ports/span/portfile.cmake b/ports/tcb-span/portfile.cmake similarity index 90% rename from ports/span/portfile.cmake rename to ports/tcb-span/portfile.cmake index ea652e235e9e8f..42e6f3d2475814 100644 --- a/ports/span/portfile.cmake +++ b/ports/tcb-span/portfile.cmake @@ -15,6 +15,6 @@ file( # Handle copyright file( INSTALL "${SOURCE_PATH}/LICENSE_1_0.txt" - DESTINATION "${CURRENT_PACKAGES_DIR}/share/tcb" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/tcb-span" RENAME copyright ) diff --git a/ports/span/vcpkg.json b/ports/tcb-span/vcpkg.json similarity index 92% rename from ports/span/vcpkg.json rename to ports/tcb-span/vcpkg.json index a52f3d37f2e95e..d2aede3df40e73 100644 --- a/ports/span/vcpkg.json +++ b/ports/tcb-span/vcpkg.json @@ -1,5 +1,5 @@ { - "name": "span", + "name": "tcb-span", "version-string": "2021-12-15", "description": "Implementation of C++20's std::span for older compilers", "homepage": "https://github.com/tcbrindle/span", From 17f84374ebfcb0d715ed01098bd39e41bc75bd84 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Mon, 14 Feb 2022 22:47:57 -0500 Subject: [PATCH 63/81] Update versions --- ports/lief/vcpkg.json | 2 +- versions/baseline.json | 8 ++++---- versions/l-/lief.json | 2 +- versions/{s-/span.json => t-/tcb-span.json} | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) rename versions/{s-/span.json => t-/tcb-span.json} (61%) diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index 3d2aa2f1ff78a6..3cc8a199c5a983 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -9,8 +9,8 @@ "boost-leaf", "frozen", "mbedtls", - "tcb-span", "spdlog", + "tcb-span", "utfcpp", { "name": "vcpkg-cmake", diff --git a/versions/baseline.json b/versions/baseline.json index 2854b8923e26d1..126b29188dedf0 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6532,10 +6532,6 @@ "baseline": "7.8.2", "port-version": 5 }, - "span": { - "baseline": "2021-12-15", - "port-version": 0 - }, "span-lite": { "baseline": "0.10.3", "port-version": 0 @@ -6760,6 +6756,10 @@ "baseline": "2020_U3", "port-version": 7 }, + "tcb-span": { + "baseline": "2021-12-15", + "port-version": 0 + }, "tcl": { "baseline": "core-9-0-a1", "port-version": 5 diff --git a/versions/l-/lief.json b/versions/l-/lief.json index 277b2cf125bf5b..6e05a687e0bf95 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "b30321c98ca2256de6085106e44e3906be45c52a", + "git-tree": "5ba5c19bbded73524a05d8cc600a055b2a79ab08", "version": "2022-02-14", "port-version": 0 }, diff --git a/versions/s-/span.json b/versions/t-/tcb-span.json similarity index 61% rename from versions/s-/span.json rename to versions/t-/tcb-span.json index 57b5d45eb8e51d..604dcb8b319300 100644 --- a/versions/s-/span.json +++ b/versions/t-/tcb-span.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "fd7108ae4c8ebafe4e6ea0254a1e652361653908", + "git-tree": "7c7e3d341fdbaa1b2603c061128db0d056e64977", "version-string": "2021-12-15", "port-version": 0 } From 3656befcfe1e7ab1c183810a93739938213ac1b5 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Mon, 21 Feb 2022 10:07:56 -0500 Subject: [PATCH 64/81] Update LIEF to master commit and simplify patch Trying to make the patch more compatible with upstream's support --- ports/lief/fix_span_include.patch | 17 -- ports/lief/portfile.cmake | 5 +- ports/lief/support_distribution.patch | 295 ++++++++++++++++++-------- ports/lief/vcpkg.json | 2 +- 4 files changed, 204 insertions(+), 115 deletions(-) delete mode 100644 ports/lief/fix_span_include.patch diff --git a/ports/lief/fix_span_include.patch b/ports/lief/fix_span_include.patch deleted file mode 100644 index 194d0454e401dd..00000000000000 --- a/ports/lief/fix_span_include.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/include/LIEF/third-party/span.hpp b/include/LIEF/third-party/span.hpp -index db355fc4..5f521fd3 100644 ---- a/include/LIEF/third-party/span.hpp -+++ b/include/LIEF/third-party/span.hpp -@@ -16,10 +16,10 @@ - #define LIEF_THIRD_PARTY_SPAN_H_ - #include "LIEF/config.h" - --#ifndef LIEF_EXTERNAL_LEAF -+#ifndef LIEF_EXTERNAL_SPAN - #include - #else --#include -+#include - #endif - - #endif diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index c810a7d8653ed3..7a068095bae1a6 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -1,12 +1,11 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lief-project/LIEF - REF 274d887e176aaa404a60cf6eea239f84f191349e # master commit 2022-02-14 - SHA512 5a5a57f4dc36eb4d74dfd4d7a66f4c5a7eb83b6b58202944ead9be86a576c141cd3c54b5b45f7182a4a7710349da16e16b67e7074523c18fedb98ecf8ba43fba + REF 566d4ac8a86e458a40de1e2816115f8db48a5501 # master commit 2022-02-19 + SHA512 8ebcd67c54903d83e43959039d0cccdbccb6132c5f84344dbd9834d98932d294c4f5ce95df8a1702c6afa8a1714179b6d413c524902f24eb0f0bceff5db3c2be HEAD_REF master PATCHES support_distribution.patch - fix_span_include.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/lief/support_distribution.patch b/ports/lief/support_distribution.patch index bbfe0d30a11b69..9437c0f1f57f94 100644 --- a/ports/lief/support_distribution.patch +++ b/ports/lief/support_distribution.patch @@ -1,29 +1,30 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1f73fb29..5a9fd079 100644 +index 456279ae..3e8f3887 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -11,11 +11,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_CROSSCOMPILING) +@@ -11,9 +11,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_CROSSCOMPILING) endif() -if(WIN32 OR ${IS_WIN_CROSS_COMPILE}) - include(ChooseMSVCCRT) -endif() --include(CheckCXXCompilerFlag) --include(CheckCCompilerFlag) + include(CheckCXXCompilerFlag) + include(CheckCCompilerFlag) include(ExternalProject) - include(CMakePackageConfigHelpers) - -@@ -201,8 +196,6 @@ if(WINDOWS AND BUILD_SHARED_LIBS) +@@ -208,11 +205,6 @@ if(WINDOWS AND BUILD_SHARED_LIBS) + target_link_libraries(LIB_LIEF ws2_32) endif() - if(MSVC OR ${IS_WIN_CROSS_COMPILE}) +-if(MSVC OR ${IS_WIN_CROSS_COMPILE}) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") - endif() - +-endif() +- if(CMAKE_BUILD_TYPE MATCHES Debug AND WINDOWS) -@@ -328,7 +321,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/LIEF.pc.in ${CMAKE_CURRENT_BINARY_DIR + add_definitions(-D_ITERATOR_DEBUG_LEVEL=0 -D_SECURE_SCL=0 + -D_HAS_ITERATOR_DEBUGGING=0) +@@ -336,7 +328,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/LIEF.pc.in ${CMAKE_CURRENT_BINARY_DIR @ONLY) target_include_directories(LIB_LIEF @@ -32,7 +33,7 @@ index 1f73fb29..5a9fd079 100644 PRIVATE "${LIEF_PRIVATE_INCLUDE_DIR}") if(LIEF_ENABLE_JSON) -@@ -371,7 +364,7 @@ if(LIEF_EXTERNAL_LEAF) +@@ -379,7 +371,7 @@ if(LIEF_EXTERNAL_LEAF) if(LIEF_EXTERNAL_LEAF_DIR) message(STATUS "External LEAF include dir: ${LIEF_EXTERNAL_LEAF_DIR}") target_include_directories(LIB_LIEF SYSTEM PUBLIC @@ -41,7 +42,7 @@ index 1f73fb29..5a9fd079 100644 endif() else() add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/leaf.hpp -@@ -533,7 +526,7 @@ if(LIEF_COVERAGE) +@@ -569,7 +561,7 @@ if(LIEF_COVERAGE) target_link_libraries(LIB_LIEF gcov) endif() @@ -50,20 +51,7 @@ index 1f73fb29..5a9fd079 100644 # Set a default build type if none was specified -@@ -580,10 +573,10 @@ endif() - - # Find Package Config - # ====================== --configure_package_config_file( -+configure_file( - LIEFConfig.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfig.cmake -- INSTALL_DESTINATION share/LIEF/cmake) -+ @ONLY) - - write_basic_package_version_file( - ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfigVersion.cmake -@@ -630,26 +623,15 @@ endif() +@@ -666,26 +658,15 @@ endif() # Installation # ====================== @@ -86,7 +74,7 @@ index 1f73fb29..5a9fd079 100644 install( - TARGETS LIB_LIEF + TARGETS LIB_LIEF lief_spdlog -+ EXPORT LIEFTargets ++ EXPORT LIEFExport ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries) @@ -95,63 +83,46 @@ index 1f73fb29..5a9fd079 100644 install( DIRECTORY ${LIEF_PUBLIC_INCLUDE_DIR} -@@ -658,11 +640,6 @@ install( +@@ -694,8 +675,12 @@ install( FILES_MATCHING REGEX "(.*).(hpp|h|def|inc)$") --install( -- FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/FindLIEF.cmake -- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/LIEF/cmake -- COMPONENT CMakeScripts) -- ++configure_file( ++ ${CMAKE_CURRENT_SOURCE_DIR}/scripts/FindLIEF.cmake ++ ${CMAKE_CURRENT_BINARY_DIR}/FindLIEF.cmake ++ @ONLY) install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfig.cmake - ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfigVersion.cmake -@@ -674,7 +651,13 @@ install( +- FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/FindLIEF.cmake ++ FILES ${CMAKE_CURRENT_BINARY_DIR}/FindLIEF.cmake + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/LIEF/cmake + COMPONENT CMakeScripts) + +@@ -710,7 +695,13 @@ install( DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT libraries) -export(TARGETS LIB_LIEF lief_spdlog FILE LIEFExport.cmake) +install( -+ EXPORT LIEFTargets ++ EXPORT LIEFExport + NAMESPACE LIEF:: + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/LIEF/cmake + COMPONENT config) + -+export(EXPORT LIEFTargets FILE LIEFTargets.cmake) ++export(EXPORT LIEFExport FILE LIEFExport.cmake) # Package # ====================== diff --git a/LIEFConfig.cmake.in b/LIEFConfig.cmake.in -index 94ee5245..16454dfd 100644 +index 94ee5245..c51d320d 100644 --- a/LIEFConfig.cmake.in +++ b/LIEFConfig.cmake.in -@@ -1,4 +1,20 @@ +@@ -1,4 +1 @@ -@PACKAGE_INIT@ -+include(CMakeFindDependencyMacro) - +- -set(LIEF_DIR "${PACKAGE_PREFIX_DIR}") --include("${CMAKE_CURRENT_LIST_DIR}/FindLIEF.cmake") -+# Need to find private dependencies even if they're private when compiled -+# statically -+if(NOT @BUILD_SHARED_LIBS@) -+ find_dependency(MbedTLS) -+ find_dependency(nlohmann_json) -+ find_dependency(frozen) -+ find_dependency(utf8cpp) -+ find_dependency(spdlog) -+endif() -+ -+include("${CMAKE_CURRENT_LIST_DIR}/LIEFTargets.cmake") -+ -+# Also attach location of Boost LEAF header-only library -+find_path(BOOST_LEAF_INCLUDE_PATH boost/leaf.hpp) -+if(NOT BOOST_LEAF_INCLUDE_PATH) -+ message(FATAL_ERROR "Could not find required path to 'boost/leaf.hpp'") -+endif() -+set_property(TARGET LIEF::LIEF APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${BOOST_LEAF_INCLUDE_PATH}") + include("${CMAKE_CURRENT_LIST_DIR}/FindLIEF.cmake") diff --git a/cmake/LIEFApi.cmake b/cmake/LIEFApi.cmake -index f06f846c..964b394d 100644 +index f06f846c..42e0b8dc 100644 --- a/cmake/LIEFApi.cmake +++ b/cmake/LIEFApi.cmake @@ -18,7 +18,7 @@ endif() @@ -159,21 +130,18 @@ index f06f846c..964b394d 100644 if(LIEF_C_API) target_include_directories(LIB_LIEF - PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include") -+ PUBLIC "$") ++ PUBLIC "$") include("${CMAKE_CURRENT_SOURCE_DIR}/api/c/CMakeLists.txt") endif() diff --git a/examples/cmake/find_package/CMakeLists.txt b/examples/cmake/find_package/CMakeLists.txt -index 1812d4b1..0add37d9 100644 +index 1812d4b1..2cf36289 100644 --- a/examples/cmake/find_package/CMakeLists.txt +++ b/examples/cmake/find_package/CMakeLists.txt -@@ -2,43 +2,17 @@ cmake_minimum_required(VERSION 3.1) - - project(CMakeLIEF) +@@ -5,15 +5,6 @@ project(CMakeLIEF) + # Use LIEF with 'find_package()' + # ============================== --# Use LIEF with 'find_package()' --# ============================== -- -# Custom path to the LIEF install directory -set(LIEF_DIR CACHE PATH ${CMAKE_INSTALL_PREFIX}) - @@ -184,33 +152,172 @@ index 1812d4b1..0add37d9 100644 -include(FindLIEF) - # Find LIEF --find_package(LIEF REQUIRED COMPONENTS STATIC) # COMPONENTS: - Default: STATIC -- --message(STATUS "LIEF include directory: ${LIEF_INCLUDE_DIRS}") --message(STATUS "LIEF library: ${LIEF_LIBRARIES}") -+find_package(LIEF REQUIRED) + find_package(LIEF REQUIRED COMPONENTS STATIC) # COMPONENTS: - Default: STATIC + +diff --git a/scripts/FindLIEF.cmake b/scripts/FindLIEF.cmake +index 43874a3a..d9f19fd1 100644 +--- a/scripts/FindLIEF.cmake ++++ b/scripts/FindLIEF.cmake +@@ -43,83 +43,65 @@ - # Add our executable - # ================== - add_executable(HelloLIEF main.cpp) --if(MSVC) -- set_property(TARGET HelloLIEF PROPERTY LINK_FLAGS /NODEFAULTLIB:MSVCRT) + +-set(_LIEF_SEARCHES) +- + if(LIEF_ROOT) + message(FATAL_ERROR "LIEF_ROOT is no longer supported. Please use LIEF_DIR") + endif() + +-if(LIEF_DIR) +- set(_LIEF_SEARCH_ROOT PATHS ${LIEF_DIR} NO_DEFAULT_PATH) +- list(APPEND _LIEF_SEARCHES _LIEF_SEARCH_ROOT) -endif() - +-set(LIEF_NAMES LIEF) +- + if (LIEF_FIND_COMPONENTS AND LIEF_FIND_REQUIRED_STATIC AND LIEF_FIND_REQUIRED_SHARED) + message(WARNING "Two incompatible components specified : static and shared. We are going to ignore the 'shared' component.") + list(REMOVE_ITEM LIEF_FIND_COMPONENTS SHARED) + unset(LIEF_FIND_REQUIRED_SHARED) + endif() + +-set(LIBRARY_SUFFIXES_SAVED ${CMAKE_FIND_LIBRARY_SUFFIXES}) + +-if (NOT LIEF_FIND_COMPONENTS) +- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX}) ++include(CMakeFindDependencyMacro) ++ ++# Need to find private dependencies even if they're private when compiled ++# statically ++if(NOT @BUILD_SHARED_LIBS@) ++ find_dependency(MbedTLS) ++ find_dependency(nlohmann_json) ++ find_dependency(frozen) ++ find_dependency(utf8cpp) ++ find_dependency(spdlog) + endif() + +-if(LIEF_FIND_COMPONENTS AND LIEF_FIND_REQUIRED_STATIC) +- unset(_LIEF_LIBRARY CACHE) +- unset(LIEF_LIBRARY) +- unset(LIEF_FOUND) +- unset(LIEF_LIBRARIES) +- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) ++include("${CMAKE_CURRENT_LIST_DIR}/LIEFExport.cmake") ++ ++# Also attach location of header-only libraries ++find_path(BOOST_LEAF_INCLUDE_PATH boost/leaf.hpp) ++if(NOT BOOST_LEAF_INCLUDE_PATH) ++ message(WARNING "Could not find required path to 'boost/leaf.hpp'") + endif() ++find_path(TCB_SPAN_INCLUDE_PATH tcb/span.hpp) ++if(NOT TCB_SPAN_INCLUDE_PATH) ++ message(WARNING "Could not find required path to 'tcb/span.hpp'") ++endif() ++set_property(TARGET LIEF::LIEF APPEND PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${BOOST_LEAF_INCLUDE_PATH}" "${TCB_SPAN_INCLUDE_PATH}") + +-if(LIEF_FIND_COMPONENTS AND LIEF_FIND_REQUIRED_SHARED) +- unset(_LIEF_LIBRARY CACHE) +- unset(LIEF_LIBRARY) +- unset(LIEF_FOUND) +- unset(LIEF_LIBRARIES) +- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX}) ++ ++get_target_property(_LIEF_LIB_TYPE LIEF::LIEF TYPE) ++ ++if(LIEF_FIND_COMPONENTS AND LIEF_FIND_REQUIRED_STATIC) ++ if(_LIEF_LIB_TYPE STREQUAL "SHARED_LIBRARY") ++ message(FATAL_ERROR "Could not find requested static LIEF library: $") ++ set(LIEF_FOUND FALSE) ++ endif() + endif() + +-# Try each search configuration. +-foreach(search ${_LIEF_SEARCHES}) +- find_path(LIEF_INCLUDE_DIR +- NAMES LIEF/LIEF.hpp +- PATH ${${search}} +- REQUIRED +- CMAKE_FIND_ROOT_PATH_BOTH +- PATH_SUFFIXES include) +-endforeach() - --# Setup the LIEF include directory --target_include_directories(HelloLIEF -- PUBLIC -- ${LIEF_INCLUDE_DIRS} --) +-# Allow LIEF_LIBRARY to be set manually, as the location of the LIEF library +-if(NOT LIEF_LIBRARY) +- foreach(search ${_LIEF_SEARCHES}) +- find_library(_LIEF_LIBRARY +- NAMES ${LIEF_NAMES} +- PATHS ${${search}} +- REQUIRED +- CMAKE_FIND_ROOT_PATH_BOTH +- PATH_SUFFIXES lib lib64) +- endforeach() - --# Enable C++11 -+# C++11 minimum - set_property(TARGET HelloLIEF - PROPERTY CXX_STANDARD 11 - PROPERTY CXX_STANDARD_REQUIRED ON) +- if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake") +- include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) +- else() +- include(SelectLibraryConfigurations) ++if(LIEF_FIND_COMPONENTS AND LIEF_FIND_REQUIRED_SHARED) ++ if(_LIEF_LIB_TYPE STREQUAL "STATIC_LIBRARY") ++ message(FATAL_ERROR "Could not find requested shared LIEF library: $") ++ set(LIEF_FOUND FALSE) + endif() ++endif() + +- select_library_configurations(LIEF) + +- set(LIEF_LIBRARY ${_LIEF_LIBRARY}) +-endif() ++set(LIEF_LIBRARIES LIEF::LIEF) + + +-unset(LIEF_NAMES) ++get_target_property(LIEF_INCLUDE_DIRS LIEF::LIEF INTERFACE_INCLUDE_DIRECTORIES) - # Link the executable with LIEF --target_link_libraries(HelloLIEF PUBLIC ${LIEF_LIBRARIES}) -+target_link_libraries(HelloLIEF PRIVATE LIEF::LIEF) +-mark_as_advanced(LIEF_INCLUDE_DIR) + + if(LIEF_INCLUDE_DIR AND EXISTS "${LIEF_INCLUDE_DIR}/LIEF/version.h") + file(STRINGS "${LIEF_INCLUDE_DIR}/LIEF/version.h" LIEF_H REGEX "^#define LIEF_VERSION \"[^\"]*\"$") +@@ -133,42 +115,3 @@ if(LIEF_INCLUDE_DIR AND EXISTS "${LIEF_INCLUDE_DIR}/LIEF/version.h") + set(LIEF_MINOR_VERSION "${LIEF_VERSION_MINOR}") + set(LIEF_PATCH_VERSION "${LIEF_VERSION_PATCH}") + endif() +- +- +-if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake") +- include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +-else() +- include(FindPackageHandleStandardArgs) +-endif() +-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIEF REQUIRED_VARS LIEF_LIBRARY LIEF_INCLUDE_DIR +- VERSION_VAR LIEF_VERSION_STRING) +- +- +-if(LIEF_FOUND) +- set(LIEF_INCLUDE_DIRS ${LIEF_INCLUDE_DIR}) +- +- if(NOT LIEF_LIBRARIES) +- set(LIEF_LIBRARIES ${LIEF_LIBRARY}) +- endif() +- +- if(NOT TARGET LIEF::LIEF) +- add_library(LIEF::LIEF UNKNOWN IMPORTED) +- set_target_properties(LIEF::LIEF PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${LIEF_INCLUDE_DIRS}") +- +- if(LIEF_LIBRARY) +- set_property(TARGET LIEF::LIEF APPEND PROPERTY +- IMPORTED_CONFIGURATIONS RELEASE) +- set_target_properties(LIEF::LIEF PROPERTIES +- IMPORTED_LOCATION_RELEASE "${LIEF_LIBRARY}") +- endif() +- +- if(NOT LIEF_LIBRARY) +- set_property(TARGET LIEF::LIEF APPEND PROPERTY +- IMPORTED_LOCATION "${LIEF_LIBRARY}") +- endif() +- endif() +-endif() +- +-# Restore +-set(CMAKE_FIND_LIBRARY_SUFFIXES ${LIBRARY_SUFFIXES_SAVED}) diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index 3cc8a199c5a983..d757712271e50d 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -1,6 +1,6 @@ { "name": "lief", - "version": "2022-02-14", + "version": "2022-02-19", "description": "LIEF - Library to Instrument Executable Formats", "homepage": "https://lief.quarkslab.com", "license": "Apache-2.0", From 594a2c6af5f7d5d1823d8c042bb492dce718234d Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Mon, 21 Feb 2022 10:15:27 -0500 Subject: [PATCH 65/81] Update version --- versions/baseline.json | 2 +- versions/l-/lief.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index 0a94eda8a37efd..dacf391cfb4ddc 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4153,7 +4153,7 @@ "port-version": 3 }, "lief": { - "baseline": "2022-02-14", + "baseline": "2022-02-19", "port-version": 0 }, "lilv": { diff --git a/versions/l-/lief.json b/versions/l-/lief.json index 6e05a687e0bf95..c85f0331a00e71 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "5ba5c19bbded73524a05d8cc600a055b2a79ab08", - "version": "2022-02-14", + "git-tree": "c803b254ee084c4a5c33ed2428fc52faea6375b0", + "version": "2022-02-19", "port-version": 0 }, { From b1d5b3302256e1b3bc0bb75c7077e432d43c94f8 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Mon, 21 Feb 2022 12:16:33 -0500 Subject: [PATCH 66/81] Upgrade ixwebsocket for MbedTLSv3 support --- ports/ixwebsocket/portfile.cmake | 4 ++-- ports/ixwebsocket/vcpkg.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/ixwebsocket/portfile.cmake b/ports/ixwebsocket/portfile.cmake index aa666b17e859c1..0bc12692bb66c7 100644 --- a/ports/ixwebsocket/portfile.cmake +++ b/ports/ixwebsocket/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO machinezone/IXWebSocket - REF 2149ac7ed60d7713a86446c4b93c6004f66415ac #v11.2.6 - SHA512 737667f6e89156168db771fd2a6d3686cd51ddc753fa083ae399a84c689770a09fd86643bb2d838e9ae5a729067236f1d9b4ceece912145cfb83b29541a3d2c1 + REF f7eb3688ddcb7d555df91e97ce8804421378e3b4 #v11.3.3 + SHA512 78eddce7d3f817632b2f48b7f7c8e767fe1995d6a91d9156b0683fafd89c00e898b09fdcaa40559df333fc63c9160fe03b2770e5e9afcfcf489e89871e12fb1c ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/ixwebsocket/vcpkg.json b/ports/ixwebsocket/vcpkg.json index 8a27789acb9758..d72d336e09105d 100644 --- a/ports/ixwebsocket/vcpkg.json +++ b/ports/ixwebsocket/vcpkg.json @@ -1,6 +1,6 @@ { "name": "ixwebsocket", - "version-semver": "11.2.6", + "version-semver": "11.3.3", "description": "Lightweight WebSocket Client and Server + HTTP Client and Server", "homepage": "https://github.com/machinezone/IXWebSocket", "dependencies": [ From 5c6234ad8230143128eb112c14e83aa02bc5d605 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Mon, 21 Feb 2022 12:17:14 -0500 Subject: [PATCH 67/81] Add ixwebsocket version --- versions/baseline.json | 2 +- versions/i-/ixwebsocket.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index dacf391cfb4ddc..1aa82f89fc9456 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2941,7 +2941,7 @@ "port-version": 8 }, "ixwebsocket": { - "baseline": "11.2.6", + "baseline": "11.3.3", "port-version": 0 }, "jack2": { diff --git a/versions/i-/ixwebsocket.json b/versions/i-/ixwebsocket.json index fdc16164fda477..c7a4aabe6d4c6b 100644 --- a/versions/i-/ixwebsocket.json +++ b/versions/i-/ixwebsocket.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "4c71b63f14abb1415d01790373aed44a12faddda", + "version-semver": "11.3.3", + "port-version": 0 + }, { "git-tree": "23fff75b15231882eb9461ff479a9f6edba3a450", "version-semver": "11.2.6", From b2d2afc69e1fa3678713cb4c1e8e573edaa089d2 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Fri, 25 Feb 2022 18:46:16 -0500 Subject: [PATCH 68/81] Use patches from PR branches --- ...INTERFACE-generator-expression-for-i.patch | 74 ++ .../0002-Export-LIEF-targets-with-CMake.patch | 937 ++++++++++++++++++ ports/lief/0003-Support-vcpkg.patch | 36 + ports/lief/portfile.cmake | 4 +- ports/lief/support_distribution.patch | 323 ------ 5 files changed, 1050 insertions(+), 324 deletions(-) create mode 100644 ports/lief/0001-Use-CMake-BUILD_INTERFACE-generator-expression-for-i.patch create mode 100644 ports/lief/0002-Export-LIEF-targets-with-CMake.patch create mode 100644 ports/lief/0003-Support-vcpkg.patch delete mode 100644 ports/lief/support_distribution.patch diff --git a/ports/lief/0001-Use-CMake-BUILD_INTERFACE-generator-expression-for-i.patch b/ports/lief/0001-Use-CMake-BUILD_INTERFACE-generator-expression-for-i.patch new file mode 100644 index 00000000000000..de6b3d41bef3f6 --- /dev/null +++ b/ports/lief/0001-Use-CMake-BUILD_INTERFACE-generator-expression-for-i.patch @@ -0,0 +1,74 @@ +From 3861a8269aee85136584cb3cb211b490fab09478 Mon Sep 17 00:00:00 2001 +From: Eric Kilmer +Date: Mon, 21 Feb 2022 10:26:55 -0500 +Subject: [PATCH 1/3] Use CMake BUILD_INTERFACE generator expression for + include directories + +This fixes the paths that are generated for the exported targets so that +they do not have absolute paths that were found/used at build time. +--- + CMakeLists.txt | 6 +++--- + cmake/LIEFApi.cmake | 2 +- + cmake/LIEFDependencies.cmake | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 456279ae..41afb8c0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -336,7 +336,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/LIEF.pc.in ${CMAKE_CURRENT_BINARY_DIR + @ONLY) + + target_include_directories(LIB_LIEF +- PUBLIC "${LIEF_PUBLIC_INCLUDE_DIR}" ++ PUBLIC "$" + PRIVATE "${LIEF_PRIVATE_INCLUDE_DIR}") + + if(LIEF_ENABLE_JSON) +@@ -379,7 +379,7 @@ if(LIEF_EXTERNAL_LEAF) + if(LIEF_EXTERNAL_LEAF_DIR) + message(STATUS "External LEAF include dir: ${LIEF_EXTERNAL_LEAF_DIR}") + target_include_directories(LIB_LIEF SYSTEM PUBLIC +- ${LIEF_EXTERNAL_LEAF_DIR}) ++ "$") + endif() + else() + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/leaf.hpp +@@ -422,7 +422,7 @@ if(LIEF_EXTERNAL_SPAN) + if(LIEF_EXTERNAL_SPAN_DIR) + message(STATUS "External span include dir: ${LIEF_EXTERNAL_SPAN_DIR}") + target_include_directories(LIB_LIEF SYSTEM PUBLIC +- ${LIEF_EXTERNAL_SPAN_DIR}) ++ "$") + endif() + else() + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/span.hpp +diff --git a/cmake/LIEFApi.cmake b/cmake/LIEFApi.cmake +index f06f846c..42e0b8dc 100644 +--- a/cmake/LIEFApi.cmake ++++ b/cmake/LIEFApi.cmake +@@ -18,7 +18,7 @@ endif() + # ----- + if(LIEF_C_API) + target_include_directories(LIB_LIEF +- PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include") ++ PUBLIC "$") + + include("${CMAKE_CURRENT_SOURCE_DIR}/api/c/CMakeLists.txt") + endif() +diff --git a/cmake/LIEFDependencies.cmake b/cmake/LIEFDependencies.cmake +index 087bae8a..2f8e6b0b 100644 +--- a/cmake/LIEFDependencies.cmake ++++ b/cmake/LIEFDependencies.cmake +@@ -179,7 +179,7 @@ else() + ExternalProject_get_property(lief_spdlog_project SOURCE_DIR) + set(SPDLOG_SOURCE_DIR "${SOURCE_DIR}") + add_dependencies(lief_spdlog lief_spdlog_project) +- target_include_directories(lief_spdlog SYSTEM INTERFACE ${SPDLOG_SOURCE_DIR}/include) ++ target_include_directories(lief_spdlog SYSTEM INTERFACE "$") + endif() + + # Frozen +-- +2.35.1 + diff --git a/ports/lief/0002-Export-LIEF-targets-with-CMake.patch b/ports/lief/0002-Export-LIEF-targets-with-CMake.patch new file mode 100644 index 00000000000000..a61f5f359824de --- /dev/null +++ b/ports/lief/0002-Export-LIEF-targets-with-CMake.patch @@ -0,0 +1,937 @@ +From 04a95dc88aae31548a0f5f2795c4115c19c38a16 Mon Sep 17 00:00:00 2001 +From: Eric Kilmer +Date: Mon, 21 Feb 2022 10:54:56 -0500 +Subject: [PATCH 2/3] Export LIEF targets with CMake + +With these changes, we no longer need to manually find the LIEF library +by filename. CMake takes care of generating the LIEF::LIEF target and +library location for us in the exported target set. This is basically a +requirement when using external dependencies because the original +functionality did not take care of this. + +I have updated the example projects to make sure that they will work +with this new setup. In doing so, I changed quite a bit to more closely +follow CMake best practices that I hope we can agree on to both improve +reliability and reduce maintenance and support questions for people who +configure LIEF with external dependencies. + +This project still supports finding static or shared LIEF libraries in +the same install prefix using the find_package COMPONENTS method. + +This project still supports development of other projects that want to +use LIEF without installing. Just specify the following option during +configuration of your project that depends on LIEF: + +```cmake +cmake -DLIEF_DIR= ... +``` +--- + CMakeLists.txt | 36 ++-- + LIEFConfig.cmake.in | 181 +++++++++++++++++- + doc/sphinx/installation.rst | 73 +++++-- + .../cmake/add_subdirectory/CMakeLists.txt | 76 ++++++++ + examples/cmake/add_subdirectory/README.rst | 12 ++ + .../main.cpp | 0 + .../cmake/external_project/CMakeLists.txt | 71 +++---- + .../external_project/HelloLIEF/CMakeLists.txt | 28 +++ + .../external_project/{ => HelloLIEF}/main.cpp | 0 + examples/cmake/external_project/README.rst | 3 + + examples/cmake/find_package/CMakeLists.txt | 28 +-- + examples/cmake/find_package/README.rst | 2 +- + scripts/FindLIEF.cmake | 174 ----------------- + 13 files changed, 411 insertions(+), 273 deletions(-) + create mode 100644 examples/cmake/add_subdirectory/CMakeLists.txt + create mode 100644 examples/cmake/add_subdirectory/README.rst + copy examples/cmake/{external_project => add_subdirectory}/main.cpp (100%) + create mode 100644 examples/cmake/external_project/HelloLIEF/CMakeLists.txt + rename examples/cmake/external_project/{ => HelloLIEF}/main.cpp (100%) + delete mode 100644 scripts/FindLIEF.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 41afb8c0..6bfe863f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -176,6 +176,7 @@ source_group("Source Files" FILES ${LIBLIEF_SOURCE_FILES}) + source_group("Header Files\\visitors" FILES ${LIEF_VISITOR_INCLUDE_FILES}) + + add_library(LIB_LIEF ${LIBLIEF_SOURCE_FILES} ${LIEF_INCLUDE_FILES}) ++add_library(LIEF::LIEF ALIAS LIB_LIEF) + + if(NOT LIEF_OPT_MBEDTLS_EXTERNAL) + set_source_files_properties(${mbedtls_src_crypto} PROPERTIES GENERATED TRUE) +@@ -569,7 +570,7 @@ if(LIEF_COVERAGE) + target_link_libraries(LIB_LIEF gcov) + endif() + +-set_target_properties(LIB_LIEF PROPERTIES OUTPUT_NAME LIEF CLEAN_DIRECT_OUTPUT 1) ++set_target_properties(LIB_LIEF PROPERTIES OUTPUT_NAME LIEF EXPORT_NAME LIEF CLEAN_DIRECT_OUTPUT 1) + + + # Set a default build type if none was specified +@@ -616,10 +617,10 @@ endif() + + # Find Package Config + # ====================== +-configure_package_config_file( ++configure_file( + LIEFConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfig.cmake +- INSTALL_DESTINATION share/LIEF/cmake) ++ @ONLY) + + write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfigVersion.cmake +@@ -682,10 +683,12 @@ else() + endif() + + install( +- TARGETS LIB_LIEF ++ TARGETS LIB_LIEF lief_spdlog ++ EXPORT LIEFExport + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries) ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries ++ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + install( + DIRECTORY ${LIEF_PUBLIC_INCLUDE_DIR} +@@ -694,11 +697,6 @@ install( + FILES_MATCHING + REGEX "(.*).(hpp|h|def|inc)$") + +-install( +- FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/FindLIEF.cmake +- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/LIEF/cmake +- COMPONENT CMakeScripts) +- + install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfigVersion.cmake +@@ -710,7 +708,23 @@ install( + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + COMPONENT libraries) + +-export(TARGETS LIB_LIEF lief_spdlog FILE LIEFExport.cmake) ++if(BUILD_SHARED_LIBS) ++ set(lib_type shared) ++else() ++ set(lib_type static) ++endif() ++ ++install( ++ EXPORT LIEFExport ++ NAMESPACE LIEF:: ++ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/LIEF/cmake ++ FILE LIEFExport-${lib_type}.cmake ++ COMPONENT config) ++ ++export( ++ EXPORT LIEFExport ++ NAMESPACE LIEF:: ++ FILE LIEFExport-${lib_type}.cmake) + + # Package + # ====================== +diff --git a/LIEFConfig.cmake.in b/LIEFConfig.cmake.in +index 94ee5245..8c35eeab 100644 +--- a/LIEFConfig.cmake.in ++++ b/LIEFConfig.cmake.in +@@ -1,4 +1,179 @@ +-@PACKAGE_INIT@ ++#.rst: ++# LIEFConfig ++# -------- ++# ++# Populate the native LIEF targets. ++# ++# IMPORTED Targets ++# ^^^^^^^^^^^^^^^^ ++# ++# This module defines :prop_tgt:`IMPORTED` target ``LIEF::LIEF`` ++# ++# Hints ++# ^^^^^ ++# ++# A user may set ``LIEF_DIR`` to the directory where ``LIEFConfig.cmake`` file ++# resides to tell CMake where to find this file. ++# ++# To choose between STATIC and SHARED version of LIEF library, one can use ++# ``COMPONENTS STATIC`` of ``COMPONENTS SHARED``. If no components are ++# specified, then a user may set ``LIEF_SHARED_LIBS`` to a true value to ++# request shared libraries. By default, if no variables or components are set, ++# the static library is preferred if present, else shared library will be used. ++# ++# .. code-block:: cmake ++# ++# find_package(LIEF 0.11.0 REQUIRED COMPONENTS STATIC) + +-set(LIEF_DIR "${PACKAGE_PREFIX_DIR}") +-include("${CMAKE_CURRENT_LIST_DIR}/FindLIEF.cmake") ++ ++# CMake component support for static and shared libraries based on ++# https://alexreinking.com/blog/building-a-dual-shared-and-static-library-with-cmake.html ++ ++# Process known components ++set(LIEF_known_comps STATIC SHARED) ++set(LIEF_comp_STATIC NO) ++set(LIEF_comp_SHARED NO) ++foreach(_comp ${LIEF_FIND_COMPONENTS}) ++ if(";${LIEF_known_comps};" MATCHES ";${_comp};") ++ set(LIEF_comp_${_comp} YES) ++ else() ++ set(LIEF_NOT_FOUND_MESSAGE ++ "LIEF does not recognize component `${_comp}`.") ++ set(LIEF_FOUND FALSE) ++ return() ++ endif() ++endforeach() ++ ++ ++# Validate component selection makes sense ++if(LIEF_comp_STATIC AND LIEF_comp_SHARED) ++ set(LIEF_NOT_FOUND_MESSAGE ++ "LIEF `STATIC` and `SHARED` components are mutually exclusive.") ++ set(LIEF_FOUND FALSE) ++ return() ++endif() ++ ++ ++# These files are generated by CMake and hold the LIEF library target(s). ++set(LIEF_static_export "${CMAKE_CURRENT_LIST_DIR}/LIEFExport-static.cmake") ++set(LIEF_shared_export "${CMAKE_CURRENT_LIST_DIR}/LIEFExport-shared.cmake") ++ ++ ++# Helper macro to load the requested targets, where `lib_type` is `static` or ++# `shared` ++macro(LIEF_load_targets lib_type) ++ if(NOT EXISTS "${LIEF_${lib_type}_export}") ++ set(LIEF_NOT_FOUND_MESSAGE ++ "LIEF `${lib_type}` libraries were requested but not found.") ++ set(LIEF_FOUND FALSE) ++ return() ++ endif () ++ ++ if("${lib_type}" STREQUAL "static") ++ # Need to find all dependencies even if they're private when LIEF is ++ # compiled statically ++ include(CMakeFindDependencyMacro) ++ ++ if(@LIEF_EXTERNAL_MBEDTLS@) ++ find_dependency(MbedTLS) ++ endif() ++ ++ if(@LIEF_EXTERNAL_UTF8CPP@) ++ find_dependency(utf8cpp) ++ endif() ++ ++ if(@LIEF_EXTERNAL_SPDLOG@) ++ find_dependency(spdlog) ++ endif() ++ ++ if(@LIEF_ENABLE_JSON@ AND @LIEF_NLOHMANN_JSON_EXTERNAL@) ++ find_dependency(nlohmann_json) ++ endif() ++ ++ if(NOT @LIEF_DISABLE_FROZEN@ AND @LIEF_OPT_FROZEN_EXTERNAL@) ++ find_dependency(frozen) ++ endif() ++ endif() ++ ++ # Include the respective targets file ++ include("${LIEF_${lib_type}_export}") ++endmacro() ++ ++# Run the logic to choose static or shared libraries ++# 1. Check components ++if(LIEF_comp_STATIC) ++ LIEF_load_targets("static") ++elseif(LIEF_comp_SHARED) ++ LIEF_load_targets("shared") ++# 2. Check LIEF-only library selection ++elseif(DEFINED LIEF_SHARED_LIBS AND LIEF_SHARED_LIBS) ++ LIEF_load_targets("shared") ++elseif(DEFINED LIEF_SHARED_LIBS AND NOT LIEF_SHARED_LIBS) ++ LIEF_load_targets("static") ++# 3. Check CMake build type and choose what's available ++elseif(BUILD_SHARED_LIBS) ++ if(EXISTS "${LIEF_shared_export}") ++ LIEF_load_targets("shared") ++ else() ++ LIEF_load_targets("static") ++ endif() ++else() ++ if(EXISTS "${LIEF_static_export}") ++ LIEF_load_targets("static") ++ else() ++ LIEF_load_targets("shared") ++ endif() ++endif() ++ ++ ++# Attach location of public interface libraries that don't have ++# their own CMake config that would otherwise be found using `find_dependency` ++ ++# Header-only library can be found relatively easily ++if(@LIEF_EXTERNAL_LEAF@) ++ find_path(BOOST_LEAF_INCLUDE_DIR boost/leaf.hpp) ++ if(NOT BOOST_LEAF_INCLUDE_DIR) ++ set(LIEF_NOT_FOUND_MESSAGE "Could not find include directory with 'boost/leaf.hpp'. Consider setting `BOOST_LEAF_INCLUDE_DIR` during CMake configuration") ++ set(LIEF_FOUND FALSE) ++ return() ++ endif() ++ set_property(TARGET LIEF::LIEF APPEND PROPERTY ++ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${BOOST_LEAF_INCLUDE_DIR}" ++ ) ++endif() ++ ++# Header-only library can be found relatively easily ++if(@LIEF_EXTERNAL_SPAN@) ++ find_path(TCB_SPAN_INCLUDE_DIR tcb/span.hpp) ++ if(NOT TCB_SPAN_INCLUDE_DIR) ++ set(LIEF_NOT_FOUND_MESSAGE "Could not find include directory with 'tcb/span.hpp'. Consider setting `TCB_SPAN_INCLUDE_DIR` during CMake configuration") ++ set(LIEF_FOUND FALSE) ++ return() ++ endif() ++ set_property(TARGET LIEF::LIEF APPEND PROPERTY ++ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${TCB_SPAN_INCLUDE_DIR}" ++ ) ++endif() ++ ++ ++# Set this for backwards compatibility. This isn't quite the path to the ++# actual library file, but using the target is strictly better because it ++# includes all other information needed to correctly link and use LIEF ++set(LIEF_LIBRARIES LIEF::LIEF) ++ ++# Set this for backwards compatibility ++get_target_property(LIEF_INCLUDE_DIRS LIEF::LIEF INTERFACE_INCLUDE_DIRECTORIES) ++ ++# Set the following for backwards compatibility ++if(LIEF_INCLUDE_DIR AND EXISTS "${LIEF_INCLUDE_DIR}/LIEF/version.h") ++ file(STRINGS "${LIEF_INCLUDE_DIR}/LIEF/version.h" LIEF_H REGEX "^#define LIEF_VERSION \"[^\"]*\"$") ++ ++ string(REGEX REPLACE "^.*LIEF_VERSION \"([0-9]+).*$" "\\1" LIEF_VERSION_MAJOR "${LIEF_H}") ++ string(REGEX REPLACE "^.*LIEF_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" LIEF_VERSION_MINOR "${LIEF_H}") ++ string(REGEX REPLACE "^.*LIEF_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" LIEF_VERSION_PATCH "${LIEF_H}") ++ set(LIEF_VERSION_STRING "${LIEF_VERSION_MAJOR}.${LIEF_VERSION_MINOR}.${LIEF_VERSION_PATCH}") ++ ++ set(LIEF_MAJOR_VERSION "${LIEF_VERSION_MAJOR}") ++ set(LIEF_MINOR_VERSION "${LIEF_VERSION_MINOR}") ++ set(LIEF_PATCH_VERSION "${LIEF_VERSION_PATCH}") ++endif() +diff --git a/doc/sphinx/installation.rst b/doc/sphinx/installation.rst +index ab812664..2ad5fe0d 100644 +--- a/doc/sphinx/installation.rst ++++ b/doc/sphinx/installation.rst +@@ -218,48 +218,85 @@ and run it: + CMake Integration + ----------------- + ++There are a few ways to integrate LIEF as a dependency in another project. The different methods are listed in order of preference and CMake best practice. These listings are only to show basic examples. Please refer to the CMake documentation for questions related to more complex project setup. + +-External Project +-**************** + +-Using `CMake External Project `_: ++find_package() ++************** + +-.. literalinclude:: ../../examples/cmake/external_project/CMakeLists.txt ++Using `CMake find_package() `_: ++ ++.. literalinclude:: ../../examples/cmake/find_package/CMakeLists.txt + :language: cmake +- :lines: 1-42 ++ :lines: 5-12 + + And now, to be integrated within a project: + +-.. literalinclude:: ../../examples/cmake/external_project/CMakeLists.txt ++.. literalinclude:: ../../examples/cmake/find_package/CMakeLists.txt + :language: cmake +- :lines: 47- ++ :lines: 13- + + For the compilation: + +-.. include:: ../../examples/cmake/external_project/README.rst ++.. include:: ../../examples/cmake/find_package/README.rst + :start-line: 3 + +-A *full* example is available in the ``examples/cmake/external_project`` directory. ++A *full* example is available in the ``examples/cmake/find_package`` directory. + + +-find_package() +-************** ++add_subdirectory() or FetchContent ++********************************** + +-Using `CMake find_package() `_: ++First, set up the options you want to set as default for the LIEF project: + +-.. literalinclude:: ../../examples/cmake/find_package/CMakeLists.txt ++.. literalinclude:: ../../examples/cmake/add_subdirectory/CMakeLists.txt ++ :language: cmake ++ :lines: 7-19 ++ ++Using `CMake add_subdirectory() `_ to add a submodule LIEF source directory: ++ ++.. literalinclude:: ../../examples/cmake/add_subdirectory/CMakeLists.txt ++ :language: cmake ++ :lines: 21-28 ++ ++If we are using a CMake version greater than or equal to 3.11, we can use `CMake FetchContent module `_ to download or specify a LIEF source directory outside of the current directory: ++ ++.. literalinclude:: ../../examples/cmake/add_subdirectory/CMakeLists.txt + :language: cmake +- :lines: 5-19 ++ :lines: 33-59 + + And now, to be integrated within a project: + +-.. literalinclude:: ../../examples/cmake/find_package/CMakeLists.txt ++.. literalinclude:: ../../examples/cmake/add_subdirectory/CMakeLists.txt + :language: cmake +- :lines: 20- ++ :lines: 62- + + For the compilation: + +-.. include:: ../../examples/cmake/find_package/README.rst ++.. include:: ../../examples/cmake/add_subdirectory/README.rst + :start-line: 3 + +-A *full* example is available in the ``examples/cmake/find_package`` directory. ++A *full* example is available in the ``examples/cmake/add_subdirectory`` directory. ++ ++ ++External Project ++**************** ++ ++If you don't want to use LIEF as a submodule or upgrade to CMake 3.11, we can use `CMake External Project `_ to set up a project as a `*superbuild* `: ++ ++.. literalinclude:: ../../examples/cmake/external_project/CMakeLists.txt ++ :language: cmake ++ :lines: 1-41 ++ ++And now, to be integrated with our main ``HelloLIEF`` project that is located in a subdirectory and looks exactly like the ``find_package()`` example shown earlier: ++ ++.. literalinclude:: ../../examples/cmake/external_project/CMakeLists.txt ++ :language: cmake ++ :lines: 42- ++ ++For the compilation: ++ ++.. include:: ../../examples/cmake/external_project/README.rst ++ :start-line: 3 ++ ++A *full* example is available in the ``examples/cmake/external_project`` directory. +diff --git a/examples/cmake/add_subdirectory/CMakeLists.txt b/examples/cmake/add_subdirectory/CMakeLists.txt +new file mode 100644 +index 00000000..fcedd1c1 +--- /dev/null ++++ b/examples/cmake/add_subdirectory/CMakeLists.txt +@@ -0,0 +1,76 @@ ++# Minimum of 3.5 for adding submodule of LIEF because LIEF min is 3.5, ++# otherwise 3.11+ for FetchContent command ++cmake_minimum_required(VERSION 3.5) ++ ++project(SubdirLIEF CXX) ++ ++# Use LIEF as an embedded/vendored project ++# ======================================== ++ ++# LIEF build config. Set the default options for LIEF's project setup ++option(LIEF_DOC "Build LIEF docs" OFF) ++option(LIEF_PYTHON_API "Build LIEF Python API" OFF) ++option(LIEF_EXAMPLES "Build LIEF examples" OFF) ++option(LIEF_TESTS "Build LIEF tests" OFF) ++ ++if(MSVC) ++ set(LIEF_USE_CRT_RELEASE "MT" CACHE STRING "LIEF CRT option") ++endif() ++ ++ ++# If you have LIEF as a submodule in a directory, then you can add it to this ++# project with ``add_subdirectory`` ++# NOTE: This submodule does not exist for this example, but it does the same ++# thing as FetchContent without the download part ++set(vendorLIEF_submodule_dir "${CMAKE_CURRENT_LIST_DIR}/LIEF") ++if(EXISTS "${vendorLIEF_submodule_dir}") ++ add_subdirectory("${vendorLIEF_submodule_dir}") ++ ++# Else, we'll specify how to obtain LIEF another way (downloading) ++else() ++ # CMake 3.11 has FetchContent which provides a simple experience for what ++ # we're trying to do ++ cmake_minimum_required(VERSION 3.11) ++ ++ # Common info for specifying LIEF source directory ++ # URL of the LIEF repo (Can be your fork) ++ set(LIEF_GIT_URL "https://github.com/lief-project/LIEF.git") ++ # LIEF's version to be used (can be 'master') ++ set(LIEF_VERSION 0.12.0) ++ ++ include(FetchContent) ++ FetchContent_Declare(LIEF ++ #GIT_REPOSITORY "${LIEF_GIT_URL}" ++ #GIT_TAG ${LIEF_VERSION} ++ SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../.." ++ ) ++ ++ if(${CMAKE_VERSION} VERSION_LESS "3.14.0") ++ # CMake 3.11 to 3.13 needs more verbose method to make LIEF available ++ FetchContent_GetProperties(LIEF) ++ if(NOT LIEF_POPULATED) ++ FetchContent_Populate(LIEF) ++ add_subdirectory(${LIEF_SOURCE_DIR} ${LIEF_BINARY_DIR}) ++ endif() ++ else() ++ # CMake 3.14+ has single function to make LIEF available ++ FetchContent_MakeAvailable(LIEF) ++ endif() ++endif() ++ ++ ++# Add our executable ++# ================== ++add_executable(HelloLIEF main.cpp) ++ ++if(MSVC) ++ set_property(TARGET HelloLIEF PROPERTY LINK_FLAGS /NODEFAULTLIB:MSVCRT) ++endif() ++ ++# Enable C++11 ++set_property(TARGET HelloLIEF ++ PROPERTY CXX_STANDARD 11 ++ PROPERTY CXX_STANDARD_REQUIRED ON) ++ ++# Link the executable with LIEF ++target_link_libraries(HelloLIEF PUBLIC LIEF::LIEF) +diff --git a/examples/cmake/add_subdirectory/README.rst b/examples/cmake/add_subdirectory/README.rst +new file mode 100644 +index 00000000..442f34a5 +--- /dev/null ++++ b/examples/cmake/add_subdirectory/README.rst +@@ -0,0 +1,12 @@ ++LIEF CMake Integration Example - add_subdirectory ++================================================= ++ ++ ++.. code-block:: console ++ ++ $ mkdir build ++ $ cd build ++ $ cmake .. ++ $ make ++ $ HelloLIEF /bin/ls # or explorer.exe or whatever ++ +diff --git a/examples/cmake/external_project/main.cpp b/examples/cmake/add_subdirectory/main.cpp +similarity index 100% +copy from examples/cmake/external_project/main.cpp +copy to examples/cmake/add_subdirectory/main.cpp +diff --git a/examples/cmake/external_project/CMakeLists.txt b/examples/cmake/external_project/CMakeLists.txt +index e84f341d..d9384e13 100644 +--- a/examples/cmake/external_project/CMakeLists.txt ++++ b/examples/cmake/external_project/CMakeLists.txt +@@ -1,34 +1,28 @@ +-cmake_minimum_required(VERSION 3.02) ++cmake_minimum_required(VERSION 3.0) + +-include(ExternalProject) ++project(CMakeLIEF LANGUAGES NONE) + +-project(CMakeLIEF) ++include(ExternalProject) + +-# LIEF as an External Project ++# LIEF integration as an External Project + # =========================== + set(LIEF_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/LIEF") +-set(LIEF_INSTALL_DIR "${LIEF_PREFIX}") +-set(LIEF_INCLUDE_DIRS "${LIEF_PREFIX}/include") +- +-# LIEF static library +-set(LIB_LIEF +- "${LIEF_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}LIEF${CMAKE_STATIC_LIBRARY_SUFFIX}") ++set(LIEF_INSTALL_DIR "${LIEF_PREFIX}/install") + + # URL of the LIEF repo (Can be your fork) + set(LIEF_GIT_URL "https://github.com/lief-project/LIEF.git") + + # LIEF's version to be used (can be 'master') +-set(LIEF_VERSION 0.11.0) ++set(LIEF_VERSION 0.12.0) + + # LIEF compilation config + set(LIEF_CMAKE_ARGS + -DCMAKE_INSTALL_PREFIX= +- -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} +- -DLIEF_DOC=off +- -DLIEF_PYTHON_API=off +- -DLIEF_EXAMPLES=off +- -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} +- -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} ++ -DCMAKE_BUILD_TYPE=RelWithDebInfo ++ -DLIEF_DOC=OFF ++ -DLIEF_PYTHON_API=OFF ++ -DLIEF_EXAMPLES=OFF ++ -DLIEF_TESTS=OFF + ) + + if(MSVC) +@@ -37,35 +31,24 @@ endif() + + ExternalProject_Add(LIEF + PREFIX "${LIEF_PREFIX}" +- GIT_REPOSITORY ${LIEF_GIT_URL} ++ GIT_REPOSITORY "${LIEF_GIT_URL}" + GIT_TAG ${LIEF_VERSION} +- INSTALL_DIR ${LIEF_INSTALL_DIR} ++ # You may specify an existing LIEF source directory if you don't want to ++ # download. Just comment out the above ``GIT_*`` commands and uncoment the ++ # following ``SOURCE_DIR`` line ++ #SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../.." ++ INSTALL_DIR "${LIEF_INSTALL_DIR}" + CMAKE_ARGS ${LIEF_CMAKE_ARGS} +- BUILD_BYPRODUCTS ${LIEF_LIBRARIES} +- UPDATE_COMMAND "" + ) + +- +-# Add our executable +-# ================== +-add_executable(HelloLIEF main.cpp) +- +-if(MSVC) +- set_property(TARGET HelloLIEF PROPERTY LINK_FLAGS /NODEFAULTLIB:MSVCRT) +-endif() +- +-# Setup the LIEF include directory +-target_include_directories(HelloLIEF +- PUBLIC +- ${LIEF_INCLUDE_DIRS} ++# User project ++# ============ ++ExternalProject_Add(HelloLIEF ++ DEPENDS LIEF ++ SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/HelloLIEF" ++ BINARY_DIR "${CMAKE_CURRENT_BUILD_DIR}" ++ INSTALL_COMMAND "" ++ CMAKE_ARGS ++ "-DLIEF_DIR=${LIEF_INSTALL_DIR}/share/LIEF/cmake" ++ -DCMAKE_BUILD_TYPE=RelWithDebInfo + ) +- +-# Enable C++11 +-set_property(TARGET HelloLIEF +- PROPERTY CXX_STANDARD 11 +- CXX_STANDARD_REQUIRED ON) +- +-# Link the executable with LIEF +-target_link_libraries(HelloLIEF PUBLIC ${LIB_LIEF}) +- +-add_dependencies(HelloLIEF LIEF) +diff --git a/examples/cmake/external_project/HelloLIEF/CMakeLists.txt b/examples/cmake/external_project/HelloLIEF/CMakeLists.txt +new file mode 100644 +index 00000000..3f587a19 +--- /dev/null ++++ b/examples/cmake/external_project/HelloLIEF/CMakeLists.txt +@@ -0,0 +1,28 @@ ++cmake_minimum_required(VERSION 3.0) ++ ++project(CMakeLIEF LANGUAGES CXX) ++ ++# Use LIEF with 'find_package()' ++# ============================== ++ ++# Find LIEF. If LIEF was not installed into a default system directory then ++# specify the following option during CMake configuration: ++# -DLIEF_DIR=/share/LIEF/cmake ++find_package(LIEF REQUIRED COMPONENTS STATIC) # COMPONENTS: - Default: STATIC ++ ++# Add our executable ++# ================== ++add_executable(HelloLIEF main.cpp) ++ ++if(MSVC) ++ set_property(TARGET HelloLIEF PROPERTY LINK_FLAGS /NODEFAULTLIB:MSVCRT) ++endif() ++ ++ ++# Enable C++11 ++set_property(TARGET HelloLIEF ++ PROPERTY CXX_STANDARD 11 ++ PROPERTY CXX_STANDARD_REQUIRED ON) ++ ++# Link the executable with LIEF ++target_link_libraries(HelloLIEF PUBLIC LIEF::LIEF) +diff --git a/examples/cmake/external_project/main.cpp b/examples/cmake/external_project/HelloLIEF/main.cpp +similarity index 100% +rename from examples/cmake/external_project/main.cpp +rename to examples/cmake/external_project/HelloLIEF/main.cpp +diff --git a/examples/cmake/external_project/README.rst b/examples/cmake/external_project/README.rst +index 09eb42b3..ebcc438e 100644 +--- a/examples/cmake/external_project/README.rst ++++ b/examples/cmake/external_project/README.rst +@@ -1,6 +1,9 @@ + LIEF CMake Integration Example - ExternalProject + ================================================ + ++This setup is known as a CMake *super build* where the top-level CMakeLists.txt drives all of the steps of the projects specified within it. The project we would be doing active development on is located in the ``HelloLIEF`` directory. ++ ++For simplicity, it is recommended to use CMake's ``FetchContent`` command introduced in CMake 3.11. See the example in the ``examples/cmake/fetch_content`` directory. + + .. code-block:: console + +diff --git a/examples/cmake/find_package/CMakeLists.txt b/examples/cmake/find_package/CMakeLists.txt +index 1812d4b1..d0e3dd64 100644 +--- a/examples/cmake/find_package/CMakeLists.txt ++++ b/examples/cmake/find_package/CMakeLists.txt +@@ -1,25 +1,15 @@ +-cmake_minimum_required(VERSION 3.1) ++cmake_minimum_required(VERSION 3.0) + +-project(CMakeLIEF) ++project(CMakeLIEF LANGUAGES CXX) + + # Use LIEF with 'find_package()' + # ============================== + +-# Custom path to the LIEF install directory +-set(LIEF_DIR CACHE PATH ${CMAKE_INSTALL_PREFIX}) +- +-# Directory to 'FindLIEF.cmake' +-list(APPEND CMAKE_MODULE_PATH ${LIEF_DIR}/share/LIEF/cmake) +- +-# include 'FindLIEF.cmake' +-include(FindLIEF) +- +-# Find LIEF ++# Find LIEF. If LIEF was not installed into a default system directory then ++# specify the following option during CMake configuration: ++# -DLIEF_DIR=/share/LIEF/cmake + find_package(LIEF REQUIRED COMPONENTS STATIC) # COMPONENTS: - Default: STATIC + +-message(STATUS "LIEF include directory: ${LIEF_INCLUDE_DIRS}") +-message(STATUS "LIEF library: ${LIEF_LIBRARIES}") +- + # Add our executable + # ================== + add_executable(HelloLIEF main.cpp) +@@ -29,16 +19,10 @@ if(MSVC) + endif() + + +-# Setup the LIEF include directory +-target_include_directories(HelloLIEF +- PUBLIC +- ${LIEF_INCLUDE_DIRS} +-) +- + # Enable C++11 + set_property(TARGET HelloLIEF + PROPERTY CXX_STANDARD 11 + PROPERTY CXX_STANDARD_REQUIRED ON) + + # Link the executable with LIEF +-target_link_libraries(HelloLIEF PUBLIC ${LIEF_LIBRARIES}) ++target_link_libraries(HelloLIEF PRIVATE LIEF::LIEF) +diff --git a/examples/cmake/find_package/README.rst b/examples/cmake/find_package/README.rst +index 6f104439..18331b7f 100644 +--- a/examples/cmake/find_package/README.rst ++++ b/examples/cmake/find_package/README.rst +@@ -6,7 +6,7 @@ LIEF CMake Integration Example - find_package() + + $ mkdir build + $ cd build +- $ cmake -DLIEF_DIR= .. # By default, LIEF_DIR=CMAKE_INSTALL_PREFIX ++ $ cmake -DLIEF_DIR=/share/LIEF/cmake .. + $ make + $ HelloLIEF /bin/ls # or explorer.exe or whatever + +diff --git a/scripts/FindLIEF.cmake b/scripts/FindLIEF.cmake +deleted file mode 100644 +index 43874a3a..00000000 +--- a/scripts/FindLIEF.cmake ++++ /dev/null +@@ -1,174 +0,0 @@ +-#.rst: +-# FindLIEF +-# -------- +-# +-# Find the native LIEF includes and library. +-# +-# IMPORTED Targets +-# ^^^^^^^^^^^^^^^^ +-# +-# This module defines :prop_tgt:`IMPORTED` target ``LIEF::LIEF``, if +-# LIEF has been found. +-# +-# Result Variables +-# ^^^^^^^^^^^^^^^^ +-# +-# This module defines the following variables: +-# +-# :: +-# +-# LIEF_INCLUDE_DIRS - Where to find LIEF/LIEF.hpp, etc. +-# LIEF_LIBRARIES - List of libraries when using LIEF. +-# LIEF_FOUND - True if LIEF found. +-# +-# :: +-# +-# LIEF_VERSION_STRING - The version of LIEF found (x.y.z) +-# LIEF_VERSION_MAJOR - The major version of LIEF +-# LIEF_VERSION_MINOR - The minor version of LIEF +-# LIEF_VERSION_PATCH - The patch version of LIEF +-# +-# Hints +-# ^^^^^ +-# +-# A user may set ``LIEF_DIR`` to a LIEF installation root to tell this +-# module where to look. +-# +-# To choose between STATIC and SHARED version of LIEF library, one +-# can use ``COMPONENTS STATIC`` of ``COMPONENTS SHARED`` +-# +-# .. code-block:: cmake +-# +-# find_package(LIEF 0.11.0 REQUIRED COMPONENTS STATIC) +- +- +- +-set(_LIEF_SEARCHES) +- +-if(LIEF_ROOT) +- message(FATAL_ERROR "LIEF_ROOT is no longer supported. Please use LIEF_DIR") +-endif() +- +-if(LIEF_DIR) +- set(_LIEF_SEARCH_ROOT PATHS ${LIEF_DIR} NO_DEFAULT_PATH) +- list(APPEND _LIEF_SEARCHES _LIEF_SEARCH_ROOT) +-endif() +- +-set(LIEF_NAMES LIEF) +- +-if (LIEF_FIND_COMPONENTS AND LIEF_FIND_REQUIRED_STATIC AND LIEF_FIND_REQUIRED_SHARED) +- message(WARNING "Two incompatible components specified : static and shared. We are going to ignore the 'shared' component.") +- list(REMOVE_ITEM LIEF_FIND_COMPONENTS SHARED) +- unset(LIEF_FIND_REQUIRED_SHARED) +-endif() +- +-set(LIBRARY_SUFFIXES_SAVED ${CMAKE_FIND_LIBRARY_SUFFIXES}) +- +-if (NOT LIEF_FIND_COMPONENTS) +- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX}) +-endif() +- +-if(LIEF_FIND_COMPONENTS AND LIEF_FIND_REQUIRED_STATIC) +- unset(_LIEF_LIBRARY CACHE) +- unset(LIEF_LIBRARY) +- unset(LIEF_FOUND) +- unset(LIEF_LIBRARIES) +- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) +-endif() +- +-if(LIEF_FIND_COMPONENTS AND LIEF_FIND_REQUIRED_SHARED) +- unset(_LIEF_LIBRARY CACHE) +- unset(LIEF_LIBRARY) +- unset(LIEF_FOUND) +- unset(LIEF_LIBRARIES) +- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX}) +-endif() +- +-# Try each search configuration. +-foreach(search ${_LIEF_SEARCHES}) +- find_path(LIEF_INCLUDE_DIR +- NAMES LIEF/LIEF.hpp +- PATH ${${search}} +- REQUIRED +- CMAKE_FIND_ROOT_PATH_BOTH +- PATH_SUFFIXES include) +-endforeach() +- +-# Allow LIEF_LIBRARY to be set manually, as the location of the LIEF library +-if(NOT LIEF_LIBRARY) +- foreach(search ${_LIEF_SEARCHES}) +- find_library(_LIEF_LIBRARY +- NAMES ${LIEF_NAMES} +- PATHS ${${search}} +- REQUIRED +- CMAKE_FIND_ROOT_PATH_BOTH +- PATH_SUFFIXES lib lib64) +- endforeach() +- +- if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake") +- include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) +- else() +- include(SelectLibraryConfigurations) +- endif() +- +- select_library_configurations(LIEF) +- +- set(LIEF_LIBRARY ${_LIEF_LIBRARY}) +-endif() +- +- +-unset(LIEF_NAMES) +- +-mark_as_advanced(LIEF_INCLUDE_DIR) +- +-if(LIEF_INCLUDE_DIR AND EXISTS "${LIEF_INCLUDE_DIR}/LIEF/version.h") +- file(STRINGS "${LIEF_INCLUDE_DIR}/LIEF/version.h" LIEF_H REGEX "^#define LIEF_VERSION \"[^\"]*\"$") +- +- string(REGEX REPLACE "^.*LIEF_VERSION \"([0-9]+).*$" "\\1" LIEF_VERSION_MAJOR "${LIEF_H}") +- string(REGEX REPLACE "^.*LIEF_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" LIEF_VERSION_MINOR "${LIEF_H}") +- string(REGEX REPLACE "^.*LIEF_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" LIEF_VERSION_PATCH "${LIEF_H}") +- set(LIEF_VERSION_STRING "${LIEF_VERSION_MAJOR}.${LIEF_VERSION_MINOR}.${LIEF_VERSION_PATCH}") +- +- set(LIEF_MAJOR_VERSION "${LIEF_VERSION_MAJOR}") +- set(LIEF_MINOR_VERSION "${LIEF_VERSION_MINOR}") +- set(LIEF_PATCH_VERSION "${LIEF_VERSION_PATCH}") +-endif() +- +- +-if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake") +- include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +-else() +- include(FindPackageHandleStandardArgs) +-endif() +-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIEF REQUIRED_VARS LIEF_LIBRARY LIEF_INCLUDE_DIR +- VERSION_VAR LIEF_VERSION_STRING) +- +- +-if(LIEF_FOUND) +- set(LIEF_INCLUDE_DIRS ${LIEF_INCLUDE_DIR}) +- +- if(NOT LIEF_LIBRARIES) +- set(LIEF_LIBRARIES ${LIEF_LIBRARY}) +- endif() +- +- if(NOT TARGET LIEF::LIEF) +- add_library(LIEF::LIEF UNKNOWN IMPORTED) +- set_target_properties(LIEF::LIEF PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${LIEF_INCLUDE_DIRS}") +- +- if(LIEF_LIBRARY) +- set_property(TARGET LIEF::LIEF APPEND PROPERTY +- IMPORTED_CONFIGURATIONS RELEASE) +- set_target_properties(LIEF::LIEF PROPERTIES +- IMPORTED_LOCATION_RELEASE "${LIEF_LIBRARY}") +- endif() +- +- if(NOT LIEF_LIBRARY) +- set_property(TARGET LIEF::LIEF APPEND PROPERTY +- IMPORTED_LOCATION "${LIEF_LIBRARY}") +- endif() +- endif() +-endif() +- +-# Restore +-set(CMAKE_FIND_LIBRARY_SUFFIXES ${LIBRARY_SUFFIXES_SAVED}) +-- +2.35.1 + diff --git a/ports/lief/0003-Support-vcpkg.patch b/ports/lief/0003-Support-vcpkg.patch new file mode 100644 index 00000000000000..e6422e702f1577 --- /dev/null +++ b/ports/lief/0003-Support-vcpkg.patch @@ -0,0 +1,36 @@ +From a912d979b97b71f189d1c702b2e322e1aa7ba325 Mon Sep 17 00:00:00 2001 +From: Eric Kilmer +Date: Fri, 25 Feb 2022 17:43:34 -0500 +Subject: [PATCH 3/3] Support vcpkg + +Remove msvccrt choosing and fix install paths on Windows +--- + CMakeLists.txt | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6bfe863f..53e20fa3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -11,9 +11,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_CROSSCOMPILING) + endif() + + +-if(WIN32 OR ${IS_WIN_CROSS_COMPILE}) +- include(ChooseMSVCCRT) +-endif() + include(CheckCXXCompilerFlag) + include(CheckCCompilerFlag) + include(ExternalProject) +@@ -667,7 +664,7 @@ endif() + # Installation + # ====================== + +-if(UNIX) ++if(1) + include(GNUInstallDirs) + else() + if(WIN32) +-- +2.35.1 + diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 7a068095bae1a6..25803fccff4a9e 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -5,7 +5,9 @@ vcpkg_from_github( SHA512 8ebcd67c54903d83e43959039d0cccdbccb6132c5f84344dbd9834d98932d294c4f5ce95df8a1702c6afa8a1714179b6d413c524902f24eb0f0bceff5db3c2be HEAD_REF master PATCHES - support_distribution.patch + 0001-Use-CMake-BUILD_INTERFACE-generator-expression-for-i.patch + 0002-Export-LIEF-targets-with-CMake.patch + 0003-Support-vcpkg.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/lief/support_distribution.patch b/ports/lief/support_distribution.patch deleted file mode 100644 index 9437c0f1f57f94..00000000000000 --- a/ports/lief/support_distribution.patch +++ /dev/null @@ -1,323 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 456279ae..3e8f3887 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -11,9 +11,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_CROSSCOMPILING) - endif() - - --if(WIN32 OR ${IS_WIN_CROSS_COMPILE}) -- include(ChooseMSVCCRT) --endif() - include(CheckCXXCompilerFlag) - include(CheckCCompilerFlag) - include(ExternalProject) -@@ -208,11 +205,6 @@ if(WINDOWS AND BUILD_SHARED_LIBS) - target_link_libraries(LIB_LIEF ws2_32) - endif() - --if(MSVC OR ${IS_WIN_CROSS_COMPILE}) -- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") --endif() -- - if(CMAKE_BUILD_TYPE MATCHES Debug AND WINDOWS) - add_definitions(-D_ITERATOR_DEBUG_LEVEL=0 -D_SECURE_SCL=0 - -D_HAS_ITERATOR_DEBUGGING=0) -@@ -336,7 +328,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/LIEF.pc.in ${CMAKE_CURRENT_BINARY_DIR - @ONLY) - - target_include_directories(LIB_LIEF -- PUBLIC "${LIEF_PUBLIC_INCLUDE_DIR}" -+ PUBLIC "$" - PRIVATE "${LIEF_PRIVATE_INCLUDE_DIR}") - - if(LIEF_ENABLE_JSON) -@@ -379,7 +371,7 @@ if(LIEF_EXTERNAL_LEAF) - if(LIEF_EXTERNAL_LEAF_DIR) - message(STATUS "External LEAF include dir: ${LIEF_EXTERNAL_LEAF_DIR}") - target_include_directories(LIB_LIEF SYSTEM PUBLIC -- ${LIEF_EXTERNAL_LEAF_DIR}) -+ "$") - endif() - else() - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/leaf.hpp -@@ -569,7 +561,7 @@ if(LIEF_COVERAGE) - target_link_libraries(LIB_LIEF gcov) - endif() - --set_target_properties(LIB_LIEF PROPERTIES OUTPUT_NAME LIEF CLEAN_DIRECT_OUTPUT 1) -+set_target_properties(LIB_LIEF PROPERTIES OUTPUT_NAME LIEF EXPORT_NAME LIEF CLEAN_DIRECT_OUTPUT 1) - - - # Set a default build type if none was specified -@@ -666,26 +658,15 @@ endif() - # Installation - # ====================== - --if(UNIX) -- include(GNUInstallDirs) --else() -- if(WIN32) -- set(CMAKE_INSTALL_LIBDIR "lib") -- set(CMAKE_INSTALL_DATADIR "share") -- set(CMAKE_INSTALL_INCLUDEDIR "include") -- set(CMAKE_INSTALL_BINDIR "bin") -- set(CMAKE_INSTALL_DATAROOTDIR "share") -- message(STATUS "Setting installation destination on Windows to: ${CMAKE_INSTALL_PREFIX}") -- else() -- message(FATAL_ERROR "System not UNIX nor WIN32 - not implemented yet") -- endif() --endif() -+include(GNUInstallDirs) - - install( -- TARGETS LIB_LIEF -+ TARGETS LIB_LIEF lief_spdlog -+ EXPORT LIEFExport - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries) -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries -+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - - install( - DIRECTORY ${LIEF_PUBLIC_INCLUDE_DIR} -@@ -694,8 +675,12 @@ install( - FILES_MATCHING - REGEX "(.*).(hpp|h|def|inc)$") - -+configure_file( -+ ${CMAKE_CURRENT_SOURCE_DIR}/scripts/FindLIEF.cmake -+ ${CMAKE_CURRENT_BINARY_DIR}/FindLIEF.cmake -+ @ONLY) - install( -- FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/FindLIEF.cmake -+ FILES ${CMAKE_CURRENT_BINARY_DIR}/FindLIEF.cmake - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/LIEF/cmake - COMPONENT CMakeScripts) - -@@ -710,7 +695,13 @@ install( - DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig - COMPONENT libraries) - --export(TARGETS LIB_LIEF lief_spdlog FILE LIEFExport.cmake) -+install( -+ EXPORT LIEFExport -+ NAMESPACE LIEF:: -+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/LIEF/cmake -+ COMPONENT config) -+ -+export(EXPORT LIEFExport FILE LIEFExport.cmake) - - # Package - # ====================== -diff --git a/LIEFConfig.cmake.in b/LIEFConfig.cmake.in -index 94ee5245..c51d320d 100644 ---- a/LIEFConfig.cmake.in -+++ b/LIEFConfig.cmake.in -@@ -1,4 +1 @@ --@PACKAGE_INIT@ -- --set(LIEF_DIR "${PACKAGE_PREFIX_DIR}") - include("${CMAKE_CURRENT_LIST_DIR}/FindLIEF.cmake") -diff --git a/cmake/LIEFApi.cmake b/cmake/LIEFApi.cmake -index f06f846c..42e0b8dc 100644 ---- a/cmake/LIEFApi.cmake -+++ b/cmake/LIEFApi.cmake -@@ -18,7 +18,7 @@ endif() - # ----- - if(LIEF_C_API) - target_include_directories(LIB_LIEF -- PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include") -+ PUBLIC "$") - - include("${CMAKE_CURRENT_SOURCE_DIR}/api/c/CMakeLists.txt") - endif() -diff --git a/examples/cmake/find_package/CMakeLists.txt b/examples/cmake/find_package/CMakeLists.txt -index 1812d4b1..2cf36289 100644 ---- a/examples/cmake/find_package/CMakeLists.txt -+++ b/examples/cmake/find_package/CMakeLists.txt -@@ -5,15 +5,6 @@ project(CMakeLIEF) - # Use LIEF with 'find_package()' - # ============================== - --# Custom path to the LIEF install directory --set(LIEF_DIR CACHE PATH ${CMAKE_INSTALL_PREFIX}) -- --# Directory to 'FindLIEF.cmake' --list(APPEND CMAKE_MODULE_PATH ${LIEF_DIR}/share/LIEF/cmake) -- --# include 'FindLIEF.cmake' --include(FindLIEF) -- - # Find LIEF - find_package(LIEF REQUIRED COMPONENTS STATIC) # COMPONENTS: - Default: STATIC - -diff --git a/scripts/FindLIEF.cmake b/scripts/FindLIEF.cmake -index 43874a3a..d9f19fd1 100644 ---- a/scripts/FindLIEF.cmake -+++ b/scripts/FindLIEF.cmake -@@ -43,83 +43,65 @@ - - - --set(_LIEF_SEARCHES) -- - if(LIEF_ROOT) - message(FATAL_ERROR "LIEF_ROOT is no longer supported. Please use LIEF_DIR") - endif() - --if(LIEF_DIR) -- set(_LIEF_SEARCH_ROOT PATHS ${LIEF_DIR} NO_DEFAULT_PATH) -- list(APPEND _LIEF_SEARCHES _LIEF_SEARCH_ROOT) --endif() -- --set(LIEF_NAMES LIEF) -- - if (LIEF_FIND_COMPONENTS AND LIEF_FIND_REQUIRED_STATIC AND LIEF_FIND_REQUIRED_SHARED) - message(WARNING "Two incompatible components specified : static and shared. We are going to ignore the 'shared' component.") - list(REMOVE_ITEM LIEF_FIND_COMPONENTS SHARED) - unset(LIEF_FIND_REQUIRED_SHARED) - endif() - --set(LIBRARY_SUFFIXES_SAVED ${CMAKE_FIND_LIBRARY_SUFFIXES}) - --if (NOT LIEF_FIND_COMPONENTS) -- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX}) -+include(CMakeFindDependencyMacro) -+ -+# Need to find private dependencies even if they're private when compiled -+# statically -+if(NOT @BUILD_SHARED_LIBS@) -+ find_dependency(MbedTLS) -+ find_dependency(nlohmann_json) -+ find_dependency(frozen) -+ find_dependency(utf8cpp) -+ find_dependency(spdlog) - endif() - --if(LIEF_FIND_COMPONENTS AND LIEF_FIND_REQUIRED_STATIC) -- unset(_LIEF_LIBRARY CACHE) -- unset(LIEF_LIBRARY) -- unset(LIEF_FOUND) -- unset(LIEF_LIBRARIES) -- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) -+include("${CMAKE_CURRENT_LIST_DIR}/LIEFExport.cmake") -+ -+# Also attach location of header-only libraries -+find_path(BOOST_LEAF_INCLUDE_PATH boost/leaf.hpp) -+if(NOT BOOST_LEAF_INCLUDE_PATH) -+ message(WARNING "Could not find required path to 'boost/leaf.hpp'") - endif() -+find_path(TCB_SPAN_INCLUDE_PATH tcb/span.hpp) -+if(NOT TCB_SPAN_INCLUDE_PATH) -+ message(WARNING "Could not find required path to 'tcb/span.hpp'") -+endif() -+set_property(TARGET LIEF::LIEF APPEND PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${BOOST_LEAF_INCLUDE_PATH}" "${TCB_SPAN_INCLUDE_PATH}") - --if(LIEF_FIND_COMPONENTS AND LIEF_FIND_REQUIRED_SHARED) -- unset(_LIEF_LIBRARY CACHE) -- unset(LIEF_LIBRARY) -- unset(LIEF_FOUND) -- unset(LIEF_LIBRARIES) -- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX}) -+ -+get_target_property(_LIEF_LIB_TYPE LIEF::LIEF TYPE) -+ -+if(LIEF_FIND_COMPONENTS AND LIEF_FIND_REQUIRED_STATIC) -+ if(_LIEF_LIB_TYPE STREQUAL "SHARED_LIBRARY") -+ message(FATAL_ERROR "Could not find requested static LIEF library: $") -+ set(LIEF_FOUND FALSE) -+ endif() - endif() - --# Try each search configuration. --foreach(search ${_LIEF_SEARCHES}) -- find_path(LIEF_INCLUDE_DIR -- NAMES LIEF/LIEF.hpp -- PATH ${${search}} -- REQUIRED -- CMAKE_FIND_ROOT_PATH_BOTH -- PATH_SUFFIXES include) --endforeach() -- --# Allow LIEF_LIBRARY to be set manually, as the location of the LIEF library --if(NOT LIEF_LIBRARY) -- foreach(search ${_LIEF_SEARCHES}) -- find_library(_LIEF_LIBRARY -- NAMES ${LIEF_NAMES} -- PATHS ${${search}} -- REQUIRED -- CMAKE_FIND_ROOT_PATH_BOTH -- PATH_SUFFIXES lib lib64) -- endforeach() -- -- if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake") -- include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) -- else() -- include(SelectLibraryConfigurations) -+if(LIEF_FIND_COMPONENTS AND LIEF_FIND_REQUIRED_SHARED) -+ if(_LIEF_LIB_TYPE STREQUAL "STATIC_LIBRARY") -+ message(FATAL_ERROR "Could not find requested shared LIEF library: $") -+ set(LIEF_FOUND FALSE) - endif() -+endif() - -- select_library_configurations(LIEF) - -- set(LIEF_LIBRARY ${_LIEF_LIBRARY}) --endif() -+set(LIEF_LIBRARIES LIEF::LIEF) - - --unset(LIEF_NAMES) -+get_target_property(LIEF_INCLUDE_DIRS LIEF::LIEF INTERFACE_INCLUDE_DIRECTORIES) - --mark_as_advanced(LIEF_INCLUDE_DIR) - - if(LIEF_INCLUDE_DIR AND EXISTS "${LIEF_INCLUDE_DIR}/LIEF/version.h") - file(STRINGS "${LIEF_INCLUDE_DIR}/LIEF/version.h" LIEF_H REGEX "^#define LIEF_VERSION \"[^\"]*\"$") -@@ -133,42 +115,3 @@ if(LIEF_INCLUDE_DIR AND EXISTS "${LIEF_INCLUDE_DIR}/LIEF/version.h") - set(LIEF_MINOR_VERSION "${LIEF_VERSION_MINOR}") - set(LIEF_PATCH_VERSION "${LIEF_VERSION_PATCH}") - endif() -- -- --if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake") -- include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) --else() -- include(FindPackageHandleStandardArgs) --endif() --FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIEF REQUIRED_VARS LIEF_LIBRARY LIEF_INCLUDE_DIR -- VERSION_VAR LIEF_VERSION_STRING) -- -- --if(LIEF_FOUND) -- set(LIEF_INCLUDE_DIRS ${LIEF_INCLUDE_DIR}) -- -- if(NOT LIEF_LIBRARIES) -- set(LIEF_LIBRARIES ${LIEF_LIBRARY}) -- endif() -- -- if(NOT TARGET LIEF::LIEF) -- add_library(LIEF::LIEF UNKNOWN IMPORTED) -- set_target_properties(LIEF::LIEF PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES "${LIEF_INCLUDE_DIRS}") -- -- if(LIEF_LIBRARY) -- set_property(TARGET LIEF::LIEF APPEND PROPERTY -- IMPORTED_CONFIGURATIONS RELEASE) -- set_target_properties(LIEF::LIEF PROPERTIES -- IMPORTED_LOCATION_RELEASE "${LIEF_LIBRARY}") -- endif() -- -- if(NOT LIEF_LIBRARY) -- set_property(TARGET LIEF::LIEF APPEND PROPERTY -- IMPORTED_LOCATION "${LIEF_LIBRARY}") -- endif() -- endif() --endif() -- --# Restore --set(CMAKE_FIND_LIBRARY_SUFFIXES ${LIBRARY_SUFFIXES_SAVED}) From 9ffbecf06f85b47ff5b7295752d835acb7fddbc8 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Fri, 25 Feb 2022 18:47:01 -0500 Subject: [PATCH 69/81] Add version --- versions/l-/lief.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/l-/lief.json b/versions/l-/lief.json index c85f0331a00e71..9746b68c240774 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "c803b254ee084c4a5c33ed2428fc52faea6375b0", + "git-tree": "e6ce152d1844f5dd53f92ec7dfc97b7c98dff43c", "version": "2022-02-19", "port-version": 0 }, From 465753ea8f5cc685741df1e9d7bd0fe77cc50ffb Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Wed, 2 Mar 2022 17:45:56 -0500 Subject: [PATCH 70/81] Update LIEF to latest master Upstream merged CMake fixes! --- ...t-vcpkg.patch => 0001-Support-vcpkg.patch} | 2 +- ...INTERFACE-generator-expression-for-i.patch | 74 -- .../0002-Export-LIEF-targets-with-CMake.patch | 937 ------------------ ports/lief/portfile.cmake | 8 +- ports/lief/vcpkg.json | 2 +- 5 files changed, 5 insertions(+), 1018 deletions(-) rename ports/lief/{0003-Support-vcpkg.patch => 0001-Support-vcpkg.patch} (95%) delete mode 100644 ports/lief/0001-Use-CMake-BUILD_INTERFACE-generator-expression-for-i.patch delete mode 100644 ports/lief/0002-Export-LIEF-targets-with-CMake.patch diff --git a/ports/lief/0003-Support-vcpkg.patch b/ports/lief/0001-Support-vcpkg.patch similarity index 95% rename from ports/lief/0003-Support-vcpkg.patch rename to ports/lief/0001-Support-vcpkg.patch index e6422e702f1577..82271a908acd4e 100644 --- a/ports/lief/0003-Support-vcpkg.patch +++ b/ports/lief/0001-Support-vcpkg.patch @@ -1,7 +1,7 @@ From a912d979b97b71f189d1c702b2e322e1aa7ba325 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Fri, 25 Feb 2022 17:43:34 -0500 -Subject: [PATCH 3/3] Support vcpkg +Subject: [PATCH 1/1] Support vcpkg Remove msvccrt choosing and fix install paths on Windows --- diff --git a/ports/lief/0001-Use-CMake-BUILD_INTERFACE-generator-expression-for-i.patch b/ports/lief/0001-Use-CMake-BUILD_INTERFACE-generator-expression-for-i.patch deleted file mode 100644 index de6b3d41bef3f6..00000000000000 --- a/ports/lief/0001-Use-CMake-BUILD_INTERFACE-generator-expression-for-i.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 3861a8269aee85136584cb3cb211b490fab09478 Mon Sep 17 00:00:00 2001 -From: Eric Kilmer -Date: Mon, 21 Feb 2022 10:26:55 -0500 -Subject: [PATCH 1/3] Use CMake BUILD_INTERFACE generator expression for - include directories - -This fixes the paths that are generated for the exported targets so that -they do not have absolute paths that were found/used at build time. ---- - CMakeLists.txt | 6 +++--- - cmake/LIEFApi.cmake | 2 +- - cmake/LIEFDependencies.cmake | 2 +- - 3 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 456279ae..41afb8c0 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -336,7 +336,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/LIEF.pc.in ${CMAKE_CURRENT_BINARY_DIR - @ONLY) - - target_include_directories(LIB_LIEF -- PUBLIC "${LIEF_PUBLIC_INCLUDE_DIR}" -+ PUBLIC "$" - PRIVATE "${LIEF_PRIVATE_INCLUDE_DIR}") - - if(LIEF_ENABLE_JSON) -@@ -379,7 +379,7 @@ if(LIEF_EXTERNAL_LEAF) - if(LIEF_EXTERNAL_LEAF_DIR) - message(STATUS "External LEAF include dir: ${LIEF_EXTERNAL_LEAF_DIR}") - target_include_directories(LIB_LIEF SYSTEM PUBLIC -- ${LIEF_EXTERNAL_LEAF_DIR}) -+ "$") - endif() - else() - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/leaf.hpp -@@ -422,7 +422,7 @@ if(LIEF_EXTERNAL_SPAN) - if(LIEF_EXTERNAL_SPAN_DIR) - message(STATUS "External span include dir: ${LIEF_EXTERNAL_SPAN_DIR}") - target_include_directories(LIB_LIEF SYSTEM PUBLIC -- ${LIEF_EXTERNAL_SPAN_DIR}) -+ "$") - endif() - else() - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/internal/span.hpp -diff --git a/cmake/LIEFApi.cmake b/cmake/LIEFApi.cmake -index f06f846c..42e0b8dc 100644 ---- a/cmake/LIEFApi.cmake -+++ b/cmake/LIEFApi.cmake -@@ -18,7 +18,7 @@ endif() - # ----- - if(LIEF_C_API) - target_include_directories(LIB_LIEF -- PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/api/c/include") -+ PUBLIC "$") - - include("${CMAKE_CURRENT_SOURCE_DIR}/api/c/CMakeLists.txt") - endif() -diff --git a/cmake/LIEFDependencies.cmake b/cmake/LIEFDependencies.cmake -index 087bae8a..2f8e6b0b 100644 ---- a/cmake/LIEFDependencies.cmake -+++ b/cmake/LIEFDependencies.cmake -@@ -179,7 +179,7 @@ else() - ExternalProject_get_property(lief_spdlog_project SOURCE_DIR) - set(SPDLOG_SOURCE_DIR "${SOURCE_DIR}") - add_dependencies(lief_spdlog lief_spdlog_project) -- target_include_directories(lief_spdlog SYSTEM INTERFACE ${SPDLOG_SOURCE_DIR}/include) -+ target_include_directories(lief_spdlog SYSTEM INTERFACE "$") - endif() - - # Frozen --- -2.35.1 - diff --git a/ports/lief/0002-Export-LIEF-targets-with-CMake.patch b/ports/lief/0002-Export-LIEF-targets-with-CMake.patch deleted file mode 100644 index a61f5f359824de..00000000000000 --- a/ports/lief/0002-Export-LIEF-targets-with-CMake.patch +++ /dev/null @@ -1,937 +0,0 @@ -From 04a95dc88aae31548a0f5f2795c4115c19c38a16 Mon Sep 17 00:00:00 2001 -From: Eric Kilmer -Date: Mon, 21 Feb 2022 10:54:56 -0500 -Subject: [PATCH 2/3] Export LIEF targets with CMake - -With these changes, we no longer need to manually find the LIEF library -by filename. CMake takes care of generating the LIEF::LIEF target and -library location for us in the exported target set. This is basically a -requirement when using external dependencies because the original -functionality did not take care of this. - -I have updated the example projects to make sure that they will work -with this new setup. In doing so, I changed quite a bit to more closely -follow CMake best practices that I hope we can agree on to both improve -reliability and reduce maintenance and support questions for people who -configure LIEF with external dependencies. - -This project still supports finding static or shared LIEF libraries in -the same install prefix using the find_package COMPONENTS method. - -This project still supports development of other projects that want to -use LIEF without installing. Just specify the following option during -configuration of your project that depends on LIEF: - -```cmake -cmake -DLIEF_DIR= ... -``` ---- - CMakeLists.txt | 36 ++-- - LIEFConfig.cmake.in | 181 +++++++++++++++++- - doc/sphinx/installation.rst | 73 +++++-- - .../cmake/add_subdirectory/CMakeLists.txt | 76 ++++++++ - examples/cmake/add_subdirectory/README.rst | 12 ++ - .../main.cpp | 0 - .../cmake/external_project/CMakeLists.txt | 71 +++---- - .../external_project/HelloLIEF/CMakeLists.txt | 28 +++ - .../external_project/{ => HelloLIEF}/main.cpp | 0 - examples/cmake/external_project/README.rst | 3 + - examples/cmake/find_package/CMakeLists.txt | 28 +-- - examples/cmake/find_package/README.rst | 2 +- - scripts/FindLIEF.cmake | 174 ----------------- - 13 files changed, 411 insertions(+), 273 deletions(-) - create mode 100644 examples/cmake/add_subdirectory/CMakeLists.txt - create mode 100644 examples/cmake/add_subdirectory/README.rst - copy examples/cmake/{external_project => add_subdirectory}/main.cpp (100%) - create mode 100644 examples/cmake/external_project/HelloLIEF/CMakeLists.txt - rename examples/cmake/external_project/{ => HelloLIEF}/main.cpp (100%) - delete mode 100644 scripts/FindLIEF.cmake - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 41afb8c0..6bfe863f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -176,6 +176,7 @@ source_group("Source Files" FILES ${LIBLIEF_SOURCE_FILES}) - source_group("Header Files\\visitors" FILES ${LIEF_VISITOR_INCLUDE_FILES}) - - add_library(LIB_LIEF ${LIBLIEF_SOURCE_FILES} ${LIEF_INCLUDE_FILES}) -+add_library(LIEF::LIEF ALIAS LIB_LIEF) - - if(NOT LIEF_OPT_MBEDTLS_EXTERNAL) - set_source_files_properties(${mbedtls_src_crypto} PROPERTIES GENERATED TRUE) -@@ -569,7 +570,7 @@ if(LIEF_COVERAGE) - target_link_libraries(LIB_LIEF gcov) - endif() - --set_target_properties(LIB_LIEF PROPERTIES OUTPUT_NAME LIEF CLEAN_DIRECT_OUTPUT 1) -+set_target_properties(LIB_LIEF PROPERTIES OUTPUT_NAME LIEF EXPORT_NAME LIEF CLEAN_DIRECT_OUTPUT 1) - - - # Set a default build type if none was specified -@@ -616,10 +617,10 @@ endif() - - # Find Package Config - # ====================== --configure_package_config_file( -+configure_file( - LIEFConfig.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfig.cmake -- INSTALL_DESTINATION share/LIEF/cmake) -+ @ONLY) - - write_basic_package_version_file( - ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfigVersion.cmake -@@ -682,10 +683,12 @@ else() - endif() - - install( -- TARGETS LIB_LIEF -+ TARGETS LIB_LIEF lief_spdlog -+ EXPORT LIEFExport - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries) -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries -+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - - install( - DIRECTORY ${LIEF_PUBLIC_INCLUDE_DIR} -@@ -694,11 +697,6 @@ install( - FILES_MATCHING - REGEX "(.*).(hpp|h|def|inc)$") - --install( -- FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/FindLIEF.cmake -- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/LIEF/cmake -- COMPONENT CMakeScripts) -- - install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfig.cmake - ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfigVersion.cmake -@@ -710,7 +708,23 @@ install( - DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig - COMPONENT libraries) - --export(TARGETS LIB_LIEF lief_spdlog FILE LIEFExport.cmake) -+if(BUILD_SHARED_LIBS) -+ set(lib_type shared) -+else() -+ set(lib_type static) -+endif() -+ -+install( -+ EXPORT LIEFExport -+ NAMESPACE LIEF:: -+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/LIEF/cmake -+ FILE LIEFExport-${lib_type}.cmake -+ COMPONENT config) -+ -+export( -+ EXPORT LIEFExport -+ NAMESPACE LIEF:: -+ FILE LIEFExport-${lib_type}.cmake) - - # Package - # ====================== -diff --git a/LIEFConfig.cmake.in b/LIEFConfig.cmake.in -index 94ee5245..8c35eeab 100644 ---- a/LIEFConfig.cmake.in -+++ b/LIEFConfig.cmake.in -@@ -1,4 +1,179 @@ --@PACKAGE_INIT@ -+#.rst: -+# LIEFConfig -+# -------- -+# -+# Populate the native LIEF targets. -+# -+# IMPORTED Targets -+# ^^^^^^^^^^^^^^^^ -+# -+# This module defines :prop_tgt:`IMPORTED` target ``LIEF::LIEF`` -+# -+# Hints -+# ^^^^^ -+# -+# A user may set ``LIEF_DIR`` to the directory where ``LIEFConfig.cmake`` file -+# resides to tell CMake where to find this file. -+# -+# To choose between STATIC and SHARED version of LIEF library, one can use -+# ``COMPONENTS STATIC`` of ``COMPONENTS SHARED``. If no components are -+# specified, then a user may set ``LIEF_SHARED_LIBS`` to a true value to -+# request shared libraries. By default, if no variables or components are set, -+# the static library is preferred if present, else shared library will be used. -+# -+# .. code-block:: cmake -+# -+# find_package(LIEF 0.11.0 REQUIRED COMPONENTS STATIC) - --set(LIEF_DIR "${PACKAGE_PREFIX_DIR}") --include("${CMAKE_CURRENT_LIST_DIR}/FindLIEF.cmake") -+ -+# CMake component support for static and shared libraries based on -+# https://alexreinking.com/blog/building-a-dual-shared-and-static-library-with-cmake.html -+ -+# Process known components -+set(LIEF_known_comps STATIC SHARED) -+set(LIEF_comp_STATIC NO) -+set(LIEF_comp_SHARED NO) -+foreach(_comp ${LIEF_FIND_COMPONENTS}) -+ if(";${LIEF_known_comps};" MATCHES ";${_comp};") -+ set(LIEF_comp_${_comp} YES) -+ else() -+ set(LIEF_NOT_FOUND_MESSAGE -+ "LIEF does not recognize component `${_comp}`.") -+ set(LIEF_FOUND FALSE) -+ return() -+ endif() -+endforeach() -+ -+ -+# Validate component selection makes sense -+if(LIEF_comp_STATIC AND LIEF_comp_SHARED) -+ set(LIEF_NOT_FOUND_MESSAGE -+ "LIEF `STATIC` and `SHARED` components are mutually exclusive.") -+ set(LIEF_FOUND FALSE) -+ return() -+endif() -+ -+ -+# These files are generated by CMake and hold the LIEF library target(s). -+set(LIEF_static_export "${CMAKE_CURRENT_LIST_DIR}/LIEFExport-static.cmake") -+set(LIEF_shared_export "${CMAKE_CURRENT_LIST_DIR}/LIEFExport-shared.cmake") -+ -+ -+# Helper macro to load the requested targets, where `lib_type` is `static` or -+# `shared` -+macro(LIEF_load_targets lib_type) -+ if(NOT EXISTS "${LIEF_${lib_type}_export}") -+ set(LIEF_NOT_FOUND_MESSAGE -+ "LIEF `${lib_type}` libraries were requested but not found.") -+ set(LIEF_FOUND FALSE) -+ return() -+ endif () -+ -+ if("${lib_type}" STREQUAL "static") -+ # Need to find all dependencies even if they're private when LIEF is -+ # compiled statically -+ include(CMakeFindDependencyMacro) -+ -+ if(@LIEF_EXTERNAL_MBEDTLS@) -+ find_dependency(MbedTLS) -+ endif() -+ -+ if(@LIEF_EXTERNAL_UTF8CPP@) -+ find_dependency(utf8cpp) -+ endif() -+ -+ if(@LIEF_EXTERNAL_SPDLOG@) -+ find_dependency(spdlog) -+ endif() -+ -+ if(@LIEF_ENABLE_JSON@ AND @LIEF_NLOHMANN_JSON_EXTERNAL@) -+ find_dependency(nlohmann_json) -+ endif() -+ -+ if(NOT @LIEF_DISABLE_FROZEN@ AND @LIEF_OPT_FROZEN_EXTERNAL@) -+ find_dependency(frozen) -+ endif() -+ endif() -+ -+ # Include the respective targets file -+ include("${LIEF_${lib_type}_export}") -+endmacro() -+ -+# Run the logic to choose static or shared libraries -+# 1. Check components -+if(LIEF_comp_STATIC) -+ LIEF_load_targets("static") -+elseif(LIEF_comp_SHARED) -+ LIEF_load_targets("shared") -+# 2. Check LIEF-only library selection -+elseif(DEFINED LIEF_SHARED_LIBS AND LIEF_SHARED_LIBS) -+ LIEF_load_targets("shared") -+elseif(DEFINED LIEF_SHARED_LIBS AND NOT LIEF_SHARED_LIBS) -+ LIEF_load_targets("static") -+# 3. Check CMake build type and choose what's available -+elseif(BUILD_SHARED_LIBS) -+ if(EXISTS "${LIEF_shared_export}") -+ LIEF_load_targets("shared") -+ else() -+ LIEF_load_targets("static") -+ endif() -+else() -+ if(EXISTS "${LIEF_static_export}") -+ LIEF_load_targets("static") -+ else() -+ LIEF_load_targets("shared") -+ endif() -+endif() -+ -+ -+# Attach location of public interface libraries that don't have -+# their own CMake config that would otherwise be found using `find_dependency` -+ -+# Header-only library can be found relatively easily -+if(@LIEF_EXTERNAL_LEAF@) -+ find_path(BOOST_LEAF_INCLUDE_DIR boost/leaf.hpp) -+ if(NOT BOOST_LEAF_INCLUDE_DIR) -+ set(LIEF_NOT_FOUND_MESSAGE "Could not find include directory with 'boost/leaf.hpp'. Consider setting `BOOST_LEAF_INCLUDE_DIR` during CMake configuration") -+ set(LIEF_FOUND FALSE) -+ return() -+ endif() -+ set_property(TARGET LIEF::LIEF APPEND PROPERTY -+ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${BOOST_LEAF_INCLUDE_DIR}" -+ ) -+endif() -+ -+# Header-only library can be found relatively easily -+if(@LIEF_EXTERNAL_SPAN@) -+ find_path(TCB_SPAN_INCLUDE_DIR tcb/span.hpp) -+ if(NOT TCB_SPAN_INCLUDE_DIR) -+ set(LIEF_NOT_FOUND_MESSAGE "Could not find include directory with 'tcb/span.hpp'. Consider setting `TCB_SPAN_INCLUDE_DIR` during CMake configuration") -+ set(LIEF_FOUND FALSE) -+ return() -+ endif() -+ set_property(TARGET LIEF::LIEF APPEND PROPERTY -+ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${TCB_SPAN_INCLUDE_DIR}" -+ ) -+endif() -+ -+ -+# Set this for backwards compatibility. This isn't quite the path to the -+# actual library file, but using the target is strictly better because it -+# includes all other information needed to correctly link and use LIEF -+set(LIEF_LIBRARIES LIEF::LIEF) -+ -+# Set this for backwards compatibility -+get_target_property(LIEF_INCLUDE_DIRS LIEF::LIEF INTERFACE_INCLUDE_DIRECTORIES) -+ -+# Set the following for backwards compatibility -+if(LIEF_INCLUDE_DIR AND EXISTS "${LIEF_INCLUDE_DIR}/LIEF/version.h") -+ file(STRINGS "${LIEF_INCLUDE_DIR}/LIEF/version.h" LIEF_H REGEX "^#define LIEF_VERSION \"[^\"]*\"$") -+ -+ string(REGEX REPLACE "^.*LIEF_VERSION \"([0-9]+).*$" "\\1" LIEF_VERSION_MAJOR "${LIEF_H}") -+ string(REGEX REPLACE "^.*LIEF_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" LIEF_VERSION_MINOR "${LIEF_H}") -+ string(REGEX REPLACE "^.*LIEF_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" LIEF_VERSION_PATCH "${LIEF_H}") -+ set(LIEF_VERSION_STRING "${LIEF_VERSION_MAJOR}.${LIEF_VERSION_MINOR}.${LIEF_VERSION_PATCH}") -+ -+ set(LIEF_MAJOR_VERSION "${LIEF_VERSION_MAJOR}") -+ set(LIEF_MINOR_VERSION "${LIEF_VERSION_MINOR}") -+ set(LIEF_PATCH_VERSION "${LIEF_VERSION_PATCH}") -+endif() -diff --git a/doc/sphinx/installation.rst b/doc/sphinx/installation.rst -index ab812664..2ad5fe0d 100644 ---- a/doc/sphinx/installation.rst -+++ b/doc/sphinx/installation.rst -@@ -218,48 +218,85 @@ and run it: - CMake Integration - ----------------- - -+There are a few ways to integrate LIEF as a dependency in another project. The different methods are listed in order of preference and CMake best practice. These listings are only to show basic examples. Please refer to the CMake documentation for questions related to more complex project setup. - --External Project --**************** - --Using `CMake External Project `_: -+find_package() -+************** - --.. literalinclude:: ../../examples/cmake/external_project/CMakeLists.txt -+Using `CMake find_package() `_: -+ -+.. literalinclude:: ../../examples/cmake/find_package/CMakeLists.txt - :language: cmake -- :lines: 1-42 -+ :lines: 5-12 - - And now, to be integrated within a project: - --.. literalinclude:: ../../examples/cmake/external_project/CMakeLists.txt -+.. literalinclude:: ../../examples/cmake/find_package/CMakeLists.txt - :language: cmake -- :lines: 47- -+ :lines: 13- - - For the compilation: - --.. include:: ../../examples/cmake/external_project/README.rst -+.. include:: ../../examples/cmake/find_package/README.rst - :start-line: 3 - --A *full* example is available in the ``examples/cmake/external_project`` directory. -+A *full* example is available in the ``examples/cmake/find_package`` directory. - - --find_package() --************** -+add_subdirectory() or FetchContent -+********************************** - --Using `CMake find_package() `_: -+First, set up the options you want to set as default for the LIEF project: - --.. literalinclude:: ../../examples/cmake/find_package/CMakeLists.txt -+.. literalinclude:: ../../examples/cmake/add_subdirectory/CMakeLists.txt -+ :language: cmake -+ :lines: 7-19 -+ -+Using `CMake add_subdirectory() `_ to add a submodule LIEF source directory: -+ -+.. literalinclude:: ../../examples/cmake/add_subdirectory/CMakeLists.txt -+ :language: cmake -+ :lines: 21-28 -+ -+If we are using a CMake version greater than or equal to 3.11, we can use `CMake FetchContent module `_ to download or specify a LIEF source directory outside of the current directory: -+ -+.. literalinclude:: ../../examples/cmake/add_subdirectory/CMakeLists.txt - :language: cmake -- :lines: 5-19 -+ :lines: 33-59 - - And now, to be integrated within a project: - --.. literalinclude:: ../../examples/cmake/find_package/CMakeLists.txt -+.. literalinclude:: ../../examples/cmake/add_subdirectory/CMakeLists.txt - :language: cmake -- :lines: 20- -+ :lines: 62- - - For the compilation: - --.. include:: ../../examples/cmake/find_package/README.rst -+.. include:: ../../examples/cmake/add_subdirectory/README.rst - :start-line: 3 - --A *full* example is available in the ``examples/cmake/find_package`` directory. -+A *full* example is available in the ``examples/cmake/add_subdirectory`` directory. -+ -+ -+External Project -+**************** -+ -+If you don't want to use LIEF as a submodule or upgrade to CMake 3.11, we can use `CMake External Project `_ to set up a project as a `*superbuild* `: -+ -+.. literalinclude:: ../../examples/cmake/external_project/CMakeLists.txt -+ :language: cmake -+ :lines: 1-41 -+ -+And now, to be integrated with our main ``HelloLIEF`` project that is located in a subdirectory and looks exactly like the ``find_package()`` example shown earlier: -+ -+.. literalinclude:: ../../examples/cmake/external_project/CMakeLists.txt -+ :language: cmake -+ :lines: 42- -+ -+For the compilation: -+ -+.. include:: ../../examples/cmake/external_project/README.rst -+ :start-line: 3 -+ -+A *full* example is available in the ``examples/cmake/external_project`` directory. -diff --git a/examples/cmake/add_subdirectory/CMakeLists.txt b/examples/cmake/add_subdirectory/CMakeLists.txt -new file mode 100644 -index 00000000..fcedd1c1 ---- /dev/null -+++ b/examples/cmake/add_subdirectory/CMakeLists.txt -@@ -0,0 +1,76 @@ -+# Minimum of 3.5 for adding submodule of LIEF because LIEF min is 3.5, -+# otherwise 3.11+ for FetchContent command -+cmake_minimum_required(VERSION 3.5) -+ -+project(SubdirLIEF CXX) -+ -+# Use LIEF as an embedded/vendored project -+# ======================================== -+ -+# LIEF build config. Set the default options for LIEF's project setup -+option(LIEF_DOC "Build LIEF docs" OFF) -+option(LIEF_PYTHON_API "Build LIEF Python API" OFF) -+option(LIEF_EXAMPLES "Build LIEF examples" OFF) -+option(LIEF_TESTS "Build LIEF tests" OFF) -+ -+if(MSVC) -+ set(LIEF_USE_CRT_RELEASE "MT" CACHE STRING "LIEF CRT option") -+endif() -+ -+ -+# If you have LIEF as a submodule in a directory, then you can add it to this -+# project with ``add_subdirectory`` -+# NOTE: This submodule does not exist for this example, but it does the same -+# thing as FetchContent without the download part -+set(vendorLIEF_submodule_dir "${CMAKE_CURRENT_LIST_DIR}/LIEF") -+if(EXISTS "${vendorLIEF_submodule_dir}") -+ add_subdirectory("${vendorLIEF_submodule_dir}") -+ -+# Else, we'll specify how to obtain LIEF another way (downloading) -+else() -+ # CMake 3.11 has FetchContent which provides a simple experience for what -+ # we're trying to do -+ cmake_minimum_required(VERSION 3.11) -+ -+ # Common info for specifying LIEF source directory -+ # URL of the LIEF repo (Can be your fork) -+ set(LIEF_GIT_URL "https://github.com/lief-project/LIEF.git") -+ # LIEF's version to be used (can be 'master') -+ set(LIEF_VERSION 0.12.0) -+ -+ include(FetchContent) -+ FetchContent_Declare(LIEF -+ #GIT_REPOSITORY "${LIEF_GIT_URL}" -+ #GIT_TAG ${LIEF_VERSION} -+ SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../.." -+ ) -+ -+ if(${CMAKE_VERSION} VERSION_LESS "3.14.0") -+ # CMake 3.11 to 3.13 needs more verbose method to make LIEF available -+ FetchContent_GetProperties(LIEF) -+ if(NOT LIEF_POPULATED) -+ FetchContent_Populate(LIEF) -+ add_subdirectory(${LIEF_SOURCE_DIR} ${LIEF_BINARY_DIR}) -+ endif() -+ else() -+ # CMake 3.14+ has single function to make LIEF available -+ FetchContent_MakeAvailable(LIEF) -+ endif() -+endif() -+ -+ -+# Add our executable -+# ================== -+add_executable(HelloLIEF main.cpp) -+ -+if(MSVC) -+ set_property(TARGET HelloLIEF PROPERTY LINK_FLAGS /NODEFAULTLIB:MSVCRT) -+endif() -+ -+# Enable C++11 -+set_property(TARGET HelloLIEF -+ PROPERTY CXX_STANDARD 11 -+ PROPERTY CXX_STANDARD_REQUIRED ON) -+ -+# Link the executable with LIEF -+target_link_libraries(HelloLIEF PUBLIC LIEF::LIEF) -diff --git a/examples/cmake/add_subdirectory/README.rst b/examples/cmake/add_subdirectory/README.rst -new file mode 100644 -index 00000000..442f34a5 ---- /dev/null -+++ b/examples/cmake/add_subdirectory/README.rst -@@ -0,0 +1,12 @@ -+LIEF CMake Integration Example - add_subdirectory -+================================================= -+ -+ -+.. code-block:: console -+ -+ $ mkdir build -+ $ cd build -+ $ cmake .. -+ $ make -+ $ HelloLIEF /bin/ls # or explorer.exe or whatever -+ -diff --git a/examples/cmake/external_project/main.cpp b/examples/cmake/add_subdirectory/main.cpp -similarity index 100% -copy from examples/cmake/external_project/main.cpp -copy to examples/cmake/add_subdirectory/main.cpp -diff --git a/examples/cmake/external_project/CMakeLists.txt b/examples/cmake/external_project/CMakeLists.txt -index e84f341d..d9384e13 100644 ---- a/examples/cmake/external_project/CMakeLists.txt -+++ b/examples/cmake/external_project/CMakeLists.txt -@@ -1,34 +1,28 @@ --cmake_minimum_required(VERSION 3.02) -+cmake_minimum_required(VERSION 3.0) - --include(ExternalProject) -+project(CMakeLIEF LANGUAGES NONE) - --project(CMakeLIEF) -+include(ExternalProject) - --# LIEF as an External Project -+# LIEF integration as an External Project - # =========================== - set(LIEF_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/LIEF") --set(LIEF_INSTALL_DIR "${LIEF_PREFIX}") --set(LIEF_INCLUDE_DIRS "${LIEF_PREFIX}/include") -- --# LIEF static library --set(LIB_LIEF -- "${LIEF_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}LIEF${CMAKE_STATIC_LIBRARY_SUFFIX}") -+set(LIEF_INSTALL_DIR "${LIEF_PREFIX}/install") - - # URL of the LIEF repo (Can be your fork) - set(LIEF_GIT_URL "https://github.com/lief-project/LIEF.git") - - # LIEF's version to be used (can be 'master') --set(LIEF_VERSION 0.11.0) -+set(LIEF_VERSION 0.12.0) - - # LIEF compilation config - set(LIEF_CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX= -- -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -- -DLIEF_DOC=off -- -DLIEF_PYTHON_API=off -- -DLIEF_EXAMPLES=off -- -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -- -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -+ -DCMAKE_BUILD_TYPE=RelWithDebInfo -+ -DLIEF_DOC=OFF -+ -DLIEF_PYTHON_API=OFF -+ -DLIEF_EXAMPLES=OFF -+ -DLIEF_TESTS=OFF - ) - - if(MSVC) -@@ -37,35 +31,24 @@ endif() - - ExternalProject_Add(LIEF - PREFIX "${LIEF_PREFIX}" -- GIT_REPOSITORY ${LIEF_GIT_URL} -+ GIT_REPOSITORY "${LIEF_GIT_URL}" - GIT_TAG ${LIEF_VERSION} -- INSTALL_DIR ${LIEF_INSTALL_DIR} -+ # You may specify an existing LIEF source directory if you don't want to -+ # download. Just comment out the above ``GIT_*`` commands and uncoment the -+ # following ``SOURCE_DIR`` line -+ #SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../.." -+ INSTALL_DIR "${LIEF_INSTALL_DIR}" - CMAKE_ARGS ${LIEF_CMAKE_ARGS} -- BUILD_BYPRODUCTS ${LIEF_LIBRARIES} -- UPDATE_COMMAND "" - ) - -- --# Add our executable --# ================== --add_executable(HelloLIEF main.cpp) -- --if(MSVC) -- set_property(TARGET HelloLIEF PROPERTY LINK_FLAGS /NODEFAULTLIB:MSVCRT) --endif() -- --# Setup the LIEF include directory --target_include_directories(HelloLIEF -- PUBLIC -- ${LIEF_INCLUDE_DIRS} -+# User project -+# ============ -+ExternalProject_Add(HelloLIEF -+ DEPENDS LIEF -+ SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/HelloLIEF" -+ BINARY_DIR "${CMAKE_CURRENT_BUILD_DIR}" -+ INSTALL_COMMAND "" -+ CMAKE_ARGS -+ "-DLIEF_DIR=${LIEF_INSTALL_DIR}/share/LIEF/cmake" -+ -DCMAKE_BUILD_TYPE=RelWithDebInfo - ) -- --# Enable C++11 --set_property(TARGET HelloLIEF -- PROPERTY CXX_STANDARD 11 -- CXX_STANDARD_REQUIRED ON) -- --# Link the executable with LIEF --target_link_libraries(HelloLIEF PUBLIC ${LIB_LIEF}) -- --add_dependencies(HelloLIEF LIEF) -diff --git a/examples/cmake/external_project/HelloLIEF/CMakeLists.txt b/examples/cmake/external_project/HelloLIEF/CMakeLists.txt -new file mode 100644 -index 00000000..3f587a19 ---- /dev/null -+++ b/examples/cmake/external_project/HelloLIEF/CMakeLists.txt -@@ -0,0 +1,28 @@ -+cmake_minimum_required(VERSION 3.0) -+ -+project(CMakeLIEF LANGUAGES CXX) -+ -+# Use LIEF with 'find_package()' -+# ============================== -+ -+# Find LIEF. If LIEF was not installed into a default system directory then -+# specify the following option during CMake configuration: -+# -DLIEF_DIR=/share/LIEF/cmake -+find_package(LIEF REQUIRED COMPONENTS STATIC) # COMPONENTS: - Default: STATIC -+ -+# Add our executable -+# ================== -+add_executable(HelloLIEF main.cpp) -+ -+if(MSVC) -+ set_property(TARGET HelloLIEF PROPERTY LINK_FLAGS /NODEFAULTLIB:MSVCRT) -+endif() -+ -+ -+# Enable C++11 -+set_property(TARGET HelloLIEF -+ PROPERTY CXX_STANDARD 11 -+ PROPERTY CXX_STANDARD_REQUIRED ON) -+ -+# Link the executable with LIEF -+target_link_libraries(HelloLIEF PUBLIC LIEF::LIEF) -diff --git a/examples/cmake/external_project/main.cpp b/examples/cmake/external_project/HelloLIEF/main.cpp -similarity index 100% -rename from examples/cmake/external_project/main.cpp -rename to examples/cmake/external_project/HelloLIEF/main.cpp -diff --git a/examples/cmake/external_project/README.rst b/examples/cmake/external_project/README.rst -index 09eb42b3..ebcc438e 100644 ---- a/examples/cmake/external_project/README.rst -+++ b/examples/cmake/external_project/README.rst -@@ -1,6 +1,9 @@ - LIEF CMake Integration Example - ExternalProject - ================================================ - -+This setup is known as a CMake *super build* where the top-level CMakeLists.txt drives all of the steps of the projects specified within it. The project we would be doing active development on is located in the ``HelloLIEF`` directory. -+ -+For simplicity, it is recommended to use CMake's ``FetchContent`` command introduced in CMake 3.11. See the example in the ``examples/cmake/fetch_content`` directory. - - .. code-block:: console - -diff --git a/examples/cmake/find_package/CMakeLists.txt b/examples/cmake/find_package/CMakeLists.txt -index 1812d4b1..d0e3dd64 100644 ---- a/examples/cmake/find_package/CMakeLists.txt -+++ b/examples/cmake/find_package/CMakeLists.txt -@@ -1,25 +1,15 @@ --cmake_minimum_required(VERSION 3.1) -+cmake_minimum_required(VERSION 3.0) - --project(CMakeLIEF) -+project(CMakeLIEF LANGUAGES CXX) - - # Use LIEF with 'find_package()' - # ============================== - --# Custom path to the LIEF install directory --set(LIEF_DIR CACHE PATH ${CMAKE_INSTALL_PREFIX}) -- --# Directory to 'FindLIEF.cmake' --list(APPEND CMAKE_MODULE_PATH ${LIEF_DIR}/share/LIEF/cmake) -- --# include 'FindLIEF.cmake' --include(FindLIEF) -- --# Find LIEF -+# Find LIEF. If LIEF was not installed into a default system directory then -+# specify the following option during CMake configuration: -+# -DLIEF_DIR=/share/LIEF/cmake - find_package(LIEF REQUIRED COMPONENTS STATIC) # COMPONENTS: - Default: STATIC - --message(STATUS "LIEF include directory: ${LIEF_INCLUDE_DIRS}") --message(STATUS "LIEF library: ${LIEF_LIBRARIES}") -- - # Add our executable - # ================== - add_executable(HelloLIEF main.cpp) -@@ -29,16 +19,10 @@ if(MSVC) - endif() - - --# Setup the LIEF include directory --target_include_directories(HelloLIEF -- PUBLIC -- ${LIEF_INCLUDE_DIRS} --) -- - # Enable C++11 - set_property(TARGET HelloLIEF - PROPERTY CXX_STANDARD 11 - PROPERTY CXX_STANDARD_REQUIRED ON) - - # Link the executable with LIEF --target_link_libraries(HelloLIEF PUBLIC ${LIEF_LIBRARIES}) -+target_link_libraries(HelloLIEF PRIVATE LIEF::LIEF) -diff --git a/examples/cmake/find_package/README.rst b/examples/cmake/find_package/README.rst -index 6f104439..18331b7f 100644 ---- a/examples/cmake/find_package/README.rst -+++ b/examples/cmake/find_package/README.rst -@@ -6,7 +6,7 @@ LIEF CMake Integration Example - find_package() - - $ mkdir build - $ cd build -- $ cmake -DLIEF_DIR= .. # By default, LIEF_DIR=CMAKE_INSTALL_PREFIX -+ $ cmake -DLIEF_DIR=/share/LIEF/cmake .. - $ make - $ HelloLIEF /bin/ls # or explorer.exe or whatever - -diff --git a/scripts/FindLIEF.cmake b/scripts/FindLIEF.cmake -deleted file mode 100644 -index 43874a3a..00000000 ---- a/scripts/FindLIEF.cmake -+++ /dev/null -@@ -1,174 +0,0 @@ --#.rst: --# FindLIEF --# -------- --# --# Find the native LIEF includes and library. --# --# IMPORTED Targets --# ^^^^^^^^^^^^^^^^ --# --# This module defines :prop_tgt:`IMPORTED` target ``LIEF::LIEF``, if --# LIEF has been found. --# --# Result Variables --# ^^^^^^^^^^^^^^^^ --# --# This module defines the following variables: --# --# :: --# --# LIEF_INCLUDE_DIRS - Where to find LIEF/LIEF.hpp, etc. --# LIEF_LIBRARIES - List of libraries when using LIEF. --# LIEF_FOUND - True if LIEF found. --# --# :: --# --# LIEF_VERSION_STRING - The version of LIEF found (x.y.z) --# LIEF_VERSION_MAJOR - The major version of LIEF --# LIEF_VERSION_MINOR - The minor version of LIEF --# LIEF_VERSION_PATCH - The patch version of LIEF --# --# Hints --# ^^^^^ --# --# A user may set ``LIEF_DIR`` to a LIEF installation root to tell this --# module where to look. --# --# To choose between STATIC and SHARED version of LIEF library, one --# can use ``COMPONENTS STATIC`` of ``COMPONENTS SHARED`` --# --# .. code-block:: cmake --# --# find_package(LIEF 0.11.0 REQUIRED COMPONENTS STATIC) -- -- -- --set(_LIEF_SEARCHES) -- --if(LIEF_ROOT) -- message(FATAL_ERROR "LIEF_ROOT is no longer supported. Please use LIEF_DIR") --endif() -- --if(LIEF_DIR) -- set(_LIEF_SEARCH_ROOT PATHS ${LIEF_DIR} NO_DEFAULT_PATH) -- list(APPEND _LIEF_SEARCHES _LIEF_SEARCH_ROOT) --endif() -- --set(LIEF_NAMES LIEF) -- --if (LIEF_FIND_COMPONENTS AND LIEF_FIND_REQUIRED_STATIC AND LIEF_FIND_REQUIRED_SHARED) -- message(WARNING "Two incompatible components specified : static and shared. We are going to ignore the 'shared' component.") -- list(REMOVE_ITEM LIEF_FIND_COMPONENTS SHARED) -- unset(LIEF_FIND_REQUIRED_SHARED) --endif() -- --set(LIBRARY_SUFFIXES_SAVED ${CMAKE_FIND_LIBRARY_SUFFIXES}) -- --if (NOT LIEF_FIND_COMPONENTS) -- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX}) --endif() -- --if(LIEF_FIND_COMPONENTS AND LIEF_FIND_REQUIRED_STATIC) -- unset(_LIEF_LIBRARY CACHE) -- unset(LIEF_LIBRARY) -- unset(LIEF_FOUND) -- unset(LIEF_LIBRARIES) -- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) --endif() -- --if(LIEF_FIND_COMPONENTS AND LIEF_FIND_REQUIRED_SHARED) -- unset(_LIEF_LIBRARY CACHE) -- unset(LIEF_LIBRARY) -- unset(LIEF_FOUND) -- unset(LIEF_LIBRARIES) -- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX}) --endif() -- --# Try each search configuration. --foreach(search ${_LIEF_SEARCHES}) -- find_path(LIEF_INCLUDE_DIR -- NAMES LIEF/LIEF.hpp -- PATH ${${search}} -- REQUIRED -- CMAKE_FIND_ROOT_PATH_BOTH -- PATH_SUFFIXES include) --endforeach() -- --# Allow LIEF_LIBRARY to be set manually, as the location of the LIEF library --if(NOT LIEF_LIBRARY) -- foreach(search ${_LIEF_SEARCHES}) -- find_library(_LIEF_LIBRARY -- NAMES ${LIEF_NAMES} -- PATHS ${${search}} -- REQUIRED -- CMAKE_FIND_ROOT_PATH_BOTH -- PATH_SUFFIXES lib lib64) -- endforeach() -- -- if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake") -- include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) -- else() -- include(SelectLibraryConfigurations) -- endif() -- -- select_library_configurations(LIEF) -- -- set(LIEF_LIBRARY ${_LIEF_LIBRARY}) --endif() -- -- --unset(LIEF_NAMES) -- --mark_as_advanced(LIEF_INCLUDE_DIR) -- --if(LIEF_INCLUDE_DIR AND EXISTS "${LIEF_INCLUDE_DIR}/LIEF/version.h") -- file(STRINGS "${LIEF_INCLUDE_DIR}/LIEF/version.h" LIEF_H REGEX "^#define LIEF_VERSION \"[^\"]*\"$") -- -- string(REGEX REPLACE "^.*LIEF_VERSION \"([0-9]+).*$" "\\1" LIEF_VERSION_MAJOR "${LIEF_H}") -- string(REGEX REPLACE "^.*LIEF_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" LIEF_VERSION_MINOR "${LIEF_H}") -- string(REGEX REPLACE "^.*LIEF_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" LIEF_VERSION_PATCH "${LIEF_H}") -- set(LIEF_VERSION_STRING "${LIEF_VERSION_MAJOR}.${LIEF_VERSION_MINOR}.${LIEF_VERSION_PATCH}") -- -- set(LIEF_MAJOR_VERSION "${LIEF_VERSION_MAJOR}") -- set(LIEF_MINOR_VERSION "${LIEF_VERSION_MINOR}") -- set(LIEF_PATCH_VERSION "${LIEF_VERSION_PATCH}") --endif() -- -- --if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake") -- include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) --else() -- include(FindPackageHandleStandardArgs) --endif() --FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIEF REQUIRED_VARS LIEF_LIBRARY LIEF_INCLUDE_DIR -- VERSION_VAR LIEF_VERSION_STRING) -- -- --if(LIEF_FOUND) -- set(LIEF_INCLUDE_DIRS ${LIEF_INCLUDE_DIR}) -- -- if(NOT LIEF_LIBRARIES) -- set(LIEF_LIBRARIES ${LIEF_LIBRARY}) -- endif() -- -- if(NOT TARGET LIEF::LIEF) -- add_library(LIEF::LIEF UNKNOWN IMPORTED) -- set_target_properties(LIEF::LIEF PROPERTIES -- INTERFACE_INCLUDE_DIRECTORIES "${LIEF_INCLUDE_DIRS}") -- -- if(LIEF_LIBRARY) -- set_property(TARGET LIEF::LIEF APPEND PROPERTY -- IMPORTED_CONFIGURATIONS RELEASE) -- set_target_properties(LIEF::LIEF PROPERTIES -- IMPORTED_LOCATION_RELEASE "${LIEF_LIBRARY}") -- endif() -- -- if(NOT LIEF_LIBRARY) -- set_property(TARGET LIEF::LIEF APPEND PROPERTY -- IMPORTED_LOCATION "${LIEF_LIBRARY}") -- endif() -- endif() --endif() -- --# Restore --set(CMAKE_FIND_LIBRARY_SUFFIXES ${LIBRARY_SUFFIXES_SAVED}) --- -2.35.1 - diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 25803fccff4a9e..d8004c56c7c690 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -1,13 +1,11 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lief-project/LIEF - REF 566d4ac8a86e458a40de1e2816115f8db48a5501 # master commit 2022-02-19 - SHA512 8ebcd67c54903d83e43959039d0cccdbccb6132c5f84344dbd9834d98932d294c4f5ce95df8a1702c6afa8a1714179b6d413c524902f24eb0f0bceff5db3c2be + REF 8f12ec939dc9da87a195e0a2b035460c97e0d1c9 # master commit 2022-03-01 + SHA512 f5aa85283417e57bfb26e67c3db2d941766c5725cb9c00d2a7ad4f94aa067907d494801a1f6c444e8725a5205a8058b33a05240e40d2f17d6a0c91fe359c1d96 HEAD_REF master PATCHES - 0001-Use-CMake-BUILD_INTERFACE-generator-expression-for-i.patch - 0002-Export-LIEF-targets-with-CMake.patch - 0003-Support-vcpkg.patch + 0001-Support-vcpkg.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index d757712271e50d..0bb33aea5ab11b 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -1,6 +1,6 @@ { "name": "lief", - "version": "2022-02-19", + "version": "2022-03-01", "description": "LIEF - Library to Instrument Executable Formats", "homepage": "https://lief.quarkslab.com", "license": "Apache-2.0", From a2352a4c8d77bee7c13a76ac31eabe03c8565ea1 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Wed, 2 Mar 2022 17:46:39 -0500 Subject: [PATCH 71/81] Add version --- versions/baseline.json | 2 +- versions/l-/lief.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index 1aa82f89fc9456..a91481cc4db772 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4153,7 +4153,7 @@ "port-version": 3 }, "lief": { - "baseline": "2022-02-19", + "baseline": "2022-03-01", "port-version": 0 }, "lilv": { diff --git a/versions/l-/lief.json b/versions/l-/lief.json index 9746b68c240774..448f02abe6fbe9 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "e6ce152d1844f5dd53f92ec7dfc97b7c98dff43c", - "version": "2022-02-19", + "git-tree": "3ff880053a034b7e360f5b957ff0c355527a7fcf", + "version": "2022-03-01", "port-version": 0 }, { From 0ec03e29cc5b7a3aa5ef7afe99a1a7ec4b41578b Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Mon, 14 Mar 2022 09:38:17 -0400 Subject: [PATCH 72/81] Tagged Release candidate 0.12.0-rc.1 --- ports/lief/portfile.cmake | 5 +++-- ports/lief/vcpkg.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index d8004c56c7c690..558a7a765c8d95 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lief-project/LIEF - REF 8f12ec939dc9da87a195e0a2b035460c97e0d1c9 # master commit 2022-03-01 - SHA512 f5aa85283417e57bfb26e67c3db2d941766c5725cb9c00d2a7ad4f94aa067907d494801a1f6c444e8725a5205a8058b33a05240e40d2f17d6a0c91fe359c1d96 + REF 0.12.0-rc.1 + SHA512 2193ef5047795c9cf6bcd6fecfc8808cf5eaaa9f30ea03a6ef55c161950f5cccfa1618b18162721bebbbc6189d5ee2941d4d9dee858cd69dc743810f2d042ed1 HEAD_REF master PATCHES 0001-Support-vcpkg.patch @@ -55,6 +55,7 @@ vcpkg_cmake_configure( ${FEATURE_OPTIONS} -DLIEF_PYTHON_API=OFF + -DLIEF_USE_CCACHE=OFF # Build with external vcpkg dependencies -DLIEF_OPT_MBEDTLS_EXTERNAL=ON diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index 0bb33aea5ab11b..b55645e45add34 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -1,6 +1,6 @@ { "name": "lief", - "version": "2022-03-01", + "version-semver": "0.12.0-rc.1", "description": "LIEF - Library to Instrument Executable Formats", "homepage": "https://lief.quarkslab.com", "license": "Apache-2.0", From edcc2c6a6b9decaeb97b9de870b6b694e1c57040 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Mon, 14 Mar 2022 09:39:18 -0400 Subject: [PATCH 73/81] Update version --- versions/baseline.json | 2 +- versions/l-/lief.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index a04f2359c443c3..98492b4d39ff72 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4173,7 +4173,7 @@ "port-version": 3 }, "lief": { - "baseline": "2022-03-01", + "baseline": "0.12.0-rc.1", "port-version": 0 }, "lilv": { diff --git a/versions/l-/lief.json b/versions/l-/lief.json index 448f02abe6fbe9..6ba34123b88906 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "3ff880053a034b7e360f5b957ff0c355527a7fcf", - "version": "2022-03-01", + "git-tree": "9a51b10b3720e7be2d4d7a649efe07feb604678c", + "version-semver": "0.12.0-rc.1", "port-version": 0 }, { From 1dc323735db4baaaeb4258eeddb652dcca66d083 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Mon, 14 Mar 2022 14:19:40 -0400 Subject: [PATCH 74/81] Update patch for installation path of Windows DLL --- ports/lief/0001-Support-vcpkg.patch | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/ports/lief/0001-Support-vcpkg.patch b/ports/lief/0001-Support-vcpkg.patch index 82271a908acd4e..8e91e1ead89624 100644 --- a/ports/lief/0001-Support-vcpkg.patch +++ b/ports/lief/0001-Support-vcpkg.patch @@ -1,15 +1,15 @@ -From a912d979b97b71f189d1c702b2e322e1aa7ba325 Mon Sep 17 00:00:00 2001 +From 754328b44c63a5cb3f9c98fe357bad7d127c6ebc Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Fri, 25 Feb 2022 17:43:34 -0500 -Subject: [PATCH 1/1] Support vcpkg +Subject: [PATCH] Support vcpkg Remove msvccrt choosing and fix install paths on Windows --- - CMakeLists.txt | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) + CMakeLists.txt | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6bfe863f..53e20fa3 100644 +index 80877756..53e20fa3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,9 +11,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_CROSSCOMPILING) @@ -31,6 +31,15 @@ index 6bfe863f..53e20fa3 100644 include(GNUInstallDirs) else() if(WIN32) +@@ -687,7 +684,7 @@ install( + EXPORT LIEFExport + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + install( -- 2.35.1 From 6953c655a836e7087007135d444a11cbc0ff73b7 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Mon, 14 Mar 2022 14:20:29 -0400 Subject: [PATCH 75/81] Update version --- versions/l-/lief.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/l-/lief.json b/versions/l-/lief.json index 6ba34123b88906..0ed9896f161ac6 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "9a51b10b3720e7be2d4d7a649efe07feb604678c", + "git-tree": "feda2c09b37d22be8131f67112a7427b0e7b4a4c", "version-semver": "0.12.0-rc.1", "port-version": 0 }, From 713dfe29f79767f9a4674ae5c9d8f5f750a4da17 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sat, 26 Mar 2022 11:50:28 -0400 Subject: [PATCH 76/81] Update to official 0.12.0 release --- ports/lief/portfile.cmake | 4 ++-- ports/lief/vcpkg.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 558a7a765c8d95..0381a10ed5873a 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lief-project/LIEF - REF 0.12.0-rc.1 - SHA512 2193ef5047795c9cf6bcd6fecfc8808cf5eaaa9f30ea03a6ef55c161950f5cccfa1618b18162721bebbbc6189d5ee2941d4d9dee858cd69dc743810f2d042ed1 + REF 0.12.0 + SHA512 07089996282ed9b8b9e3061f5b0e1f1711a54d316e8d602205b8eb99a24da762bf7d91143f52af5d75f7a5d94ea65caf08b3263e4e18935277d2aecc8330203b HEAD_REF master PATCHES 0001-Support-vcpkg.patch diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index b55645e45add34..2e50109749c8b3 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -1,6 +1,6 @@ { "name": "lief", - "version-semver": "0.12.0-rc.1", + "version-semver": "0.12.0", "description": "LIEF - Library to Instrument Executable Formats", "homepage": "https://lief.quarkslab.com", "license": "Apache-2.0", From dcf8bb41af55e53d0fc5603e24bbf1f3759ebe4c Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Sat, 26 Mar 2022 11:51:06 -0400 Subject: [PATCH 77/81] Update version --- versions/baseline.json | 2 +- versions/l-/lief.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index 959883d9dd330f..3136f62ce52a99 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4201,7 +4201,7 @@ "port-version": 3 }, "lief": { - "baseline": "0.12.0-rc.1", + "baseline": "0.12.0", "port-version": 0 }, "lilv": { diff --git a/versions/l-/lief.json b/versions/l-/lief.json index 0ed9896f161ac6..5cea53af3987e6 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "feda2c09b37d22be8131f67112a7427b0e7b4a4c", - "version-semver": "0.12.0-rc.1", + "git-tree": "122bcad08ea144f61ec59980340d33da82c4c2bd", + "version-semver": "0.12.0", "port-version": 0 }, { From 97e461c602c9236b84a621c34adc8809b0194c88 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Tue, 12 Apr 2022 10:53:04 -0400 Subject: [PATCH 78/81] Update to LIEF 0.12.1 --- ports/lief/0001-Support-vcpkg.patch | 10 +++++----- ports/lief/portfile.cmake | 5 ++--- ports/lief/vcpkg.json | 5 +---- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/ports/lief/0001-Support-vcpkg.patch b/ports/lief/0001-Support-vcpkg.patch index 8e91e1ead89624..0bcabb70184205 100644 --- a/ports/lief/0001-Support-vcpkg.patch +++ b/ports/lief/0001-Support-vcpkg.patch @@ -1,6 +1,6 @@ -From 754328b44c63a5cb3f9c98fe357bad7d127c6ebc Mon Sep 17 00:00:00 2001 +From 426d8167648fff0ad79832a701223b8171dad096 Mon Sep 17 00:00:00 2001 From: Eric Kilmer -Date: Fri, 25 Feb 2022 17:43:34 -0500 +Date: Tue, 12 Apr 2022 10:42:27 -0400 Subject: [PATCH] Support vcpkg Remove msvccrt choosing and fix install paths on Windows @@ -9,7 +9,7 @@ Remove msvccrt choosing and fix install paths on Windows 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 80877756..53e20fa3 100644 +index b89d0522..9ca50c35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,9 +11,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_CROSSCOMPILING) @@ -29,9 +29,9 @@ index 80877756..53e20fa3 100644 -if(UNIX) +if(1) include(GNUInstallDirs) + set(CMAKE_INSTALL_LIBDIR "lib") else() - if(WIN32) -@@ -687,7 +684,7 @@ install( +@@ -688,7 +685,7 @@ install( EXPORT LIEFExport ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 0381a10ed5873a..26f3b7b058b1ca 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lief-project/LIEF - REF 0.12.0 - SHA512 07089996282ed9b8b9e3061f5b0e1f1711a54d316e8d602205b8eb99a24da762bf7d91143f52af5d75f7a5d94ea65caf08b3263e4e18935277d2aecc8330203b + REF 0.12.1 + SHA512 833a04ece5ff7365717aee3408a2d522756319e43cf4ff795047021c46b48d5d525c2a56cdafd04259ddfcf6888972d19655924f999460ce05f52a32ac7e8bca HEAD_REF master PATCHES 0001-Support-vcpkg.patch @@ -11,7 +11,6 @@ vcpkg_from_github( vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES "tests" LIEF_TESTS # Enable tests - "doc" LIEF_DOC # Enable documentation "c-api" LIEF_C_API # C API "examples" LIEF_EXAMPLES # Build LIEF C++ examples "force32" LIEF_FORCE32 # Force build LIEF 32 bits version diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index 2e50109749c8b3..0e57ee0689ef3a 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -1,6 +1,6 @@ { "name": "lief", - "version-semver": "0.12.0", + "version-semver": "0.12.1", "description": "LIEF - Library to Instrument Executable Formats", "homepage": "https://lief.quarkslab.com", "license": "Apache-2.0", @@ -52,9 +52,6 @@ "disable-frozen": { "description": "Disable Frozen even if it is supported" }, - "doc": { - "description": "Enable documentation" - }, "elf": { "description": "Build LIEF with ELF module" }, From a3767d36ca3dc4b5ab8acaf48391186f9f86d88a Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Tue, 12 Apr 2022 10:54:04 -0400 Subject: [PATCH 79/81] Update version --- versions/baseline.json | 2 +- versions/l-/lief.json | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index 710c5708e5f7c4..1242f7be44caa8 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4221,7 +4221,7 @@ "port-version": 3 }, "lief": { - "baseline": "0.12.0", + "baseline": "0.12.1", "port-version": 0 }, "lilv": { diff --git a/versions/l-/lief.json b/versions/l-/lief.json index 5cea53af3987e6..ee3b8c8e9f11c9 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,13 +1,8 @@ { "versions": [ { - "git-tree": "122bcad08ea144f61ec59980340d33da82c4c2bd", - "version-semver": "0.12.0", - "port-version": 0 - }, - { - "git-tree": "caf1c9aaa488f2153ac9c63639cd915684df6dca", - "version": "0.11.5", + "git-tree": "67d3cebd92f954449b337f67acfe6775fa2398d2", + "version-semver": "0.12.1", "port-version": 0 } ] From 579845ce8a3d1c29b3d5dd6eaa4d156dba867046 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Tue, 12 Apr 2022 11:13:28 -0400 Subject: [PATCH 80/81] Fix frozen feature --- ports/lief/portfile.cmake | 5 ++--- ports/lief/vcpkg.json | 11 +++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ports/lief/portfile.cmake b/ports/lief/portfile.cmake index 26f3b7b058b1ca..bd9e87e1f54138 100644 --- a/ports/lief/portfile.cmake +++ b/ports/lief/portfile.cmake @@ -42,9 +42,8 @@ FEATURES # Profiling "profiling" LIEF_PROFILING # Enable performance profiling - # INVERTED_FEATURES - # TODO: Not sure how to remove a dependency from list of defaults - # "disable-frozen" LIEF_DISABLE_FROZEN # Disable Frozen even if it is supported +INVERTED_FEATURES + "enable-frozen" LIEF_DISABLE_FROZEN # Disable Frozen even if it is supported ) vcpkg_cmake_configure( diff --git a/ports/lief/vcpkg.json b/ports/lief/vcpkg.json index 0e57ee0689ef3a..c13aafeff1ffd9 100644 --- a/ports/lief/vcpkg.json +++ b/ports/lief/vcpkg.json @@ -7,7 +7,6 @@ "supports": "!uwp", "dependencies": [ "boost-leaf", - "frozen", "mbedtls", "spdlog", "tcb-span", @@ -26,6 +25,7 @@ "c-api", "dex", "elf", + "enable-frozen", "enable-json", "logging", "macho", @@ -49,12 +49,15 @@ "dex": { "description": "Build LIEF with DEX module" }, - "disable-frozen": { - "description": "Disable Frozen even if it is supported" - }, "elf": { "description": "Build LIEF with ELF module" }, + "enable-frozen": { + "description": "Enable Frozen", + "dependencies": [ + "frozen" + ] + }, "enable-json": { "description": "Enable JSON-related APIs", "dependencies": [ From 9c49449c3b05a30042e5d85f3a83e48d63670911 Mon Sep 17 00:00:00 2001 From: Eric Kilmer Date: Tue, 12 Apr 2022 11:14:39 -0400 Subject: [PATCH 81/81] Update version --- versions/l-/lief.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/l-/lief.json b/versions/l-/lief.json index ee3b8c8e9f11c9..8939d6a470c273 100644 --- a/versions/l-/lief.json +++ b/versions/l-/lief.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "67d3cebd92f954449b337f67acfe6775fa2398d2", + "git-tree": "0254c0f0d69dc63cfa589ae705d39ecc4bd9bd00", "version-semver": "0.12.1", "port-version": 0 }