1 { lib, stdenv, fetchFromGitHub, fetchpatch, cmake, libxslt, html-tidy }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
11 hash = "sha256-vzVWQodwzi3GvC9IcSQniYBsbkJV20iZanF33A0Gpe0=";
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=";
20 nativeBuildInputs = [ cmake libxslt/*manpage*/ ]
21 ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) html-tidy;
23 cmakeFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
27 # ATM bin/tidy is statically linked, as upstream provides no other option yet.
28 # https://github.com/htacg/tidy-html5/issues/326#issuecomment-160322107
31 description = "HTML validator and `tidier'";
33 HTML Tidy is a command-line tool and C library that can be
34 used to validate and fix HTML data.
36 license = licenses.libpng; # very close to it - the 3 clauses are identical
37 homepage = "http://html-tidy.org";
38 platforms = platforms.all;
39 maintainers = with maintainers; [ edwtjo ];