mandoc: move executableCross assert into meta.broken

For splicing to work, callPackage needs to be able to attach extra
attributes (e. g. nativeDrv) to pkgsHostTarget.mandoc. If we have the
assert like before, pkgsHostTarget.mandoc would fail to evaluate,
preventing buildPackages.mandoc (which works as expected) to be attached
to the former. This affected cross compilation of the netbsd package set
in particular.

+14 -14
+14 -14
pkgs/tools/misc/mandoc/default.nix
··· 1 1 { lib, stdenv, fetchurl, zlib, perl, nixosTests }: 2 2 3 3 let 4 - # check if we can execute binaries for the host platform on the build platform 5 - # even though the platforms aren't the same. mandoc can't be cross compiled 6 - # (easily) because of its configurePhase, but we want to allow “native” cross 7 - # such as pkgsLLVM and pkgsStatic. 8 - # For a lack of a better predicate at the moment, we compare the platforms' 9 - # system tuples. See also: 10 - # * https://github.com/NixOS/nixpkgs/pull/140271 11 - # * https://github.com/NixOS/nixpkgs/issues/61414 12 - executableCross = stdenv.buildPlatform.system == stdenv.hostPlatform.system; 13 - 14 4 # Name of an UTF-8 locale _always_ present at runtime, used for UTF-8 support 15 5 # (locale set by the user may differ). This would usually be C.UTF-8, but 16 6 # darwin has no such locale. ··· 19 9 then "en_US.UTF-8" 20 10 else "C.UTF-8"; 21 11 in 22 - 23 - assert executableCross || 24 - throw "mandoc relies on executing compiled programs in configurePhase, can't cross compile"; 25 12 26 13 stdenv.mkDerivation rec { 27 14 pname = "mandoc"; ··· 61 48 printf '%s' "$configureLocal" > configure.local 62 49 ''; 63 50 64 - doCheck = executableCross; 51 + doCheck = true; 65 52 checkTarget = "regress"; 66 53 checkInputs = [ perl ]; 67 54 preCheck = "patchShebangs --build regress/regress.pl"; ··· 71 58 }; 72 59 73 60 meta = with lib; { 61 + # check if we can execute binaries for the host platform on the build platform 62 + # even though the platforms aren't the same. mandoc can't be cross compiled 63 + # (easily) because of its configurePhase which executes compiled programs 64 + # for gathering information about the host system. Consequently, we can only 65 + # allow “native” cross such as pkgsLLVM and pkgsStatic. 66 + # For a lack of a better predicate at the moment, we compare the platforms' 67 + # system tuples. See also: 68 + # * https://github.com/NixOS/nixpkgs/pull/140271 69 + # * https://github.com/NixOS/nixpkgs/issues/61414 70 + # We need to use broken instead of, say a top level assert, to keep splicing 71 + # working. 72 + broken = stdenv.buildPlatform.system != stdenv.hostPlatform.system; 73 + 74 74 homepage = "https://mandoc.bsd.lv/"; 75 75 description = "suite of tools compiling mdoc and man"; 76 76 downloadPage = "http://mandoc.bsd.lv/snapshots/";