Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions pkgs/by-name/tt/ttfx/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
installShellFiles,
versionCheckHook,
nix-update-script,
}:

rustPlatform.buildRustPackage (finalAttrs: {
pname = "ttfx";
version = "0.5.1";

src = fetchFromGitHub {
owner = "omacom";
repo = "ttfx";
tag = "v${finalAttrs.version}";
hash = "sha256-/cECljrthspJsg6fgWMm4QIv8V3FJLuP/pbZoRKFVAc=";
};

cargoHash = "sha256-xSv2a0Q1biE20cOHkSOADxFfRNYKH/1MNCA03hQX9pE=";

__structuredAttrs = true;

nativeBuildInputs = [ installShellFiles ];

# glibc picks its libm variant per CPU, so the bit-exact easing goldens drift by
# an ulp on some builders; upstream: omacom/ttfx#58 (issue omacom/ttfx#56)
checkFlags = lib.optionals stdenv.hostPlatform.isGnu [
"--skip=easing_matches_python_bit_exactly"
];

postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd ttfx \
--bash <($out/bin/ttfx --print-completion bash) \
--zsh <($out/bin/ttfx --print-completion zsh)
'';

nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;

passthru.updateScript = nix-update-script { };

meta = {
description = "Terminal text effects engine as a standalone CLI";
homepage = "https://github.com/omacom/ttfx";
changelog = "https://github.com/omacom/ttfx/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ kleinbem ];
mainProgram = "ttfx";
};
})
Loading