Subject: Re: bug#61386: [PATCH] cp,mv,install: Disable sparse copy on macOS

From: George Valkov <[email-masked]>
Date: Tue, 21 Mar 2023 17:27:18 +0200

> On 2023-03-21, at 4:49 PM, Paul Eggert <[email-masked]> wrote:
> Easiest might be to build from the latest release:
> https://ftp.gnu.org/pub/gnu/coreutils/coreutils-9.2.tar.xz
> If you do that, you shouldn't need to run m4, and all the gnulib files will be there already.

Thanks, Paul!

Yes, this is what we do, if you look at tools/coreutils/Makefile (link below), I changed PKG_VERSION and PKG_HASH.

make tools/coreutils/{clean,compile} V=sc
downloads the file you mentioned from one of the @GNU mirrors, the SHA2 hash matches 6885ff47b9cdb211de47d368c17853f406daaf98b148aaecdf10de29cc04b0b3, so it proceeds with the build.
https://github.com/httpstorm/openwrt/tree/coreutils-9.2/tools/coreutils
https://github.com/openwrt/openwrt/pull/12233/files

However since the old m4-1.4.19 in under tools/m4, coreutils builds with the legacy version:
https://github.com/httpstorm/openwrt/tree/coreutils-9.2/tools/m4

I tried removing tools/m4, and I get the following error
https://httpstorm.com/share/.openwrt/test/2023-02-06_coreutils-9.1/2023-03-21-openwrt-build-coreutils-9.2.txt

make tools/coreutils/{clean,compile} V=sc
…
config.status: creating po/POTFILES
config.status: creating po/Makefile
touch /Volumes/wrt3200/openwrt/build_dir/host/coreutils-9.2/.configured
CFLAGS="-O2 -I/Volumes/wrt3200/openwrt/staging_dir/host/include " CPPFLAGS="-I/Volumes/wrt3200/openwrt/staging_dir/host/include " CXXFLAGS="" LDFLAGS="-L/Volumes/wrt3200/openwrt/staging_dir/host/lib " make  -C /Volumes/wrt3200/openwrt/build_dir/host/coreutils-9.2 PROGRAMS="src/date src/readlink src/touch src/ln src/chown src/ginstall" LIBRARIES= MANS= SUBDIRS=. 
make[3]: Entering directory '/Volumes/wrt3200/openwrt/build_dir/host/coreutils-9.2'
CDPATH="${ZSH_VERSION+.}:" && cd . && /usr/bin/env bash '/Volumes/wrt3200/openwrt/build_dir/host/coreutils-9.2/build-aux/missing' aclocal-1.16 -I m4
autom4te: error: need GNU m4 1.4 or later: /Volumes/wrt3200/openwrt/staging_dir/host/bin/m4
aclocal.real: error: autom4te failed with exit status: 1
make[3]: *** [Makefile:8458: aclocal.m4] Error 1
make[3]: Leaving directory '/Volumes/wrt3200/openwrt/build_dir/host/coreutils-9.2'
make[2]: *** [Makefile:45: /Volumes/wrt3200/openwrt/build_dir/host/coreutils-9.2/.built] Error 2
make[2]: Leaving directory '/Volumes/wrt3200/openwrt/tools/coreutils'
time: tools/coreutils/compile#58.69#31.58#154.08
    ERROR: tools/coreutils failed to build.
make[1]: *** [tools/Makefile:219: tools/coreutils/compile] Error 1
make[1]: Leaving directory '/Volumes/wrt3200/openwrt'
make: *** [/Volumes/wrt3200/openwrt/include/toplevel.mk:231: tools/coreutils/compile] Error 2

Any ideas?

Georgi Valkov
httpstorm.com
nano RTOS