Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / discord-gamesdk / default.nix
blob86e1a70accdeacf35d564271b7aae75e947b6601
1 { lib
2 , stdenv
3 , fetchzip
4 , autoPatchelfHook
5 }:
7 stdenv.mkDerivation rec {
8   pname = "discord-gamesdk";
9   version = "3.2.1";
11   src = fetchzip {
12     url = "https://dl-game-sdk.discordapp.net/${version}/discord_game_sdk.zip";
13     sha256 = "sha256-83DgL9y3lHLLJ8vgL3EOVk2Tjcue64N+iuDj/UpSdLc=";
14     stripRoot = false;
15   };
17   outputs = [ "out" "dev" ];
19   buildInputs = [ (stdenv.cc.cc.libgcc or null) ];
21   nativeBuildInputs = [ autoPatchelfHook ];
23   installPhase =
24     let
25       processor = stdenv.hostPlatform.uname.processor;
26       sharedLibrary = stdenv.hostPlatform.extensions.sharedLibrary;
27     in
28     ''
29       runHook preInstall
31       install -Dm555 lib/${processor}/discord_game_sdk${sharedLibrary} $out/lib/discord_game_sdk${sharedLibrary}
33       install -Dm444 c/discord_game_sdk.h $dev/lib/include/discord_game_sdk.h
35       runHook postInstall
36     '';
38   meta = with lib; {
39     homepage = "https://discord.com/developers/docs/game-sdk/sdk-starter-guide";
40     description = "Library to allow other programs to interact with the Discord desktop application";
41     license = licenses.unfree;
42     maintainers = with maintainers; [ tomodachi94 ];
43     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
44     platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "x86_64-windows" ];
45   };