Merge pull request #207620 from andersk/validator-nu

Fixes https://github.com/NixOS/nixpkgs/issues/185842
This commit is contained in:
Sandro 2022-12-26 22:25:53 +01:00 committed by GitHub
commit 30c0633f3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 70 additions and 0 deletions

View file

@ -0,0 +1,68 @@
{ fetchFromGitHub
, git
, jdk_headless
, jre_headless
, makeWrapper
, python3
, stdenvNoCC
, lib
}:
let
pname = "validator-nu";
version = "22.9.29";
src = fetchFromGitHub {
owner = "validator";
repo = "validator";
rev = version;
fetchSubmodules = true;
hash = "sha256-NH/OyaKGITAL2yttB1kmuKVuZuYzhVuS0Oohj1N4icI=";
};
deps = stdenvNoCC.mkDerivation {
pname = "${pname}-deps";
inherit version src;
nativeBuildInputs = [ git jdk_headless python3 python3.pkgs.certifi ];
buildPhase = ''
python checker.py dldeps
'';
installPhase = ''
mkdir "$out"
mv dependencies extras "$out"
'';
outputHashMode = "recursive";
outputHash = "sha256-LPtxpUd7LAYZHJL7elgcZOTaTgHqeqquiB9hiuajA6c=";
};
in
stdenvNoCC.mkDerivation rec {
inherit pname version src;
nativeBuildInputs = [ git jdk_headless makeWrapper python3 ];
buildPhase = ''
ln -s '${deps}/dependencies' '${deps}/extras' .
JAVA_HOME='${jdk_headless}' python checker.py build
'';
installPhase = ''
mkdir -p "$out/bin" "$out/share/java"
mv build/dist/vnu.jar "$out/share/java/"
makeWrapper "${jre_headless}/bin/java" "$out/bin/vnu" \
--add-flags "-jar '$out/share/java/vnu.jar'"
'';
meta = with lib; {
description = "Helps you catch problems in your HTML/CSS/SVG";
homepage = "https://validator.github.io/validator/";
license = licenses.mit;
maintainers = with maintainers; [ andersk ];
mainProgram = "vnu";
sourceProvenance = with sourceTypes; [ binaryBytecode fromSource ];
};
}

View file

@ -12638,6 +12638,8 @@ with pkgs;
vacuum = callPackage ../applications/networking/instant-messengers/vacuum {};
validator-nu = callPackage ../tools/text/validator-nu { };
vampire = callPackage ../applications/science/logic/vampire {};
variety = callPackage ../applications/misc/variety {};