man-db: fix cross

This commit is contained in:
Will Dietz 2018-01-10 17:33:19 -06:00
parent 37c2ac90e6
commit e6da426a54

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, libpipeline, db, groff, makeWrapper }:
{ stdenv, fetchurl, pkgconfig, libpipeline, db, groff, libiconv, makeWrapper, buildPackages }:
stdenv.mkDerivation rec {
name = "man-db-2.7.5";
@ -11,8 +11,10 @@ stdenv.mkDerivation rec {
outputs = [ "out" "doc" ];
outputMan = "out"; # users will want `man man` to work
nativeBuildInputs = [ pkgconfig makeWrapper ];
buildInputs = [ libpipeline db groff ];
nativeBuildInputs = [ pkgconfig makeWrapper groff ]
++ stdenv.lib.optionals doCheck checkInputs;
buildInputs = [ libpipeline db groff ]; # (Yes, 'groff' is both native and build input)
checkInputs = [ libiconv /* for 'iconv' binary */ ];
postPatch = ''
substituteInPlace src/man_db.conf.in \
@ -41,6 +43,18 @@ stdenv.mkDerivation rec {
done
'';
postFixup = stdenv.lib.optionalString (buildPackages.groff != groff) ''
# Check to make sure none of the outputs depend on build-time-only 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;
doCheck = true;