Github messages for voidlinux
 help / color / mirror / Atom feed
From: pullmoll <pullmoll@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] coreutils: reenable statx(2) support on glibc
Date: Thu, 02 Apr 2020 14:18:42 +0200	[thread overview]
Message-ID: <20200402121842.Juh0up9OalX_xKhhgLscuJGLX7o3kIV99rfu08Pigm0@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20570@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 476 bytes --]

There is an updated pull request by pullmoll against master on the void-packages repository

https://github.com/pullmoll/void-packages coreutils-legacy
https://github.com/void-linux/void-packages/pull/20570

coreutils: reenable statx(2) support on glibc
Also create a coreutils-legacy package for use on old kernels (<= 4.19)
which does not try to use statx(2).

Supersedes: #20569

A patch file from https://github.com/void-linux/void-packages/pull/20570.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-coreutils-legacy-20570.patch --]
[-- Type: text/x-diff, Size: 4708 bytes --]

From a1d535ad506e209b98af30327c6f7e7012a3044f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= <pullmoll@t-online.de>
Date: Thu, 2 Apr 2020 14:00:45 +0200
Subject: [PATCH] coreutils: reenable statx(2) support on glibc

Also create a coreutils-legacy package for use on old kernels (< 4.11)
which does not try to use statx(2).

Supersedes: #20569
---
 srcpkgs/coreutils-legacy   |  1 +
 srcpkgs/coreutils/template | 73 ++++++++++++++++++++++++++++++++++----
 2 files changed, 67 insertions(+), 7 deletions(-)
 create mode 120000 srcpkgs/coreutils-legacy

diff --git a/srcpkgs/coreutils-legacy b/srcpkgs/coreutils-legacy
new file mode 120000
index 00000000000..a4b710b1789
--- /dev/null
+++ b/srcpkgs/coreutils-legacy
@@ -0,0 +1 @@
+coreutils
\ No newline at end of file
diff --git a/srcpkgs/coreutils/template b/srcpkgs/coreutils/template
index 16a2c9e1dbe..98de979b5fc 100644
--- a/srcpkgs/coreutils/template
+++ b/srcpkgs/coreutils/template
@@ -1,7 +1,7 @@
 # Template file for 'coreutils'
 pkgname=coreutils
 version=8.32
-revision=3
+revision=4
 bootstrap=yes
 makedepends="gmp-devel acl-devel libcap-devel"
 short_desc="GNU core utilities"
@@ -40,6 +40,9 @@ pre_configure() {
 		make install
 		make distclean
 	fi
+	mkdir ../${pkgname}-${version}-legacy
+	cp -aR . ../${pkgname}-${version}-legacy
+	mv ../${pkgname}-${version}-legacy .
 }
 
 do_configure() {
@@ -51,9 +54,6 @@ do_configure() {
 	case "$XBPS_TARGET_MACHINE" in
 		# XXX syncfs() in src/sync.c expects a return value.
 		*-musl) configure_args+=" ac_cv_func_syncfs=no";;
-		# XXX disable statx(), needs glibc>=2.28 and linux>=4.11
-		# XXX seems to fail on travis always returning EACCES.
-		*) configure_args+=" ac_cv_func_statx=no";;
 	esac
 	#
 	# Do not install kill: provided by util-linux.
