Skip to content

Commit

Permalink
git-wait: init at 0.4.0-unstable-2024-12-01
Browse files Browse the repository at this point in the history
  • Loading branch information
pbsds committed Feb 5, 2025
1 parent 70395ee commit a0f674f
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions pkgs/by-name/gi/git-wait/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
lib,
rustPlatform,
fetchFromGitHub,
stdenv,
darwin,
git,
}:

rustPlatform.buildRustPackage rec {
pname = "git-wait";
version = "0.4.0-unstable-2024-12-01";

src = fetchFromGitHub {
owner = "darshanparajuli";
repo = "git-wait";
# on tags upstream
rev = "1d610f694dd1cd4a0970e97b886053ffc7c76244";
hash = "sha256-Va917eD9M3oUVmLrDab6cx/LvmBlk95U4mRHqPpBB5I=";
};

useFetchCargoVendor = true;
cargoHash = "sha256-tA0WjghBB2K71IlZ1u9K67tZWGe9VNFOfI2YdrqCUw0=";

buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.CoreFoundation
darwin.apple_sdk.frameworks.CoreServices
];

checkFlags = lib.optionals stdenv.hostPlatform.isDarwin [
"--skip=tests::wait_if_index_lock_is_present"
];

# versionCheckHook is too complex to use here
doInstallCheck = true;
nativeInstallCheckInputs = [ git ];
installCheckPhase = ''
runHook preInstallCheck
stdout=$(set -x; $out/bin/git-wait -v 2>&1)
if ! grep <<<"$stdout" -q ${lib.escapeShellArg git.version}; then
>&2 echo "ERROR: version check failed!" ${lib.escapeShellArg git.version} "was not found."
>&2 echo "Output was"
>&2 echo "$stdout"
fi
runHook postInstallCheck
'';

meta = {
description = "A simple git wrapper that waits until index.lock file is removed when present before running the command";
homepage = "https://github.com/darshanparajuli/git-wait";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ pbsds ];
mainProgram = "git-wait";
};
}

0 comments on commit a0f674f

Please sign in to comment.