[PATCH 68/94] sys-kernel/hurd: arrange to install libshouldbeinlibc for cross-*

Sam James <[email protected]>
Newsgroups gmane.linux.gentoo.devel
Message-ID <952aef006999c17a1523b20be18df20ed917f533.1774994350.git.sam@gentoo.org>
For cross-*, we always want a minimal build even with USE=-headers-only,
as we will need libshouldbeinlibc. This becomes apparent since
02810362d5f2bb31cbd06e17fdeceb0f75ea56f9 where sys-block/parted needs that,
but Hurd itself depends on parted.

Missing libshouldbeinlibc means that initial @system build in the sysroot
w/ i686-gnu-emerge falis because while we have Hurd, we don't have a Hurd
that provides any libraries.

There will be corresponding changes in crossdev.

Signed-off-by: Sam James <[email protected]>
---
 sys-kernel/hurd/hurd-0.9_p20251029.ebuild | 42 +++++++++++++++++++----
 sys-kernel/hurd/hurd-9999.ebuild          | 42 +++++++++++++++++++----
 2 files changed, 70 insertions(+), 14 deletions(-)

diff --git a/sys-kernel/hurd/hurd-0.9_p20251029.ebuild b/sys-kernel/hurd/hurd-0.9_p20251029.ebuild
index 66744c9d3af80..61a4dd09a6092 100644
--- a/sys-kernel/hurd/hurd-0.9_p20251029.ebuild
+++ b/sys-kernel/hurd/hurd-0.9_p20251029.ebuild
@@ -81,6 +81,9 @@ src_configure() {
 		--prefix="${EPREFIX}${sysroot}/usr"
 		--datadir="${EPREFIX}${sysroot}/usr/share"
 		--host=${CTARGET}
+
+		# Builds everything twice and needs profiling libs
+		--disable-profile
 	)
 
 	if ! use custom-cflags ; then
@@ -92,7 +95,9 @@ src_configure() {
 
 	append-flags -Wl,--no-error-rwx-segments -Wl,--no-error-execstack -Wl,-z,notext
 
-	if use headers-only ; then
+	# For cross-*, we always want a minimal build even with USE=-headers-only,
+	# as we will need libshouldbeinlibc.
+	if use headers-only || is_crosspkg ; then
 		myeconfargs+=(
 			ac_cv_func_file_exec_paths=no
 			ac_cv_func_exec_exec_paths=no
@@ -104,17 +109,21 @@ src_configure() {
 			--without-acpica
 			--without-libcrypt
 			--without-libbz2
+			--without-libdaemon
 			--without-libz
 			--without-libtirpc
 			--without-parted
 			--without-rump
 			--disable-ncursesw
 		)
+
+		cat <<-EOF >> config.make.in || die "Failed to amend config.make.in"
+		HAVE_LIBGCRYPT = no
+		HAVE_LIBPCIACCESS = no
+		HAVE_XKBCOMMON = no
+		EOF
 	else
 		myeconfargs+=(
-			# Builds everything twice and needs profiling libs
-			--disable-profile
-
 			# Unpackaged
 			--without-acpica
 
@@ -136,8 +145,16 @@ src_configure() {
 }
 
 src_compile() {
-	use headers-only && return
-	default
+	if use headers-only ; then
+		return
+	elif is_crosspkg ; then
+		emake \
+			lib-subdirs="libshouldbeinlibc libihash libstore" \
+			prog-subdirs= \
+			other-subdirs=
+	else
+		default
+	fi
 }
 
 src_test() {
@@ -146,7 +163,18 @@ src_test() {
 }
 
 src_install() {
-	emake DESTDIR="${D}" $(usex headers-only install-headers install) no_deps=t
+	if use headers-only ; then
+		emake DESTDIR="${D}" install-headers no_deps=t
+	elif is_crosspkg ; then
+		emake DESTDIR="${D}" install-headers no_deps=t
+		emake DESTDIR="${D}" install \
+			lib-subdirs="libshouldbeinlibc libihash libstore" \
+			prog-subdirs= \
+			other-subdirs= \
+			no_deps=t
+	else
+		emake DESTDIR="${D}" install
+	fi
 
 	if target_is_not_host ; then
 		# TODO: Is this needed?
diff --git a/sys-kernel/hurd/hurd-9999.ebuild b/sys-kernel/hurd/hurd-9999.ebuild
index 51b174db77908..92f0c89d304a2 100644
--- a/sys-kernel/hurd/hurd-9999.ebuild
+++ b/sys-kernel/hurd/hurd-9999.ebuild
@@ -80,6 +80,9 @@ src_configure() {
 		--prefix="${EPREFIX}${sysroot}/usr"
 		--datadir="${EPREFIX}${sysroot}/usr/share"
 		--host=${CTARGET}
+
+		# Builds everything twice and needs profiling libs
+		--disable-profile
 	)
 
 	if ! use custom-cflags ; then
@@ -91,7 +94,9 @@ src_configure() {
 
 	append-flags -Wl,--no-error-rwx-segments -Wl,--no-error-execstack -Wl,-z,notext
 
-	if use headers-only ; then
+	# For cross-*, we always want a minimal build even with USE=-headers-only,
+	# as we will need libshouldbeinlibc.
+	if use headers-only || is_crosspkg ; then
 		myeconfargs+=(
 			ac_cv_func_file_exec_paths=no
 			ac_cv_func_exec_exec_paths=no
@@ -103,17 +108,21 @@ src_configure() {
 			--without-acpica
 			--without-libcrypt
 			--without-libbz2
+			--without-libdaemon
 			--without-libz
 			--without-libtirpc
 			--without-parted
 			--without-rump
 			--disable-ncursesw
 		)
+
+		cat <<-EOF >> config.make.in || die "Failed to amend config.make.in"
+		HAVE_LIBGCRYPT = no
+		HAVE_LIBPCIACCESS = no
+		HAVE_XKBCOMMON = no
+		EOF
 	else
 		myeconfargs+=(
-			# Builds everything twice and needs profiling libs
-			--disable-profile
-
 			# Unpackaged
 			--without-acpica
 
@@ -135,8 +144,16 @@ src_configure() {
 }
 
 src_compile() {
-	use headers-only && return
-	default
+	if use headers-only ; then
+		return
+	elif is_crosspkg ; then
+		emake \
+			lib-subdirs="libshouldbeinlibc libihash libstore" \
+			prog-subdirs= \
+			other-subdirs=
+	else
+		default
+	fi
 }
 
 src_test() {
@@ -145,7 +162,18 @@ src_test() {
 }
 
 src_install() {
-	emake DESTDIR="${D}" $(usex headers-only install-headers install) no_deps=t
+	if use headers-only ; then
+		emake DESTDIR="${D}" install-headers no_deps=t
+	elif is_crosspkg ; then
+		emake DESTDIR="${D}" install-headers no_deps=t
+		emake DESTDIR="${D}" install \
+			lib-subdirs="libshouldbeinlibc libihash libstore" \
+			prog-subdirs= \
+			other-subdirs= \
+			no_deps=t
+	else
+		emake DESTDIR="${D}" install
+	fi
 
 	if target_is_not_host ; then
 		# TODO: Is this needed?
-- 
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.