commit: 6c39ca9cf28b2d970475ea4914eea5cfb5254a93 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Sat Mar 7 05:56:06 2026 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sun Mar 15 22:29:47 2026 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c39ca9c
sys-kernel/hurd: new package, add 0.9, 0.9_p20251029, 9999 The last release of GNU Hurd is very old. savannah doesn't allow snapshot downloads from cgit as of 2026-03, but the Debian maintainer is also upstream, so just use theirs instead. Signed-off-by: Sam James <sam <AT> gentoo.org> profiles/package.mask | 1 + sys-kernel/hurd/Manifest | 2 + sys-kernel/hurd/hurd-0.9.ebuild | 92 +++++++++++++++++++ sys-kernel/hurd/hurd-0.9_p20251029.ebuild | 145 ++++++++++++++++++++++++++++++ sys-kernel/hurd/hurd-9999.ebuild | 145 ++++++++++++++++++++++++++++++ sys-kernel/hurd/metadata.xml | 14 +++ 6 files changed, 399 insertions(+) diff --git a/profiles/package.mask b/profiles/package.mask index 00563c0ed849..477fa0eb98cc 100644 --- a/profiles/package.mask +++ b/profiles/package.mask @@ -743,3 +743,4 @@ dev-embedded/avr-libc sys-devel/nvptx-tools sys-devel/clang-crossdev-wrappers sys-kernel/gnumach +sys-kernel/hurd diff --git a/sys-kernel/hurd/Manifest b/sys-kernel/hurd/Manifest new file mode 100644 index 000000000000..3d1b8fbbddc1 --- /dev/null +++ b/sys-kernel/hurd/Manifest @@ -0,0 +1,2 @@ +DIST hurd-0.9.tar.bz2 2464800 BLAKE2B 71421acbe9a42b4c7c3b1af9a19fe6973510e9afd8a98569868521d3678d8cf75f0169a15f98d17de11729bbbaf4a667952fef4b2dc9cc864ffa48f5e62aa016 SHA512 715915c9bcb8f1f2102131e38931c2e151737ab7a2199f2e335f8e0b17439fde1fd1e6b6d681546391251043ba2c6ff3913cd80e9bb9f7bb83a93ef9afcb31b0 +DIST hurd_0.9.git20251029.orig.tar.bz2 2047762 BLAKE2B a349bb475e966ed824b1a31b8f76edd72bef5a3c149ec810de140462893eca9d01f45784645f996b75b6277da49f75f2db524cc548febbcb46c2621ba024db3e SHA512 7322236abdea9bea0885983580890f3ed6393e567b6c1a5c52ffe40e76694e887eb22c1da5743e215a2c74b0e22af1457cd95fc517a6371e564da412378c2736 diff --git a/sys-kernel/hurd/hurd-0.9.ebuild b/sys-kernel/hurd/hurd-0.9.ebuild new file mode 100644 index 000000000000..04650139828d --- /dev/null +++ b/sys-kernel/hurd/hurd-0.9.ebuild @@ -0,0 +1,92 @@ +# Copyright 2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit crossdev flag-o-matic + +DESCRIPTION="GNU Hurd is the GNU project's replacement for UNIX" +HOMEPAGE="https://www.gnu.org/software/hurd/hurd.html" + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://git.savannah.gnu.org/git/hurd/hurd.git" + inherit autotools git-r3 +else + SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2" + + KEYWORDS="~x86" +fi + +LICENSE="GPL-2 BSD-2" +SLOT="0" +IUSE="headers-only" + +if is_crosspkg ; then + BDEPEND=" + !headers-only? ( cross-${CTARGET}/mig ) + " +else + BDEPEND=" + dev-util/mig + " +fi + +src_prepare() { + default + [[ ${PV} == 9999 ]] && eautoreconf +} + +src_configure() { + if target_is_not_host ; then + local sysroot=/usr/${CTARGET} + export MIG="${CTARGET}-mig" + fi + + local myeconfargs=( + --prefix="${EPREFIX}${sysroot}/usr" + --datadir="${EPREFIX}${sysroot}/usr/share" + --host=${CTARGET} + ) + + if use headers-only ; then + myeconfargs+=( + ac_cv_func_file_exec_paths=no + ac_cv_func_exec_exec_paths=no + ac_cv_func__hurd_exec_paths=no + ac_cv_func__hurd_libc_proc_init=no + ac_cv_func_mach_port_set_ktype=no + ac_cv_func_file_utimens=no + + # TODO: Wire these up to not be automagic for + # USE=-headers-only! + --without-libcrypt + --without-parted + --without-libbz2 + --without-libz + --without-rump + --disable-ncursesw + ) + fi + + econf "${myeconfargs[@]}" +} + +src_compile() { + use headers-only && return + default +} + +src_test() { + use headers-only && return + default +} + +src_install() { + emake DESTDIR="${D}" $(usex headers-only install-headers install) no_deps=t + + if target_is_not_host ; then + # TODO: Is this needed? + # On Hurd, gcc expects system headers to be in /include, not /usr/include + dosym usr/include /usr/${CTARGET}/include + fi +} diff --git a/sys-kernel/hurd/hurd-0.9_p20251029.ebuild b/sys-kernel/hurd/hurd-0.9_p20251029.ebuild new file mode 100644 index 000000000000..f1173ce985c0 --- /dev/null +++ b/sys-kernel/hurd/hurd-0.9_p20251029.ebuild @@ -0,0 +1,145 @@ +# Copyright 2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit crossdev flag-o-matic + +DESCRIPTION="GNU Hurd is the GNU project's replacement for UNIX" +HOMEPAGE="https://www.gnu.org/software/hurd/hurd.html" + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://git.savannah.gnu.org/git/hurd/hurd.git" + inherit autotools git-r3 +elif [[ ${PV} == *_p* ]] ; then + inherit autotools + + MY_PV=${PV%_p*}.git${PV#*_p} + MY_P=${PN}_${MY_PV} + + # savannah doesn't allow snapshot downloads from cgit as of 2026-03, + # but the Debian maintainer is also upstream, so just use theirs + # instead. + SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${MY_P}.orig.tar.bz2" + S="${WORKDIR}"/${MY_P/_/-} +else + SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2" +fi + +LICENSE="GPL-2 BSD-2" +SLOT="0" +if is_crosspkg ; then + IUSE="headers-only" +else + IUSE="ncurses" +fi +[[ ${PV} != 9999 ]] && KEYWORDS="~amd64 ~x86" + +if is_crosspkg ; then + BDEPEND=" + !headers-only? ( cross-${CTARGET}/mig ) + " +else + DEPEND=" + app-arch/bzip2:=[static-libs] + dev-libs/libdaemon:= + >=dev-libs/libgcrypt-1.8.0:= + dev-util/mig + sys-apps/util-linux[static-libs] + x11-libs/libpciaccess[static-libs] + x11-libs/libxkbcommon + virtual/libcrypt:=[static-libs] + virtual/zlib:=[static-libs] + ncurses? ( sys-libs/ncurses:= ) + " + RDEPEND="${DEPEND}" + BDEPEND="virtual/pkgconfig" +fi + +src_prepare() { + default + [[ ${PV} == 9999 || ${PV} == *_p* ]] && eautoreconf +} + +src_configure() { + if target_is_not_host ; then + local sysroot=/usr/${CTARGET} + export MIG="${CTARGET}-mig" + fi + + local myeconfargs=( + # XXX: --enable-static-progs seems to behave differently + # to the default. + --prefix="${EPREFIX}${sysroot}/usr" + --datadir="${EPREFIX}${sysroot}/usr/share" + --host=${CTARGET} + ) + + append-flags -Wl,--no-error-rwx-segments -Wl,--no-error-execstack -Wl,-z,notext + + if use headers-only ; then + myeconfargs+=( + ac_cv_func_file_exec_paths=no + ac_cv_func_exec_exec_paths=no + ac_cv_func__hurd_exec_paths=no + ac_cv_func__hurd_libc_proc_init=no + ac_cv_func_mach_port_set_ktype=no + ac_cv_func_file_utimens=no + + --without-acpica + --without-libcrypt + --without-libbz2 + --without-libz + --without-libtirpc + --without-parted + --without-rump + --disable-ncursesw + ) + else + myeconfargs+=( + # Builds everything twice and needs profiling libs + --disable-profile + + # Unpackaged + --without-acpica + --without-rump + + # TODO (configure really wants parted) + --without-parted + # TODO (nfs) + --without-libtirpc + + --with-libcrypt + --with-libbz2 + --with-libz + + $(use_enable ncurses ncursesw) + ) + fi + + econf "${myeconfargs[@]}" +} + +src_compile() { + use headers-only && return + default +} + +src_test() { + use headers-only && return + default +} + +src_install() { + emake DESTDIR="${D}" $(usex headers-only install-headers install) no_deps=t + + if target_is_not_host ; then + # TODO: Is this needed? + # On Hurd, gcc expects system headers to be in /include, not /usr/include + dosym usr/include /usr/${CTARGET}/include + + # Avoid collisions for other Hurd targets + # TODO: autoconf var? + rm -rfv "${ED}"/usr/share/info || die + fi +} diff --git a/sys-kernel/hurd/hurd-9999.ebuild b/sys-kernel/hurd/hurd-9999.ebuild new file mode 100644 index 000000000000..f1173ce985c0 --- /dev/null +++ b/sys-kernel/hurd/hurd-9999.ebuild @@ -0,0 +1,145 @@ +# Copyright 2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit crossdev flag-o-matic + +DESCRIPTION="GNU Hurd is the GNU project's replacement for UNIX" +HOMEPAGE="https://www.gnu.org/software/hurd/hurd.html" + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://git.savannah.gnu.org/git/hurd/hurd.git" + inherit autotools git-r3 +elif [[ ${PV} == *_p* ]] ; then + inherit autotools + + MY_PV=${PV%_p*}.git${PV#*_p} + MY_P=${PN}_${MY_PV} + + # savannah doesn't allow snapshot downloads from cgit as of 2026-03, + # but the Debian maintainer is also upstream, so just use theirs + # instead. + SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${MY_P}.orig.tar.bz2" + S="${WORKDIR}"/${MY_P/_/-} +else + SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2" +fi + +LICENSE="GPL-2 BSD-2" +SLOT="0" +if is_crosspkg ; then + IUSE="headers-only" +else + IUSE="ncurses" +fi +[[ ${PV} != 9999 ]] && KEYWORDS="~amd64 ~x86" + +if is_crosspkg ; then + BDEPEND=" + !headers-only? ( cross-${CTARGET}/mig ) + " +else + DEPEND=" + app-arch/bzip2:=[static-libs] + dev-libs/libdaemon:= + >=dev-libs/libgcrypt-1.8.0:= + dev-util/mig + sys-apps/util-linux[static-libs] + x11-libs/libpciaccess[static-libs] + x11-libs/libxkbcommon + virtual/libcrypt:=[static-libs] + virtual/zlib:=[static-libs] + ncurses? ( sys-libs/ncurses:= ) + " + RDEPEND="${DEPEND}" + BDEPEND="virtual/pkgconfig" +fi + +src_prepare() { + default + [[ ${PV} == 9999 || ${PV} == *_p* ]] && eautoreconf +} + +src_configure() { + if target_is_not_host ; then + local sysroot=/usr/${CTARGET} + export MIG="${CTARGET}-mig" + fi + + local myeconfargs=( + # XXX: --enable-static-progs seems to behave differently + # to the default. + --prefix="${EPREFIX}${sysroot}/usr" + --datadir="${EPREFIX}${sysroot}/usr/share" + --host=${CTARGET} + ) + + append-flags -Wl,--no-error-rwx-segments -Wl,--no-error-execstack -Wl,-z,notext + + if use headers-only ; then + myeconfargs+=( + ac_cv_func_file_exec_paths=no + ac_cv_func_exec_exec_paths=no + ac_cv_func__hurd_exec_paths=no + ac_cv_func__hurd_libc_proc_init=no + ac_cv_func_mach_port_set_ktype=no + ac_cv_func_file_utimens=no + + --without-acpica + --without-libcrypt + --without-libbz2 + --without-libz + --without-libtirpc + --without-parted + --without-rump + --disable-ncursesw + ) + else + myeconfargs+=( + # Builds everything twice and needs profiling libs + --disable-profile + + # Unpackaged + --without-acpica + --without-rump + + # TODO (configure really wants parted) + --without-parted + # TODO (nfs) + --without-libtirpc + + --with-libcrypt + --with-libbz2 + --with-libz + + $(use_enable ncurses ncursesw) + ) + fi + + econf "${myeconfargs[@]}" +} + +src_compile() { + use headers-only && return + default +} + +src_test() { + use headers-only && return + default +} + +src_install() { + emake DESTDIR="${D}" $(usex headers-only install-headers install) no_deps=t + + if target_is_not_host ; then + # TODO: Is this needed? + # On Hurd, gcc expects system headers to be in /include, not /usr/include + dosym usr/include /usr/${CTARGET}/include + + # Avoid collisions for other Hurd targets + # TODO: autoconf var? + rm -rfv "${ED}"/usr/share/info || die + fi +} diff --git a/sys-kernel/hurd/metadata.xml b/sys-kernel/hurd/metadata.xml new file mode 100644 index 000000000000..9aeb4320a581 --- /dev/null +++ b/sys-kernel/hurd/metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>[email protected]</email> + <name>Sam James</name> + </maintainer> + <use> + <flag name="ncurses"> + Build console-curses client for non-basic capabilities, + unlike the builtin one. + </flag> + </use> +</pkgmetadata>
