diff options
author | Anthony Roussel <anthony@roussel.dev> | 2024-04-02 14:05:16 +0200 |
---|---|---|
committer | Anthony Roussel <anthony@roussel.dev> | 2024-04-02 15:22:05 +0200 |
commit | 878c3b903fc0b8a85f5bf7bb7ff9283e885f6fc3 (patch) | |
tree | 94baafcc4daeac4ee68af26466395801a22ac387 /pkgs/by-name/wi | |
parent | dab574787a692fa4fb047fc975125cc7049574b7 (diff) |
wiremock: add passthru.tests.version
Diffstat (limited to 'pkgs/by-name/wi')
-rw-r--r-- | pkgs/by-name/wi/wiremock/package.nix | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/pkgs/by-name/wi/wiremock/package.nix b/pkgs/by-name/wi/wiremock/package.nix index b474ea2556df9..c6d44446ce9c8 100644 --- a/pkgs/by-name/wi/wiremock/package.nix +++ b/pkgs/by-name/wi/wiremock/package.nix @@ -1,11 +1,19 @@ -{ lib, stdenv, fetchurl, jre, makeWrapper, gitUpdater }: - -stdenv.mkDerivation rec { +{ + fetchurl, + gitUpdater, + jre, + lib, + makeWrapper, + stdenv, + testers, +}: + +stdenv.mkDerivation (finalAttrs: { pname = "wiremock"; version = "3.5.2"; src = fetchurl { - url = "mirror://maven/org/wiremock/wiremock-standalone/${version}/wiremock-standalone-${version}.jar"; + url = "mirror://maven/org/wiremock/wiremock-standalone/${finalAttrs.version}/wiremock-standalone-${finalAttrs.version}.jar"; hash = "sha256-27DIcfP5R1Qiwl2fhvUQjFsE8pTHTv5MuFqHGa+whVY="; }; @@ -15,25 +23,31 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p "$out"/{share/wiremock,bin} - cp ${src} "$out/share/wiremock/wiremock.jar" + cp ${finalAttrs.src} "$out/share/wiremock/wiremock.jar" - makeWrapper ${jre}/bin/java $out/bin/${pname} \ + makeWrapper ${jre}/bin/java $out/bin/${finalAttrs.meta.mainProgram} \ --add-flags "-jar $out/share/wiremock/wiremock.jar" ''; - passthru.updateScript = gitUpdater { - url = "https://github.com/wiremock/wiremock.git"; - ignoredVersions = "(alpha|beta|rc).*"; + passthru = { + tests.version = testers.testVersion { + command = "${lib.getExe finalAttrs.finalPackage} --version"; + package = finalAttrs.finalPackage; + }; + updateScript = gitUpdater { + url = "https://github.com/wiremock/wiremock.git"; + ignoredVersions = "(alpha|beta|rc).*"; + }; }; meta = { description = "A flexible tool for building mock APIs"; homepage = "https://wiremock.org/"; - changelog = "https://github.com/wiremock/wiremock/releases/tag/${version}"; + changelog = "https://github.com/wiremock/wiremock/releases/tag/${finalAttrs.version}"; maintainers = with lib.maintainers; [ bobvanderlinden anthonyroussel ]; mainProgram = "wiremock"; platforms = jre.meta.platforms; sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; license = lib.licenses.asl20; }; -} +}) |