nixpkgs/pkgs/tools/misc/cowsay/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.2 KiB
Nix
Raw Normal View History

2021-05-25 15:29:37 +00:00
{ lib, stdenv, perl, installShellFiles, fetchFromGitHub }:
2016-11-05 03:04:05 +00:00
stdenv.mkDerivation rec {
pname = "cowsay";
2021-05-25 15:29:37 +00:00
version = "3.04";
2016-11-05 03:04:05 +00:00
2021-05-25 15:29:37 +00:00
src = fetchFromGitHub {
owner = "tnalpgge";
repo = "rank-amateur-cowsay";
rev = "cowsay-${version}";
sha256 = "sha256-9jCaQ6Um6Nl9j0/urrMCRcsGeubRN3VWD3jDM/AshRg=";
2016-11-05 03:04:05 +00:00
};
buildInputs = [ perl ];
2021-05-25 15:29:37 +00:00
nativeBuildInputs = [ installShellFiles ];
# overriding buildPhase because we don't want to use the install.sh script
buildPhase = ''
runHook preBuild;
substituteInPlace cowsay --replace "%BANGPERL%" "!${perl}/bin/perl" \
--replace "%PREFIX%" "$out"
2021-05-25 15:29:37 +00:00
runHook postBuild;
'';
2016-11-05 03:04:05 +00:00
installPhase = ''
2021-05-25 15:29:37 +00:00
runHook preInstall
install -Dm755 cowsay $out/bin/cowsay
ln -s $out/bin/cowsay $out/bin/cowthink
installManPage cowsay.1
ln -s $man/share/man/man1/cowsay.1.gz $man/share/man/man1/cowthink.1.gz
install -Dm644 cows/* -t $out/share/cows/
runHook postInstall
2016-11-05 03:04:05 +00:00
'';
2021-05-25 15:29:37 +00:00
outputs = [ "out" "man" ];
meta = with lib; {
2016-11-05 03:04:05 +00:00
description = "A program which generates ASCII pictures of a cow with a message";
2021-05-25 15:29:37 +00:00
homepage = "https://github.com/tnalpgge/rank-amateur-cowsay";
license = licenses.gpl3Only;
2018-08-15 18:21:16 +00:00
platforms = platforms.all;
maintainers = [ maintainers.rob ];
2016-11-05 03:04:05 +00:00
};
}