diff options
| author | Ted John <ted@brambles.org> | 2017-11-11 18:46:05 +0000 |
|---|---|---|
| committer | Ted John <ted@brambles.org> | 2017-11-11 19:57:27 +0000 |
| commit | e57d38a8128ddd278bc4249358c292923e867736 (patch) | |
| tree | ce252710ea6fb20c79ab38ca77a99e0b5bc62e37 | |
| parent | 50f6bc4e8f103c695f8754962dde0be03e32cbc5 (diff) | |
| download | vcpkg-e57d38a8128ddd278bc4249358c292923e867736.tar.gz vcpkg-e57d38a8128ddd278bc4249358c292923e867736.zip | |
[discord-rpc] Add v2.0.1
- Not properly configured for debug builds and always forced /MT. Fixed by patching cmake.
- Unable to stop building of examples, so delete afterwards.
| -rw-r--r-- | ports/discord-rpc/CONTROL | 3 | ||||
| -rw-r--r-- | ports/discord-rpc/fix-debug.diff | 24 | ||||
| -rw-r--r-- | ports/discord-rpc/portfile.cmake | 45 |
3 files changed, 72 insertions, 0 deletions
diff --git a/ports/discord-rpc/CONTROL b/ports/discord-rpc/CONTROL new file mode 100644 index 000000000..e6d3462aa --- /dev/null +++ b/ports/discord-rpc/CONTROL @@ -0,0 +1,3 @@ +Source: discord-rpc +Version: 2.0.1 +Description: Rich Presence allows you to leverage the totally overhauled "Now Playing" section in a Discord user's profile to help people play your game together. diff --git a/ports/discord-rpc/fix-debug.diff b/ports/discord-rpc/fix-debug.diff new file mode 100644 index 000000000..df33249b9 --- /dev/null +++ b/ports/discord-rpc/fix-debug.diff @@ -0,0 +1,24 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -30,7 +30,6 @@ if(WIN32) + set(BASE_RPC_SRC ${BASE_RPC_SRC} connection_win.cpp discord_register_win.cpp) + add_library(discord-rpc ${RPC_LIBRARY_TYPE} ${BASE_RPC_SRC}) + target_compile_options(discord-rpc PRIVATE /EHsc +- /MT + /Wall + /wd4100 # unreferenced formal parameter + /wd4514 # unreferenced inline +@@ -102,13 +101,10 @@ install( + EXPORT "discord-rpc" + RUNTIME + DESTINATION "bin" +- CONFIGURATIONS Release + LIBRARY + DESTINATION "lib" +- CONFIGURATIONS Release + ARCHIVE + DESTINATION "lib" +- CONFIGURATIONS Release + INCLUDES + DESTINATION "include" + ) diff --git a/ports/discord-rpc/portfile.cmake b/ports/discord-rpc/portfile.cmake new file mode 100644 index 000000000..ea59126a3 --- /dev/null +++ b/ports/discord-rpc/portfile.cmake @@ -0,0 +1,45 @@ +include(vcpkg_common_functions) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO discordapp/discord-rpc + REF v2.0.1 + SHA512 496f8f34184c4be3c3341b05ebd440a9e89e36ecf15747ea8f4d1cc0404f1341404fda6c8358a2c08e0149023775472ea78603b9d41687f1004828523debda99 + HEAD_REF master +) + +vcpkg_apply_patches( + SOURCE_PATH + ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/fix-debug.diff +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(BUILD_DYNAMIC_LIB ON) +else() + set(BUILD_DYNAMIC_LIB OFF) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_DYNAMIC_LIB=${BUILD_DYNAMIC_LIB} +) + +vcpkg_install_cmake() + +# Remove bin and debug include +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin + ${CURRENT_PACKAGES_DIR}/debug/bin) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/send-presence.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/send-presence.exe) +endif() +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Copy copright information +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/discord-rpc" RENAME "copyright") + +vcpkg_copy_pdbs() |
