From 37447aa7af95e660d323123ba355e1c91a804cb9 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sun, 16 Oct 2022 13:27:23 +0200 Subject: pokemonsay: init at unstable-2021-10-05 --- pkgs/tools/misc/pokemonsay/default.nix | 65 ++++++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 67 insertions(+) create mode 100644 pkgs/tools/misc/pokemonsay/default.nix diff --git a/pkgs/tools/misc/pokemonsay/default.nix b/pkgs/tools/misc/pokemonsay/default.nix new file mode 100644 index 0000000000000..f61b93a874f22 --- /dev/null +++ b/pkgs/tools/misc/pokemonsay/default.nix @@ -0,0 +1,65 @@ +{ lib +, stdenvNoCC +, fetchFromGitHub +, cowsay +, coreutils +, findutils +}: + +stdenvNoCC.mkDerivation rec { + pname = "pokemonsay"; + version = "unstable-2021-10-05"; + + src = fetchFromGitHub { + owner = "HRKings"; + repo = "pokemonsay-newgenerations"; + rev = "baccc6d2fe1897c48f60d82ff9c4d4c018f5b594"; + hash = "sha256-IDTAZmOzkUg0kLUM0oWuVbi8EwE4sEpLWrNAtq/he+g="; + }; + + postPatch = '' + substituteInPlace pokemonsay.sh \ + --replace \ + 'INSTALL_PATH=''${HOME}/.bin/pokemonsay' \ + "" \ + --replace \ + 'POKEMON_PATH=''${INSTALL_PATH}/pokemons' \ + 'POKEMON_PATH=${placeholder "out"}/share/pokemonsay' \ + --replace \ + '$(find ' \ + '$(${findutils}/bin/find ' \ + --replace \ + '$(basename ' \ + '$(${coreutils}/bin/basename ' \ + --replace \ + 'cowsay -f ' \ + '${cowsay}/bin/cowsay -f ' \ + --replace \ + 'cowthink -f ' \ + '${cowsay}/bin/cowthink -f ' + + substituteInPlace pokemonthink.sh \ + --replace \ + './pokemonsay.sh' \ + "${placeholder "out"}/bin/pokemonsay" + ''; + + installPhase = '' + mkdir -p $out/{bin,share/pokemonsay} + cp pokemonsay.sh $out/bin/pokemonsay + cp pokemonthink.sh $out/bin/pokemonthink + cp pokemons/*.cow $out/share/pokemonsay + ''; + + checkPhase = '' + $out/bin/pokemonsay --list-pokemon + ''; + + meta = with lib; { + description = "Print pokemon in the CLI! An adaptation of the classic cowsay"; + homepage = "https://github.com/HRKings/pokemonsay-newgenerations"; + license = licenses.mit; + platforms = platforms.all; + maintainers = with maintainers; [ pbsds ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ebacd3760105b..59ac04d248802 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30952,6 +30952,8 @@ with pkgs; poke = callPackage ../applications/editors/poke { }; + pokemonsay = callPackage ../tools/misc/pokemonsay { }; + polar-bookshelf = callPackage ../applications/misc/polar-bookshelf { }; poezio = python3Packages.poezio; -- cgit 1.4.1