3
0
Fork 0
forked from mirrors/nixpkgs

discord: set meta.mainProgram to binaryName

Additionally, pull out repetitive pieces of the `packages` definition.
This commit is contained in:
Infinidoge 2022-02-11 09:10:30 -05:00 committed by GitHub
parent 7c48c0a0de
commit 0f47936e80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,24 +61,26 @@ let
++ lib.optionals (branch == "ptb") [ "aarch64-darwin" ];
};
package = if stdenv.isLinux then ./linux.nix else ./darwin.nix;
packages = {
stable = callPackage package rec {
inherit src version meta;
pname = "discord";
binaryName = "Discord";
desktopName = "Discord";
};
ptb = callPackage package rec {
inherit src version meta;
pname = "discord-ptb";
binaryName = "DiscordPTB";
desktopName = "Discord PTB";
};
canary = callPackage package rec {
inherit src version meta;
pname = "discord-canary";
binaryName = "DiscordCanary";
desktopName = "Discord Canary";
};
};
packages = (builtins.mapAttrs
(_: value: callPackage package (value // { inherit src version; meta = meta // { mainProgram = value.binaryName; }; }))
{
stable = rec {
pname = "discord";
binaryName = "Discord";
desktopName = "Discord";
};
ptb = rec {
pname = "discord-ptb";
binaryName = "DiscordPTB";
desktopName = "Discord PTB";
};
canary = rec {
pname = "discord-canary";
binaryName = "DiscordCanary";
desktopName = "Discord Canary";
};
}
);
in packages.${branch}