2022-08-12 12:06:08 +00:00
|
|
|
{ lib, stdenv, rustPlatform, fetchFromGitHub, Cocoa, AppKit, installShellFiles }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "watchexec";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "1.23.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2023-03-24 00:07:29 +00:00
|
|
|
rev = "v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
sha256 = "sha256-Lm0UWx4f57lo6rnolQp3x03tLYBsPgMx50RP3sKufek=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
cargoHash = "sha256-kkmELD9886/NRuYfAT9OTRa9CUNazdG4E9/D3djgk5E=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ Cocoa AppKit ];
|
|
|
|
|
|
|
|
NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework AppKit";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
checkFlags = [ "--skip=help" "--skip=help_short" ];
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
postPatch = ''
|
|
|
|
rm .cargo/config
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
installManPage doc/watchexec.1
|
|
|
|
installShellCompletion --zsh --name _watchexec completions/zsh
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Executes commands in response to file modifications";
|
2021-10-04 12:37:57 +00:00
|
|
|
homepage = "https://watchexec.github.io/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = [ maintainers.michalrus ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "watchexec";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|