Merge pull request #252312 from ryanccn/catwalk

catppuccin-catwalk: adopt rust rewrite
This commit is contained in:
OTABI Tomoya 2023-09-03 02:22:23 +09:00 committed by GitHub
commit ea472482d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,41 +1,37 @@
{ lib { lib
, fetchPypi , fetchFromGitHub
, python3 , rustPlatform
, , installShellFiles
}: }:
python3.pkgs.buildPythonApplication rec { rustPlatform.buildRustPackage {
pname = "catppuccin-catwalk"; pname = "catppuccin-catwalk";
version = "0.4.0"; version = "0.1.0";
format = "pyproject";
src = fetchPypi { src = fetchFromGitHub {
inherit version; owner = "catppuccin";
pname = "catppuccin_catwalk"; repo = "toolbox";
hash = "sha256-5TAw5H3soxe9vLhfj1qs8uMr4ybrHlCj4zdsMzvPo6s="; rev = "b38153e94622bab574224bb24a6ae953b3a849da";
hash = "sha256-zZRl6Xem41pBQmEoK24YR4TKiQ84nU5phBih2TF8G8g=";
}; };
postPatch = '' buildAndTestSubdir = "catwalk";
substituteInPlace pyproject.toml \ cargoHash = "sha256-KoxivYLzJEjWbxIkizrMpmVwUF7bfVxl13H774lzQRg=";
--replace 'Pillow = "^' 'Pillow = ">='
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd catwalk \
--bash <("$out/bin/catwalk" completion bash) \
--zsh <("$out/bin/catwalk" completion zsh) \
--fish <("$out/bin/catwalk" completion fish)
''; '';
nativeBuildInputs = with python3.pkgs; [
poetry-core
];
propagatedBuildInputs = with python3.pkgs; [
pillow
];
pythonImports = [
"catwalk"
];
meta = with lib; { meta = with lib; {
homepage = "https://github.com/catppuccin/toolbox"; homepage = "https://github.com/catppuccin/toolbox/tree/main/catwalk";
description = "A CLI for Catppuccin that takes in four showcase images and displays them all at once"; description = "A CLI for Catppuccin that takes in four showcase images and displays them all at once";
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ ryanccn ]; maintainers = with maintainers; [ ryanccn ];
mainProgram = "catwalk";
}; };
} }