aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackBoosY <47264268+JackBoosY@users.noreply.github.com>2019-08-02 08:50:06 +0800
committerPhil Christensen <philc@microsoft.com>2019-08-01 17:50:06 -0700
commited7822f5af596076143fe0d89bb1dba04ef26c8f (patch)
tree0b3fe1e672248030ccd16ca23a68ceeff2ab4455
parentae6ca87221cf71fc217bff65f0df0808da17a047 (diff)
downloadvcpkg-ed7822f5af596076143fe0d89bb1dba04ef26c8f.tar.gz
vcpkg-ed7822f5af596076143fe0d89bb1dba04ef26c8f.zip
[easyhook]Add new port. (#7487)
* [easyhook]Add new port. * [easyhook]Replace files with a patch, add Description, use .Net framework 4.0. * [easyhook]Set ONLY_DYNAMIC_CRT. * [easyhook]Print error message when building static library.
-rw-r--r--ports/easyhook/CONTROL4
-rw-r--r--ports/easyhook/fix-build.patch128
-rw-r--r--ports/easyhook/portfile.cmake38
3 files changed, 170 insertions, 0 deletions
diff --git a/ports/easyhook/CONTROL b/ports/easyhook/CONTROL
new file mode 100644
index 000000000..a47eb803d
--- /dev/null
+++ b/ports/easyhook/CONTROL
@@ -0,0 +1,4 @@
+Source: easyhook
+Version: 2.7.6789.0
+Homepage: https://github.com/EasyHook/EasyHook
+Description: This project supports extending (hooking) unmanaged code (APIs) with pure managed ones, from within a fully managed environment on 32- or 64-bit Windows Vista x64, Windows Server 2008 x64, Windows 7, Windows 8.1, and Windows 10. \ No newline at end of file
diff --git a/ports/easyhook/fix-build.patch b/ports/easyhook/fix-build.patch
new file mode 100644
index 000000000..230faf65d
--- /dev/null
+++ b/ports/easyhook/fix-build.patch
@@ -0,0 +1,128 @@
+diff --git a/EasyHookDll/EasyHookDll.vcxproj b/EasyHookDll/EasyHookDll.vcxproj
+index ec66f91..5773555 100644
+--- a/EasyHookDll/EasyHookDll.vcxproj
++++ b/EasyHookDll/EasyHookDll.vcxproj
+@@ -188,7 +188,7 @@
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+- <SmallerTypeCheck>true</SmallerTypeCheck>
++ <SmallerTypeCheck>false</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+@@ -207,10 +207,6 @@
+ <TargetMachine>MachineX86</TargetMachine>
+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ </Link>
+- <PostBuildEvent>
+- <Command>copy "$(TargetPath)" "$(TargetDir)..\x64\EasyHook32.dll"
+-copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command>
+- </PostBuildEvent>
+ <MASM>
+ <UseSafeExceptionHandlers>false</UseSafeExceptionHandlers>
+ </MASM>
+@@ -223,7 +219,7 @@ copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+- <SmallerTypeCheck>true</SmallerTypeCheck>
++ <SmallerTypeCheck>false</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+@@ -242,10 +238,6 @@ copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command>
+ <TargetMachine>MachineX86</TargetMachine>
+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ </Link>
+- <PostBuildEvent>
+- <Command>copy "$(TargetPath)" "$(TargetDir)..\x64\EasyHook32.dll"
+-copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command>
+- </PostBuildEvent>
+ <MASM>
+ <UseSafeExceptionHandlers>false</UseSafeExceptionHandlers>
+ </MASM>
+@@ -261,7 +253,7 @@ copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+- <SmallerTypeCheck>true</SmallerTypeCheck>
++ <SmallerTypeCheck>false</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+@@ -278,10 +270,6 @@ copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command>
+ <SubSystem>Windows</SubSystem>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+- <PostBuildEvent>
+- <Command>copy "$(TargetPath)" "$(TargetDir)..\x86\EasyHook64.dll"
+-copy "$(TargetDir)EasyHook64.lib" "$(TargetDir)..\x86\EasyHook64.lib"</Command>
+- </PostBuildEvent>
+ <MASM>
+ <UseSafeExceptionHandlers>false</UseSafeExceptionHandlers>
+ </MASM>
+@@ -297,7 +285,7 @@ copy "$(TargetDir)EasyHook64.lib" "$(TargetDir)..\x86\EasyHook64.lib"</Command>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+- <SmallerTypeCheck>true</SmallerTypeCheck>
++ <SmallerTypeCheck>false</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+@@ -314,10 +302,6 @@ copy "$(TargetDir)EasyHook64.lib" "$(TargetDir)..\x86\EasyHook64.lib"</Command>
+ <SubSystem>Windows</SubSystem>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+- <PostBuildEvent>
+- <Command>copy "$(TargetPath)" "$(TargetDir)..\x86\EasyHook64.dll"
+-copy "$(TargetDir)EasyHook64.lib" "$(TargetDir)..\x86\EasyHook64.lib"</Command>
+- </PostBuildEvent>
+ <MASM>
+ <UseSafeExceptionHandlers>false</UseSafeExceptionHandlers>
+ </MASM>
+@@ -355,10 +339,6 @@ copy "$(TargetDir)EasyHook64.lib" "$(TargetDir)..\x86\EasyHook64.lib"</Command>
+ <TargetMachine>MachineX86</TargetMachine>
+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ </Link>
+- <PostBuildEvent>
+- <Command>copy "$(TargetPath)" "$(TargetDir)..\x64\EasyHook32.dll"
+-copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command>
+- </PostBuildEvent>
+ <MASM>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <UseSafeExceptionHandlers>false</UseSafeExceptionHandlers>
+@@ -397,10 +377,6 @@ copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command>
+ <TargetMachine>MachineX86</TargetMachine>
+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ </Link>
+- <PostBuildEvent>
+- <Command>copy "$(TargetPath)" "$(TargetDir)..\x64\EasyHook32.dll"
+-copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command>
+- </PostBuildEvent>
+ <MASM>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <UseSafeExceptionHandlers>false</UseSafeExceptionHandlers>
+@@ -439,10 +415,6 @@ copy "$(TargetDir)EasyHook32.lib" "$(TargetDir)..\x64\EasyHook32.lib"</Command>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+- <PostBuildEvent>
+- <Command>copy "$(TargetPath)" "$(TargetDir)..\x86\EasyHook64.dll"
+-copy "$(TargetDir)EasyHook64.lib" "$(TargetDir)..\x86\EasyHook64.lib"</Command>
+- </PostBuildEvent>
+ <MASM>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <UseSafeExceptionHandlers>false</UseSafeExceptionHandlers>
+@@ -481,10 +453,6 @@ copy "$(TargetDir)EasyHook64.lib" "$(TargetDir)..\x86\EasyHook64.lib"</Command>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+- <PostBuildEvent>
+- <Command>copy "$(TargetPath)" "$(TargetDir)..\x86\EasyHook64.dll"
+-copy "$(TargetDir)EasyHook64.lib" "$(TargetDir)..\x86\EasyHook64.lib"</Command>
+- </PostBuildEvent>
+ <MASM>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <UseSafeExceptionHandlers>false</UseSafeExceptionHandlers>
diff --git a/ports/easyhook/portfile.cmake b/ports/easyhook/portfile.cmake
new file mode 100644
index 000000000..d74457880
--- /dev/null
+++ b/ports/easyhook/portfile.cmake
@@ -0,0 +1,38 @@
+include(vcpkg_common_functions)
+
+if (NOT VCPKG_TARGET_IS_WINDOWS)
+ message(FATAL_ERROR "easyhook only support windows.")
+endif()
+
+if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ message(FATAL_ERROR "easyhook can only be built as dynamic library.")
+endif()
+
+message(".Net framework 4.0 is required, please install it before install easyhook.")
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO EasyHook/EasyHook
+ REF v2.7.6789.0
+ SHA512 a48b4fe6dd2e55a2d515bc917c0f3ff5b73f08d1778e671df802347c3b8e1d4638005582a494acdf891ffe3fa6eae3eab0096083a8af2352e3f0883eb83421d6
+ HEAD_REF master
+ PATCHES fix-build.patch
+)
+
+vcpkg_install_msbuild(
+ SOURCE_PATH ${SOURCE_PATH}
+ PROJECT_SUBPATH EasyHook.sln
+ TARGET EasyHookDll
+ RELEASE_CONFIGURATION "netfx4-Release"
+ DEBUG_CONFIGURATION "netfx4-Debug"
+)
+
+# These libraries are useless, so remove.
+file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/EasyHook.dll ${CURRENT_PACKAGES_DIR}/bin/EasyHook.pdb)
+file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/EasyHook.dll ${CURRENT_PACKAGES_DIR}/debug/bin/EasyHook.pdb)
+
+# Install includes
+file(INSTALL ${SOURCE_PATH}/Public/easyhook.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/easyhook)
+
+# Handle copyright
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/easyhook RENAME copyright)