2021-05-25 16:29:37 +01:00
|
|
|
{ lib, stdenv, perl, installShellFiles, fetchFromGitHub }:
|
2016-11-05 03:04:05 +00:00
|
|
|
|
2020-06-07 22:11:08 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "cowsay";
|
2021-05-25 16:29:37 +01:00
|
|
|
version = "3.04";
|
2016-11-05 03:04:05 +00:00
|
|
|
|
2021-05-25 16:29:37 +01: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 16:29:37 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
# overriding buildPhase because we don't want to use the install.sh script
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild;
|
2018-12-03 23:19:37 +00:00
|
|
|
substituteInPlace cowsay --replace "%BANGPERL%" "!${perl}/bin/perl" \
|
|
|
|
--replace "%PREFIX%" "$out"
|
2021-05-25 16:29:37 +01:00
|
|
|
runHook postBuild;
|
2018-12-03 23:19:37 +00:00
|
|
|
'';
|
|
|
|
|
2016-11-05 03:04:05 +00:00
|
|
|
installPhase = ''
|
2021-05-25 16:29:37 +01: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 16:29:37 +01:00
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
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 16:29:37 +01:00
|
|
|
homepage = "https://github.com/tnalpgge/rank-amateur-cowsay";
|
|
|
|
license = licenses.gpl3Only;
|
2018-08-15 19:21:16 +01:00
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = [ maintainers.rob ];
|
2016-11-05 03:04:05 +00:00
|
|
|
};
|
|
|
|
}
|