2021-05-28 09:39:13 +00:00
|
|
|
{ lib, stdenv, perl, installShellFiles, fetchFromGitHub }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "cowsay";
|
2021-05-28 09:39:13 +00:00
|
|
|
version = "3.04";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tnalpgge";
|
|
|
|
repo = "rank-amateur-cowsay";
|
|
|
|
rev = "cowsay-${version}";
|
|
|
|
sha256 = "sha256-9jCaQ6Um6Nl9j0/urrMCRcsGeubRN3VWD3jDM/AshRg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ perl ];
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
# overriding buildPhase because we don't want to use the install.sh script
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild;
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace cowsay --replace "%BANGPERL%" "!${perl}/bin/perl" \
|
|
|
|
--replace "%PREFIX%" "$out"
|
2021-05-28 09:39:13 +00:00
|
|
|
runHook postBuild;
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-05-28 09:39:13 +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
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A program which generates ASCII pictures of a cow with a message";
|
2021-05-28 09:39:13 +00:00
|
|
|
homepage = "https://github.com/tnalpgge/rank-amateur-cowsay";
|
|
|
|
license = licenses.gpl3Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = [ maintainers.rob ];
|
|
|
|
};
|
|
|
|
}
|