minimal-bootstrap.findutils: rebuild with musl

This commit is contained in:
Emily Trau 2023-09-18 22:21:16 -07:00
parent 3fd09b7547
commit 114d57a054
2 changed files with 21 additions and 17 deletions

View File

@ -42,8 +42,8 @@ lib.makeScope
findutils = callPackage ./findutils {
bash = bash_2_05;
gcc = gcc2;
glibc = glibc22;
tinycc = tinycc-musl;
musl = musl11;
};
gawk-mes = callPackage ./gawk/mes.nix {

View File

@ -3,38 +3,35 @@
, hostPlatform
, fetchurl
, bash
, gcc
, glibc
, binutils
, linux-headers
, tinycc
, musl
, gnumake
, gnugrep
, gnused
, gawk
, gnutar
, gzip
, xz
}:
let
pname = "findutils";
version = "4.4.2";
version = "4.9.0";
src = fetchurl {
url = "mirror://gnu/findutils/findutils-${version}.tar.gz";
sha256 = "0amn0bbwqvsvvsh6drfwz20ydc2czk374lzw5kksbh6bf78k4ks3";
url = "mirror://gnu/findutils/findutils-${version}.tar.xz";
hash = "sha256-or+4wJ1DZ3DtxZ9Q+kg+eFsWGjt7nVR1c8sIBl/UYv4=";
};
in
bash.runCommand "${pname}-${version}" {
inherit pname version;
nativeBuildInputs = [
gcc
binutils
tinycc.compiler
gnumake
gnused
gnugrep
gawk
gnutar
gzip
xz
];
passthru.tests.get-version = result:
@ -52,13 +49,20 @@ bash.runCommand "${pname}-${version}" {
};
} ''
# Unpack
tar xzf ${src}
cp ${src} findutils.tar.xz
unxz findutils.tar.xz
tar xf findutils.tar
rm findutils.tar
cd findutils-${version}
# Patch
# configure fails to accurately detect PATH_MAX support
sed -i 's/chdir_long/chdir/' gl/lib/save-cwd.c
# Configure
export C_INCLUDE_PATH="${glibc}/include:${linux-headers}/include"
export LIBRARY_PATH="${glibc}/lib"
export LIBS="-lc -lnss_files -lnss_dns -lresolv"
export CC="tcc -B ${musl}/lib"
export AR="tcc -ar"
export LD=tcc
bash ./configure \
--prefix=$out \
--build=${buildPlatform.config} \