Commit 09fcb659 authored by Yureka's avatar Yureka
Browse files

catppucin-catwalk: use system libwebp

parent 1697b7d4
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
{ lib
{ stdenv
, lib
, fetchFromGitHub
, rustPlatform
, installShellFiles
, pkg-config
, libwebp
}:

rustPlatform.buildRustPackage {
@@ -18,7 +21,8 @@ rustPlatform.buildRustPackage {
  buildAndTestSubdir = "catwalk";
  cargoHash = "sha256-KoxivYLzJEjWbxIkizrMpmVwUF7bfVxl13H774lzQRg=";

  nativeBuildInputs = [ installShellFiles ];
  nativeBuildInputs = [ installShellFiles pkg-config ];
  buildInputs = [ libwebp ];

  postInstall = ''
    installShellCompletion --cmd catwalk \
@@ -27,6 +31,14 @@ rustPlatform.buildRustPackage {
      --fish <("$out/bin/catwalk" completion fish)
  '';

  doInstallCheck = !stdenv.hostPlatform.isStatic &&
    stdenv.hostPlatform.parsed.kernel.execFormat == lib.systems.parse.execFormats.elf;
  installCheckPhase = ''
    runHook preInstallCheck
    readelf -a $out/bin/catwalk | grep -F 'Shared library: [libwebp.so'
    runHook postInstallCheck
  '';

  meta = with lib; {
    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";