aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/discord-rpc
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/discord-rpc')
-rw-r--r--vcpkg/ports/discord-rpc/disable-downloading.patch21
-rw-r--r--vcpkg/ports/discord-rpc/portfile.cmake31
-rw-r--r--vcpkg/ports/discord-rpc/vcpkg.json15
3 files changed, 67 insertions, 0 deletions
diff --git a/vcpkg/ports/discord-rpc/disable-downloading.patch b/vcpkg/ports/discord-rpc/disable-downloading.patch
new file mode 100644
index 0000000..bb85049
--- /dev/null
+++ b/vcpkg/ports/discord-rpc/disable-downloading.patch
@@ -0,0 +1,21 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5dad9e9..961f02d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -12,6 +12,7 @@ file(GLOB_RECURSE ALL_SOURCE_FILES
+ src/*.cpp src/*.h src/*.c
+ )
+
++if(0)
+ # Set CLANG_FORMAT_SUFFIX if you are using custom clang-format, e.g. clang-format-5.0
+ find_program(CLANG_FORMAT_CMD clang-format${CLANG_FORMAT_SUFFIX})
+
+@@ -43,7 +44,7 @@ if (NOT RAPIDJSONTEST)
+ )
+ file(REMOVE ${RJ_TAR_FILE})
+ endif(NOT RAPIDJSONTEST)
+-
++endif()
+ find_file(RAPIDJSON NAMES rapidjson rapidjson-1.1.0 PATHS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty CMAKE_FIND_ROOT_PATH_BOTH)
+
+ add_library(rapidjson STATIC IMPORTED ${RAPIDJSON})
diff --git a/vcpkg/ports/discord-rpc/portfile.cmake b/vcpkg/ports/discord-rpc/portfile.cmake
new file mode 100644
index 0000000..e2d7b0a
--- /dev/null
+++ b/vcpkg/ports/discord-rpc/portfile.cmake
@@ -0,0 +1,31 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO discordapp/discord-rpc
+ REF "v${VERSION}"
+ SHA512 ca981b833aff5f21fd629a704deadd8e3fb5423d959ddb75e381313f6462d984c567671b10c8f031905c08d85792ddbe2dddc402ba2613c42de9e80fc68d0d51
+ HEAD_REF master
+ PATCHES disable-downloading.patch
+)
+
+string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_CRT)
+file(REMOVE_RECURSE "${SOURCE_PATH}/thirdparty")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DUSE_STATIC_CRT=${STATIC_CRT}
+ -DBUILD_EXAMPLES=OFF
+ "-DRAPIDJSON=${CURRENT_INSTALLED_DIR}"
+)
+
+if(EXISTS "${SOURCE_PATH}/thirdparty")
+ message(FATAL_ERROR "The source directory should not be modified during the build.")
+endif()
+
+vcpkg_cmake_install()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
+
+vcpkg_copy_pdbs()
diff --git a/vcpkg/ports/discord-rpc/vcpkg.json b/vcpkg/ports/discord-rpc/vcpkg.json
new file mode 100644
index 0000000..addeb8e
--- /dev/null
+++ b/vcpkg/ports/discord-rpc/vcpkg.json
@@ -0,0 +1,15 @@
+{
+ "name": "discord-rpc",
+ "version": "3.4.0",
+ "port-version": 4,
+ "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.",
+ "homepage": "https://github.com/discordapp/discord-rpc",
+ "license": "MIT",
+ "dependencies": [
+ "rapidjson",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ }
+ ]
+}