Merge pull request #177673 from MatthewCroughan/mc/discord.sh

discord-sh: init at unstable-2022-05-19
This commit is contained in:
Sandro 2022-06-15 14:28:46 +02:00 committed by GitHub
commit 0ee5bae3d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,50 @@
{ lib, stdenvNoCC, fetchFromGitHub, makeWrapper, curl, jq, coreutils }:
stdenvNoCC.mkDerivation {
pname = "discord-sh";
version = "unstable-2022-05-19";
src = fetchFromGitHub {
owner = "ChaoticWeg";
repo = "discord.sh";
rev = "6aaea548f88eb48b7adeef824fbddac1c4749447";
sha256 = "sha256-RoPhn/Ot4ID1nEbZEz1bd2iq8g7mU2e7kwNRvZOD/pc=";
};
# ignore Makefile by disabling buildPhase. Upstream Makefile tries to download
# binaries from the internet for linting
dontBuild = true;
# discord.sh looks for the .webhook file in the source code directory, which
# isn't mutable on Nix
postPatch = ''
substituteInPlace discord.sh \
--replace 'thisdir="$(cd "$(dirname "$(readlink -f "''${BASH_SOURCE[0]}")")" && pwd)"' 'thisdir="$(pwd)"'
'';
nativeBuildInputs = [ makeWrapper ];
doInstallCheck = true;
installCheckPhase = ''
runHook preCheck
$out/bin/discord.sh --help
runHook postCheck
'';
installPhase = ''
runHook preInstall
install -Dm555 discord.sh $out/bin/discord.sh
wrapProgram $out/bin/discord.sh \
--set PATH "${lib.makeBinPath [ curl jq coreutils ]}"
runHook postInstall
'';
meta = with lib; {
description = "Write-only command-line Discord webhook integration written in 100% Bash script";
homepage = "https://github.com/ChaoticWeg/discord.sh";
license = licenses.gpl3;
platforms = platforms.unix;
maintainers = with maintainers; [ matthewcroughan ];
};
}

View File

@ -17087,6 +17087,8 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) AppKit; inherit (darwin.apple_sdk.frameworks) AppKit;
}; };
discord-sh = callPackage ../tools/networking/discord-sh { };
dlib = callPackage ../development/libraries/dlib { }; dlib = callPackage ../development/libraries/dlib { };
doctest = callPackage ../development/libraries/doctest { }; doctest = callPackage ../development/libraries/doctest { };