docker-cli: Update to upstream ebuild file.

Updating to upstream ebuild file, solves the man page creation for arm
platform.

BUG=b/178526852
TEST=presubmit, validation
RELEASE_NOTE=None

Change-Id: Ida61df7a03d2e81ba637b3622250790db77139b7
Reviewed-on: https://cos-review.googlesource.com/c/cos/overlays/board-overlays/+/49430
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
Reviewed-by: Oleksandr Tymoshenko <ovt@google.com>
diff --git a/project-lakitu/app-containers/docker-cli/Manifest b/project-lakitu/app-containers/docker-cli/Manifest
index b09b5c8..6ca2ce6 100644
--- a/project-lakitu/app-containers/docker-cli/Manifest
+++ b/project-lakitu/app-containers/docker-cli/Manifest
@@ -1,2 +1,3 @@
 DIST docker-cli-20.10.12.tar.gz 7527161 BLAKE2B 34a90f6df9f43507461307817e72cfb9e37f88d00e6fc50b8b16f3db9c573e54edc2eb2641ff4e091a2a73e936f8844011520efe5aaec37a9eb9880f5f81c51a SHA512 ac7c997f5751f2e34b9bcb9f026d3d0c2cd58c32a13e9255536b0eb0d7eabd81c42f2d608c0fe7725322b619f2360818b08379e847d598dd0bec570602ad224f
+DIST docker-cli-23.0.3-man.tar.xz 81976 BLAKE2B e7390b429d0db2445035da506bb796364f97e6560e766a28d1245e6a76c84314c38af1f3a946d2eb1785132d26805e0d3a76c374559e70989b64e8ce917f8423 SHA512 842d7187ad8a3933d815057ec535c13466c56bd051c7133e6e0a9c85f5140e4ef61b66771ee6788c8fb50d10652a86b663f29fe4ec3190773f70fd45f36fbcd4
 DIST docker-cli-23.0.3.tar.gz 6215298 BLAKE2B 817ca474d61839c8b5929db9bfa964b936285622859ab30f45be2f382238a5e49987fdbcdc896eaa7109f114166cf0e1dbc4f001cefe293a6c286b50e2737258 SHA512 873783a0fe9ecab3b8f251c842ba69070e0dffbb4a758c16165441b2f483d55d15b98fd7da0707e483995ac2d1fbb9a0f13f570b78486382b26d6ca6c5e612a9
diff --git a/project-lakitu/app-containers/docker-cli/docker-cli-23.0.3-r1.ebuild b/project-lakitu/app-containers/docker-cli/docker-cli-23.0.3-r2.ebuild
similarity index 100%
rename from project-lakitu/app-containers/docker-cli/docker-cli-23.0.3-r1.ebuild
rename to project-lakitu/app-containers/docker-cli/docker-cli-23.0.3-r2.ebuild
diff --git a/project-lakitu/app-containers/docker-cli/docker-cli-23.0.3.ebuild b/project-lakitu/app-containers/docker-cli/docker-cli-23.0.3.ebuild
index a5f8ff2..4eb8075 100644
--- a/project-lakitu/app-containers/docker-cli/docker-cli-23.0.3.ebuild
+++ b/project-lakitu/app-containers/docker-cli/docker-cli-23.0.3.ebuild
@@ -1,34 +1,40 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 GIT_COMMIT=3e7cbfdee1
-GIT_VERSION=23.0.3
 EGO_PN="github.com/docker/cli"
+MY_PV=${PV/_/-}
 inherit bash-completion-r1  golang-vcs-snapshot
 
 DESCRIPTION="the command line binary for docker"
 HOMEPAGE="https://www.docker.com/"
-MY_PV=${PV/_/-}
 SRC_URI="https://github.com/docker/cli/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
+SRC_URI+=" https://dev.gentoo.org/~williamh/dist/${P}-man.tar.xz"
 
 LICENSE="Apache-2.0"
 SLOT="0"
 KEYWORDS="*"
-IUSE="hardened"
+IUSE="hardened selinux"
 
-RDEPEND="!<app-containers/docker-20.10.1"
-BDEPEND="dev-go/go-md2man"
+RDEPEND="!<app-containers/docker-20.10.1
+	selinux? ( sec-policy/selinux-docker )"
+BDEPEND="
+	>=dev-lang/go-1.16.6"
 
-RESTRICT="installsources strip"
+RESTRICT="installsources strip test"
 
 S="${WORKDIR}/${P}/src/${EGO_PN}"
 
+src_unpack() {
+	golang-vcs-snapshot_src_unpack
+	set -- ${A}
+	unpack ${2}
+}
 
 src_prepare() {
 	default
 	sed -i 's@dockerd\?\.exe@@g' contrib/completion/bash/docker || die
-
 }
 
 src_compile() {
@@ -36,8 +42,8 @@
 	export GOPATH="${WORKDIR}/${P}"
 	# setup CFLAGS and LDFLAGS for separate build target
 	# see https://github.com/tianon/docker-overlay/pull/10
-	export CGO_CFLAGS="-I${ROOT}/usr/include"
-	export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
+	export CGO_CFLAGS="-I${ESYSROOT}/usr/include"
+	export CGO_LDFLAGS="-L${ESYSROOT}/usr/$(get_libdir)"
 	# lakitu: export a function named 'go' that invokes the go cross-compiler.
 	# The docker-cli Makefile will invoke this function instead of doing a PATH
 	# lookup for the go binary.
@@ -52,30 +58,15 @@
 		# accurate
 		emake \
 		LDFLAGS="$(usex hardened '-extldflags -fno-PIC' '')" \
-		VERSION="${GIT_VERSION}" \
+		VERSION="${PV}" \
 		GITCOMMIT="${GIT_COMMIT}" \
 		dynbinary
 	unset -f go
-
-	# lakitu: don't build man pages as cross-compiling man pages doesn't
-	# work on ARM.
-	# TODO(mikewu@): uncommment the following lines once b/178526852 is fixed.
-	# build man pages
-	# see "cli/scripts/docs/generate-man.sh" (which also does "go get" for go-md2man)
-	#go build -o "${T}"/gen-manpages ./man ||
-		#die 'build gen-manpages failed'
-	#"${T}"/gen-manpages --root "$(pwd)" --target "$(pwd)"/man/man1 ||
-		#die 'gen-manpages failed'
-	#./man/md2man-all.sh -q ||
-		#die 'md2man-all.sh failed'
 }
 
 src_install() {
 	dobin build/docker
-	# lakitu: don't install man pages as cross-compiling man pages doesn't
-	# work on ARM.
-	# TODO(mikewu@): uncomment the following line once b/178526852 is fixed.
-	#doman man/man*/*
+	doman "${WORKDIR}"/man/man?/*
 	dobashcomp contrib/completion/bash/*
 	bashcomp_alias docker dockerd
 	insinto /usr/share/fish/vendor_completions.d/
@@ -83,3 +74,10 @@
 	insinto /usr/share/zsh/site-functions
 	doins contrib/completion/zsh/_*
 }
+
+pkg_postinst() {
+	has_version "app-containers/docker-buildx" && return
+	ewarn "the 'docker build' command is deprecated and will be removed in a"
+	ewarn "future release. If you need this functionality, install"
+	ewarn "app-containers/docker-buildx."
+}