diff options
Diffstat (limited to 'pkgs/build-support/docker/tarsum.nix')
-rw-r--r-- | pkgs/build-support/docker/tarsum.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/build-support/docker/tarsum.nix b/pkgs/build-support/docker/tarsum.nix new file mode 100644 index 0000000000000..734c6b3d5aeb8 --- /dev/null +++ b/pkgs/build-support/docker/tarsum.nix @@ -0,0 +1,42 @@ +{ stdenv, go, docker, nixosTests }: + +stdenv.mkDerivation { + name = "tarsum"; + + nativeBuildInputs = [ go ]; + disallowedReferences = [ go ]; + + dontUnpack = true; + + CGO_ENABLED = 0; + GOFLAGS = "-trimpath"; + GO111MODULE = "off"; + + buildPhase = '' + runHook preBuild + mkdir tarsum + cd tarsum + cp ${./tarsum.go} tarsum.go + export GOPATH=$(pwd) + export GOCACHE="$TMPDIR/go-cache" + mkdir -p src/github.com/docker/docker/pkg + ln -sT ${docker.moby-src}/pkg/tarsum src/github.com/docker/docker/pkg/tarsum + go build + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + cp tarsum $out/bin/ + runHook postInstall + ''; + + passthru = { + tests = { + dockerTools = nixosTests.docker-tools; + }; + }; + + meta.platforms = go.meta.platforms; +} |