commit: 3ce0255e9cbc84cd4290c5d3dfb5559c075df416 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Sat Mar 7 05:52:46 2026 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sun Mar 15 22:29:46 2026 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ce0255e
sys-kernel/gnumach: new package, add 1.8, 1.8_p20260224, 9999 The last release of GNU Mach 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/gnumach/Manifest | 2 + sys-kernel/gnumach/gnumach-1.8.ebuild | 88 ++++++++++++++++++++ sys-kernel/gnumach/gnumach-1.8_p20260224.ebuild | 105 ++++++++++++++++++++++++ sys-kernel/gnumach/gnumach-9999.ebuild | 105 ++++++++++++++++++++++++ sys-kernel/gnumach/metadata.xml | 8 ++ 6 files changed, 309 insertions(+) diff --git a/profiles/package.mask b/profiles/package.mask index 804aae770a59..00563c0ed849 100644 --- a/profiles/package.mask +++ b/profiles/package.mask @@ -742,3 +742,4 @@ sys-libs/newlib dev-embedded/avr-libc sys-devel/nvptx-tools sys-devel/clang-crossdev-wrappers +sys-kernel/gnumach diff --git a/sys-kernel/gnumach/Manifest b/sys-kernel/gnumach/Manifest new file mode 100644 index 000000000000..620de7630825 --- /dev/null +++ b/sys-kernel/gnumach/Manifest @@ -0,0 +1,2 @@ +DIST gnumach-1.8.tar.gz 4053816 BLAKE2B 575d8cd1941739391e74263026ecd8a0dcdcd598ba02e930dbe7d5d65b09dba1c46d437eea15f7918e256f075b0f7b19c10f65c5dbbddcc9d2d7bcd67f1a27ea SHA512 05a4d1219e94bd3a4fc01d1fea81f0b0c39069a609eff6ba8081859401da621133110cf8f92e30f2a73293c60115b60937326e76ed48fb666ed67636929490f1 +DIST gnumach_1.8+git20260224.orig.tar.xz 2951432 BLAKE2B 8f0bda1736aeebbb917fcf9f1d79b51a8a4d6315b170495ee10a81a787fe4bad15f17ebfd4bf1802b9cde0313ecbeee2b413a8954e69e7d23c6832fb4ec1f8c0 SHA512 aaea1653862a7d6fdcc741257a245e0f3d7dd177fdd78ed443f6c85ee6057e0effe27fb16f00d7ac64012664c1411907fbcf7bb330ca4f202da975a2d28afd6a diff --git a/sys-kernel/gnumach/gnumach-1.8.ebuild b/sys-kernel/gnumach/gnumach-1.8.ebuild new file mode 100644 index 000000000000..86140faa2f21 --- /dev/null +++ b/sys-kernel/gnumach/gnumach-1.8.ebuild @@ -0,0 +1,88 @@ +# Copyright 2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit crossdev flag-o-matic toolchain-funcs + +DESCRIPTION="GNU Mach Kernel" +HOMEPAGE="https://www.gnu.org/software/hurd/microkernel/mach/gnumach.html" + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://git.savannah.gnu.org/git/hurd/gnumach.git" + inherit autotools git-r3 +else + SRC_URI="mirror://gnu/${PN}/${P}.tar.gz" + + KEYWORDS="~x86" +fi + +LICENSE="GPL-2 BSD-2" +SLOT="0" +IUSE="headers-only" + +if is_crosspkg ; then + DEPEND=" + !headers-only? ( cross-${CTARGET}/mig ) + " +else + DEPEND=" + dev-util/mig + " +fi + +src_prepare() { + default + [[ ${PV} == 9999 ]] && eautoreconf +} + +src_configure() { + if target_is_not_host ; then + local sysroot=/usr/${CTARGET} + + if use headers-only ; then + # Assume we don't have working cross-compiler + export CC=$(tc-getBUILD_CC) + else + export MIG="${CTARGET}-mig" + fi + fi + + local myeconfargs=( + # MIG machinery relies on this! + --enable-dependency-tracking + --prefix="${EPREFIX}${sysroot}/usr" + --datadir="${EPREFIX}${sysroot}/usr/share" + --host=${CTARGET} + ) + + export LDFLAGS="$(raw-ldflags)" + + 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-data install) + + 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 installing manpages into common location to allow + # multiple Hurd targets. + # TODO: autoconf var? + rm -rfv "${ED}"/usr/share/info + rmdir "${ED}"/usr/share || die + fi +} diff --git a/sys-kernel/gnumach/gnumach-1.8_p20260224.ebuild b/sys-kernel/gnumach/gnumach-1.8_p20260224.ebuild new file mode 100644 index 000000000000..ddea69ed1dd8 --- /dev/null +++ b/sys-kernel/gnumach/gnumach-1.8_p20260224.ebuild @@ -0,0 +1,105 @@ +# Copyright 2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit crossdev flag-o-matic toolchain-funcs + +DESCRIPTION="GNU Mach Kernel" +HOMEPAGE="https://www.gnu.org/software/hurd/microkernel/mach/gnumach.html" + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://git.savannah.gnu.org/git/hurd/gnumach.git" + inherit autotools git-r3 +elif [[ ${PV} == *_p* ]] ; then + 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.xz" + S="${WORKDIR}"/${MY_P/_/-} +else + SRC_URI="mirror://gnu/${PN}/${P}.tar.gz" +fi + +LICENSE="GPL-2 BSD-2" +SLOT="0" +IUSE="headers-only" +[[ ${PV} != 9999 ]] && KEYWORDS="~amd64 ~x86" + +if is_crosspkg ; then + DEPEND=" + !headers-only? ( cross-${CTARGET}/mig ) + " +else + DEPEND=" + dev-util/mig + " +fi + +src_prepare() { + default + [[ ${PV} == 9999 ]] && eautoreconf +} + +src_configure() { + if target_is_not_host ; then + local sysroot=/usr/${CTARGET} + + if use headers-only ; then + # Assume we don't have working cross-compiler + export CC=$(tc-getBUILD_CC) + else + export MIG="${CTARGET}-mig" + fi + fi + + strip-flags + # LTO confuses one of the assemble steps + filter-lto + # -g3 confuses MIG which relies on preprocessed input + replace-flags '-g*' '-g1' + # LD gets invoked directly. raw-ldflags would work here except + # that it breaks configure which uses the compiler driver + unset LDFLAGS + + local myeconfargs=( + # MIG machinery relies on this! + --enable-dependency-tracking + --prefix="${EPREFIX}${sysroot}/usr" + --datadir="${EPREFIX}${sysroot}/usr/share" + --host=${CTARGET} + + # Needed for QEMU with `-net nic,model=ne2k_pc` at least + --enable-net-group + ) + + 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-data install) + + if target_is_not_host ; then + # On Hurd, gcc expects system headers to be in /include, not /usr/include + # TODO: Is this needed? + dosym usr/include /usr/${CTARGET}/include + + # Avoid collisions for other Hurd targets + # TODO: autoconf var? + rm -rfv "${ED}"/usr/share/info || die + rmdir "${ED}"/usr/share || die + fi +} diff --git a/sys-kernel/gnumach/gnumach-9999.ebuild b/sys-kernel/gnumach/gnumach-9999.ebuild new file mode 100644 index 000000000000..ddea69ed1dd8 --- /dev/null +++ b/sys-kernel/gnumach/gnumach-9999.ebuild @@ -0,0 +1,105 @@ +# Copyright 2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit crossdev flag-o-matic toolchain-funcs + +DESCRIPTION="GNU Mach Kernel" +HOMEPAGE="https://www.gnu.org/software/hurd/microkernel/mach/gnumach.html" + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://git.savannah.gnu.org/git/hurd/gnumach.git" + inherit autotools git-r3 +elif [[ ${PV} == *_p* ]] ; then + 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.xz" + S="${WORKDIR}"/${MY_P/_/-} +else + SRC_URI="mirror://gnu/${PN}/${P}.tar.gz" +fi + +LICENSE="GPL-2 BSD-2" +SLOT="0" +IUSE="headers-only" +[[ ${PV} != 9999 ]] && KEYWORDS="~amd64 ~x86" + +if is_crosspkg ; then + DEPEND=" + !headers-only? ( cross-${CTARGET}/mig ) + " +else + DEPEND=" + dev-util/mig + " +fi + +src_prepare() { + default + [[ ${PV} == 9999 ]] && eautoreconf +} + +src_configure() { + if target_is_not_host ; then + local sysroot=/usr/${CTARGET} + + if use headers-only ; then + # Assume we don't have working cross-compiler + export CC=$(tc-getBUILD_CC) + else + export MIG="${CTARGET}-mig" + fi + fi + + strip-flags + # LTO confuses one of the assemble steps + filter-lto + # -g3 confuses MIG which relies on preprocessed input + replace-flags '-g*' '-g1' + # LD gets invoked directly. raw-ldflags would work here except + # that it breaks configure which uses the compiler driver + unset LDFLAGS + + local myeconfargs=( + # MIG machinery relies on this! + --enable-dependency-tracking + --prefix="${EPREFIX}${sysroot}/usr" + --datadir="${EPREFIX}${sysroot}/usr/share" + --host=${CTARGET} + + # Needed for QEMU with `-net nic,model=ne2k_pc` at least + --enable-net-group + ) + + 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-data install) + + if target_is_not_host ; then + # On Hurd, gcc expects system headers to be in /include, not /usr/include + # TODO: Is this needed? + dosym usr/include /usr/${CTARGET}/include + + # Avoid collisions for other Hurd targets + # TODO: autoconf var? + rm -rfv "${ED}"/usr/share/info || die + rmdir "${ED}"/usr/share || die + fi +} diff --git a/sys-kernel/gnumach/metadata.xml b/sys-kernel/gnumach/metadata.xml new file mode 100644 index 000000000000..641cbd3703e7 --- /dev/null +++ b/sys-kernel/gnumach/metadata.xml @@ -0,0 +1,8 @@ +<?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> +</pkgmetadata>
