nixpkgs/pkgs/by-name/di/discord-gamesdk/package.nix
Ihar Hrachyshka 567e8dfd8e
treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

55 lines
1.4 KiB
Nix

{
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";
hash = "sha256-83DgL9y3lHLLJ8vgL3EOVk2Tjcue64N+iuDj/UpSdLc=";
stripRoot = false;
};
outputs = [
"out"
"dev"
];
buildInputs = [ (stdenv.cc.cc.libgcc or null) ];
nativeBuildInputs = lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook;
installPhase =
let
processor = stdenv.hostPlatform.parsed.cpu.name;
sharedLibrary = stdenv.hostPlatform.extensions.sharedLibrary;
in
''
runHook preInstall
install -Dm555 lib/${processor}/discord_game_sdk${sharedLibrary} $out/lib/discord_game_sdk${sharedLibrary}
install -Dm444 c/discord_game_sdk.h $dev/lib/include/discord_game_sdk.h
runHook postInstall
'';
meta = {
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 = lib.licenses.unfree;
maintainers = with lib.maintainers; [ tomodachi94 ];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
platforms = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
"x86_64-windows"
];
};
}