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-13 08:15:51 +00:00
|
|
|
version = "1.25.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-13 08:15:51 +00:00
|
|
|
sha256 = "sha256-kEZvzIbmL+Plko+uLP5LnacPoypkBCMzxSOkRkDsLW4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
cargoHash = "sha256-FgTD7jFgkhJA73VVZ47FcA21xJaMX8c3SAaB13Nvrqs=";
|
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
|
|
|
};
|
|
|
|
}
|