forked from mirrors/nixpkgs
commit
1c4b1018a3
|
@ -5,7 +5,6 @@
|
||||||
callPackage,
|
callPackage,
|
||||||
closureInfo,
|
closureInfo,
|
||||||
coreutils,
|
coreutils,
|
||||||
docker,
|
|
||||||
e2fsprogs,
|
e2fsprogs,
|
||||||
fakeroot,
|
fakeroot,
|
||||||
findutils,
|
findutils,
|
||||||
|
@ -17,6 +16,7 @@
|
||||||
moreutils,
|
moreutils,
|
||||||
nix,
|
nix,
|
||||||
pigz,
|
pigz,
|
||||||
|
pkgs,
|
||||||
rsync,
|
rsync,
|
||||||
runCommand,
|
runCommand,
|
||||||
runtimeShell,
|
runtimeShell,
|
||||||
|
@ -123,24 +123,7 @@ rec {
|
||||||
|
|
||||||
# We need to sum layer.tar, not a directory, hence tarsum instead of nix-hash.
|
# We need to sum layer.tar, not a directory, hence tarsum instead of nix-hash.
|
||||||
# And we cannot untar it, because then we cannot preserve permissions etc.
|
# And we cannot untar it, because then we cannot preserve permissions etc.
|
||||||
tarsum = runCommand "tarsum" {
|
tarsum = pkgs.tarsum;
|
||||||
nativeBuildInputs = [ go ];
|
|
||||||
} ''
|
|
||||||
mkdir tarsum
|
|
||||||
cd tarsum
|
|
||||||
|
|
||||||
cp ${./tarsum.go} tarsum.go
|
|
||||||
export GOPATH=$(pwd)
|
|
||||||
export GOCACHE="$TMPDIR/go-cache"
|
|
||||||
export GO111MODULE=off
|
|
||||||
mkdir -p src/github.com/docker/docker/pkg
|
|
||||||
ln -sT ${docker.moby-src}/pkg/tarsum src/github.com/docker/docker/pkg/tarsum
|
|
||||||
go build
|
|
||||||
|
|
||||||
mkdir -p $out/bin
|
|
||||||
|
|
||||||
cp tarsum $out/bin/
|
|
||||||
'';
|
|
||||||
|
|
||||||
# buildEnv creates symlinks to dirs, which is hard to edit inside the overlay VM
|
# buildEnv creates symlinks to dirs, which is hard to edit inside the overlay VM
|
||||||
mergeDrvs = {
|
mergeDrvs = {
|
||||||
|
|
42
pkgs/build-support/docker/tarsum.nix
Normal file
42
pkgs/build-support/docker/tarsum.nix
Normal file
|
@ -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;
|
||||||
|
}
|
|
@ -369,6 +369,7 @@ in
|
||||||
dockerTools = callPackage ../build-support/docker {
|
dockerTools = callPackage ../build-support/docker {
|
||||||
writePython3 = buildPackages.writers.writePython3;
|
writePython3 = buildPackages.writers.writePython3;
|
||||||
};
|
};
|
||||||
|
tarsum = callPackage ../build-support/docker/tarsum.nix { };
|
||||||
|
|
||||||
snapTools = callPackage ../build-support/snap { };
|
snapTools = callPackage ../build-support/snap { };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue