about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorNick Cao <nickcao@nichi.co>2023-01-29 16:24:55 +0800
committerGitHub <noreply@github.com>2023-01-29 16:24:55 +0800
commit6224e5c235b22661b36ee9884405b9f441da9b66 (patch)
treef2d8199e9eb53007afce4c7f8ee97ba8cf747350 /pkgs
parentf75928f743771a45af270cee7848a07a2635f5b6 (diff)
parent407b029dde2f8f01c116b46d387676ec8d35dace (diff)
Merge pull request #213321 from tomodachi94/discord-gamesdk
discord-gamesdk: init at 3.2.1
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/libraries/discord-gamesdk/default.nix41
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/development/libraries/discord-gamesdk/default.nix b/pkgs/development/libraries/discord-gamesdk/default.nix
new file mode 100644
index 0000000000000..513eebe7124f4
--- /dev/null
+++ b/pkgs/development/libraries/discord-gamesdk/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, stdenv
+, fetchzip
+, autoPatchelfHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "discord-gamesdk";
+  version = "3.2.1";
+
+  src = fetchzip {
+    url = "https://dl-game-sdk.discordapp.net/${version}/discord_game_sdk.zip";
+    sha256 = "sha256-83DgL9y3lHLLJ8vgL3EOVk2Tjcue64N+iuDj/UpSdLc=";
+    stripRoot = false;
+  };
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+  ];
+
+  installPhase =
+    let
+      processor = stdenv.hostPlatform.uname.processor;
+      sharedLibrary = stdenv.hostPlatform.extensions.sharedLibrary;
+    in
+    ''
+      runHook preInstall
+
+      install -Dm555 lib/${processor}/discord_game_sdk${sharedLibrary} $out/lib/discord_game_sdk${sharedLibrary}
+
+      runHook postInstall
+    '';
+
+  meta = with lib; {
+    homepage = "https://discord.com/developers/docs/game-sdk/sdk-starter-guide";
+    description = "Library to allow other programs to interact with the Discord desktop application";
+    license = licenses.unfree;
+    maintainers = with maintainers; [ tomodachi94 ];
+    platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "x86_64-windows" ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 84588a3fb207a..1463780e90b6a 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -19309,6 +19309,8 @@ with pkgs;
 
   discordchatexporter-cli = callPackage ../tools/backup/discordchatexporter-cli { };
 
+  discord-gamesdk = callPackage ../development/libraries/discord-gamesdk { };
+
   discord-rpc = callPackage ../development/libraries/discord-rpc {
     inherit (darwin.apple_sdk.frameworks) AppKit;
   };