diff options
author | Nick Cao <nickcao@nichi.co> | 2024-04-14 21:38:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-14 21:38:14 -0400 |
commit | 29084fa04bf4abcd229422497d7edc8c6e383e8c (patch) | |
tree | d6a8078f12e58707d244a76669a859ed70fba6c6 /pkgs/tools | |
parent | c5b6949790f4db63955a84d659f331b2896a4641 (diff) | |
parent | c4415d2272ec2be13549086c3b87abc797073d2a (diff) |
Merge pull request #299207 from afh/fix-vnu-version
validator-nu: fix version output and modernize package
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/text/validator-nu/default.nix | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/pkgs/tools/text/validator-nu/default.nix b/pkgs/tools/text/validator-nu/default.nix index 17f9a5ba8b595..56c227b46da45 100644 --- a/pkgs/tools/text/validator-nu/default.nix +++ b/pkgs/tools/text/validator-nu/default.nix @@ -6,6 +6,7 @@ , python3 , stdenvNoCC , lib +, testers }: let @@ -40,29 +41,43 @@ let }; in -stdenvNoCC.mkDerivation rec { +stdenvNoCC.mkDerivation (finalAttrs: { inherit pname version src; nativeBuildInputs = [ git jdk_headless makeWrapper python3 ]; + postPatch = '' + substituteInPlace build/build.py --replace-warn \ + '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 ''; installPhase = '' + runHook preInstall + 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'" + + runHook postInstall ''; - meta = with lib; { + passthru.tests.version = testers.testVersion { + package = finalAttrs.finalPackage; + }; + + meta = { description = "Helps you catch problems in your HTML/CSS/SVG"; homepage = "https://validator.github.io/validator/"; - license = licenses.mit; - maintainers = with maintainers; [ andersk ivan ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ andersk ivan ]; mainProgram = "vnu"; - sourceProvenance = with sourceTypes; [ binaryBytecode fromSource ]; + sourceProvenance = with lib.sourceTypes; [ binaryBytecode fromSource ]; }; -} +}) |