From c3af60a2720602c30dfae07b54ced2fa0582aaab Mon Sep 17 00:00:00 2001 From: nartsisss Date: Sat, 1 Nov 2025 08:09:47 +0300 Subject: [PATCH 1/2] topiary: 0.6.1 -> 0.7.0 --- pkgs/by-name/to/topiary/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/to/topiary/package.nix b/pkgs/by-name/to/topiary/package.nix index 79439f3a1d25..29eaa77dfef3 100644 --- a/pkgs/by-name/to/topiary/package.nix +++ b/pkgs/by-name/to/topiary/package.nix @@ -10,19 +10,19 @@ }: rustPlatform.buildRustPackage rec { pname = "topiary"; - version = "0.6.1"; + version = "0.7.0"; src = fetchFromGitHub { owner = "tweag"; repo = "topiary"; tag = "v${version}"; - hash = "sha256-CyqZhkzAOqC3xWhwUzCpkDO0UFsO0S4/3sV7zIILiVg="; + hash = "sha256-49LTUtgroD0wCwJYYb/IN1lsWbAtdfKjGNMuUa2+vhI="; }; nativeBuildInputs = [ installShellFiles ]; nativeInstallCheckInputs = [ versionCheckHook ]; + cargoHash = "sha256-I3hsaA4N2x00J5+U0z2B1gi1N7QVf7Vnab2scjDpWoo="; - cargoHash = "sha256-akAjn9a7dMwjPSNveDY2KJ62evjHCAWpRR3A7Ghkb5A="; # https://github.com/NixOS/nixpkgs/pull/359145#issuecomment-2542418786 depsExtraArgs.postBuild = '' From e42a25c564191c95a48febf2664763952cdcfca8 Mon Sep 17 00:00:00 2001 From: nartsisss Date: Sat, 1 Nov 2025 08:11:03 +0300 Subject: [PATCH 2/2] topiary: remove unused postBuild, refactor --- pkgs/by-name/to/topiary/package.nix | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/pkgs/by-name/to/topiary/package.nix b/pkgs/by-name/to/topiary/package.nix index 29eaa77dfef3..af0174829dfa 100644 --- a/pkgs/by-name/to/topiary/package.nix +++ b/pkgs/by-name/to/topiary/package.nix @@ -3,41 +3,29 @@ stdenv, rustPlatform, fetchFromGitHub, - iconv, installShellFiles, versionCheckHook, nix-update-script, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "topiary"; version = "0.7.0"; src = fetchFromGitHub { owner = "tweag"; repo = "topiary"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-49LTUtgroD0wCwJYYb/IN1lsWbAtdfKjGNMuUa2+vhI="; }; - nativeBuildInputs = [ installShellFiles ]; - nativeInstallCheckInputs = [ versionCheckHook ]; cargoHash = "sha256-I3hsaA4N2x00J5+U0z2B1gi1N7QVf7Vnab2scjDpWoo="; - - # https://github.com/NixOS/nixpkgs/pull/359145#issuecomment-2542418786 - depsExtraArgs.postBuild = '' - find $out -name '*.ps1' -print | while read -r file; do - if [ "$(file --brief --mime-encoding "$file")" == utf-16be ]; then - ${iconv}/bin/iconv -f UTF-16BE -t UTF16LE "$file" > tmp && mv tmp "$file" - fi - done - ''; + nativeBuildInputs = [ installShellFiles ]; cargoBuildFlags = [ "-p" "topiary-cli" ]; - cargoTestFlags = cargoBuildFlags; # Skip tests that cannot be executed in sandbox (operation not permitted) checkFlags = [ @@ -76,6 +64,7 @@ rustPlatform.buildRustPackage rec { "--skip=test_vis" "--skip=test_vis_invalid" ]; + cargoTestFlags = finalAttrs.cargoBuildFlags; env.TOPIARY_LANGUAGE_DIR = "${placeholder "out"}/share/queries"; @@ -89,6 +78,8 @@ rustPlatform.buildRustPackage rec { --zsh <($out/bin/topiary completion zsh) ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; versionCheckProgramArg = "--version"; @@ -96,13 +87,13 @@ rustPlatform.buildRustPackage rec { meta = { description = "Uniform formatter for simple languages, as part of the Tree-sitter ecosystem"; - mainProgram = "topiary"; homepage = "https://github.com/tweag/topiary"; - changelog = "https://github.com/tweag/topiary/blob/${src.tag}/CHANGELOG.md"; + changelog = "https://github.com/tweag/topiary/blob/v${finalAttrs.version}/CHANGELOG.md"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ figsoda nartsiss ]; + mainProgram = "topiary"; }; -} +})