html-tidy: fix cross-compilation

This commit is contained in:
Nikolay Korotkiy 2022-05-20 12:18:37 +03:00
parent 437fd89069
commit 710918b8fe
No known key found for this signature in database
GPG key ID: D1DE6D7F693663A5

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake, libxslt }:
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, libxslt, html-tidy }:
stdenv.mkDerivation rec {
pname = "html-tidy";
@ -11,9 +11,18 @@ stdenv.mkDerivation rec {
sha256 = "sha256-ZMz0NySxzX2XHiqB8f5asvwjIG6kdIcq8Gb3EbAxBaU=";
};
nativeBuildInputs = [ cmake libxslt/*manpage*/ ];
# https://github.com/htacg/tidy-html5/pull/1036
patches = (fetchpatch {
url = "https://github.com/htacg/tidy-html5/commit/e9aa038bd06bd8197a0dc049380bc2945ff55b29.diff";
sha256 = "sha256-Q2GjinNBWLL+HXUtslzDJ7CJSTflckbjweiSMCnIVwg=";
});
cmakeFlags = [];
nativeBuildInputs = [ cmake libxslt/*manpage*/ ]
++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) html-tidy;
cmakeFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"-DHOST_TIDY=tidy"
];
# ATM bin/tidy is statically linked, as upstream provides no other option yet.
# https://github.com/htacg/tidy-html5/issues/326#issuecomment-160322107