diff --git a/pkgs/tools/misc/man-db/default.nix b/pkgs/tools/misc/man-db/default.nix index d0cb9a22336..eadb736aeeb 100644 --- a/pkgs/tools/misc/man-db/default.nix +++ b/pkgs/tools/misc/man-db/default.nix @@ -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;