Merge pull request #173736 from sikmir/html-tidy

html-tidy: fix cross-compilation

authored by

Rick van Schijndel and committed by
GitHub
4ae5d09a 53dea2d2

+12 -3
+12 -3
pkgs/tools/text/html-tidy/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, cmake, libxslt }: 1 + { lib, stdenv, fetchFromGitHub, fetchpatch, cmake, libxslt, html-tidy }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "html-tidy"; ··· 11 11 sha256 = "sha256-ZMz0NySxzX2XHiqB8f5asvwjIG6kdIcq8Gb3EbAxBaU="; 12 12 }; 13 13 14 - nativeBuildInputs = [ cmake libxslt/*manpage*/ ]; 14 + # https://github.com/htacg/tidy-html5/pull/1036 15 + patches = (fetchpatch { 16 + url = "https://github.com/htacg/tidy-html5/commit/e9aa038bd06bd8197a0dc049380bc2945ff55b29.diff"; 17 + sha256 = "sha256-Q2GjinNBWLL+HXUtslzDJ7CJSTflckbjweiSMCnIVwg="; 18 + }); 19 + 20 + nativeBuildInputs = [ cmake libxslt/*manpage*/ ] 21 + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) html-tidy; 15 22 16 - cmakeFlags = []; 23 + cmakeFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 24 + "-DHOST_TIDY=tidy" 25 + ]; 17 26 18 27 # ATM bin/tidy is statically linked, as upstream provides no other option yet. 19 28 # https://github.com/htacg/tidy-html5/issues/326#issuecomment-160322107