freebsd.boot-install: wrap coreutils install instead of netbsd

netbsd can no longer compile under FreeBSD native early bootstrap
stdenv, so switch to coreutils. This only involves discarding the -l
flag. The -l flag causes a symlink instead of a copy to be installed, so
it is safe to discard during bootstrap.
This commit is contained in:
Audrey Dutcher 2024-05-27 12:24:30 -07:00 committed by John Ericson
parent 4050f49cac
commit e68aabe87d

View File

@ -1,10 +1,23 @@
{ buildPackages, freebsd-lib }:
# Wrap NetBSD's install
# Wrap GNU coreutils' install
# The -l flag causes a symlink instead of a copy to be installed, so
# it is safe to discard during bootstrap since coreutils does not support it.
buildPackages.writeShellScriptBin "boot-install" (
freebsd-lib.install-wrapper
+ ''
fixed_args=()
while [[ ''${#args[0]} > 0 ]]; do
case "''${args[0]}" in
-l)
args=("''${args[@]:2}")
continue
esac
fixed_args+=("''${args[0]}")
args=("''${args[@]:1}")
done
${buildPackages.netbsd.install}/bin/xinstall "''${args[@]}"
${buildPackages.coreutils}/bin/install "''${fixed_args[@]}"
''
)