2023-07-15 17:15:38 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, Cocoa
|
|
|
|
, Foundation
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-watch";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "8.5.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-02-02 18:25:31 +00:00
|
|
|
owner = "watchexec";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-Vf6BFr8MphaUJoHMtksbbVQb+jha7jowhktQCVFxlxQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
cargoHash = "sha256-skUG1B6TCFEXeQSRwA6vWjXmNifk5bTR4+JESw7CZMo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ Foundation Cocoa ];
|
|
|
|
|
|
|
|
NIX_LDFLAGS = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ "-framework" "AppKit" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# `test with_cargo` tries to call cargo-watch as a cargo subcommand
|
|
|
|
# (calling cargo-watch with command `cargo watch`)
|
2020-07-18 16:06:22 +00:00
|
|
|
preCheck = ''
|
2023-11-16 04:20:00 +00:00
|
|
|
export PATH="$(pwd)/target/${stdenv.hostPlatform.rust.rustcTarget}/release:$PATH"
|
2020-07-18 16:06:22 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A Cargo subcommand for watching over Cargo project's source";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "cargo-watch";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://github.com/watchexec/cargo-watch";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.cc0;
|
2023-08-22 20:05:09 +00:00
|
|
|
maintainers = with maintainers; [ xrelkd ivan matthiasbeyer ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|