about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorTomo <68489118+Tomodachi94@users.noreply.github.com>2023-01-28 13:06:23 -0800
committerTomo <68489118+tomodachi94@users.noreply.github.com>2023-01-29 08:22:30 +0000
commit407b029dde2f8f01c116b46d387676ec8d35dace (patch)
tree43c9b7df6101c9546ec620f318055a715c66fe87 /pkgs
parente1cf19931b5a526db1ebcfc78c12ccd1233a2ee8 (diff)
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 2b7e2fad9bb48..04d42e9379ff3 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -19242,6 +19242,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;
   };