depot/third_party/nixpkgs/pkgs/by-name/ba/bazel-watcher/package.nix

47 lines
1 KiB
Nix

{
lib,
fetchFromGitHub,
buildGoModule,
testers,
bazel-watcher,
stdenv,
}:
buildGoModule rec {
pname = "bazel-watcher";
version = "0.25.3";
src = fetchFromGitHub {
owner = "bazelbuild";
repo = "bazel-watcher";
rev = "v${version}";
hash = "sha256-5cRj04e5VVG4NSe4LOLkZIrerT4laLEDeXCqTiJj6MM=";
};
vendorHash = "sha256-0I/bvuyosN55oNSMuom4C8rVjxneUaqV19l9OMiwWhU=";
# The dependency github.com/fsnotify/fsevents requires CGO
CGO_ENABLED = if stdenv.hostPlatform.isDarwin then "1" else "0";
ldflags = [
"-s"
"-X main.Version=${version}"
];
subPackages = [ "cmd/ibazel" ];
passthru = {
tests.version = testers.testVersion {
package = bazel-watcher;
command = "ibazel version";
};
};
meta = with lib; {
homepage = "https://github.com/bazelbuild/bazel-watcher";
description = "Tools for building Bazel targets when source files change";
license = licenses.asl20;
maintainers = with maintainers; [ kalbasit ];
mainProgram = "ibazel";
platforms = platforms.all;
};
}