aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/pe-parse
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/pe-parse')
-rw-r--r--vcpkg/ports/pe-parse/arm64-windows-fix.patch13
-rw-r--r--vcpkg/ports/pe-parse/no-werror.patch26
-rw-r--r--vcpkg/ports/pe-parse/portfile.cmake25
-rw-r--r--vcpkg/ports/pe-parse/vcpkg.json17
4 files changed, 81 insertions, 0 deletions
diff --git a/vcpkg/ports/pe-parse/arm64-windows-fix.patch b/vcpkg/ports/pe-parse/arm64-windows-fix.patch
new file mode 100644
index 0000000..44907c0
--- /dev/null
+++ b/vcpkg/ports/pe-parse/arm64-windows-fix.patch
@@ -0,0 +1,13 @@
+find_package(Filesystem) fails on arm64 Windows.
+We can remove it as it is only used for tests which are not built in vcpkg.
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -15,7 +15,6 @@ endif ()
+ include(cmake/compilation_flags.cmake)
+ # Greater c++17 filesystem compatibility (like with experimental)
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
+-find_package(Filesystem COMPONENTS Experimental Final REQUIRED)
+ list(APPEND GLOBAL_CXXFLAGS ${DEFAULT_CXX_FLAGS})
+
+ option(BUILD_SHARED_LIBS "Build Shared Libraries" ON)
diff --git a/vcpkg/ports/pe-parse/no-werror.patch b/vcpkg/ports/pe-parse/no-werror.patch
new file mode 100644
index 0000000..6fb2c55
--- /dev/null
+++ b/vcpkg/ports/pe-parse/no-werror.patch
@@ -0,0 +1,26 @@
+diff --git a/cmake/compilation_flags.cmake b/cmake/compilation_flags.cmake
+index 395f1b5..bb10165 100644
+--- a/cmake/compilation_flags.cmake
++++ b/cmake/compilation_flags.cmake
+@@ -26,7 +26,7 @@ else ()
+ -pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization
+ -Wformat=2 -Winit-self -Wlong-long -Wmissing-declarations -Wmissing-include-dirs -Wcomment
+ -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion
+- -Wsign-promo -Wstrict-overflow=5 -Wswitch-default -Wundef -Werror -Wunused -Wuninitialized
++ -Wsign-promo -Wstrict-overflow=5 -Wswitch-default -Wundef -Wunused -Wuninitialized
+ -Wno-missing-declarations -Wno-strict-overflow
+ )
+
+diff --git a/examples/peaddrconv/CMakeLists.txt b/examples/peaddrconv/CMakeLists.txt
+index fbad06a..02c8bcf 100644
+--- a/examples/peaddrconv/CMakeLists.txt
++++ b/examples/peaddrconv/CMakeLists.txt
+@@ -26,7 +26,7 @@ else ()
+ -pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization
+ -Wformat=2 -Winit-self -Wlong-long -Wmissing-declarations -Wmissing-include-dirs -Wcomment
+ -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion
+- -Wsign-promo -Wstrict-overflow=5 -Wswitch-default -Wundef -Werror -Wunused -Wuninitialized
++ -Wsign-promo -Wstrict-overflow=5 -Wswitch-default -Wundef -Wunused -Wuninitialized
+ -Wno-missing-declarations
+ )
+
diff --git a/vcpkg/ports/pe-parse/portfile.cmake b/vcpkg/ports/pe-parse/portfile.cmake
new file mode 100644
index 0000000..8abd4e8
--- /dev/null
+++ b/vcpkg/ports/pe-parse/portfile.cmake
@@ -0,0 +1,25 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO trailofbits/pe-parse
+ REF "v${VERSION}"
+ SHA512 fae9060c48e2cebdfbb742c52bc39c36335c1ad4fc7e6bc75a7da012f59d16497630d40ca814c8da71acc44dcce82983ebe13da3a0d389cc53032261fcd1f6bb
+ HEAD_REF master
+ PATCHES
+ arm64-windows-fix.patch
+ no-werror.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DBUILD_COMMAND_LINE_TOOLS=OFF
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/pe-parse")
+
+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)
diff --git a/vcpkg/ports/pe-parse/vcpkg.json b/vcpkg/ports/pe-parse/vcpkg.json
new file mode 100644
index 0000000..45761d0
--- /dev/null
+++ b/vcpkg/ports/pe-parse/vcpkg.json
@@ -0,0 +1,17 @@
+{
+ "name": "pe-parse",
+ "version": "2.1.1",
+ "description": "pe-parse is a principled, lightweight C/C++ PE parser",
+ "homepage": "https://github.com/trailofbits/pe-parse",
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}