commit:     1b6b6de34f19dceb3a64c66cd5d2bbb4ada29355
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 29 18:21:40 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 29 18:24:39 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1b6b6de3

app-emulation/rkt: support rkt_stage1_host

Package-Manager: portage-2.2.27

 app-emulation/rkt/rkt-1.1.0.ebuild | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/app-emulation/rkt/rkt-1.1.0.ebuild 
b/app-emulation/rkt/rkt-1.1.0.ebuild
index 4ae5909..3628d9e 100644
--- a/app-emulation/rkt/rkt-1.1.0.ebuild
+++ b/app-emulation/rkt/rkt-1.1.0.ebuild
@@ -32,8 +32,8 @@ HOMEPAGE="https://github.com/coreos/rkt";
 
 LICENSE="Apache-2.0"
 SLOT="0"
-IUSE="doc examples +rkt_stage1_coreos +rkt_stage1_fly rkt_stage1_kvm 
rkt_stage1_src +actool"
-REQUIRED_USE="|| ( rkt_stage1_coreos rkt_stage1_fly rkt_stage1_kvm 
rkt_stage1_src )"
+IUSE="doc examples +rkt_stage1_coreos +rkt_stage1_fly rkt_stage1_host 
rkt_stage1_kvm rkt_stage1_src +actool systemd"
+REQUIRED_USE="|| ( rkt_stage1_coreos rkt_stage1_fly rkt_stage1_host 
rkt_stage1_kvm rkt_stage1_src ) rkt_stage1_host? ( systemd )"
 
 DEPEND=">=dev-lang/go-1.4.1
        app-arch/cpio
@@ -41,7 +41,11 @@ DEPEND=">=dev-lang/go-1.4.1
        sys-fs/squashfs-tools
        dev-perl/Capture-Tiny"
 
-RDEPEND="!app-emulation/rocket"
+RDEPEND="!app-emulation/rocket
+       systemd? (
+               >=sys-apps/systemd-222
+               app-shells/bash:0
+       )"
 
 BUILDDIR="build-${P}"
 STAGE1_DEFAULT_LOCATION="/usr/share/rkt/stage1.aci"
@@ -84,6 +88,12 @@ src_prepare() {
        sed -e 's|wget .*|ln -s 
"$${DISTDIR}/linux-'${KVM_LINUX_VERSION}'.tar.xz" "$@"|' \
                -i stage1/usr_from_kvm/kernel.mk || die
 
+       if use rkt_stage1_host; then
+               # Make systemdUnitsPath consistent with host
+               sed -e 's|\(systemdUnitsPath := 
\).*|\1"'$(systemd_get_systemunitdir)'"|' \
+                       -i stage1/init/init.go || die
+       fi
+
        autotools-utils_src_prepare
 }
 
@@ -93,11 +103,8 @@ src_configure() {
                --with-stage1-default-location="${STAGE1_DEFAULT_LOCATION}"
        )
 
-       # TODO:
-       #  - fix rkt_stage1_kvm to not download kernel sources with wget
-       #  - fix rkt_stage1_host to not fail during launch
-
        # enable flavors (first is default)
+       use rkt_stage1_host && flavors+=",host"
        use rkt_stage1_src && flavors+=",src"
        use rkt_stage1_coreos && flavors+=",coreos"
        use rkt_stage1_fly && flavors+=",fly"
@@ -148,7 +155,9 @@ src_install() {
        doins "${S}/${BUILDDIR}/bin/"*.aci
 
        # create symlink for default stage1 image path
-       if use rkt_stage1_src; then
+       if use rkt_stage1_host; then
+               dosym stage1-host.aci "${STAGE1_DEFAULT_LOCATION}"
+       elif use rkt_stage1_src; then
                dosym stage1-src.aci "${STAGE1_DEFAULT_LOCATION}"
        elif use rkt_stage1_coreos; then
                dosym stage1-coreos.aci "${STAGE1_DEFAULT_LOCATION}"

Reply via email to