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

54 lines
1.4 KiB
Nix
Raw Normal View History

2023-03-25 11:05:23 +00:00
{ lib, stdenv, perl, fetchFromGitHub, fetchpatch, makeWrapper, nix-update-script, testers, cowsay }:
2016-11-05 03:04:05 +00:00
stdenv.mkDerivation rec {
pname = "cowsay";
2023-01-08 21:32:18 +00:00
version = "3.7.0";
outputs = [ "out" "man" ];
2016-11-05 03:04:05 +00:00
2021-05-25 15:29:37 +00:00
src = fetchFromGitHub {
2023-01-08 21:32:18 +00:00
owner = "cowsay-org";
repo = "cowsay";
rev = "v${version}";
hash = "sha256-t1grmCPQhRgwS64RjEwkK61F2qxxMBKuv0/DzBTnL3s=";
2016-11-05 03:04:05 +00:00
};
2023-01-08 21:32:18 +00:00
patches = [
# Install cowthink as a symlink, not a copy
# See https://github.com/cowsay-org/cowsay/pull/18
(fetchpatch {
url = "https://github.com/cowsay-org/cowsay/commit/9e129fa0933cf1837672c97f5ae5ad4a1a10ec11.patch";
hash = "sha256-zAYEUAM5MkyMONAl5BXj8hBHRalQVAOdpxgiM+Ewmlw=";
})
];
2023-03-25 11:05:23 +00:00
nativeBuildInputs = [ makeWrapper ];
2023-01-08 21:32:18 +00:00
buildInputs = [ perl ];
2021-05-25 15:29:37 +00:00
2023-03-25 11:05:23 +00:00
postInstall = ''
wrapProgram $out/bin/cowsay \
--suffix COWPATH : $out/share/cowsay/cows
'';
2023-01-08 21:32:18 +00:00
makeFlags = [
"prefix=${placeholder "out"}"
];
2016-11-05 03:04:05 +00:00
2023-01-08 21:32:18 +00:00
passthru = {
updateScript = nix-update-script { };
tests.version = testers.testVersion {
package = cowsay;
command = "cowsay --version";
};
};
2021-05-25 15:29:37 +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";
2023-01-08 21:32:18 +00:00
homepage = "https://cowsay.diamonds";
changelog = "https://github.com/cowsay-org/cowsay/releases/tag/v${version}";
2021-05-25 15:29:37 +00:00
license = licenses.gpl3Only;
2018-08-15 18:21:16 +00:00
platforms = platforms.all;
maintainers = with maintainers; [ rob anthonyroussel ];
2016-11-05 03:04:05 +00:00
};
}