-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overlay ports for projects (sleigh, lief) that don't exist in upstream vcpkg repo and/or are required overlays (mbedtls v3) because upstream won't accept them due to single-version package policy and mandatory compatibility of all existing packages. This uses a development version of sleigh that does a large refactor of the CMake and some target names. The lief portfile was copied from an existing PR
- Loading branch information
Showing
12 changed files
with
613 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
From 426d8167648fff0ad79832a701223b8171dad096 Mon Sep 17 00:00:00 2001 | ||
From: Eric Kilmer <[email protected]> | ||
Date: Tue, 12 Apr 2022 10:42:27 -0400 | ||
Subject: [PATCH] Support vcpkg | ||
|
||
Remove msvccrt choosing and fix install paths on Windows | ||
--- | ||
CMakeLists.txt | 7 ++----- | ||
1 file changed, 2 insertions(+), 5 deletions(-) | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index b89d0522..9ca50c35 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) | ||
set(CMAKE_INSTALL_LIBDIR "lib") | ||
else() | ||
@@ -688,7 +685,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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
diff --git a/LIEFConfig.cmake.in b/LIEFConfig.cmake.in | ||
index 8c35eeab..ea09099f 100644 | ||
--- a/LIEFConfig.cmake.in | ||
+++ b/LIEFConfig.cmake.in | ||
@@ -165,7 +165,8 @@ set(LIEF_LIBRARIES LIEF::LIEF) | ||
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") | ||
+if(LIEF_INCLUDE_DIR) | ||
+if(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}") | ||
@@ -177,3 +178,4 @@ 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() | ||
+endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO lief-project/LIEF | ||
REF 0.12.1 | ||
SHA512 833a04ece5ff7365717aee3408a2d522756319e43cf4ff795047021c46b48d5d525c2a56cdafd04259ddfcf6888972d19655924f999460ce05f52a32ac7e8bca | ||
HEAD_REF master | ||
PATCHES | ||
0001-Support-vcpkg.patch | ||
0002-Fix-Uninitialized-CMake-var.patch | ||
) | ||
|
||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
FEATURES | ||
"tests" LIEF_TESTS # Enable tests | ||
"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 | ||
|
||
"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 | ||
"enable-frozen" LIEF_DISABLE_FROZEN # Disable Frozen even if it is supported | ||
) | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
|
||
OPTIONS | ||
${FEATURE_OPTIONS} | ||
|
||
-DLIEF_PYTHON_API=OFF | ||
-DLIEF_USE_CCACHE=OFF | ||
|
||
# Build with external vcpkg dependencies | ||
-DLIEF_OPT_MBEDTLS_EXTERNAL=ON | ||
-DLIEF_OPT_UTFCPP_EXTERNAL=ON | ||
-DLIEF_EXTERNAL_SPDLOG=ON | ||
-DLIEF_OPT_NLOHMANN_JSON_EXTERNAL=ON | ||
-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() | ||
|
||
vcpkg_cmake_config_fixup(CONFIG_PATH share/LIEF/cmake) | ||
|
||
vcpkg_copy_pdbs() | ||
|
||
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_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) | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/LIEF") | ||
endif() | ||
|
||
# Handle copyright | ||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
{ | ||
"name": "lief", | ||
"version-semver": "0.12.1", | ||
"description": "LIEF - Library to Instrument Executable Formats", | ||
"homepage": "https://lief.quarkslab.com", | ||
"license": "Apache-2.0", | ||
"supports": "!uwp", | ||
"dependencies": [ | ||
"boost-leaf", | ||
"mbedtls", | ||
"spdlog", | ||
"tcb-span", | ||
"utfcpp", | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
], | ||
"default-features": [ | ||
"art", | ||
"c-api", | ||
"dex", | ||
"elf", | ||
"enable-frozen", | ||
"enable-json", | ||
"logging", | ||
"macho", | ||
"oat", | ||
"pe", | ||
"vdex" | ||
], | ||
"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" | ||
}, | ||
"elf": { | ||
"description": "Build LIEF with ELF module" | ||
}, | ||
"enable-frozen": { | ||
"description": "Enable Frozen", | ||
"dependencies": [ | ||
"frozen" | ||
] | ||
}, | ||
"enable-json": { | ||
"description": "Enable JSON-related APIs", | ||
"dependencies": [ | ||
"nlohmann-json" | ||
] | ||
}, | ||
"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" | ||
}, | ||
"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" | ||
}, | ||
"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" | ||
} | ||
} | ||
} |
Oops, something went wrong.