uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
85
pkgs/development/tools/bazel-watcher/default.nix
Normal file
85
pkgs/development/tools/bazel-watcher/default.nix
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
{ buildBazelPackage
|
||||
, fetchFromGitHub
|
||||
, git
|
||||
, go
|
||||
, python3
|
||||
, lib, stdenv
|
||||
}:
|
||||
|
||||
let
|
||||
patches = [
|
||||
./use-go-in-path.patch
|
||||
];
|
||||
in
|
||||
buildBazelPackage rec {
|
||||
pname = "bazel-watcher";
|
||||
version = "0.14.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "bazelbuild";
|
||||
repo = "bazel-watcher";
|
||||
rev = "v${version}";
|
||||
sha256 = "0gigl1lg8sb4bj5crvj54329ws4yirldbncs15f96db6vhp0ig7r";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ go git python3 ];
|
||||
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 = "1j175z3d4fbi4pl35py7yjq7ywrvwin6id131jv32hx0ck4g1m46";
|
||||
};
|
||||
|
||||
buildAttrs = {
|
||||
inherit patches;
|
||||
|
||||
preBuild = ''
|
||||
patchShebangs .
|
||||
|
||||
substituteInPlace ibazel/BUILD --replace '{STABLE_GIT_VERSION}' ${version}
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
install -Dm755 bazel-bin/ibazel/*_pure_stripped/ibazel $out/bin/ibazel
|
||||
'';
|
||||
};
|
||||
|
||||
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 ];
|
||||
platforms = platforms.all;
|
||||
# broken on darwin, see https://github.com/NixOS/nixpkgs/issues/105573
|
||||
broken = stdenv.isDarwin;
|
||||
};
|
||||
}
|
||||
13
pkgs/development/tools/bazel-watcher/use-go-in-path.patch
Normal file
13
pkgs/development/tools/bazel-watcher/use-go-in-path.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/WORKSPACE b/WORKSPACE
|
||||
index 51273b6..fcf9ffb 100644
|
||||
--- a/WORKSPACE
|
||||
+++ b/WORKSPACE
|
||||
@@ -61,7 +61,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe
|
||||
|
||||
go_rules_dependencies()
|
||||
|
||||
-go_register_toolchains()
|
||||
+go_register_toolchains(go_version = "host")
|
||||
|
||||
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue