man-db: fix cross enable strictDeps

verified with diffoscope
This commit is contained in:
Artturin 2022-04-20 03:39:36 +03:00
parent c7b6852cad
commit c9d0bcbaaa

View file

@ -25,6 +25,7 @@ stdenv.mkDerivation rec {
outputs = [ "out" "doc" ]; outputs = [ "out" "doc" ];
outputMan = "out"; # users will want `man man` to work outputMan = "out"; # users will want `man man` to work
strictDeps = true;
nativeBuildInputs = [ autoreconfHook groff makeWrapper pkg-config zstd ]; nativeBuildInputs = [ autoreconfHook groff makeWrapper pkg-config zstd ];
buildInputs = [ libpipeline db groff ]; # (Yes, 'groff' is both native and build input) buildInputs = [ libpipeline db groff ]; # (Yes, 'groff' is both native and build input)
checkInputs = [ libiconv /* for 'iconv' binary */ ]; checkInputs = [ libiconv /* for 'iconv' binary */ ];
@ -41,12 +42,6 @@ stdenv.mkDerivation rec {
# Add mandb locations for the above # Add mandb locations for the above
echo "MANDB_MAP /nix/var/nix/profiles/default/share/man /var/cache/man/nixpkgs" >> src/man_db.conf.in echo "MANDB_MAP /nix/var/nix/profiles/default/share/man /var/cache/man/nixpkgs" >> src/man_db.conf.in
# use absolute paths to reference programs, otherwise artifacts will have undeclared dependencies
for f in configure.ac m4/man-check-progs.m4 m4/man-po4a.m4; do
substituteInPlace $f \
--replace AC_CHECK_PROGS AC_PATH_PROGS
done
''; '';
configureFlags = [ configureFlags = [
@ -72,21 +67,15 @@ stdenv.mkDerivation rec {
# (multi-call binary). `apropos` is actually just a symlink to whatis. So we need to # (multi-call binary). `apropos` is actually just a symlink to whatis. So we need to
# make sure that we don't wrap symlinks (since that changes argv[0] to the -wrapped name) # make sure that we don't wrap symlinks (since that changes argv[0] to the -wrapped name)
find "$out/bin" -type f | while read file; do find "$out/bin" -type f | while read file; do
wrapProgram "$file" --prefix PATH : "${groff}/bin" wrapProgram "$file" \
--prefix PATH : "${lib.getBin groff}/bin" \
--prefix PATH : "${lib.getBin zstd}/bin"
done done
''; '';
postFixup = lib.optionalString (buildPackages.groff != groff) '' disallowedReferences = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
# Check to make sure none of the outputs depend on build-time-only groff: buildPackages.groff
for outName in $outputs; do ];
out=''${!outName}
echo "Checking $outName(=$out) for references to build-time groff..."
if grep -r '${buildPackages.groff}' $out; then
echo "Found an erroneous dependency on groff ^^^" >&2
exit 1
fi
done
'';
enableParallelBuilding = true; enableParallelBuilding = true;