2023-03-27 19:17:25 +00:00
|
|
|
{ lib, stdenv, perl, fetchFromGitHub, fetchpatch, makeWrapper, nix-update-script, testers, cowsay }:
|
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";
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "3.7.0";
|
|
|
|
|
|
|
|
outputs = [ "out" "man" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
src = fetchFromGitHub {
|
2023-01-11 07:51:40 +00:00
|
|
|
owner = "cowsay-org";
|
|
|
|
repo = "cowsay";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-t1grmCPQhRgwS64RjEwkK61F2qxxMBKuv0/DzBTnL3s=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-01-11 07:51:40 +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=";
|
|
|
|
})
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2023-01-11 07:51:40 +00:00
|
|
|
buildInputs = [ perl ];
|
2021-05-28 09:39:13 +00:00
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/cowsay \
|
|
|
|
--suffix COWPATH : $out/share/cowsay/cows
|
|
|
|
'';
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
makeFlags = [
|
|
|
|
"prefix=${placeholder "out"}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
tests.version = testers.testVersion {
|
|
|
|
package = cowsay;
|
|
|
|
command = "cowsay --version";
|
|
|
|
};
|
|
|
|
};
|
2021-05-28 09:39:13 +00:00
|
|
|
|
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";
|
2023-01-11 07:51:40 +00:00
|
|
|
homepage = "https://cowsay.diamonds";
|
|
|
|
changelog = "https://github.com/cowsay-org/cowsay/releases/tag/v${version}";
|
2021-05-28 09:39:13 +00:00
|
|
|
license = licenses.gpl3Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.all;
|
2023-01-11 07:51:40 +00:00
|
|
|
maintainers = with maintainers; [ rob anthonyroussel ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|