From cbfc33a9cec2cfdcb1c1e2394272cbdb9988f85a Mon Sep 17 00:00:00 2001 From: Christian Kampka Date: Mon, 31 Aug 2020 13:52:09 +0200 Subject: [PATCH] source-highlight: Skip building docs when cross-compiling source-highlight uses it's own binary to generate documentation. During cross-compilation, that binary was built for the target platform architecture, so it can't run on the build host. --- pkgs/tools/text/source-highlight/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/tools/text/source-highlight/default.nix b/pkgs/tools/text/source-highlight/default.nix index 7052d9e5a44a..29a269ec08f2 100644 --- a/pkgs/tools/text/source-highlight/default.nix +++ b/pkgs/tools/text/source-highlight/default.nix @@ -12,6 +12,14 @@ stdenv.mkDerivation { sha256 = "148w47k3zswbxvhg83z38ifi85f9dqcpg7icvvw1cm6bg21x4zrs"; }; + # source-highlight uses it's own binary to generate documentation. + # During cross-compilation, that binary was built for the target + # platform architecture, so it can't run on the build host. + patchPhase = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + substituteInPlace Makefile.in --replace "src doc tests" "src tests" + ''; + + strictDeps = true; buildInputs = [ boost ]; configureFlags = [ "--with-boost=${boost.out}" ];