Unverified Commit f39864f3 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

validator-nu: 23.4.11-unstable-2023-12-18 → 25.12.12 (#473999)

parents a1f2ba5a f58602e5
Loading
Loading
Loading
Loading
+27 −11
Original line number Diff line number Diff line
{
  ant,
  cacert,
  fetchFromGitHub,
  git,
  installShellFiles,
  jdk_headless,
  jre_headless,
  makeWrapper,
  pandoc,
  python3,
  stdenvNoCC,
  lib,
@@ -12,14 +16,13 @@

let
  pname = "validator-nu";
  version = "23.4.11-unstable-2023-12-18";
  version = "25.12.12";

  src = fetchFromGitHub {
    owner = "validator";
    repo = "validator";
    rev = "c3a401feb6555affdc891337f5a40af238f9ac2d";
    fetchSubmodules = true;
    hash = "sha256-pcA3HXduzFKzoOHhor12qvzbGSSvo3k3Bpy2MvvQlCI=";
    rev = "7ed7f67468f7f61975dcc78891ea462fce578828";
    hash = "sha256-cdDmhRyXIdoNWhP4oqu7vRb5abuNXRqvt4P4Dzq48xY=";
  };

  deps = stdenvNoCC.mkDerivation {
@@ -27,23 +30,31 @@ let
    inherit version src;

    nativeBuildInputs = [
      git
      ant
      cacert
      jdk_headless
      python3
      python3.pkgs.certifi
    ];

    postPatch = ''
      substituteInPlace build/build.xml \
        --replace-fail \
        'src="https://html.spec.whatwg.org/"' \
        'src="https://html.spec.whatwg.org/commit-snapshots/0aa021ab4f21a6550f1591a9cc98449aaea9eefa/"'
    '';

    buildPhase = ''
      python checker.py dldeps
    '';

    installPhase = ''
      mkdir "$out"
      mkdir "$out" "$out/build"
      mv dependencies extras "$out"
      mv build/html5spec "$out/build"
    '';

    outputHashMode = "recursive";
    outputHash = "sha256-LPtxpUd7LAYZHJL7elgcZOTaTgHqeqquiB9hiuajA6c=";
    outputHash = "sha256-8cMoLeOnKNqisezkVS2UeVW11gtkGmhvQWrbSVuqbb8=";
  };

in
@@ -51,21 +62,25 @@ stdenvNoCC.mkDerivation (finalAttrs: {
  inherit pname version src;

  nativeBuildInputs = [
    git
    ant
    installShellFiles
    jdk_headless
    makeWrapper
    pandoc
    python3
  ];

  postPatch = ''
    substituteInPlace build/build.py --replace-warn \
    substituteInPlace build/build.py --replace-fail \
      'validatorVersion = "%s.%s.%s" % (year, month, day)' \
      'validatorVersion = "${finalAttrs.version}"'
  '';

  buildPhase = ''
    ln -s '${deps}/dependencies' '${deps}/extras' .
    JAVA_HOME='${jdk_headless}' python checker.py build
    ln -s '${deps}/build/html5spec' build/
    JAVA_HOME='${jdk_headless}' python checker.py --offline build
    make -C docs VNU_VERSION='${finalAttrs.version}' DATE='date -d @$(SOURCE_DATE_EPOCH)'
  '';

  installPhase = ''
@@ -73,6 +88,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {

    mkdir -p "$out/bin" "$out/share/java"
    mv build/dist/vnu.jar "$out/share/java/"
    installManPage docs/*.1
    makeWrapper "${jre_headless}/bin/java" "$out/bin/vnu" \
      --add-flags "-jar '$out/share/java/vnu.jar'"