diff --git a/pkgs/applications/networking/cluster/cni/default.nix b/pkgs/applications/networking/cluster/cni/default.nix index 88dbd177da048..954f58ef2e358 100644 --- a/pkgs/applications/networking/cluster/cni/default.nix +++ b/pkgs/applications/networking/cluster/cni/default.nix @@ -17,6 +17,6 @@ buildGoPackage rec { license = licenses.asl20; homepage = https://github.com/containernetworking/cni; maintainers = with maintainers; [ offline vdemeester ]; - platforms = [ "x86_64-linux" ]; + platforms = [ "x86_64-linux" "aarch64-linux" ]; }; } diff --git a/pkgs/applications/virtualization/containerd/default.nix b/pkgs/applications/virtualization/containerd/default.nix index b770c6ed0a599..e5d0d5bd93dbe 100644 --- a/pkgs/applications/virtualization/containerd/default.nix +++ b/pkgs/applications/virtualization/containerd/default.nix @@ -18,7 +18,8 @@ buildGoPackage rec { hardeningDisable = [ "fortify" ]; - buildInputs = [ btrfs-progs go-md2man utillinux ]; + nativeBuildInputs = [ go-md2man utillinux ]; + buildInputs = [ btrfs-progs ]; buildFlags = "VERSION=v${version}"; BUILDTAGS = [] diff --git a/pkgs/applications/virtualization/docker/default.nix b/pkgs/applications/virtualization/docker/default.nix index a1125f25e816a..4273ae454e456 100644 --- a/pkgs/applications/virtualization/docker/default.nix +++ b/pkgs/applications/virtualization/docker/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, makeWrapper, removeReferencesTo, pkgconfig +{ stdenv, lib, fetchFromGitHub, fetchpatch, makeWrapper, removeReferencesTo, pkgconfig , go-md2man, go, containerd, runc, docker-proxy, tini, libtool , sqlite, iproute, lvm2, systemd , btrfs-progs, iptables, e2fsprogs, xz, utillinux, xfsprogs @@ -82,12 +82,22 @@ rec { sha256 = sha256; }; + patches = [ + # Replace hard-coded cross-compiler with $CC + (fetchpatch { + url = https://github.com/docker/docker-ce/commit/2fdfb4404ab811cb00227a3de111437b829e55cf.patch; + sha256 = "1af20bzakhpfhaixc29qnl9iml9255xdinxdnaqp4an0n1xa686a"; + }) + ]; + # Optimizations break compilation of libseccomp c bindings hardeningDisable = [ "fortify" ]; - nativeBuildInputs = [ pkgconfig ]; + inherit (go.nativeDrv or go) GOOS GOARCH; + + nativeBuildInputs = [ pkgconfig go-md2man go libtool removeReferencesTo ]; buildInputs = [ - makeWrapper removeReferencesTo go-md2man go libtool + makeWrapper ] ++ optionals (stdenv.isLinux) [ sqlite lvm2 btrfs-progs systemd libseccomp ]; @@ -120,7 +130,7 @@ rec { ''; # systemd 230 no longer has libsystemd-journal as a separate entity from libsystemd - patchPhase = '' + postPatch = '' substituteInPlace ./components/cli/scripts/build/.variables --replace "set -eu" "" '' + optionalString (stdenv.isLinux) '' patchShebangs . @@ -159,12 +169,15 @@ rec { install -Dm644 ./components/cli/contrib/completion/zsh/_docker $out/share/zsh/site-functions/_docker # Include contributed man pages (cli) + cd ./components/cli + + '' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' # Generate man pages from cobra commands echo "Generate man pages from cobra" - cd ./components/cli mkdir -p ./man/man1 go build -o ./gen-manpages github.com/docker/cli/man ./gen-manpages --root . --target ./man/man1 + '' + '' # Generate legacy pages from markdown echo "Generate legacy manpages" @@ -183,7 +196,7 @@ rec { ''; preFixup = '' - find $out -type f -exec remove-references-to -t ${go} -t ${stdenv.cc.cc} '{}' + + find $out -type f -exec remove-references-to -t ${go.nativeDrv or go} -t ${stdenv.cc.cc} '{}' + '' + optionalString (stdenv.isLinux) '' find $out -type f -exec remove-references-to -t ${stdenv.glibc.dev} '{}' + ''; diff --git a/pkgs/applications/virtualization/tini/default.nix b/pkgs/applications/virtualization/tini/default.nix index 39508412333c3..1887a224ec5e1 100644 --- a/pkgs/applications/virtualization/tini/default.nix +++ b/pkgs/applications/virtualization/tini/default.nix @@ -18,7 +18,8 @@ stdenv.mkDerivation rec { "-DPR_GET_CHILD_SUBREAPER=37" ]; - buildInputs = [ cmake glibc glibc.static ]; + nativeBuildInputs = [ cmake ]; + buildInputs = [ glibc glibc.static ]; meta = with stdenv.lib; { description = "A tiny but valid init for containers";