From 407b029dde2f8f01c116b46d387676ec8d35dace Mon Sep 17 00:00:00 2001 From: Tomo <68489118+Tomodachi94@users.noreply.github.com> Date: Sat, 28 Jan 2023 13:06:23 -0800 Subject: [PATCH] discord-gamesdk: init at 3.2.1 --- .../libraries/discord-gamesdk/default.nix | 41 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/libraries/discord-gamesdk/default.nix diff --git a/pkgs/development/libraries/discord-gamesdk/default.nix b/pkgs/development/libraries/discord-gamesdk/default.nix new file mode 100644 index 00000000000..513eebe7124 --- /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 2b7e2fad9bb..04d42e9379f 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; };