nixpkgs/pkgs/by-name/ba/bant/package.nix
Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d5c88a98d674f637d092807cfc12253.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e4587d75882aebc21a04bee960418f8ce9
2025-04-08 02:57:25 -04:00

79 lines
1.7 KiB
Nix

{
lib,
stdenv,
buildBazelPackage,
fetchFromGitHub,
bazel_6,
jdk,
nix-update-script,
cctools,
}:
let
system = stdenv.hostPlatform.system;
registry = fetchFromGitHub {
owner = "bazelbuild";
repo = "bazel-central-registry";
rev = "b03f4f95d8ba67873843eae80a73fef8ebf1522e";
hash = "sha256-gJr5bJ6Kj7jiUhnCC+YOUh3ChFR/55eUbwpP2srsVvM=";
};
in
buildBazelPackage rec {
pname = "bant";
version = "0.2.0";
src = fetchFromGitHub {
owner = "hzeller";
repo = "bant";
rev = "v${version}";
hash = "sha256-Qq35WhRFpmQwWPupcjnUo/SEFRSRynVIx+PiHEsGED8=";
};
bazelFlags = [
"--registry"
"file://${registry}"
];
LIBTOOL = lib.optionalString stdenv.hostPlatform.isDarwin "${cctools}/bin/libtool";
postPatch = ''
patchShebangs scripts/create-workspace-status.sh
'';
fetchAttrs = {
hash =
{
aarch64-linux = "sha256-ibv49Y0VjAvfTUwxRUH4BmzUvz8J/qfYPGnI5Tw51HA=";
x86_64-linux = "sha256-VHR08FB4G0LlczWtBb8AdU5tNEzBDNUZpHoB6e3HB1M=";
aarch64-darwin = "sha256-5uKCLDJs0tzOJ7YiKP90RIfIYrken3XFyhT5HHdzft0=";
}
.${system} or (throw "No hash for system: ${system}");
};
nativeBuildInputs = [
jdk
];
bazel = bazel_6;
bazelBuildFlags = [ "-c opt" ];
bazelTestTargets = [ "//..." ];
bazelTargets = [ "//bant:bant" ];
buildAttrs = {
installPhase = ''
install -D --strip bazel-bin/bant/bant "$out/bin/bant"
'';
};
passthru.updateScript = nix-update-script { };
meta = {
description = "Bazel/Build Analysis and Navigation Tool";
homepage = "http://bant.build/";
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [
hzeller
lromor
];
};
}