[PATCH 01/94] sys-kernel/gnumach: new package, add 1.8, 1.8_p20260224, 9999

Sam James <[email protected]>
Newsgroups gmane.linux.gentoo.devel
Message-ID <27211a57e2c3aa50edb8e1804a3993e1779bf099.1774994272.git.sam@gentoo.org>
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 <[email protected]>
---
 profiles/package.mask                         |   1 +
 sys-kernel/gnumach/Manifest                   |   2 +
 sys-kernel/gnumach/gnumach-1.8.ebuild         |  88 +++++++++++++++
 .../gnumach/gnumach-1.8_p20260224.ebuild      | 105 ++++++++++++++++++
 sys-kernel/gnumach/gnumach-9999.ebuild        | 105 ++++++++++++++++++
 .../anope => sys-kernel/gnumach}/metadata.xml |   0
 6 files changed, 301 insertions(+)
 create mode 100644 sys-kernel/gnumach/Manifest
 create mode 100644 sys-kernel/gnumach/gnumach-1.8.ebuild
 create mode 100644 sys-kernel/gnumach/gnumach-1.8_p20260224.ebuild
 create mode 100644 sys-kernel/gnumach/gnumach-9999.ebuild
 copy {acct-group/anope => sys-kernel/gnumach}/metadata.xml (100%)

diff --git a/profiles/package.mask b/profiles/package.mask
index 804aae770a59f..00563c0ed8490 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 0000000000000..620de76308256
--- /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 0000000000000..86140faa2f216
--- /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 0000000000000..ddea69ed1dd84
--- /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 0000000000000..ddea69ed1dd84
--- /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/acct-group/anope/metadata.xml b/sys-kernel/gnumach/metadata.xml
similarity index 100%
copy from acct-group/anope/metadata.xml
copy to sys-kernel/gnumach/metadata.xml
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.