nixpkgs/pkgs/by-name/po/ponysay/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

41 lines
1.2 KiB
Nix

{ lib, stdenv, fetchFromGitHub, python3, texinfo, makeWrapper }:
stdenv.mkDerivation rec {
pname = "ponysay";
version = "unstable-2021-03-27";
src = fetchFromGitHub {
owner = "erkin";
repo = "ponysay";
rev = "8a2c71416e70e4e7b0931917ebfd6479f51ddf9a";
sha256 = "sha256-LNc83E+7NFYYILORElNlYC7arQKGUJHv6phu+vM5xpQ=";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ python3 texinfo ];
inherit python3;
installPhase = ''
runHook preInstall
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
runHook postInstall
'';
meta = with lib; {
description = "Cowsay reimplemention for ponies";
homepage = "https://github.com/erkin/ponysay";
license = licenses.gpl3;
maintainers = with maintainers; [ bodil ];
platforms = platforms.unix;
};
}