nixpkgs/pkgs/development/tools/bazel-watcher/default.nix
Colin 4007ceb6af
treewide get rid of go 1.12 (#83253)
* treewide Drop unneeded go 1.12 overrides

* Fix packr to be go module compatible.

I updated to version 2.8.0 which is the latest on master.
Then due to the 2 different sets of go modules which are used, I split
the build into two different derivations, then merged them togethor
using symlinkJoin to have the same output structure as the existing derivation.

* Remove consul dependency on go1.12

I updated the consul version to 1.7.2 and flipped it to building using
modules.

* Remove go1.12 from perkeep.

Update the version to the latest unstable on master.

* Update scaleway-cli to not be pinned to go1.12

Switched the version to 1.20

* Update prometheus-varnish-exporter to not depend on go1.12

* Update lnd to build with go1.12

Updated the version
Forced only building subpackages with main to prevent panics over
multiple modules in one repo

* Remove go1.12 from openshift

Had to update the version to 4.1.0 and do a bit of munging to get this
to work

* Remove go1.12 completely.

These are no longer needed.

* Update bazel-watcher and make it build with go 1.14
2020-04-28 20:16:20 -04:00

86 lines
2.5 KiB
Nix

{ buildBazelPackage
, fetchFromGitHub
, fetchpatch
, git
, go
, python
, stdenv
, iana-etc
, mailcap
, tzdata
}:
let
patches = [
./use-go-in-path.patch
];
in
buildBazelPackage rec {
name = "bazel-watcher-${version}";
version = "0.13.0";
src = fetchFromGitHub {
owner = "bazelbuild";
repo = "bazel-watcher";
rev = "v${version}";
sha256 = "1fc3sp79znbbq1yjap56lham72n7cap8yfghpzrzmpl5brybjkvm";
};
nativeBuildInputs = [ go git python ];
removeRulesCC = false;
bazelTarget = "//ibazel";
fetchAttrs = {
inherit patches;
preBuild = ''
patchShebangs .
'';
preInstall = ''
# Remove the go_sdk (it's just a copy of the go derivation) and all
# references to it from the marker files. Bazel does not need to download
# this sdk because we have patched the WORKSPACE file to point to the one
# currently present in PATH. Without removing the go_sdk from the marker
# file, the hash of it will change anytime the Go derivation changes and
# that would lead to impurities in the marker files which would result in
# a different sha256 for the fetch phase.
rm -rf $bazelOut/external/{go_sdk,\@go_sdk.marker}
sed -e '/^FILE:@go_sdk.*/d' -i $bazelOut/external/\@*.marker
# Retains go build input markers
chmod -R 755 $bazelOut/external/{bazel_gazelle_go_repository_cache,@\bazel_gazelle_go_repository_cache.marker}
rm -rf $bazelOut/external/{bazel_gazelle_go_repository_cache,@\bazel_gazelle_go_repository_cache.marker}
# Remove the gazelle tools, they contain go binaries that are built
# non-deterministically. As long as the gazelle version matches the tools
# should be equivalent.
rm -rf $bazelOut/external/{bazel_gazelle_go_repository_tools,\@bazel_gazelle_go_repository_tools.marker}
sed -e '/^FILE:@bazel_gazelle_go_repository_tools.*/d' -i $bazelOut/external/\@*.marker
'';
sha256 = "0wj573dcirssr2cmq90b4yl57mv3gsxaj1s26afvkz1dvyxmq7sz";
};
buildAttrs = {
inherit patches;
preBuild = ''
patchShebangs .
'';
installPhase = ''
install -Dm755 bazel-bin/ibazel/*_pure_stripped/ibazel $out/bin/ibazel
'';
};
meta = with stdenv.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 ];
platforms = platforms.all;
};
}