app-containers/docker: Fix automagic systemd dependency

This broke the binary packages for half our users.

Closes: https://bugs.gentoo.org/914076
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
This commit is contained in:
Andreas K. Hüttel 2024-04-28 17:57:14 +11:00
parent 119c04fb93
commit b1bd5d199e
No known key found for this signature in database
GPG Key ID: DC2B16215ED5412A
5 changed files with 41 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# Copyright 1999-2023 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@ -14,7 +14,7 @@ SRC_URI="https://github.com/moby/moby/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 ~arm arm64 ppc64 ~riscv ~x86"
IUSE="apparmor btrfs +container-init device-mapper overlay seccomp selinux"
IUSE="apparmor btrfs +container-init device-mapper overlay seccomp selinux systemd"
DEPEND="
acct-group/docker
@ -23,6 +23,7 @@ DEPEND="
btrfs? ( >=sys-fs/btrfs-progs-3.16.1 )
device-mapper? ( >=sys-fs/lvm2-2.02.89[thin] )
seccomp? ( >=sys-libs/libseccomp-2.2.1 )
systemd? ( sys-apps/systemd )
"
# https://github.com/moby/moby/blob/master/project/PACKAGERS.md#runtime-dependencies
@ -54,6 +55,7 @@ S="${WORKDIR}/${P}/src/${EGO_PN}"
# https://bugs.gentoo.org/748984 https://github.com/etcd-io/etcd/pull/12552
PATCHES=(
"${FILESDIR}/0001-Openrc-Depend-on-containerd-init-script.patch"
"${FILESDIR}/docker-24.0.5-automagic-systemd.patch"
)
pkg_setup() {
@ -263,6 +265,8 @@ src_compile() {
fi
done
export SYSTEMD=$(usex systemd 1 0)
# build binaries
./hack/make.sh dynbinary || die 'dynbinary failed'
}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2023 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@ -14,7 +14,7 @@ SRC_URI="https://github.com/moby/moby/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
IUSE="apparmor btrfs +container-init device-mapper overlay seccomp selinux"
IUSE="apparmor btrfs +container-init device-mapper overlay seccomp selinux systemd"
DEPEND="
acct-group/docker
@ -23,6 +23,7 @@ DEPEND="
btrfs? ( >=sys-fs/btrfs-progs-3.16.1 )
device-mapper? ( >=sys-fs/lvm2-2.02.89[thin] )
seccomp? ( >=sys-libs/libseccomp-2.2.1 )
systemd? ( sys-apps/systemd )
"
# https://github.com/moby/moby/blob/master/project/PACKAGERS.md#runtime-dependencies
@ -55,6 +56,7 @@ S="${WORKDIR}/${P}/src/${EGO_PN}"
# https://bugs.gentoo.org/748984 https://github.com/etcd-io/etcd/pull/12552
PATCHES=(
"${FILESDIR}/0001-Openrc-Depend-on-containerd-init-script.patch"
"${FILESDIR}/docker-24.0.5-automagic-systemd.patch"
)
pkg_setup() {
@ -264,6 +266,8 @@ src_compile() {
fi
done
export SYSTEMD=$(usex systemd 1 0)
# build binaries
./hack/make.sh dynbinary || die 'dynbinary failed'
}

View File

@ -54,6 +54,7 @@ S="${WORKDIR}/${P}/src/${EGO_PN}"
# https://bugs.gentoo.org/748984 https://github.com/etcd-io/etcd/pull/12552
PATCHES=(
"${FILESDIR}/0001-Openrc-Depend-on-containerd-init-script.patch"
"${FILESDIR}/docker-26.1.0-automagic-systemd.patch"
)
pkg_setup() {
@ -258,6 +259,8 @@ src_compile() {
fi
done
export SYSTEMD=$(usex systemd 1 0)
# build binaries
./hack/make.sh dynbinary || die 'dynbinary failed'
}

View File

@ -0,0 +1,13 @@
https://bugs.gentoo.org/914076
https://github.com/moby/moby/issues/47770
--- a/hack/make.sh
+++ b/hack/make.sh
@@ -90,7 +90,7 @@ add_buildtag() {
[[ " $DOCKER_BUILDTAGS" == *" $1_"* ]] || DOCKER_BUILDTAGS+=" $1_$2"
}
-if ${PKG_CONFIG} 'libsystemd' 2> /dev/null; then
+if [[ -n "$SYSTEMD" ]] && [[ "$SYSTEMD" == 1 ]] && ${PKG_CONFIG} 'libsystemd' 2> /dev/null; then
DOCKER_BUILDTAGS+=" journald"
fi

View File

@ -0,0 +1,13 @@
https://bugs.gentoo.org/914076
https://github.com/moby/moby/issues/47770
--- a/hack/make.sh
+++ b/hack/make.sh
@@ -83,7 +83,7 @@ if [ ! "$GOPATH" ]; then
exit 1
fi
-if ${PKG_CONFIG} 'libsystemd' 2> /dev/null; then
+if [[ -n "$SYSTEMD" ]] && [[ "$SYSTEMD" == 1 ]] && ${PKG_CONFIG} 'libsystemd' 2> /dev/null; then
DOCKER_BUILDTAGS+=" journald"
fi