2021-07-21 07:28:18 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, python3, texinfo, makeWrapper }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "ponysay";
|
2021-10-28 06:52:43 +00:00
|
|
|
version = "unstable-2021-03-27";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "erkin";
|
|
|
|
repo = "ponysay";
|
2021-10-28 06:52:43 +00:00
|
|
|
rev = "8a2c71416e70e4e7b0931917ebfd6479f51ddf9a";
|
|
|
|
sha256 = "sha256-LNc83E+7NFYYILORElNlYC7arQKGUJHv6phu+vM5xpQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2021-07-21 07:28:18 +00:00
|
|
|
buildInputs = [ python3 texinfo ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
inherit python3;
|
|
|
|
|
|
|
|
installPhase = ''
|
2024-09-19 14:19:46 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
find -type f -name "*.py" | xargs sed -i "s@/usr/bin/env python3@$python3/bin/python3@g"
|
|
|
|
substituteInPlace setup.py --replace \
|
|
|
|
"fileout.write(('#!/usr/bin/env %s\n' % env).encode('utf-8'))" \
|
|
|
|
"fileout.write(('#!%s/bin/%s\n' % (os.environ['python3'], env)).encode('utf-8'))"
|
|
|
|
python3 setup.py --prefix=$out --freedom=partial install \
|
|
|
|
--with-shared-cache=$out/share/ponysay \
|
|
|
|
--with-bash
|
2024-09-19 14:19:46 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Cowsay reimplemention for ponies";
|
|
|
|
homepage = "https://github.com/erkin/ponysay";
|
2021-07-21 07:28:18 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ bodil ];
|
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|