nixpkgs/pkgs/by-name/co/cowsay/package.nix
2024-08-24 22:47:59 +00:00

58 lines
1.2 KiB
Nix

{
lib,
fetchFromGitHub,
makeWrapper,
nix-update-script,
perl,
stdenv,
testers,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cowsay";
version = "3.8.3";
outputs = [
"out"
"man"
];
src = fetchFromGitHub {
owner = "cowsay-org";
repo = "cowsay";
rev = "v${finalAttrs.version}";
hash = "sha256-Bca+/a9jXsNnuBeYEjjtvZ1LsMMraLKiCn04CiS+uXU=";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ perl ];
makeFlags = [ "prefix=${placeholder "out"}" ];
postInstall = ''
wrapProgram $out/bin/cowsay \
--suffix COWPATH : $out/share/cowsay/cows
'';
passthru = {
updateScript = nix-update-script { };
tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "cowsay --version";
};
};
meta = with lib; {
description = "Program which generates ASCII pictures of a cow with a message";
homepage = "https://cowsay.diamonds";
changelog = "https://github.com/cowsay-org/cowsay/releases/tag/v${finalAttrs.version}";
license = licenses.gpl3Only;
platforms = platforms.all;
maintainers = with maintainers; [
rob
anthonyroussel
];
mainProgram = "cowsay";
};
})