comma: 2.2.0 -> 2.3.0

Diff: https://www.github.com/nix-community/comma/compare/v2.2.0...v2.3.0
This commit is contained in:
Artturin
2025-07-24 21:55:02 +03:00
parent 4ba0ebe962
commit ccc604730b
+26 -12
View File
@@ -3,37 +3,51 @@
fetchFromGitHub,
fzy,
lib,
makeBinaryWrapper,
nix-index-unwrapped,
nix,
rustPlatform,
testers,
}:
rustPlatform.buildRustPackage rec {
pname = "comma";
version = "2.2.0";
version = "2.3.0";
src = fetchFromGitHub {
owner = "nix-community";
repo = "comma";
rev = "v${version}";
hash = "sha256-mhSX2yx+/xDwCtLVb+aSFFxP2TOJek/ZX/28khvetwE=";
hash = "sha256-JogC9NIS71GyimpqmX2/dhBX1IucK395iWZVVabZxiE=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-6BsRgxcUtVuN1gp3VVXkNQzqb9hD5rWWctieJvFdyrQ=";
cargoHash = "sha256-Cd4WaOG+OkCM4Q1K9qVzMYOjSi9U8W82JypqUN20x9w=";
nativeBuildInputs = [ makeBinaryWrapper ];
postPatch = ''
substituteInPlace ./src/main.rs \
--replace-fail '"nix-locate"' '"${lib.getExe' nix-index-unwrapped "nix-locate"}"' \
--replace-fail '"nix"' '"${lib.getExe nix}"' \
--replace-fail '"nix-env"' '"${lib.getExe' nix "nix-env"}"' \
--replace-fail '"fzy"' '"${lib.getExe fzy}"'
'';
postInstall = ''
wrapProgram $out/bin/comma \
--prefix PATH : ${
lib.makeBinPath [
fzy
nix-index-unwrapped
]
}
ln -s $out/bin/comma $out/bin/,
mkdir -p $out/etc/profile.d
mkdir -p $out/etc/nushell
mkdir -p $out/etc/fish/functions
cp $src/etc/comma-command-not-found.sh $out/etc/profile.d
cp $src/etc/comma-command-not-found.nu $out/etc/nushell
cp $src/etc/comma-command-not-found.fish $out/etc/fish/functions
patchShebangs $out/etc/profile.d/comma-command-not-found.sh
substituteInPlace \
"$out/etc/profile.d/comma-command-not-found.sh" \
"$out/etc/nushell/comma-command-not-found.nu" \
"$out/etc/fish/functions/comma-command-not-found.fish" \
--replace-fail "comma --ask" "$out/bin/comma --ask"
'';
passthru.tests = {