From 58b812f7496dffb22a690267a3c74bbe5a12589d Mon Sep 17 00:00:00 2001 From: Benjamin Hipple Date: Sun, 12 Apr 2020 11:55:36 -0400 Subject: [PATCH] discord-{ptb,canary}: update to latest versions and fixup updateScript This commit: - Moves the update script into the dir, out of the maintainers dir. This makes it more discoverable in general. It can also be invoked from anywhere to write to default.nix - Swaps it to use the standardized `passthru.updateScript`. This means that eventually bots like `nixpkgs-update` will be able to handle it. - Runs the script to upgrade to the latest versions See https://nixos.org/nixpkgs/manual/#ssec-stdenv-attributes --- .../networking/instant-messengers/discord/base.nix | 2 ++ .../networking/instant-messengers/discord/default.nix | 10 +++++----- .../instant-messengers/discord/update-discord.sh | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) rename maintainers/scripts/update-discord => pkgs/applications/networking/instant-messengers/discord/update-discord.sh (85%) diff --git a/pkgs/applications/networking/instant-messengers/discord/base.nix b/pkgs/applications/networking/instant-messengers/discord/base.nix index 6e4a914ecb0e..8f4f16673d25 100644 --- a/pkgs/applications/networking/instant-messengers/discord/base.nix +++ b/pkgs/applications/networking/instant-messengers/discord/base.nix @@ -51,6 +51,8 @@ in stdenv.mkDerivation rec { mimeType = "x-scheme-handler/discord"; }; + passthru.updateScript = ./update-discord.sh; + meta = with stdenv.lib; { description = "All-in-one cross-platform voice and text chat for gamers"; homepage = "https://discordapp.com/"; diff --git a/pkgs/applications/networking/instant-messengers/discord/default.nix b/pkgs/applications/networking/instant-messengers/discord/default.nix index ab15cbb22af4..926ddeeb0483 100644 --- a/pkgs/applications/networking/instant-messengers/discord/default.nix +++ b/pkgs/applications/networking/instant-messengers/discord/default.nix @@ -1,5 +1,5 @@ { branch ? "stable", pkgs }: -# Generated by /maintainers/scripts/update-discord +# Generated by ./update-discord.sh let inherit (pkgs) callPackage fetchurl; in { @@ -17,20 +17,20 @@ in { pname = "discord-ptb"; binaryName = "DiscordPTB"; desktopName = "Discord PTB"; - version = "0.0.18"; + version = "0.0.19"; src = fetchurl { url = "https://dl-ptb.discordapp.net/apps/linux/${version}/discord-ptb-${version}.tar.gz"; - sha256 = "1v9xph7shpmabwysbc08qqlkydzgsir8rwarrjf01xmpcpyia17g"; + sha256 = "0wixmm16qsmgbr0l9144vl5pc3s2p4jqhl7cnc6kmgy1y4ig56ib"; }; }; canary = callPackage ./base.nix rec { pname = "discord-canary"; binaryName = "DiscordCanary"; desktopName = "Discord Canary"; - version = "0.0.102"; + version = "0.0.103"; src = fetchurl { url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz"; - sha256 = "1zl53vprkwbkfn3v0lddpp1swignqjxksi4qxl5zqj7482j372a4"; + sha256 = "1d95q75ak4z6wkxlgcmkl7yk20gl7zf568b0xslz42hwx032fn4z"; }; }; }.${branch} diff --git a/maintainers/scripts/update-discord b/pkgs/applications/networking/instant-messengers/discord/update-discord.sh similarity index 85% rename from maintainers/scripts/update-discord rename to pkgs/applications/networking/instant-messengers/discord/update-discord.sh index b4c26b3bdefd..34c1574c65aa 100755 --- a/maintainers/scripts/update-discord +++ b/pkgs/applications/networking/instant-messengers/discord/update-discord.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash -# script to generate `pkgs/networking/instant-messengers/discord/default.nix` +# script to generate ./default.nix set -e -exec >${1:?usage: $0 } +exec >"${BASH_SOURCE%/*}/default.nix" cat <