diff --git a/sdk_container/src/third_party/coreos-overlay/sys-process/tini/README.md b/sdk_container/src/third_party/coreos-overlay/sys-process/tini/README.md deleted file mode 100644 index b7ea2dcbde..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-process/tini/README.md +++ /dev/null @@ -1,5 +0,0 @@ -This is a fork of gentoo's sys-process/tini package. The sole reason -that this package is in coreos-overlay and not in portage-stable is to -get rid of the build dependency on cmake, which we do not provide. The -build system is replaced with a small autotools setup (see -[files/automake](files/automake)). diff --git a/sdk_container/src/third_party/coreos-overlay/sys-process/tini/files/automake/Makefile.am b/sdk_container/src/third_party/coreos-overlay/sys-process/tini/files/automake/Makefile.am deleted file mode 100644 index af437a64d6..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-process/tini/files/automake/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = src diff --git a/sdk_container/src/third_party/coreos-overlay/sys-process/tini/files/automake/configure.ac b/sdk_container/src/third_party/coreos-overlay/sys-process/tini/files/automake/configure.ac deleted file mode 100644 index b4d32b3278..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-process/tini/files/automake/configure.ac +++ /dev/null @@ -1,12 +0,0 @@ -AC_INIT([tini], [0.1]) -AC_PROG_CC - -AM_INIT_AUTOMAKE([]) - -AC_SUBST(tini_VERSION_MAJOR) -AC_SUBST(tini_VERSION_MINOR) -AC_SUBST(tini_VERSION_PATCH) -AC_SUBST(tini_VERSION_GIT) - -AC_CONFIG_FILES([Makefile src/Makefile src/tiniConfig.h tpl/VERSION]) -AC_OUTPUT diff --git a/sdk_container/src/third_party/coreos-overlay/sys-process/tini/files/automake/src/Makefile.am b/sdk_container/src/third_party/coreos-overlay/sys-process/tini/files/automake/src/Makefile.am deleted file mode 100644 index 115d247d5d..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-process/tini/files/automake/src/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -bin_PROGRAMS = tini -tini_SOURCES = tini.c - -tini_CFLAGS = -static diff --git a/sdk_container/src/third_party/coreos-overlay/sys-process/tini/tini-0.19.0-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-process/tini/tini-0.19.0-r1.ebuild deleted file mode 100644 index a1279af126..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-process/tini/tini-0.19.0-r1.ebuild +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# Flatcar: Based on tini-0.18.0.ebuild from commit -# d6c89a5caedbe5cae98142ebb99974b41177aedd in gentoo repo (see -# https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-process/tini/tini-0.18.0.ebuild?id=d6c89a5caedbe5cae98142ebb99974b41177aedd). - -EAPI=7 - -# Flatcar: We provide our autotools-based build system to avoid build -# dependency on cmake. So the settings are hardcoded in the build -# system - we want static binary and a non-minimal build. -inherit autotools - -GIT_COMMIT=de40ad007797e0dcd8b7126f27bb87401d224240 -DESCRIPTION="A tiny but valid init for containers" -HOMEPAGE="https://github.com/krallin/tini" -SRC_URI="https://github.com/krallin/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="MIT" -SLOT="0" -# Flatcar: We don't mark arm64 as "testing". -KEYWORDS="amd64 arm64" -# Flatcar: No IUSE on args or on static - it's hardcoded in the build -# system replacement. - -src_prepare() { - # Flatcar: We don't use cmake, so all the code handling cmake - # stuff is dropped. Autotools provide the standard configure - # && make && make install build protocol, which Gentoo handles - # out of the box. - for file in configure.ac Makefile.am src/Makefile.am; do - cp "${FILESDIR}/automake/${file}" "${S}/${file}" - done - eapply_user - - export tini_VERSION_MAJOR=$(ver_cut 1) - export tini_VERSION_MINOR=$(ver_cut 2) - export tini_VERSION_PATCH=$(ver_cut 3) - export tini_VERSION_GIT=${GIT_COMMIT} - eautoreconf -} diff --git a/sdk_container/src/third_party/coreos-overlay/sys-process/tini/Manifest b/sdk_container/src/third_party/portage-stable/sys-process/tini/Manifest similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/sys-process/tini/Manifest rename to sdk_container/src/third_party/portage-stable/sys-process/tini/Manifest diff --git a/sdk_container/src/third_party/coreos-overlay/sys-process/tini/metadata.xml b/sdk_container/src/third_party/portage-stable/sys-process/tini/metadata.xml similarity index 87% rename from sdk_container/src/third_party/coreos-overlay/sys-process/tini/metadata.xml rename to sdk_container/src/third_party/portage-stable/sys-process/tini/metadata.xml index 7d1b420712..f7f648a7d2 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-process/tini/metadata.xml +++ b/sdk_container/src/third_party/portage-stable/sys-process/tini/metadata.xml @@ -1,5 +1,5 @@ - + krallin/tini diff --git a/sdk_container/src/third_party/portage-stable/sys-process/tini/tini-0.19.0-r1.ebuild b/sdk_container/src/third_party/portage-stable/sys-process/tini/tini-0.19.0-r1.ebuild new file mode 100644 index 0000000000..0f911be287 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/sys-process/tini/tini-0.19.0-r1.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake flag-o-matic + +# guard against forgetfulness, https://bugs.gentoo.org/795936 +GIT_COMMIT_0190="de40ad007797e0dcd8b7126f27bb87401d224240" +GIT_COMMIT="GIT_COMMIT_${PV//./}" +GIT_COMMIT="${!GIT_COMMIT}" + +DESCRIPTION="A tiny but valid init for containers" +HOMEPAGE="https://github.com/krallin/tini" +SRC_URI="https://github.com/krallin/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="amd64 arm arm64 hppa ppc64 ~riscv ~x86" +IUSE="+args +static" + +src_prepare() { + + [[ -z ${GIT_COMMIT} ]] && die "forgetful maintainer! please define GIT_COMMIT_${PV//./} on bump" + + cmake_src_prepare + + local sed_args=( + # Do not strip binary + -e 's/-Wl,-s")$/")/' + + # Remove -Werror and -pedantic-errors in order to allow macro + # redefinition, so that CFLAGS="-U_FORTIFY_SOURCE" does not + # trigger an error due to add_definitions(-D_FORTIFY_SOURCE=2) + # in CMakeLists.txt (bug 626438). + -e "s/ -Werror / /" + -e "s/ -pedantic-errors / /" + ) + + sed -i "${sed_args[@]}" \ + -e "s/git.*status --porcelain.*/true/" \ + -e "s/git.*log -n 1.*/true/" \ + -e "s/git.\${tini_VERSION_GIT}/git.${GIT_COMMIT}/" \ + CMakeLists.txt || die +} + +src_configure() { + local mycmakeargs=() + use args || mycmakeargs+=(-DMINIMAL=ON) + + cmake_src_configure +} + +src_compile() { + append-cflags -DPR_SET_CHILD_SUBREAPER=36 -DPR_GET_CHILD_SUBREAPER=37 + cmake_src_compile +} + +src_install() { + cmake_src_install + if use static; then + mv "${ED}"/usr/bin/{${PN}-static,${PN}} || die + else + rm "${ED}"/usr/bin/${PN}-static || die + fi +}