From 73052f6867b4d3be871f1028644a9760fba86f8c Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Sun, 25 May 2025 12:59:54 +0900 Subject: [PATCH] shaperglot-cli: init at 0-unstable-2025-05-27 Co-authored-by: Aleksana --- pkgs/by-name/sh/shaperglot-cli/package.nix | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 pkgs/by-name/sh/shaperglot-cli/package.nix diff --git a/pkgs/by-name/sh/shaperglot-cli/package.nix b/pkgs/by-name/sh/shaperglot-cli/package.nix new file mode 100644 index 000000000000..57e63811bc50 --- /dev/null +++ b/pkgs/by-name/sh/shaperglot-cli/package.nix @@ -0,0 +1,64 @@ +{ + lib, + fetchFromGitHub, + rustPlatform, + _experimental-update-script-combinators, + unstableGitUpdater, + nix-update-script, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "shaperglot-cli"; + version = "0-unstable-2025-05-27"; + + src = fetchFromGitHub { + owner = "googlefonts"; + repo = "shaperglot"; + rev = "0d934110dfdf315761255e34040f207f7d7868b5"; + hash = "sha256-5Bgvx4Yv74nQLd037L5uBj6oySqqp947LI/6yGwYSKY="; + }; + + cargoHash = "sha256-UMPoPNpyM/+1rq4U6xQ1DF4W+51p5YjQXr/8zLiPvEI="; + + cargoBuildFlags = [ + "--package=shaperglot-cli" + ]; + + cargoTestFlags = [ + "--package=shaperglot-cli" + ]; + + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + + describe_output="$("$out/bin/shaperglot" describe English)" + [[ "$describe_output" == *'support'* ]] + + runHook postInstallCheck + ''; + + passthru = { + updateScript = _experimental-update-script-combinators.sequence [ + (unstableGitUpdater { + branch = "main"; + # Git tag differs from CLI version: https://github.com/googlefonts/shaperglot/issues/138 + hardcodeZeroVersion = true; + }) + (nix-update-script { + # Updating `cargoHash` + extraArgs = [ "--version=skip" ]; + }) + ]; + }; + + meta = { + description = "Test font files for language support"; + homepage = "https://github.com/googlefonts/shaperglot"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ + kachick + ]; + mainProgram = "shaperglot"; + }; +})