@@ -69,6 +69,12 @@ do_configure() {
 		sed -e 's;^\(cu_install_program =\).*;\1 install;' \
 			Makefile.cfg.orig >Makefile
 	fi
+	msg_normal "Configuring legacy build ...\n"
+	cd ${sourcepkg}-${version}-legacy
+	env $_force_unsafe_configure ./configure ${configure_args} \
+		--enable-install-program=arch,hostname \
+		--enable-no-install-program=kill,uptime \
+		--disable-rpath ac_cv_func_statx=no
 }
 
 do_build() {
@@ -88,6 +94,24 @@ do_build() {
 		sed -e '/hostname.1/d' Makefile.bak > Makefile
 	fi
 	make ${makejobs}
+	msg_normal "Building legacy version ...\n"
+	cd ${sourcepkg}-${version}-legacy
+	if [ "$CROSS_BUILD" ]; then
+		cp Makefile Makefile.orig
+		sed '/src_make_prime_list/d' Makefile.orig > Makefile
+		depbase=$(echo src/make-prime-list.o | sed 's|[^/]*$|.deps/&|;s|\.o$||')
+		cc -std=gnu99  -I. -I./lib  -Ilib -I./lib -Isrc -I./src  \
+			-fdiagnostics-show-option -funit-at-a-time -g -O2 -MT \
+			src/make-prime-list.o -MD -MP -MF $depbase.Tpo -c \
+			-o src/make-prime-list.o \
+			src/make-prime-list.c
+		mv -f $depbase.Tpo $depbase.Po
+		cc -std=gnu99 -fdiagnostics-show-option -funit-at-a-time -g -O2 \
+			-Wl,--as-needed  -o src/make-prime-list src/make-prime-list.o
+		cp Makefile Makefile.bak
+		sed -e '/hostname.1/d' Makefile.bak > Makefile
+	fi
+	make ${makejobs}
 }
 
 do_check() {
@@ -107,16 +131,51 @@ do_check() {
 	done
 
 	make check
+
+	cd ${sourcepkg}-${version}-legacy
+
+	# chgrp tests fail inside a chroot
+	sed -i '/tests\/chgrp/d' Makefile
+
+	# Tests that fail due to being inside a chroot
+	exeext_tests="chown lchown fchownat"
+
+	# Tests that depend on the tests reemoved
+	exeext_tests+=" fchmodat fchdir"
+
+	for test in $exeext_tests ; do
+		sed -i "/test-$test\$(EXEEXT)/d" gnulib-tests/Makefile
+	done
+
+	make check
 }
 
 do_install() {
 	make DESTDIR=${DESTDIR} install
 	if [ "$CROSS_BUILD" ]; then
-		mv ${wrksrc}/coreutils-${XBPS_MACHINE}/share/man \
+		mv coreutils-${XBPS_MACHINE}/share/man \
 			${DESTDIR}/usr/share
 		# provided by procps-ng
 		rm -f ${DESTDIR}/usr/share/man/man1/{kill,uptime}.1
 	fi
-	mv ${DESTDIR}/usr/bin/hostname ${DESTDIR}/usr/bin/hostname-coreutils
-	mv ${DESTDIR}/usr/share/man/man1/hostname.1 ${DESTDIR}/usr/share/man/man1/hostname-coreutils.1
+	mv ${DESTDIR}/usr/bin/hostname{,-coreutils}
+	mv ${DESTDIR}/usr/share/man/man1/hostname{,-coreutils}.1
+}
+
+coreutils-legacy_package() {
+	short_desc+=" - legacy build for kernels < 4.11"
+	provides="coreutils-${version}_${revision}"
+	replaces="coreutils>=0"
+	pkg_install() {
+		cd ${sourcepkg}-${version}-legacy
+		make DESTDIR=${PKGDESTDIR} install
+		if [ "$CROSS_BUILD" ]; then
+			mv coreutils-${XBPS_MACHINE}/share/man \
+				${PKGDESTDIR}/usr/share
+			# provided by procps-ng
+			rm -f ${PKGDESTDIR}/usr/share/man/man1/{kill,uptime}.1
+		fi
+		mv ${PKGDESTDIR}/usr/bin/hostname{,-coreutils}
+		mv ${PKGDESTDIR}/usr/share/man/man1/hostname{,-coreutils}.1
+	}
 }

  parent reply	other threads:[~2020-04-02 12:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02 12:06 [PR PATCH] " pullmoll
2020-04-02 12:10 ` xtraeme
2020-04-02 12:18 ` pullmoll [this message]
2020-04-02 12:24 ` [PR PATCH] [Closed]: " pullmoll
2020-04-02 12:24 ` pullmoll

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200402121842.Juh0up9OalX_xKhhgLscuJGLX7o3kIV99rfu08Pigm0@z \
    --to=pullmoll@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).