commit:     7ba831e58aab5709d32a28f6042d694ef342a935
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 12 10:23:09 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Mar 16 21:06:31 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ba831e5

sys-apps/openrc: port to GNU Hurd

This boots but it doesn't yet start up a login prompt. The builtin Hurd
init works.

Conditionalise the libcap dep to Linux (as is the case in the upstream
meson.build) and use a custom libexecdir to avoid clashing with 
sys-kernel/hurd's
`rc`. I've discussed possibly renaming rc in general w/ OpenRC upstream (navi)
as well.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-apps/openrc/openrc-0.63-r1.ebuild | 11 ++++++++++-
 sys-apps/openrc/openrc-9999.ebuild    | 11 ++++++++++-
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/sys-apps/openrc/openrc-0.63-r1.ebuild 
b/sys-apps/openrc/openrc-0.63-r1.ebuild
index 8285106b26f6..7d135106d3e3 100644
--- a/sys-apps/openrc/openrc-0.63-r1.ebuild
+++ b/sys-apps/openrc/openrc-0.63-r1.ebuild
@@ -21,7 +21,7 @@ SLOT="0"
 IUSE="audit bash debug pam newnet +netifrc selinux s6 +sysvinit sysv-utils 
unicode"
 
 COMMON_DEPEND="
-       sys-libs/libcap
+       kernel_linux? ( sys-libs/libcap )
        sys-process/psmisc
        pam? ( sys-libs/pam )
        audit? ( sys-process/audit )
@@ -63,6 +63,15 @@ src_configure() {
                -Dshell=$(usex bash "${EPREFIX}/bin/bash" "${EPREFIX}/bin/sh")
                $(meson_use sysv-utils sysvinit)
        )
+
+       # XXX: hurd hack
+       if use kernel_Hurd ; then
+               # Avoid collision with sys-kernel/hurd's own /usr/libexec/rc
+               emesonargs+=(
+                       -Dlibexecdir="${EPREFIX}/usr/libexec/openrc"
+               )
+       fi
+
        # export DEBUG=$(usev debug)
        meson_src_configure
 }

diff --git a/sys-apps/openrc/openrc-9999.ebuild 
b/sys-apps/openrc/openrc-9999.ebuild
index f1a11d1a9716..7e73a8ca78f6 100644
--- a/sys-apps/openrc/openrc-9999.ebuild
+++ b/sys-apps/openrc/openrc-9999.ebuild
@@ -21,7 +21,7 @@ SLOT="0"
 IUSE="audit bash debug pam newnet +netifrc selinux s6 +sysvinit sysv-utils 
unicode"
 
 COMMON_DEPEND="
-       sys-libs/libcap
+       kernel_linux? ( sys-libs/libcap )
        sys-process/psmisc
        pam? ( sys-libs/pam )
        audit? ( sys-process/audit )
@@ -63,6 +63,15 @@ src_configure() {
                -Dshell=$(usex bash "${EPREFIX}/bin/bash" "${EPREFIX}/bin/sh")
                $(meson_use sysv-utils sysvinit)
        )
+
+       # XXX: hurd hack
+       if use kernel_Hurd ; then
+               # Avoid collision with sys-kernel/hurd's own /usr/libexec/rc
+               emesonargs+=(
+                       -Dlibexecdir="${EPREFIX}/usr/libexec/openrc"
+               )
+       fi
+
        # export DEBUG=$(usev debug)
        meson_src_configure
 }

Reply via email to