diff options
author | Jamie Quigley <jamie@quigley.xyz> | 2022-06-27 21:59:02 +0100 |
---|---|---|
committer | Jamie Quigley <jamie@quigley.xyz> | 2022-07-15 18:37:59 +0100 |
commit | b86abe5cf424b9ea6ae5a550489b17e6cc42a06e (patch) | |
tree | 2cfbb4022efbb022b1737088538b678a5957704a /pkgs/applications/networking/instant-messengers/discord | |
parent | b4093a24a868708c06d93e9edf13de0b3228b9c7 (diff) |
discord: enable aarch64-darwin support for discord-canary
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/discord')
-rw-r--r-- | pkgs/applications/networking/instant-messengers/discord/default.nix | 95 |
1 files changed, 49 insertions, 46 deletions
diff --git a/pkgs/applications/networking/instant-messengers/discord/default.nix b/pkgs/applications/networking/instant-messengers/discord/default.nix index 8407927d81897..f3af6d9e8bf1b 100644 --- a/pkgs/applications/networking/instant-messengers/discord/default.nix +++ b/pkgs/applications/networking/instant-messengers/discord/default.nix @@ -10,21 +10,14 @@ let canary = "0.0.283"; }; version = versions.${branch}; - srcs = let - darwin-ptb = fetchurl { - url = "https://dl-ptb.discordapp.net/apps/osx/${version}/DiscordPTB.dmg"; - sha256 = "sha256-LS7KExVXkOv8O/GrisPMbBxg/pwoDXIOo1dK9wk1yB8="; - }; - in { + srcs = rec { x86_64-linux = { stable = fetchurl { - url = - "https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz"; + url = "https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz"; sha256 = "1hl01rf3l6kblx5v7rwnwms30iz8zw6dwlkjsx2f1iipljgkh5q4"; }; ptb = fetchurl { - url = - "https://dl-ptb.discordapp.net/apps/linux/${version}/discord-ptb-${version}.tar.gz"; + url = "https://dl-ptb.discordapp.net/apps/linux/${version}/discord-ptb-${version}.tar.gz"; sha256 = "d78NnQZ3MkLje8mHrI6noH2iD2oEvSJ3cDnsmzQsUYc="; }; canary = fetchurl { @@ -32,20 +25,25 @@ let sha256 = "sha256-OrGg4jXziesHBhQORxREN/wq776RgNGaTyjJNV4pSAU="; }; }; - x86_64-darwin = { - stable = fetchurl { - url = "https://dl.discordapp.net/apps/osx/${version}/Discord.dmg"; - sha256 = "1jvlxmbfqhslsr16prsgbki77kq7i3ipbkbn67pnwlnis40y9s7p"; + aarch64-darwin = { + ptb = fetchurl { + url = "https://dl-ptb.discordapp.net/apps/osx/${version}/DiscordPTB.dmg"; + sha256 = "sha256-LS7KExVXkOv8O/GrisPMbBxg/pwoDXIOo1dK9wk1yB8="; }; - ptb = darwin-ptb; canary = fetchurl { - url = - "https://dl-canary.discordapp.net/apps/osx/${version}/DiscordCanary.dmg"; + url = "https://dl-canary.discordapp.net/apps/osx/${version}/DiscordCanary.dmg"; sha256 = "0mqpk1szp46mih95x42ld32rrspc6jx1j7qdaxf01whzb3d4pi9l"; }; }; - # Only PTB bundles a MachO Universal binary with ARM support. - aarch64-darwin = { ptb = darwin-ptb; }; + # Stable does not (yet) provide aarch64-darwin support. PTB and Canary, however, do. + x86_64-darwin = + aarch64-darwin + // { + stable = fetchurl { + url = "https://dl.discordapp.net/apps/osx/${version}/Discord.dmg"; + sha256 = "1jvlxmbfqhslsr16prsgbki77kq7i3ipbkbn67pnwlnis40y9s7p"; + }; + }; }; src = srcs.${stdenv.hostPlatform.system}.${branch}; @@ -57,35 +55,40 @@ let license = licenses.unfree; maintainers = with maintainers; [ ldesgoui MP2E devins2518 ]; platforms = [ "x86_64-linux" "x86_64-darwin" ] - ++ lib.optionals (branch == "ptb") [ "aarch64-darwin" ]; + ++ lib.optionals (branch != "stable") [ "aarch64-darwin" ]; }; - package = if stdenv.isLinux then ./linux.nix else ./darwin.nix; + package = + if stdenv.isLinux + then ./linux.nix + else ./darwin.nix; openasar = callPackage ./openasar.nix { }; - packages = (builtins.mapAttrs - (_: value: callPackage package - (value // { - inherit src version openasar; - 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"; - }; - } + packages = ( + builtins.mapAttrs + (_: value: + callPackage package (value + // { + inherit src version openasar; + 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} +in +packages.${branch} |