forked from mirrors/nixpkgs
slack-cli: remove wrapper package
This commit is contained in:
parent
0a57de6f5b
commit
026f49e28c
3 changed files with 36 additions and 45 deletions
|
@ -5,9 +5,22 @@
|
||||||
# for token storage, except that it would make the Nix package inconsistent with
|
# for token storage, except that it would make the Nix package inconsistent with
|
||||||
# upstream and other distributions.
|
# upstream and other distributions.
|
||||||
|
|
||||||
{ stdenv, fetchFromGitHub }:
|
{ stdenv, lib, writeShellScriptBin, fetchFromGitHub, curl, jq }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let
|
||||||
|
wrapper = writeShellScriptBin "slack" ''
|
||||||
|
[ "$1" = "init" -a -z "$SLACK_CLI_TOKEN" ] && cat >&2 <<-'MESSAGE'
|
||||||
|
WARNING: slack-cli must be configured using the SLACK_CLI_TOKEN environment
|
||||||
|
variable. Using `slack init` will not work because it tries to write to the
|
||||||
|
Nix store.
|
||||||
|
|
||||||
|
MESSAGE
|
||||||
|
|
||||||
|
export PATH=${lib.makeBinPath [ curl jq ]}:"$PATH"
|
||||||
|
exec "$(dirname "$0")/.slack-wrapped" "$@"
|
||||||
|
'';
|
||||||
|
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
name = "slack-cli-${version}";
|
name = "slack-cli-${version}";
|
||||||
version = "0.18.0";
|
version = "0.18.0";
|
||||||
|
|
||||||
|
@ -22,12 +35,13 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p "$out/bin"
|
mkdir -p "$out/bin"
|
||||||
cp src/slack "$out/bin"
|
cp src/slack "$out/bin/.slack-wrapped"
|
||||||
|
ln -s ${wrapper}/bin/slack "$out/bin/slack"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
license = stdenv.lib.licenses.mit;
|
license = lib.licenses.mit;
|
||||||
maintainers = [ stdenv.lib.maintainers.qyliss ];
|
maintainers = [ lib.maintainers.qyliss ];
|
||||||
platforms = stdenv.lib.platforms.unix;
|
platforms = lib.platforms.unix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
{ lib, writeShellScriptBin, curl, jq }:
|
|
||||||
|
|
||||||
slack-cli:
|
|
||||||
|
|
||||||
(writeShellScriptBin "slack" ''
|
|
||||||
[ "$1" = "init" -a -z "$SLACK_CLI_TOKEN" ] && cat >&2 <<-'MESSAGE'
|
|
||||||
WARNING: slack-cli must be configured using the SLACK_CLI_TOKEN environment
|
|
||||||
variable. Using `slack init` will not work because it tries to write to the
|
|
||||||
Nix store.
|
|
||||||
|
|
||||||
MESSAGE
|
|
||||||
|
|
||||||
export PATH=${lib.makeBinPath [ curl jq ]}:"$PATH"
|
|
||||||
exec ${slack-cli}/bin/slack "$@"
|
|
||||||
'') // {
|
|
||||||
unwrapped = slack-cli;
|
|
||||||
|
|
||||||
meta = slack-cli.meta;
|
|
||||||
name = slack-cli.name;
|
|
||||||
version = slack-cli.version;
|
|
||||||
}
|
|
|
@ -16695,9 +16695,7 @@ with pkgs;
|
||||||
|
|
||||||
slack = callPackage ../applications/networking/instant-messengers/slack { };
|
slack = callPackage ../applications/networking/instant-messengers/slack { };
|
||||||
|
|
||||||
wrapSlackCli = callPackage ../tools/networking/slack-cli/wrapper.nix { };
|
slack-cli = callPackage ../tools/networking/slack-cli { };
|
||||||
slack-cli-unwrapped = callPackage ../tools/networking/slack-cli { };
|
|
||||||
slack-cli = wrapSlackCli slack-cli-unwrapped;
|
|
||||||
|
|
||||||
singularity = callPackage ../applications/virtualization/singularity { };
|
singularity = callPackage ../applications/virtualization/singularity { };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue