Skip to content

Commit

Permalink
prayer: use html-tidy 5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
tu-maurice committed Nov 7, 2023
1 parent 03e7a22 commit d6d0823
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
42 changes: 42 additions & 0 deletions pkgs/tools/text/html-tidy/5.6.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, libxslt, html-tidy }:

stdenv.mkDerivation rec {
pname = "html-tidy";
version = "5.6.0";

src = fetchFromGitHub {
owner = "htacg";
repo = "tidy-html5";
rev = version;
hash = "sha256-M3kOhy/gZn30QQVtVLB/C0dDX+K//R84wEut0AorJ3A=";
};

# https://github.com/htacg/tidy-html5/pull/1036
patches = (fetchpatch {
url = "https://github.com/htacg/tidy-html5/commit/e9aa038bd06bd8197a0dc049380bc2945ff55b29.diff";
sha256 = "sha256-Q2GjinNBWLL+HXUtslzDJ7CJSTflckbjweiSMCnIVwg=";
});

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

meta = with lib; {
description = "A HTML validator and `tidier'";
longDescription = ''
HTML Tidy is a command-line tool and C library that can be
used to validate and fix HTML data.
'';
license = licenses.libpng; # very close to it - the 3 clauses are identical
homepage = "http://html-tidy.org";
platforms = platforms.all;
maintainers = with maintainers; [];
mainProgram = "tidy";
};
}
9 changes: 8 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14673,6 +14673,7 @@ with pkgs;
html2text = callPackage ../tools/text/html2text { };

html-tidy = callPackage ../tools/text/html-tidy { };
html-tidy_5_6 = callPackage ../tools/text/html-tidy/5.6.nix { };

html-xml-utils = callPackage ../tools/text/xml/html-xml-utils { };

Expand Down Expand Up @@ -28567,7 +28568,13 @@ with pkgs;

pps-tools = callPackage ../os-specific/linux/pps-tools { };

prayer = callPackage ../servers/prayer { };
prayer = callPackage ../servers/prayer {
# 2023-07-11: prayer uses internal functions of html-tidy which have become
# hidden after version 5.6. There are no public equivalents of all the
# internal functions used by pray, so using an older version of html-tidy is
# the only way to keep prayer alive.
html-tidy = html-tidy_5_6;
};

procps = if stdenv.isLinux
then callPackage ../os-specific/linux/procps-ng { }
Expand Down

0 comments on commit d6d0823

Please sign in to comment.